In the Prolog, how to represent the situation “somewhere to the left”.
For example, there is a List “List” and two terms “X” and “Y”, how to represent the rule: X is somewhere to the left of Y in the List.
In the Prolog, how to represent the situation somewhere to the left. For example,
Share
This can be reduced to the problem of subsequence matching.
Then your “left-of” query would be
subsequence([X, Y], List), !.