Module s_complex

Source
Expand description

Functions to support complex terms.

Suiron’s complex terms (SComplex) are similar to Prolog’s complex terms. They consist of a functor, followed by a list of terms between parentheses. Some examples:

element(Argon, 18)
father($F, Luke)
pronoun(I, subject, first, singular)

In Rust, complex terms are implemented as a vector of unifiable terms.

§Note

Unlike Prolog, Suiron’s atoms (string constants) can be capitalized or lower case.
Logic variables start with a dollar sign and a letter, eg. $F.

Functions§

make_complex
Produces a complex term from a vector of terms.
make_query
Produces a query from a vector of terms.
parse_complex
Parses a string to produce a complex term.
parse_functor_terms
Parses two string arguments to produce a complex term.
parse_query
Parses a string to produce a query.
validate_complex
Validates the string to be parsed.