Skip to main content

ProgramValidationError

Enum ProgramValidationError 

Source
pub enum ProgramValidationError {
    UnsafeRule {
        rule_index: usize,
        variables: Vec<VariableSymbol>,
    },
    UnsafeNegation {
        rule_index: usize,
        variables: Vec<VariableSymbol>,
    },
    UnsafeFilter {
        rule_index: usize,
        variables: Vec<VariableSymbol>,
    },
    UnsafeBind {
        rule_index: usize,
        variables: Vec<VariableSymbol>,
    },
    UnsafeAggregate {
        rule_index: usize,
        variables: Vec<VariableSymbol>,
    },
    NestedAggregateInInnerBody {
        rule_index: usize,
    },
    UnstratifiableNegation {
        predicates: Vec<PredicateSymbol>,
    },
    NegationUnderEqualityMode {
        rule_index: usize,
    },
    AggregationUnderEqualityMode {
        rule_index: usize,
    },
    SkolemInBodyAtom {
        rule_index: usize,
    },
    TripleTermNestingExceeded {
        rule_index: usize,
        depth: usize,
        limit: usize,
    },
}
Expand description

Program validation failures.

Variants§

§

UnsafeRule

Rule is unsafe because one or more head variables are missing from the positive body literals.

Fields

§rule_index: usize

Rule index in Program::rules.

§variables: Vec<VariableSymbol>

Missing variables.

§

UnsafeNegation

Rule has a negated body literal whose variables are not bound by any positive body literal (range-restriction violation — negation-as-failure requires the negated atom to be ground at evaluation time).

Fields

§rule_index: usize

Rule index in Program::rules.

§variables: Vec<VariableSymbol>

Unbound variables in negated literals.

§

UnsafeFilter

Rule has a Literal::Filter referencing variables that no positive body literal binds. Filters guard candidate bindings; they cannot introduce new ones.

Fields

§rule_index: usize

Rule index in Program::rules.

§variables: Vec<VariableSymbol>

Unbound variables in filter expressions.

§

UnsafeBind

Rule has a Literal::Bind whose expr references a variable not bound by an earlier positive atom or Bind, or whose output var shadows a variable that is already bound by an earlier positive atom or Bind. Both cases produce undefined evaluation order under sequential rule-body semantics.

Fields

§rule_index: usize

Rule index in Program::rules.

§variables: Vec<VariableSymbol>

Offending variables — either an unbound expression reference or a colliding output name.

§

UnsafeAggregate

Rule has a Literal::Aggregate that violates aggregation safety:

  • input_var or a group_by key is not bound by the inner body.
  • result_var is not fresh (collides with an outer-rule binding).
  • An inner negative literal or filter references a variable that no inner positive atom or BIND produces.
  • An inner BIND references a variable not bound by an earlier inner positive atom or BIND, or its output variable collides with an existing inner-scope binding.

Nested aggregates inside an aggregate’s inner body surface separately as Self::NestedAggregateInInnerBody.

Fields

§rule_index: usize

Rule index in Program::rules.

§variables: Vec<VariableSymbol>

Offending variables.

§

NestedAggregateInInnerBody

Rule has a Literal::Aggregate whose inner_body itself contains a nested Literal::Aggregate. Nested aggregation is out of scope — the evaluator only folds a flat inner sub-query — and the inner aggregate’s stratification dependencies would require an extra rewriting pass. Authors that need aggregation over an aggregate’s output should lift the inner aggregate into its own intermediate rule whose head feeds the outer aggregate’s inner_body.

Fields

§rule_index: usize

Rule index in Program::rules.

§

UnstratifiableNegation

Program contains a recursive cycle through a negation edge. Such programs have no unique least fixed point under stratified negation-as-failure semantics.

Fields

§predicates: Vec<PredicateSymbol>

Predicate symbols whose stratification could not be resolved. Includes every predicate in the offending strongly connected component.

§

NegationUnderEqualityMode

Rule contains a Literal::Negative while equality mode is EqualityMode::SameAs.

Under equality-driven rewriting, terms get rewritten across equality classes, which interacts non-deterministically with negation-as-failure (the set the negated atom is evaluated against changes shape as equality classes merge). Programs that combine negation with equality mode are rejected for this reason. This crate enforces the same restriction so semantics stay stable under the equality rewrite.

Fields

§rule_index: usize

Rule index in Program::rules.

§

AggregationUnderEqualityMode

Rule contains a Literal::Aggregate while equality mode is EqualityMode::SameAs.

Aggregation depends on the complete extension of its inner predicates. Under equality mode that extension is non-monotonic as equality classes merge term identities, which would silently change aggregate results across reasoning rounds. This crate rejects the combination.

Fields

§rule_index: usize

Rule index in Program::rules.

§

SkolemInBodyAtom

Rule has a body atom (positive, negative, filter, bind, or aggregate inner atom) that carries a Term::Skolem term. SKOLEM is a deterministic IRI-minting function and is only well-defined in head positions — using it as a body pattern would be a no-op match (the freshly-minted IRI never unifies with anything in the EDB). See extension.

Fields

§rule_index: usize

Rule index in Program::rules.

§

TripleTermNestingExceeded

Rule contains a Term::TripleTerm nested deeper than MAX_TRIPLE_TERM_NESTING in either the head or a body atom. Unification cost grows with nesting; the bound exists to keep evaluation finite.

Fields

§rule_index: usize

Rule index in Program::rules.

§depth: usize

Observed nesting depth (always > MAX_TRIPLE_TERM_NESTING).

§limit: usize

Configured limit at the time of validation.

Trait Implementations§

Source§

impl Clone for ProgramValidationError

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ProgramValidationError

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for ProgramValidationError

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for ProgramValidationError

Source§

impl Error for ProgramValidationError

1.30.0 · Source§

fn source(&self) -> Option<&(dyn Error + 'static)>

Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§

fn description(&self) -> &str

👎Deprecated since 1.42.0:

use the Display impl or to_string()

1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
Source§

impl From<StratificationError> for ProgramValidationError

Source§

fn from(err: StratificationError) -> Self

Converts to this type from the input type.
Source§

impl PartialEq for ProgramValidationError

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for ProgramValidationError

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.