Expand description
Host-side reference scorer for n-ary rule patterns.
The parity anchor for the device n-ary scoring stage: a direct,
obviously-correct interpretation of NaryRulePattern coverage
semantics over host fact tables. The device kernel, when it lands, must
reproduce these counts bit-for-bit on bounded inputs — exactly the role
the Python prototype played for the binary engine.
Coverage semantics, stated once: an example tuple (one head assignment) is covered by a pattern iff there exists an assignment of the pattern’s join variables such that every body atom’s bound row exists in its candidate relation. Head positions are fixed by the example; join variables are searched. The search is a plain backtracking walk — the reference optimizes for auditability, not speed.
Structs§
- Host
Relation - One candidate relation’s facts as host rows; row length is the arity.
- Reference
Coverage - Coverage counts for one pattern over one example set pair.
Functions§
- score_
pattern_ reference - Score one pattern against positive and negative example tuples.