diff options
author | Peter Mikkelsen <peter@pmikkelsen.com> | 2021-06-30 01:58:24 +0000 |
---|---|---|
committer | Peter Mikkelsen <peter@pmikkelsen.com> | 2021-06-30 01:58:24 +0000 |
commit | 2c3e688c3f779f0abfaad887f13ab2b70c9f814a (patch) | |
tree | 0ca93ea97a38864991eeb0097afd1f989e1939b2 /example.pl | |
parent | d5ce41f05bc322fa2fb4d0eee66080b3b3004853 (diff) |
Add backtracking to the evaluator. This means we have to keep track of choicepoints which is implemented the easy but wasteful way for now.
I have also added a number which is used to differentiate variables from different application of the clauses.
Diffstat (limited to 'example.pl')
-rw-r--r-- | example.pl | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -25,4 +25,10 @@ curly(A) :- A = {one,two,three}. =(A,A). -:- initialization(could_be_friends(bob, sam)).
\ No newline at end of file +length([], zero). +length([Head|Tail], suc(Length)) :- + length(Tail, Length). + +:- initialization(could_be_friends(bob, sam)). + +:- initialization(length([a,b,c,d], Len)). |