print equations between variables (#228, #252)

This commit is contained in:
Mark Thom
2019-12-06 10:30:16 -04:00
parent 018b076835
commit 90e1c990e5

View File

@@ -144,13 +144,20 @@
). ).
'$gather_query_vars'([], []). '$gather_query_vars'([], []).
'$is_a_different_variable'([Var = Binding | Pairs], Value) :-
( Value == Binding, !
; '$is_a_different_variable'(Pairs, Value)
).
'$gather_goals'([], VarList, Goals) :- '$gather_goals'([], VarList, Goals) :-
'$get_attr_var_queue_beyond'(0, AttrVars), '$get_attr_var_queue_beyond'(0, AttrVars),
'$gather_query_vars'(VarList, QueryVars), '$gather_query_vars'(VarList, QueryVars),
'$call_attribute_goals'(QueryVars, AttrVars), '$call_attribute_goals'(QueryVars, AttrVars),
'$fetch_attribute_goals'(Goals). '$fetch_attribute_goals'(Goals).
'$gather_goals'([Var = Value | Pairs], VarList, Goals) :- '$gather_goals'([Var = Value | Pairs], VarList, Goals) :-
( nonvar(Value) -> ( ( nonvar(Value)
; '$is_a_different_variable'(Pairs, Value)
) ->
Goals = [Var = Value | Goals0], Goals = [Var = Value | Goals0],
'$gather_goals'(Pairs, VarList, Goals0) '$gather_goals'(Pairs, VarList, Goals0)
; '$gather_goals'(Pairs, VarList, Goals) ; '$gather_goals'(Pairs, VarList, Goals)