]> Repositorios git - scryer-prolog.git/commitdiff
correct and load numbervars
authorMark Thom <[email protected]>
Tue, 18 Sep 2018 20:20:34 +0000 (17:20 -0300)
committerMark Thom <[email protected]>
Tue, 18 Sep 2018 20:20:34 +0000 (17:20 -0300)
src/prolog/lib/numbervars.pl
src/prolog/machine/mod.rs

index 26bc549424672f4311a1cff67ff38ee078676a5f..84a1431d4a4511d93e6157e079f9b39ca710c561 100644 (file)
@@ -10,8 +10,6 @@ numbervars(Term, NewTerm, N) :-
 
 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],
index de4c613f059a95dcdce8ee94134db17a24a595e9..ec9b11e7aa4a0fd372a6b26f60cc7b7c1898fe6e 100644 (file)
@@ -115,6 +115,7 @@ impl<'a> SubModuleUser for MachineCodeIndices<'a> {
 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 {
@@ -137,6 +138,7 @@ impl Machine {
         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
     }