rule
tuprolog.solve.stdlib.rule
¶
The rules of the standard library, i.e. its predicates written in Prolog.
Each constant is a rule with a signature (its name and arity in Prolog), and an
implementation, i.e. the clause defining it; predicates defined by several clauses (append/3,
member/2, ;/2) are classes grouping them. They are loaded by default in Prolog solvers.
Examples:
>>> Once.implementation
once(G_...) :- (ensure_executable(G_...), call(G_...), '!')
>>> Append.SIGNATURE
Signature(name=append, arity=3, vararg=false)
Arrow
module-attribute
¶
Arrow: Arrow = _rule.Arrow.INSTANCE
The rule of ->/2: if-then, i.e. (C -> T) proves T if C holds (once).
CurrentPrologFlag
module-attribute
¶
CurrentPrologFlag: CurrentPrologFlag = (
_rule.CurrentPrologFlag.INSTANCE
)
The rule of current_prolog_flag/2: a flag and its value (see tuprolog.solve.flags).
Not
module-attribute
¶
Not: Not = _rule.Not.INSTANCE
The rule of not/1: negation as failure, like \+/1.
Once
module-attribute
¶
Once: Once = _rule.Once.INSTANCE
The rule of once/1: proves a goal, keeping its first solution only.
SetPrologFlag
module-attribute
¶
SetPrologFlag: SetPrologFlag = _rule.SetPrologFlag.INSTANCE
The rule of set_prolog_flag/2: sets the value of a flag.
Append
¶
The rules of append/3: a list is the concatenation of two others.
Attributes:
| Name | Type | Description |
|---|---|---|
FUNCTOR |
The name, |
|
ARITY |
The arity, 3. |
|
SIGNATURE |
The signature, |
|
Base |
The base case, |
|
Recursive |
The recursive case, |
Member
¶
The rules of member/2: a term is an element of a list.
Attributes:
| Name | Type | Description |
|---|---|---|
FUNCTOR |
The name, |
|
ARITY |
The arity, 2. |
|
SIGNATURE |
The signature, |
|
Base |
The base case, |
|
Recursive |
The recursive case, |
Semicolon
¶
The rules of ;/2: disjunction (A ; B) and if-then-else ((C -> T ; E)).
Attributes:
| Name | Type | Description |
|---|---|---|
FUNCTOR |
The name, |
|
ARITY |
The arity, 2. |
|
SIGNATURE |
The signature, |
|
If |
The rules of if-then-else: |
|
Or |
The rules of disjunction: |