]> Repositorios git - scryer-prolog.git/commitdiff
move term_variables to builtins
authorMark Thom <[email protected]>
Thu, 27 Sep 2018 01:33:27 +0000 (19:33 -0600)
committerMark Thom <[email protected]>
Thu, 27 Sep 2018 01:33:27 +0000 (19:33 -0600)
README.md
src/prolog/lib/builtins.pl
src/prolog/lib/terms.pl

index e182968912fc7980133a3b6a60617380aa2855e0..1339b10ec6bdfe7d32aaf0fde76ae9d37271be5d 100644 (file)
--- a/README.md
+++ b/README.md
@@ -153,7 +153,7 @@ The following predicates are built-in to rusty-wam.
 * `member/2`
 * `memberchk/2`
 * `nonvar/1`
-* `numbervars/{2,3}`
+* `numbervars/2`
 * `once/1`
 * `partial_string/2`
 * `rational/1`
index 5e82723a1631a8a2fcf784b656ba68555d9ca41e..b07b7e9699eddcc153d6b7bbd6b37282177ccc07 100644 (file)
@@ -1,13 +1,14 @@
 :- op(400, yfx, /).
 
-:- module(builtins, [(=)/2, (+)/2, (**)/2, (*)/2, (-)/2, (/)/2, (/\)/2,
-       (\/)/2, (is)/2, (xor)/2, (div)/2, (//)/2, (rdiv)/2, (<<)/2,
-       (>>)/2, (mod)/2, (rem)/2, (>)/2, (<)/2, (=\=)/2, (=:=)/2,
-       (-)/1, (>=)/2, (=<)/2, (,)/2, (->)/2, (;)/2, (=..)/2, (==)/2,
-       (\==)/2, (@=<)/2, (@>=)/2, (@<)/2, (@>)/2, (=@=)/2, (\=@=)/2,
-       (:)/2, call_with_inference_limit/3, catch/3,
+:- module(builtins, [(=)/2, (+)/2, (**)/2, (*)/2, (-)/2, (/)/2,
+       (/\)/2, (\/)/2, (is)/2, (xor)/2, (div)/2, (//)/2, (rdiv)/2,
+       (<<)/2, (>>)/2, (mod)/2, (rem)/2, (>)/2, (<)/2, (=\=)/2,
+       (=:=)/2, (-)/1, (>=)/2, (=<)/2, (,)/2, (->)/2, (;)/2, (=..)/2,
+       (==)/2, (\==)/2, (@=<)/2, (@>=)/2, (@<)/2, (@>)/2, (=@=)/2,
+       (\=@=)/2, (:)/2, call_with_inference_limit/3, catch/3,
        current_prolog_flag/2, set_prolog_flag/2,
-       setup_call_cleanup/3, throw/1, true/0, false/0]).
+       setup_call_cleanup/3, term_variables/2, throw/1, true/0,
+       false/0]).
 
 /* this is an implementation specific declarative operator used to implement call_with_inference_limit/3
    and setup_call_cleanup/3. switches to the default trust_me and retry_me_else. Indexing choice
@@ -205,6 +206,8 @@ get_args([Arg|Args], Func, I0, N) :-
     '$call_with_default_policy'(I1 is I0 + 1),
     '$call_with_default_policy'(get_args(Args, Func, I1, N)).
 
+term_variables(Term, Vars) :- '$term_variables'(Term, Vars).
+
 % setup_call_cleanup.
 
 setup_call_cleanup(S, G, C) :- '$get_b_value'(B),
index 7c16f021db41aacadc216f8cc6c32fd96b6616c2..8e87b97540c1df0e2dc91e70d2f6537dbc3968b4 100644 (file)
@@ -1,17 +1,9 @@
-:- module(terms, [term_variables/2, numbervars/2, numbervars/3]).
-
-term_variables(Term, Vars) :- '$term_variables'(Term, Vars).
+:- module(terms, [numbervars/2]).
 
 numbervars(Term, N) :-
     integer(N),
     term_variables(Term, Vars),
     numberlist(Vars, N, N1).
-    
-numbervars(Term, N0, N) :-
-    integer(N0),
-    integer(N),
-    term_variables(Term, Vars),
-    numberlist(Vars, N0, N).
 
 numberlist([], N,N).
 numberlist(['$VAR'(N0)|Vars], N0,N) :-