Skip to content

Commit

Permalink
fixed wrong imply behavior when undefined terms
Browse files Browse the repository at this point in the history
  • Loading branch information
nrueh committed Jun 5, 2024
1 parent c91fb41 commit f2d016d
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/coomsolver/encodings/preprocess.lp
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,17 @@ binary(X,F,@binary(XL,Op,XR),XL,Op,XR) :- coom_binary(F,L,Op,R),
type_aux(X,C), path_to(X,L,XL), path_to(X,R,XR).
binary(X,F,G) :- binary(X,F,G,_,_,_).

% Default binaries for arithmetics if one side is undefined
% TODO: Does this always give desired behavior?
binary(X,F,XL) :- coom_binary(F,L,"+",R),
binary_context(F,C),
type_aux(X,C), path_to(X,L,XL), not path_to(X,R,_).

binary(X,F,XR) :- coom_binary(F,L,"+",R),
binary_context(F,C),
type_aux(X,C), not path_to(X,L,_), path_to(X,R,XR).


% Instantiate functions
function(X,F,T,P) :- coom_function(C,F,T,P), type_aux(X,C).

Expand Down

0 comments on commit f2d016d

Please sign in to comment.