implement new disjunction compilation

This commit is contained in:
Mark
2023-06-17 16:28:56 -06:00
parent b205abe949
commit 0e583d620a
32 changed files with 2877 additions and 2980 deletions

View File

@@ -218,13 +218,13 @@ fail :- '$fail'.
%% \+(Goal)
%
% True iff Goal fails
\+ G :- call(G), !, false.
\+ G :- call(G), !, '$fail'.
\+ _.
%% \=(?X, ?Y)
%
% True iff X and Y can't be unified
X \= X :- !, false.
X \= X :- !, '$fail'.
_ \= _.

View File

@@ -513,10 +513,12 @@ portray_clause(Stream, Term) :-
phrase_to_stream(portray_clause_(Term), Stream),
flush_output(Stream).
% called once.
portray_clause_(Term) -->
{ unique_variable_names(Term, VNs) },
portray_(Term, VNs), ".\n".
% mysteriously called twice, the second time with the truncated B3.
unique_variable_names(Term, VNs) :-
term_variables(Term, Vs),
foldl(var_name, Vs, VNs, 0, _).