use C-code.

This commit is contained in:
Vítor Santos Costa 2011-11-03 07:51:58 +09:00
parent c322722d5b
commit fc2a50b67e

View File

@ -31,30 +31,4 @@ max_var_numberl(I0,Ar,T,Max0,Max) :-
). ).
varnumbers(GT, VT) :- varnumbers(GT, VT) :-
max_var_number(GT,0,Max), unnumber_vars(GT, VT).
Max1 is Max+1,
functor(Vars,vars,Max1),
varnumbers(GT, Vars, VT).
varnumbers(V,_,V) :- var(V), !.
varnumbers('$VAR'(I),Vs,V) :- !,
I1 is I+1,
arg(I1,Vs,V).
varnumbers(S,Vs,NS) :-
functor(S,N,Ar),
functor(NS,N,Ar),
varnumbersl(0,Ar,Vs,S,NS).
varnumbersl(I0,Ar,Vs,S,NS) :-
(I0 =:= Ar ->
true
;
I is I0+1,
arg(I,S,A),
arg(I,NS,NA),
varnumbers(A,Vs,NA),
varnumbersl(I,Ar,Vs,S,NS)
).