Skip to main content

Crate sim_lib_logic

Crate sim_lib_logic 

Source
Expand description

Logic behavior for the SIM runtime: clauses, unification, and queries.

The kernel defines the Shape, eval-policy, and codec contracts; this crate supplies the concrete logic organ (a clause database, unifier, constraint solving, and a query/stream surface).

Re-exports§

pub use policy::LogicPolicy;

Modules§

builtins
Browseable logic builtin bindings.
policy
Eval-policy adapter for running logic queries through a sim_kernel::Cx.

Structs§

Clause
A parsed logic clause: a head goal plus an optional list of body goals.
ClauseId
Stable identifier assigned to a clause when it is added to a database.
LogicConfig
Aggregate tuning for the logic organ, threaded through every query.
LogicDb
An indexed store of logic Clauses queried by goal.
LogicEnv
A unification substitution: bindings from logic variables to terms.
LogicLib
The loadable logic organ: shapes, functions, and database/config state.
LogicLimits
Resource ceilings that bound a single logic query.
LogicQuery
A goal paired with the LogicConfig under which it should be resolved.

Enums§

OccursCheck
Whether the unifier runs the occurs check when binding a variable.
SearchStrategy
Order in which the resolver explores pending goal states.

Functions§

install_logic_lib
Installs the LogicLib into cx, idempotently.
parse_clause_expr
Parses a (fact head) or (rule head body) expression into a Clause.
query
Resolves goal against db and returns the answers as a logic stream.
query_all
Resolves goal against db and returns all answers up to limit.
query_all_with_builtins
Resolves goal with an explicit builtin table.
realize_logic
Resolves goal against the installed logic database and returns the result.
unify_exprs
Unifies two expressions and reports the result as a kernel ShapeMatch.