Relates a relation to a list of its attributes. An attribute is a
[key Value]
pair.
Relates an attribute (a [key Value]
pair) to its key and value.
Extracts a value from a relation given the key name. Faster than searching through a list of the relation's attributes.
Unifies together the elements of the provided list.
-- [eq {A B C}]
- A = B = C
Relates a term to the list of variables contained in that term.
Creates a duplicate of Original
and unifies it with Duplicate
.
Creates a duplicate of Original
and unifies it with Duplicate
.
The variables in the list Renaming
that appear in Original
will be
renamed and their new names will be put in the list Renamed
.
-- [original [a A][b B][ab {A B}]
][Duplicate
][renaming {A Z}
][Renamed
]
- Duplicate = [a A_1][B][ab {A_1 B}]
- Renamed = {A_1 Z}
Convert symbols between snake_case and PascalCase.
True if the number Gt
is greater than the number Lt
.
True if the number Gte
is greater than or equal to the number Lte
.
Succeeds if its argument is an unbound variable.
Succeeds if its argument is an instantiated number.
Succeeds if its argument is an instantiated symbol.
Succeeds if its argument is an instantiated text string.
Succeeds if its argument is an instantiated relation structure.
Pushes a suffix onto a text string.
Relates two adjacent integers: a predecessor and a successor.
Always succeeds.
Always fails.
Succeeds if the goal passed to it fails, fails if the goal succeeds at least once. Note: This is safe because the knowledgebase is immutable.
Writes a text string to Stream
, and then writes a newline character.
Stream
can be the symbol stdin
or the symbol stderr
.
Writes a text string to Stream
.
Stream
can be the symbol stdin
or the symbol stderr
.
Relates a term to its text string representation.
Lists all builtin relations.
Gives the current working directory.
Changes the current working directory to the path provided as an argument.
Unifies its argument with a list of file/directory names from the current working directory.
Expresses the relationship: $$ \text{Minuend} - \text{Subtrahend} = \text{Difference} $$
To perform addition, use mode [subtrahend][difference][Minuend]
.
Alias: [Min][Sub][Dif]
Automatically included in every program unless the --no-std-lib
flag is provided.
Relates a list to a member of that list.
Relates a list to it's length.
Mode [len in][list out]
is broken.
Relates a list to its last element.
Relates a list to its reversal.
Mode [forwards out][backwards in]
loops forever. Does it need to be an intrinsic?
Requires the argument to conform to the given type test. It must be an instantiated value of the given type.
List
must be a ground list.
Num
must be a ground number.
Allows the argument to be unbound, but if it's bound, it must conform to the given type test.
List
can be a ground list or an unbound variable.
Num
can be a ground number or an unbound variable.
Expresses the relationship: Numerator/Denominator = Quotient (with a remainder of Remainder)
. More precisely, the relationship is Numerator = Quotient * Denominator + Remainder
.
Can be used to express divisibility (when Remainder
is set to 0), as well as multiplication (when Remainder
is 0).
Alias: [Num][Den][Quo][Rem]
[num][den][Quo][Rem] <=> quo = num / den, rem = num % den
[Num][den][quo][rem] <=> num = den * quo + rem
[Num][den 1][quo][rem] <=> num = quo + rem
[Num][den][quo 1][rem] <=> num = den + rem
[Num][den][quo][rem 0] <=> num = den * quo
[num][Den][quo][rem] <=> den = (num - rem) / quo
[num][den][Quo][rem] <=> quo = (num - rem) / den
[num][Den][quo 1][rem] <=> den = num - rem
[num][den 1][Quo][rem] <=> quo = num - rem
Relates a rellog source file given by FilePath
to that file's contained Clauses
and Directives
.
Finds relations which have not been documented.
Kinda broken.
Runs Goal
. If successful Truth
= true
, if it fails Truth
= false
, and if it errors Truth
= [Error]
where Error
is the error generated.
When Goal
errors, all subsequent solutions will be cut.
Runs the goal passed as the value to the If
key, if the goal fails this relation fails, if the goal succeeds (once or more) this relation succeeds (once or more).
Fulfills a similar role to a list map
function. See Prolog's maplist
predicate for a rough idea of this relation's uses.
Use [Splat]
and [Scalar]
to wrap direct arguments of the relation passed in.
- Allow deeper nesting.
-- [elementwise
[base
[splat {1 2 3}]
][exponent
[scalar 3]
][power
[splat Out]
]
]
- Out = {1 8 27}
-- [elementwise [pred [splat {1 2 3}]]][succ [splat Succs]]]
- Succs = {2 3 4}
-- [elementwise [pred [splat {1 Y 3}]][succ {X 3 Z}]]
- X = 2
- Y = 2
- Z = 4