Advertisement
logicmoo

Untitled

Apr 27th, 2019
645
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Prolog 0.46 KB | None | 0 0
  1. upper_dash(N,NN):- atomic_list_concat(NL,'_',N),atomic_list_concat(NL,'-',NN).
  2. harden_cycl_vars(G,G):- ground(G),!.
  3. harden_cycl_vars(V,NN):- var(V),var_property(V,name(VN)),!,atom_concat('?VAR-',VN,N),upper_dash(N,NN).
  4. harden_cycl_vars(V,NN):- var(V),!,format(atom(N),'?VAR~w',[V]),upper_dash(N,NN).
  5. harden_cycl_vars(G,G):- \+ compound(G),!.
  6. harden_cycl_vars(A,AA):- compound_name_arguments(A,F,AL),maplist(harden_cycl_vars,AL,AAL),compound_name_arguments(AA,F,AAL).
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement