pub enum KernelError {
UnboundVariable(String),
NotAFunction(String),
NotAType(String),
TypeMismatch {
expected: String,
found: String,
},
NotAnInductive(String),
InvalidMotive(String),
WrongNumberOfCases {
expected: usize,
found: usize,
},
CertificationError(String),
TerminationViolation {
fix_name: String,
reason: String,
},
PositivityViolation {
inductive: String,
constructor: String,
reason: String,
},
CannotInferHole,
}Expand description
Errors that can occur during type checking.
Variants§
UnboundVariable(String)
Reference to an undefined variable.
NotAFunction(String)
Attempted to apply a non-function term.
NotAType(String)
Expected a type (something with type Sort), got something else.
TypeMismatch
Type mismatch: expected one type, found another.
NotAnInductive(String)
Attempted to match on a non-inductive type.
InvalidMotive(String)
Invalid motive in match expression.
WrongNumberOfCases
Wrong number of cases in match expression.
CertificationError(String)
Error during proof certification.
TerminationViolation
Recursive call does not decrease structurally.
This error prevents infinite loops in proofs. A fixpoint must recurse on a structurally smaller argument.
PositivityViolation
Inductive type appears in negative position in constructor.
This error prevents logical paradoxes (Russell’s paradox, etc). An inductive must appear strictly positively in its constructors.
CannotInferHole
Cannot infer the type of a hole without context.
Holes (implicit arguments) need to be checked against an expected type, not inferred standalone.