diff options
Diffstat (limited to 'builtins.c')
-rw-r--r-- | builtins.c | 20 |
1 files changed, 5 insertions, 15 deletions
@@ -4,7 +4,6 @@ #include "dat.h" #include "fns.h" -int builtintrue(Term *, Term *, Goal **, Choicepoint **, Binding **); int builtinfail(Term *, Term *, Goal **, Choicepoint **, Binding **); int builtincall(Term *, Term *, Goal **, Choicepoint **, Binding **); int builtincut(Term *, Term *, Goal **, Choicepoint **, Binding **); @@ -28,8 +27,6 @@ findbuiltin(Term *goal) return nil; } - if(!runestrcmp(name, L"true") && arity == 0) - return builtintrue; if(!runestrcmp(name, L"fail") && arity == 0) return builtinfail; if(!runestrcmp(name, L"call") && arity == 1) @@ -41,17 +38,6 @@ findbuiltin(Term *goal) } int -builtintrue(Term *database, Term *goal, Goal **goals, Choicepoint **choicestack, Binding **bindings) -{ - USED(database); - USED(goal); - USED(goals); - USED(choicestack); - USED(bindings); - return 1; -} - -int builtinfail(Term *database, Term *goal, Goal **goals, Choicepoint **choicestack, Binding **bindings) { USED(database); @@ -85,7 +71,11 @@ builtincut(Term *database, Term *goal, Goal **goals, Choicepoint **choicestack, USED(bindings); Choicepoint *cp = *choicestack; - while(cp != nil && cp->id == goal->clausenr) + + /* Cut all choicepoints with an id larger or equal to the goal clause number, since they must have been introduced + after this goal's parent. + */ + while(cp != nil && cp->id >= goal->clausenr) cp = cp->next; *choicestack = cp; return 1; |