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.
- Clause
Id - Stable identifier assigned to a clause when it is added to a database.
- Logic
Config - Aggregate tuning for the logic organ, threaded through every query.
- LogicDb
- An indexed store of logic
Clauses queried by goal. - Logic
Env - A unification substitution: bindings from logic variables to terms.
- Logic
Lib - The loadable logic organ: shapes, functions, and database/config state.
- Logic
Limits - Resource ceilings that bound a single logic query.
- Logic
Query - A goal paired with the
LogicConfigunder which it should be resolved.
Enums§
- Occurs
Check - Whether the unifier runs the occurs check when binding a variable.
- Search
Strategy - Order in which the resolver explores pending goal states.
Functions§
- install_
logic_ lib - Installs the
LogicLibintocx, idempotently. - parse_
clause_ expr - Parses a
(fact head)or(rule head body)expression into aClause. - query
- Resolves
goalagainstdband returns the answers as a logic stream. - query_
all - Resolves
goalagainstdband returns all answers up tolimit. - query_
all_ with_ builtins - Resolves
goalwith an explicit builtin table. - realize_
logic - Resolves
goalagainst the installed logic database and returns the result. - unify_
exprs - Unifies two expressions and reports the result as a kernel
ShapeMatch.