How to define a statement in the prolog to create a list?
3 answers
:- op(500,xfy,++>).
++>(X,Y,[X,Y]).
And use it like
?- ++>(1,2,X).
X = [1, 2].
Actually, Prolog is not oriented computation, so operators are simply synonymous with terms. You need the term \ 3, where one item is a list of the other two. Therefore, you cannot use a 2-position operator in this case. By the way, you cannot use in this situation, because it was used only in arithmetic cases.
0