diagnostic
Diagnostic classes for Clingspector.
Diagnostic
dataclass
module-attribute
¶
Diagnostic = register_diagnostics(Diagnostic)
Base class for diagnostics.
This also uses the attribute _registry to call the
from_symbol method of the correct diagnostic class.
The attribute _registry is populated by the register_diagnostics
decorator at the end of this file.
CyclicDependencyDiagnostic
dataclass
¶
Bases: Diagnostic
Diagnostic for cyclic dependencies in variables.
TypeMismatchDiagnostic
dataclass
¶
Bases: Diagnostic
Diagnostic for type mismatches in variables.
from_symbol
staticmethod
¶
from_symbol(symbol: Symbol)
Create a TypeMismatchDiagnostic from a Clingo symbol.
UndefinedAssignmentDiagnostic
dataclass
¶
Bases: Diagnostic
Diagnostic for assigning to undefined variables.
UndefinedDependencyDiagnostic
dataclass
¶
Bases: Diagnostic
Diagnostic for variables depending on undefined variables.
UnsupportedArgumentTypeDiagnostic
dataclass
¶
Bases: Diagnostic
Diagnostic for unsupported argument types in operators.
UnsupportedOperatorDiagnostic
dataclass
¶
Bases: Diagnostic
Diagnostic for unsupported operators.
UnsupportedTypeDiagnostic
dataclass
¶
Bases: Diagnostic
Diagnostic for unsupported types.
register_diagnostics
¶
register_diagnostics(cls)
Decorator to attach _registry to Diagnostic after subclasses are defined.
The registry is a mapping from DiagnosticType to the corresponding Diagnostic subclass and is used to create instances of diagnostics based on Clingo symbols.