numbervars(Term, NewTerm, N1, N2) :-
var(Term), !, NewTerm = '$VAR'(N1), N2 is N1 + 1.
-numbervars([Arg | Args], NewTerms, N1, N2) :- !,
- fold_numbervars([Arg | Args], NewTerms, N1, N2).
numbervars(Term, NewTerm, N1, N2) :- compound(Term), !,
Term =.. [Name | Args],
NewTerm =.. [Name | NewArgs],
static LISTS: &str = include_str!("../lib/lists.pl");
static CONTROL: &str = include_str!("../lib/control.pl");
static QUEUES: &str = include_str!("../lib/queues.pl");
+static NUMBERVARS: &str = include_str!("../lib/numbervars.pl");
impl Machine {
pub fn new() -> Self {
compile_user_module(&mut wam, LISTS.as_bytes());
compile_user_module(&mut wam, CONTROL.as_bytes());
compile_user_module(&mut wam, QUEUES.as_bytes());
+ compile_user_module(&mut wam, NUMBERVARS.as_bytes());
wam
}