Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- replace_arg_fast(C,A,VAR,CC):- duplicate_term(C,CC),setarg(A,CC,VAR),!.
- replace_arg(C,A,VAR,CC):-
- C=..FARGS,
- replace_nth(FARGS,A,VAR,FARGO),!,
- CC=..FARGO.
- :-moo_hide_childs(replace_arg/4).
- :-moo_hide_childs(replace_nth/4).
- replace_nth([],_,_,[]):- !.
- replace_nth([_|ARGO],0,VAR,[VAR|ARGO]):- !.
- replace_nth([T|FARGS],A,VAR,[T|FARGO]):-
- A2 is A-1,replace_nth(FARGS,A2,VAR,FARGO).
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement