Skip to main content

Module semantic

Module semantic 

Source
Expand description

Semantic invariant mining over inferred grammars.

This module is a clean-room, deterministic implementation of the D8 inference layer. It keeps the public model grammar-aware and query-shaped, while the current backend mines observations from the positive corpus until a public derivation-tree parser is available from the CFG runtime.

Structs§

ConstraintClause
One conjunctive clause in a disjunctive-normal-form constraint.
ConstraintPattern
A reusable invariant template with named non-terminal slots.
NonTerminalRef
A reference to a non-terminal plus the structural query that locates it.
SemanticConstraint
A ranked disjunctive-normal-form semantic constraint.
SemanticInferenceConfig
Configuration for semantic invariant mining.

Enums§

ConstraintAtom
A grammar-aware atomic predicate over derivation-tree observations.
LengthUnit
Unit used by ConstraintAtom::LengthField.

Functions§

default_pattern_catalog
Returns the built-in semantic-invariant pattern catalog.
evaluate_atom
Evaluates one atom over one input.
evaluate_clause
Evaluates one clause over one input.
evaluate_constraint
Evaluates a semantic DNF over one input.
evaluate_probabilistic
Evaluates a semantic DNF as a probabilistic truth value.
mine_semantic_constraints
Mines a ranked DNF of semantic constraints from a grammar and positive corpus.

Type Aliases§

ConstraintInstantiator
Function type used by a constraint-pattern template.