Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- prolog term without a functor
- transform([a,b],X)
- =..((a,b,c,d),X)
- transform([A], A):-
- A=..[_].
- transform([A,B], (A,B)):-
- B=..[_].
- transform([A,B,C|Tail], L):-
- L=..[',',A,T],
- transform([B,C|Tail], T).
- ?- transform([a,b], X).
- X = (a, b)
- ?- transform([a,b,c,d,e,f], X).
- X = (a, b, c, d, e, f)
- ?- transform(L, (a,b,c,d,e,f,g))
- L = [a, b, c, d, e, f, g]
Add Comment
Please, Sign In to add comment