pub enum ProgramValidationError {
Show 17 variants
UnsafeRule {
rule: RuleIndex,
atom: HeadAtomPath,
variables: Vec<VariableSymbol>,
},
UnusedExistentialVariable {
rule: RuleIndex,
variable: VariableSymbol,
},
ExistentialVariableBoundInBody {
rule: RuleIndex,
variable: 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,
},
RuleCountExceeded {
count: usize,
limit: usize,
},
BodyLengthExceeded {
rule: RuleIndex,
length: usize,
limit: usize,
},
SkolemDepthExceeded {
position: ArgumentPosition,
depth: usize,
limit: usize,
},
}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, and are not existentially quantified.
Fields
atom: HeadAtomPathThe first head atom with missing variables.
variables: Vec<VariableSymbol>Its missing variables.
UnusedExistentialVariable
An existentially quantified head variable occurs in no head atom.
Fields
variable: VariableSymbolThe first unused existential variable.
ExistentialVariableBoundInBody
An existentially quantified head variable is also bound by the body, so it would denote a body value rather than a witness.
Fields
variable: VariableSymbolThe first such existential variable.
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
ValidationLimits::triple_term_nesting.
Fields
InvalidSkolemArguments
A Skolem argument is neither a variable nor a constant.
Fields
RuleCountExceeded
The program has more rules than
ValidationLimits::rules.
BodyLengthExceeded
A rule body has more literals than
ValidationLimits::body_literals.
Fields
SkolemDepthExceeded
Invented values nest deeper than
ValidationLimits::skolem_depth,
as measured by WeakAcyclicity::skolem_depth.
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_UNUSED_EXISTENTIAL_VARIABLE: ErrorCode
pub const CODE_UNUSED_EXISTENTIAL_VARIABLE: ErrorCode
Code of Self::UnusedExistentialVariable.
Sourcepub const CODE_EXISTENTIAL_VARIABLE_BOUND_IN_BODY: ErrorCode
pub const CODE_EXISTENTIAL_VARIABLE_BOUND_IN_BODY: ErrorCode
Code of Self::ExistentialVariableBoundInBody.
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.
Sourcepub const CODE_RULE_COUNT_EXCEEDED: ErrorCode
pub const CODE_RULE_COUNT_EXCEEDED: ErrorCode
Code of Self::RuleCountExceeded.
Sourcepub const CODE_BODY_LENGTH_EXCEEDED: ErrorCode
pub const CODE_BODY_LENGTH_EXCEEDED: ErrorCode
Code of Self::BodyLengthExceeded.
Sourcepub const CODE_SKOLEM_DEPTH_EXCEEDED: ErrorCode
pub const CODE_SKOLEM_DEPTH_EXCEEDED: ErrorCode
Code of Self::SkolemDepthExceeded.
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()