Tabled declarations have wrong arity
The ":- table pred/arity" doesn't take into account that pred's arity could be increased due to it being a function's graph.
Example:
:- table diag1/2.
:- table diag2/2.
diag1(IDPXSB_x, IDPXSB_y, IDPXSB_var12) :- a1(IDPXSB_x, IDPXSB_y, IDPXSB_var12), index(IDPXSB_x), index(IDPXSB_y), s51(IDPXSB_var12).
a1(IDPXSB_x, IDPXSB_y, IDPXSB_var12) :- index(IDPXSB_x), index(IDPXSB_y), IDPXSB_var12 is IDPXSB_x - IDPXSB_y+3.
diag2(IDPXSB_x, IDPXSB_y, IDPXSB_var13) :- a2(IDPXSB_x, IDPXSB_y, IDPXSB_var13), index(IDPXSB_x), index(IDPXSB_y), s15(IDPXSB_var13).
a2(IDPXSB_x, IDPXSB_y, IDPXSB_var13) :- index(IDPXSB_x), index(IDPXSB_y), IDPXSB_var13 is IDPXSB_x+IDPXSB_y - 1.
Loading into XSB:
| ?- [tmp].
[Compiling ./tmp]
++Warning[XSB]: [Compiler] ./tmp : diag1/2 declared as tabled, but not defined.
++Warning[XSB]: [Compiler] ./tmp : diag2/2 declared as tabled, but not defined.
[tmp compiled, cpu time used: 0.0280 seconds]
[tmp loaded]
Comments (6)
-
reporter -
reporter - changed status to resolved
Fixed a bug that lead to incorrect ":- table ..." statements
When functions are transformed into Prolog rules, the resulting arity is incremented. This was not yet reflected in the declaration of the ":- table prologpred/arity" statements.
This fixes issue
#335→ <<cset c9b0c14421ec>>
-
reporter Fixed a bug that lead to incorrect ":- table ..." statements
When functions are transformed into Prolog rules, the resulting arity is incremented. This was not yet reflected in the declaration of the ":- table prologpred/arity" statements.
This fixes issue
#335→ <<cset 938c928f92c4>>
-
reporter Fixed a bug that lead to incorrect ":- table ..." statements
When functions are transformed into Prolog rules, the resulting arity is incremented. This was not yet reflected in the declaration of the ":- table prologpred/arity" statements.
This fixes issue
#335→ <<cset de5307129ded>>
-
reporter Fixed a bug that lead to incorrect ":- table ..." statements
When functions are transformed into Prolog rules, the resulting arity is incremented. This was not yet reflected in the declaration of the ":- table prologpred/arity" statements.
This fixes issue
#335→ <<cset 3446db042bbb>>
-
Fixed a bug that lead to incorrect ":- table ..." statements
When functions are transformed into Prolog rules, the resulting arity is incremented. This was not yet reflected in the declaration of the ":- table prologpred/arity" statements.
This fixes issue
#335→ <<cset 51f04b74c76a>>
- Log in to comment
Context: The above Prolog rules are produced by the following definitions (of 2 functions):
{ diag1(x,y) = x-(y+3). }
{ diag2(x,y) = x+y-1. }