diff --git a/inst/prelude.pl b/inst/prelude.pl index 54246ba..2bb0b39 100644 --- a/inst/prelude.pl +++ b/inst/prelude.pl @@ -1,8 +1,8 @@ member(X, [X|_]). member(X, [_|T]) :- member(X,T). -append([], [], []) :- !. -append([], [H|T], [H|T]) :- !. +append([], [], []). +append([], [H|T], [H|T]). append([X|T], Y, [X|TY]) :- append(T,Y,TY). list([]). @@ -83,3 +83,5 @@ expand_phrasecall(X, Xp, S0, S) :- !, struct(X, Id, Args), append(Args, [S0, S], Args1), struct(Xp, Id, Args1). + +phrase(X, S0, S) :- expand_phrasecall(X, Xp, S0, S), call(Xp).