Node:Asserting with Constraints, Previous:Partial Evaluation, Up:Fragments and Bits



Asserting with Constraints

If you use the dynamic data base, the clauses you assert might have constraints associated with their variables. You should use projecting_assert/1 instead of assert/1 in order to ensure that only the relevant and projected constraints get stored in the data base.

     | ?- {A+B=<33}, projecting_assert(test(A,B)).
     
     {A+B=<33} ?
     
     yes
     | ?- listing(test).
     test(A, B) :-
             {A+B=<rat(33,1)}.
     
     
     yes
     | ?- test(A,B).
     
     {A+B=<33} ?