The operator -?->
at the beginning of the clause
body specifies that one-way matching should be used
instead of full unification:
p(f(X)) :- -?-> q(X).Pattern matching can be used for several purposes:
get_attr(X{A}, Attr) :- -?-> A = Attr.This predicate can be used to return the attribute of a given attributed variable and fail if it is not one.
If some argument positions of a matching clause are declared as output in a mode declaration, then they are not unified using pattern matching but normal unification, in this case then the variable is normally bound. The above example can thus be also written as
:- mode get_attr(?, -). get_attr(X{A}, A) :- -?-> true.but in this case it must not be called with its second argument already instantiated.