Next: mpg-ref-tell, Previous: mpg-ref-sub_atom, Up: mpg-bpr [Contents][Index]
subsumes_term/2
ISOsubsumes_term(+General, +Specific)
is true when Specific is an instance of General. It does not bind any variables.
any term.
any term.
True iff there is a substitution that makes General identical to Specific and that does not affect Specific.
The predicate is determinate and either succeeds or fails. It never binds variables.
The predicate does not take any constraints, variable attributes, or blocked goals into account when determining whether a substitution exists. This can be seen in the last two examples.
| ?- subsumes_term(a, a). yes | ?- subsumes_term(f(X,Y), f(Z,Z)). yes | ?- subsumes_term(f(Z,Z), f(X,Y)). no | ?- subsumes_term(g(X), g(f(X))). no | ?- subsumes_term(X, f(X)). no | ?- subsumes_term(X, Y), subsumes_term(Y, f(X)). yes | ?- when(nonvar(X), X=a), subsumes_term(X, b), X = a. X = a ? yes | ?- when(nonvar(X), X=a), subsumes_term(X, b), X = b. no
None.