Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#2 clause/2 needs copy_term

closed-fixed
Jeff Thompson
None
7
2009-07-26
2009-01-29
Jeff Thompson
No

After:
assert((zero(X) :- X = 0)).
the following query fails:
clause(zero(1), Body1), clause(zero(2), Body2).
because after the first call to clause, X is bound to 1 and the same X variable is used when matching the second call the clause. But clause should use copy_term to return the body.

Discussion

  • Jeff Thompson
    Jeff Thompson
    2009-07-26

    • status: open --> closed-fixed
     
  • Jeff Thompson
    Jeff Thompson
    2009-07-26

    Fixed in 1.0.4.
    In ClauseHeadAndBody.clause, need to return a copy of the body.