Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- subst_functor(X, X) :- atomic(X).
- subst_functor(X, Y) :-
- X =.. [f, ArgX],
- Y =.. [h, ArgY],
- subst_functor_list([ArgX], [ArgY]).
- subst_functor(X, Y) :-
- X =.. [g, ArgX1, ArgX2],
- Y =.. [g, ArgY1, ArgY2],
- subst_functor_list([ArgX1, ArgX2], [ArgY1, ArgY2]).
- subst_functor_list([], []).
- subst_functor_list([H1|T1], [H2|T2]) :-
- subst_functor(H1, H2),
- subst_functor_list(T1, T2).
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement