Skip to main content

Module functions

Module functions 

Source
Expand description

Functions for Prolog-style logic programming: unification, SLD resolution, parsing.

Functionsยง

apply_subst
Apply a substitution to a term, recursively dereferencing variables.
load_standard_predicates
Populate a database with classic Prolog predicates: member/2, append/3, reverse/3, length/2, last/2.
occurs_check
Check whether variable var occurs in term under substitution subst.
parse_clause
Parse a Horn clause from a string: head :- b1, b2. or head.
parse_term
Parse a simple Prolog term from a string.
resolve
Collect all solutions to a query using SLD resolution.
solve_one
Solve the query, returning the first solution or failure.
term_to_string
Pretty-print a term to a Prolog-style string.
unify
Compute the most general unifier of t1 and t2 under subst.
unify_with_occurs_check
Unify with the occurs check enabled (sound but slower).