Skip to main content

Crate prolog8

Crate prolog8 

Source
Expand description

§Prolog8 — Byte-Capped Proof Engine

Implements the Prolog8 PRD/ARD: a Rust/WASM proof engine for bounded rules, graph/bit execution, action admission, and replayable decisions.

§Doctrine

  • No parser in the kernel. The kernel accepts only IDs, byte arrays, and graph objects. Authoring text becomes IDs at boundary time.
  • The byte is the governor. Arity ≤ 8, body atoms ≤ 8, variables ≤ 8, binding patterns ≤ 256.
  • Need9 means split. Constructs that exceed eight elements must be decomposed into multiple predicates or rules.
  • Proof is the product. Every decision emits a positive or negative proof and a receipt sufficient for deterministic replay.

§Components

  • types — core types: Atom8, Rule8, FactRow8, FactBlock8, QueryAtom8, ProofNode, Receipt, identifier newtypes.
  • catalog — predicate / term registries.
  • admission — Admit(x) law: caps, feature mask, indexability checks.
  • kernel — query execution: binding-mask dispatch, scans, joins, proof emission, receipt assembly.
  • [replay] — receipt verifier.
  • hash — BLAKE3 root computations with domain-separation tags.

Build with --features wasm to expose the byte-buffer ABI defined by wasm.rs.

Re-exports§

pub use admission::admit_atom;
pub use admission::admit_rule;
pub use admission::RejectionCode;
pub use catalog::Catalog;
pub use catalog::PredicateMeta;
pub use catalog::PredicateProofPolicy;
pub use hash::combine_roots;
pub use hash::hash_bytes;
pub use hash::Hash;
pub use hash::DOMAIN_PROLOG8_RECEIPT;
pub use kernel::Decision;
pub use kernel::Kernel;
pub use kernel::QueryResult;
pub use replay::replay;
pub use replay::ReplayStatus;
pub use types::Atom8;
pub use types::CatalogId;
pub use types::DecisionKind;
pub use types::EpochId;
pub use types::FactBlock8;
pub use types::FactBlockMeta;
pub use types::FactRow8;
pub use types::FeatureBit;
pub use types::PredicateId;
pub use types::ProofKind;
pub use types::ProofMode;
pub use types::ProofNode;
pub use types::ProofNodeId;
pub use types::QueryAtom8;
pub use types::Receipt;
pub use types::Rule8;
pub use types::RuleId;
pub use types::SourceId;
pub use types::SubstitutionId;
pub use types::TermId;
pub use types::ARITY_CAP;
pub use types::BINDING_PATTERNS;
pub use types::BODY_CAP;
pub use types::VAR_CAP;

Modules§

admission
Admission Law — ARD section 6 + section 7.
catalog
Catalog: predicate / term registries with admission metadata.
hash
BLAKE3 hashing with domain-separation tags.
kernel
Kernel — query execution, proof emission, receipt assembly.
replay
Replay verifier — ARD section 12.
types
Core Prolog8 types per ARD section 4.

Constants§

ENGINE_NAME
Engine identifier reported in receipts.
ENGINE_VERSION
Engine version reported in receipts.