Created
August 22, 2017 21:52
-
-
Save nathggns/5725595c24276e1ec62ae75ed23f8be0 to your computer and use it in GitHub Desktop.
Prolog to create union of two lists without unifying non-ground terms
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
myUMember(X, [Y|T]) :- X == Y; myUMember(X, T). | |
myU([X|Y],Z,W) :- | |
myUMember(X,Z), | |
!, | |
myU(Y,Z,W). | |
myU([X|Y],Z,[X|W]) :- myU(Y,Z,W). | |
myU([],Z,Z). | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment