Skip to content

Commit

Permalink
print equations between variables (#228, #252)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark Thom committed Dec 6, 2019
1 parent 018b076 commit 90e1c99
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/prolog/toplevel.pl
Original file line number Diff line number Diff line change
Expand Up @@ -144,13 +144,20 @@
).
'$gather_query_vars'([], []).

'$is_a_different_variable'([Var = Binding | Pairs], Value) :-
( Value == Binding, !
; '$is_a_different_variable'(Pairs, Value)
).

'$gather_goals'([], VarList, Goals) :-
'$get_attr_var_queue_beyond'(0, AttrVars),
'$gather_query_vars'(VarList, QueryVars),
'$call_attribute_goals'(QueryVars, AttrVars),
'$fetch_attribute_goals'(Goals).
'$gather_goals'([Var = Value | Pairs], VarList, Goals) :-
( nonvar(Value) ->
( ( nonvar(Value)
; '$is_a_different_variable'(Pairs, Value)
) ->
Goals = [Var = Value | Goals0],
'$gather_goals'(Pairs, VarList, Goals0)
; '$gather_goals'(Pairs, VarList, Goals)
Expand Down

0 comments on commit 90e1c99

Please sign in to comment.