PublicShow sourcevariables.pl -- Variable storage and access

Predicates related to storing, accessing and modifying variables.

author
- Kyle Marple
version
- 20170515
license
- BSD-3
Source is_var(@Term) is semidet
Source is_var(@Term, Name) is semidet
Test an entry to see if it's a variable (the first non-underscore is an upper-case letter.
Arguments:
Term- is the term to be tested.
Source body_vars(+Head:compound, +Body:list, -BodyVars:list) is det
Get the body variables (variables used in the body but not in the head) for a clause.
Source var_list(+N:int, -Vars:list) is det
Get a list of N variables, each of which is different. Basically, just append a counter to '_X'. The '_' prefix ensures they don't overlap with any existing variables in a rule.
Arguments:
N- The size of the list to return.
Vars- output list.
Source revar(+Term, -VarTerm, -Bindings) is det
If Term is a term that contains atoms using variable syntax ([A-Z].*), VarTerm is a copy of Term with all such atoms replaced by variables. In addition this performs the following rewrites:
Arguments:
Bindings- is a list Name=Var that contains the variable names.