pub enum ProgramValidationError {
UnsafeRule {
rule: RuleIndex,
variables: Vec<VariableSymbol>,
},
UnsafeNegation {
rule: RuleIndex,
literal: LiteralPath,
variables: Vec<VariableSymbol>,
},
UnsafeFilter {
rule: RuleIndex,
literal: LiteralPath,
variables: Vec<VariableSymbol>,
},
UnsafeBind {
rule: RuleIndex,
literal: LiteralPath,
variables: Vec<VariableSymbol>,
},
UnsafeAggregate {
rule: RuleIndex,
literal: LiteralPath,
variables: Vec<VariableSymbol>,
},
NestedAggregateInInnerBody {
rule: RuleIndex,
literal: LiteralPath,
},
UnstratifiableCycle(UnstratifiableCycle),
NegationUnderEqualityMode {
rule: RuleIndex,
literal: LiteralPath,
},
AggregationUnderEqualityMode {
rule: RuleIndex,
literal: LiteralPath,
},
SkolemInBodyAtom {
rule: RuleIndex,
literal: LiteralPath,
term: TermPath,
},
TripleTermNestingExceeded {
rule: RuleIndex,
site: RuleSite,
term: TermPath,
depth: usize,
limit: usize,
},
InvalidSkolemArguments {
rule: RuleIndex,
site: RuleSite,
term: TermPath,
},
}Expand description
Program validation failures. Every failure tied to a location names the rule and, where narrower, the literal and term inside it.
Variants§
UnsafeRule
Head variables are missing from the positive body, BIND outputs, and
aggregate exports.
UnsafeNegation
A negated body literal references variables no positive body literal binds (negation-as-failure requires a ground negated atom).
Fields
literal: LiteralPathThe first offending negated literal.
variables: Vec<VariableSymbol>Its unbound variables.
UnsafeFilter
A Literal::Filter references unbound
variables. Filters guard bindings; they cannot introduce them.
Fields
literal: LiteralPathThe first offending filter.
variables: Vec<VariableSymbol>Its unbound variables.
UnsafeBind
A Literal::Bind references a variable not
bound earlier, or its output shadows an already-bound variable.
Fields
literal: LiteralPathThe first offending BIND.
variables: Vec<VariableSymbol>Unbound expression references or the colliding output name.
UnsafeAggregate
A Literal::Aggregate violates
aggregation safety: unbound input_var or group key, non-fresh
result_var, or an unsafe inner negation, filter, or BIND.
Fields
literal: LiteralPathThe first offending aggregate.
variables: Vec<VariableSymbol>Offending variables.
NestedAggregateInInnerBody
An aggregate’s inner body contains another aggregate. Lift the inner aggregate into its own rule.
Fields
literal: LiteralPathPath to the nested aggregate.
UnstratifiableCycle(UnstratifiableCycle)
The program contains a recursive cycle through negation or aggregation.
NegationUnderEqualityMode
A negative literal under
EqualityMode::SameAs; equality
rewriting and negation-as-failure are mutually exclusive.
AggregationUnderEqualityMode
An aggregate literal under
EqualityMode::SameAs; aggregation
needs a complete extension that equality rewriting keeps changing.
SkolemInBodyAtom
A body literal carries a Term::Skolem.
SKOLEM mints IRIs and is only well-defined in the head.
Fields
literal: LiteralPathThe body literal.
TripleTermNestingExceeded
A Term::TripleTerm nests deeper than
MAX_TRIPLE_TERM_NESTING.
Fields
InvalidSkolemArguments
A Skolem argument is neither a variable nor a constant.
Implementations§
Source§impl ProgramValidationError
impl ProgramValidationError
Sourcepub const CODE_UNSAFE_RULE: ErrorCode
pub const CODE_UNSAFE_RULE: ErrorCode
Code of Self::UnsafeRule.
Sourcepub const CODE_UNSAFE_NEGATION: ErrorCode
pub const CODE_UNSAFE_NEGATION: ErrorCode
Code of Self::UnsafeNegation.
Sourcepub const CODE_UNSAFE_FILTER: ErrorCode
pub const CODE_UNSAFE_FILTER: ErrorCode
Code of Self::UnsafeFilter.
Sourcepub const CODE_UNSAFE_BIND: ErrorCode
pub const CODE_UNSAFE_BIND: ErrorCode
Code of Self::UnsafeBind.
Sourcepub const CODE_UNSAFE_AGGREGATE: ErrorCode
pub const CODE_UNSAFE_AGGREGATE: ErrorCode
Code of Self::UnsafeAggregate.
Sourcepub const CODE_NESTED_AGGREGATE: ErrorCode
pub const CODE_NESTED_AGGREGATE: ErrorCode
Code of Self::NestedAggregateInInnerBody.
Sourcepub const CODE_UNSTRATIFIABLE_CYCLE: ErrorCode
pub const CODE_UNSTRATIFIABLE_CYCLE: ErrorCode
Code of Self::UnstratifiableCycle.
Sourcepub const CODE_NEGATION_UNDER_EQUALITY_MODE: ErrorCode
pub const CODE_NEGATION_UNDER_EQUALITY_MODE: ErrorCode
Code of Self::NegationUnderEqualityMode.
Sourcepub const CODE_AGGREGATION_UNDER_EQUALITY_MODE: ErrorCode
pub const CODE_AGGREGATION_UNDER_EQUALITY_MODE: ErrorCode
Code of Self::AggregationUnderEqualityMode.
Sourcepub const CODE_SKOLEM_IN_BODY: ErrorCode
pub const CODE_SKOLEM_IN_BODY: ErrorCode
Code of Self::SkolemInBodyAtom.
Sourcepub const CODE_TRIPLE_TERM_NESTING_EXCEEDED: ErrorCode
pub const CODE_TRIPLE_TERM_NESTING_EXCEEDED: ErrorCode
Code of Self::TripleTermNestingExceeded.
Sourcepub const CODE_INVALID_SKOLEM_ARGUMENTS: ErrorCode
pub const CODE_INVALID_SKOLEM_ARGUMENTS: ErrorCode
Code of Self::InvalidSkolemArguments.
Trait Implementations§
Source§impl Clone for ProgramValidationError
impl Clone for ProgramValidationError
Source§impl Debug for ProgramValidationError
impl Debug for ProgramValidationError
Source§impl<'de> Deserialize<'de> for ProgramValidationError
impl<'de> Deserialize<'de> for ProgramValidationError
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl Display for ProgramValidationError
impl Display for ProgramValidationError
impl Eq for ProgramValidationError
Source§impl Error for ProgramValidationError
impl Error for ProgramValidationError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()