pub enum RefEvalError {
Ineligible(Vec<Boundary>),
MissingRelation(String),
RelationArityMismatch {
predicate: String,
atom_arity: usize,
relation_arity: usize,
},
RelationRowArityMismatch {
predicate: String,
row_index: usize,
row_len: usize,
schema_len: usize,
},
RelationValueTypeMismatch {
predicate: String,
row_index: usize,
column: usize,
expected: ScalarType,
got: String,
},
ConstantTypeMismatch {
predicate: String,
position: usize,
expected: ScalarType,
got: String,
},
ComparisonTypeMismatch {
left: String,
right: String,
op: CompOp,
},
UnboundHeadVariable(String),
IsExprNotSupported,
ConflictingVariableType {
var: String,
first_predicate: String,
first_position: usize,
first_type: ScalarType,
second_predicate: String,
second_position: usize,
second_type: ScalarType,
},
InferenceConflict {
predicate: String,
column: usize,
first_rule_index: usize,
first_type: ScalarType,
second_rule_index: usize,
second_type: ScalarType,
},
}Expand description
Errors surfaced by evaluate_rule.
Variants§
Ineligible(Vec<Boundary>)
The rule was Eligibility::Ineligible — callers must gate
on super::analyze / super::analyze_typed before
evaluation. Carries the boundary list for diagnostic use.
MissingRelation(String)
A predicate referenced by the rule body was not present in
the supplied RefRelationStore.
RelationArityMismatch
A body atom’s arity does not match the supplied relation’s schema arity. The evaluator is the WCOJ correctness oracle — arity drift between rule and fixture must surface as a loud failure, not a silent skip.
Fields
RelationRowArityMismatch
A relation row’s length does not equal the schema’s column count. Rejected before evaluation begins so a malformed fixture fails on entry rather than producing misleading partial-row matches.
Fields
RelationValueTypeMismatch
A relation row carries a RefValue whose variant does not
match the schema’s [ScalarType] at that column. Detected
before evaluation so type drift in fixtures fails loudly
rather than silently corrupting GPU oracle comparisons.
Fields
expected: ScalarTypeSchema-declared type at that column.
ConstantTypeMismatch
A constant in a body atom could not be coerced to a value compatible with the relation’s column type at that position.
Fields
expected: ScalarTypeExpected scalar type per the relation’s schema.
ComparisonTypeMismatch
A Comparison body literal could not be evaluated because
its operands were of incompatible types.
Fields
UnboundHeadVariable(String)
The rule head referenced a variable that is not bound by any body atom (a free variable in the head).
IsExprNotSupported
The rule body contained an crate::ast::IsExpr — PR 2
rejects rules containing computed bindings via the
BodyIsExpr boundary, so this is a defensive arm; if it
fires the analyzer let an IsExpr rule through erroneously.
ConflictingVariableType
A variable appears in two body atoms whose relation schemas disagree on the column type at the variable’s position.
Detected by super::evaluate_rule_typed (and the typed
fixpoint variants) at the typed-gate phase, before
evaluation. Without this check, an evaluator would either
silently coerce values across types or fail later with a
less precise error pointing at a row, not at the rule.
The two (predicate, position, type) triples are recorded
in first-encountered order: walking body atoms in source
order, the first atom that types this variable wins
first_*; the second atom whose type differs gets
second_*. Subsequent agreeing atoms are silent.
Fields
first_type: ScalarTypeSchema type at (first_predicate, first_position).
second_type: ScalarTypeSchema type at (second_predicate, second_position).
InferenceConflict
Two rules contributing to the same head predicate disagree on the type of the same column under the PR 8 SCC type inference pass.
Distinct from Self::ConflictingVariableType, which is a
within-rule body conflict (one rule, two body atoms typing
the same variable differently). This variant is a
cross-rule head-column conflict, detected by
super::infer_scc_predicate_schemas when back-propagating
from rule heads to head-predicate column types.
Surfaced through the typed evaluators via
super::FixpointError::RuleEval /
super::SccFixpointError::RuleEval; their rule_index
field carries second_rule_index (the rule whose typing
caused the conflict to be detected; the first rule’s typing
was already accepted by then).
Trait Implementations§
Source§impl Clone for RefEvalError
impl Clone for RefEvalError
Source§fn clone(&self) -> RefEvalError
fn clone(&self) -> RefEvalError
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more