Ex4pmEngine.Cognition.Prolog (ex4pm v26.9.9)

Copy Markdown View Source

Horn-clause backward chaining resolution engine with Robinson first-order term unification. Provides native BEAM logic programming execution for rules, invariants, and ontology deductions.

Summary

Functions

Asserts a fact into the knowledge base.

Asserts a Horn clause rule: Head :- Body1, Body2, ...

Constructs a new Prolog knowledge base from clauses.

Evaluates a query against the knowledge base, returning all satisfying variable bindings.

Robinson First-Order Term Unification.

Types

clause()

@type clause() :: {:fact, tuple()} | {:rule, tuple(), [tuple()]}

t()

@type t() :: %Ex4pmEngine.Cognition.Prolog{clauses: [clause()], metadata: map()}

Functions

assert_fact(kb, fact)

Asserts a fact into the knowledge base.

assert_rule(kb, head, body)

Asserts a Horn clause rule: Head :- Body1, Body2, ...

is_var(atom)

new(clauses \\ [], metadata \\ %{})

Constructs a new Prolog knowledge base from clauses.

query(kb, goals)

Evaluates a query against the knowledge base, returning all satisfying variable bindings.

unify(t1, t2, env \\ %{})

Robinson First-Order Term Unification.