[PPL-devel] An odd bug
P M Hill
hill at comp.leeds.ac.uk
Tue Oct 30 10:32:41 CET 2001
Hi,
I need help. I have a bug (one of many...) in a trivial meta-interpreter
for CLP(Q) which I just don't understand. The constraints become the
mirror of what they should be.
9 4 Call: ppl_insert_constraint(-32821246,A>=2) ?
9 4 Exit: ppl_insert_constraint(-32821246,A>=2) ?
8 3 Exit: solve_constraints(A>=2,-32821246) ?
7 2 Exit: solve({A>=2},-32821246) ?
10 2 Call: check_constraints(-32821246) ?
11 3 Call: ppl_space_dimension(-32821246,_7710) ?
11 3 Exit: ppl_space_dimension(-32821246,1) ?
12 3 Call: ppl_check_empty(-32821246) ?
13 4 Call: ppl_check_empty(-32821246,1) ?
13 4 Fail: ppl_check_empty(-32821246,1) ?
12 3 Fail: ppl_check_empty(-32821246) ?
14 3 Call: write(1) ?
14 3 Exit: write(1) ? 1
15 3 Call: write(' * ') ?
15 3 Exit: write(' * ') ? *
16 3 Call: ppl_get_constraints(-32821246,_7684) ?
16 3 Exit: ppl_get_constraints(-32821246,[1*A>= -2]) ?
17 3 Call: write([1*A>= -2]) ?
17 3 Exit: write([1*A>= -2]) ? [1*A>= -2]
Note that on the 1st line the constraint A >= 2 is inserted.
However, on the last line when it is printed we have A >= -2!
Another experiment:
| ?- solve({A==B+2}).
2 * [-1*A+1*B==2] % [vertex(-2*B),line(-1*A+ -1*B)]
A = A,
B = B ?
| ?- solve({A+B==C+D-A+2}).
4 * [-2*A+ -1*B+1*C+1*D==2] % [vertex(-2*D),line(-1*C+1*D),line(-1*B+
-1*D),line(-1*A+ -2*D)]
Note that all the variables are negated, regardless of where they occur -
or equivalently, the constant term is negated.
This is one of several bugs, but I just cannot see what is causing it and
would appreciate suggestions.
Also, as you can see from above, I have to use "==" for "=" which is not
clp(q) syntax. Obviously, "=" -> "==" can be done in in the
meta-interpreter, but it would be better if it was dealt with in the
interface.
ciao,
Pat
--
More information about the PPL-devel
mailing list