correct dcg handling of cuts

This commit is contained in:
Mark Thom
2019-10-04 15:41:48 -06:00
parent d4f9d18149
commit 1569cac98f
3 changed files with 5 additions and 3 deletions

View File

@@ -1,6 +1,6 @@
[package]
name = "scryer-prolog"
version = "0.8.100"
version = "0.8.101"
authors = ["Mark Thom <markjordanthom@gmail.com>"]
build = "build.rs"
repository = "https://github.com/mthom/scryer-prolog"

View File

@@ -100,6 +100,7 @@ expand_body_term((P ; Q), (PModTerm ; QModTerm), N0, N) :-
PModTerm = PModTerm0,
N = N1
).
expand_body_term(!, !, N, N) :- !.
expand_body_term(CommaTerm, ModTerm, N, N) :-
CommaTerm =.. [{} | BodyTerms], !,
comma_ify(BodyTerms, ModTerm).

View File

@@ -22,10 +22,11 @@ freeze(X, Goal) :-
Fresh = X.
gather_freeze_goals(Attrs, _) -->
{ var(Attrs), ! }.
{ var(Attrs) },
!.
gather_freeze_goals([frozen(X) | _], Var) -->
[freeze(Var, X)],
{ ! }.
!.
gather_freeze_goals([_ | Attrs], Var) -->
gather_freeze_goals(Attrs, Var).