Theory Engine Records¶
Every answer of the theory engine is a typed record: the provenance of a composition, its check report, the conflict a refused composition names, the obligations of a view with their equality witnesses, rewrite-system reports, finite models and their verification, and the classification of a change of theory.
records
¶
Typed records of what panproto's theory engine computes.
Every value the engine returns about a theory, a morphism, a
composition, a rewrite system, or a model is mirrored here as a
didactic model, so it can be compared, hashed, serialized, and shown
without holding a handle to the native object. The records are filled
by quivers.gat.engine; nothing in this module
calls panproto.
The records fall into six groups:
- symbols and provenance:
SymbolRef,ProvenanceEntry,AddedEquation,Provenance; - composition reports and conflicts:
CheckSubject,CheckOutcome,CheckRecord,Freshening,CompositionReport,CompositionConflictand its variants; - morphisms and their obligations:
MorphismRecord,Witness,Obligationand its variants,ViewCheck; - rewriting:
CriticalPair,RuleViolation,RewriteSystemReport,NormalForm; - models:
Valueand its variants,Carrier,TableEntry,OperationTable,FiniteModel,EquationViolation,ModelVerification,SigmaExtension; - theory change:
TheoryChange,TheoryChangeReport.
SYMBOL_KINDS
module-attribute
¶
SYMBOL_KINDS: tuple[SymbolKind, ...] = ('sort', 'op', 'eq', 'directed_eq', 'policy')
Every symbol kind, in panproto's declaration order.
CHANGE_KINDS
module-attribute
¶
CHANGE_KINDS: tuple[ChangeKind, ...] = ('added_sort', 'removed_sort', 'changed_sort', 'added_op', 'removed_op', 'changed_op', 'added_equation', 'removed_equation', 'changed_equation', 'added_directed_equation', 'removed_directed_equation', 'changed_directed_equation')
Every change kind.
SymbolKind
¶
The kind of a symbol of a theory, as panproto names it.
CompositionMode
¶
Which symbols a composition identifies: exactly the related ones, or also same-name ones.
ClashPolicy
¶
What a composition does when two distinct classes would share a name.
CheckStatus
¶
The verdict of a check: established, refuted, or neither.
ChangeClassification
¶
How a change of theory affects its dependents.
WitnessKind
¶
WitnessKind = Literal['reflexivity', 'axiom', 'symmetry', 'transitivity', 'congruence', 'runtime_checked']
How an equality witness justifies its equation.
ChangeKind
¶
ChangeKind = Literal['added_sort', 'removed_sort', 'changed_sort', 'added_op', 'removed_op', 'changed_op', 'added_equation', 'removed_equation', 'changed_equation', 'added_directed_equation', 'removed_directed_equation', 'changed_directed_equation']
The kind of one change between two theories.
SymbolRef
didactic-model
¶
Bases: Model
A symbol of one node of a diagram.
| PARAMETER | DESCRIPTION |
|---|---|
node
|
The label of the node that declares (or uses) the symbol.
TYPE:
|
name
|
The symbol's name in that node's theory.
TYPE:
|
ProvenanceEntry
didactic-model
¶
ProvenanceEntry(*, symbol_kind: SymbolKind, source: SymbolRef, image: str)
Bases: Model
Where one source symbol of a composition went.
| PARAMETER | DESCRIPTION |
|---|---|
symbol_kind
|
The kind of the symbol.
TYPE:
|
source
|
The symbol in its node.
TYPE:
|
image
|
The name of its image in the composed theory.
TYPE:
|
AddedEquation
didactic-model
¶
AddedEquation(*, name: str, edge: int, op: SymbolRef)
Bases: Model
An equation a composition added for an operation sent to a derived term.
| PARAMETER | DESCRIPTION |
|---|---|
name
|
The equation's name in the composed theory.
TYPE:
|
edge
|
The edge's position in panproto's canonical edge order.
TYPE:
|
op
|
The operation the edge sends to a term.
TYPE:
|
Provenance
didactic-model
¶
Provenance(*, entries: tuple[ProvenanceEntry, ...] = (), added_equations: tuple[AddedEquation, ...] = ())
Bases: Model
Where every source symbol of a composition went.
The entries are total: every sort, operation, equation, directed equation, and policy of every node has exactly one entry.
| PARAMETER | DESCRIPTION |
|---|---|
entries
|
One entry per source symbol, ascending by kind, node, name.
TYPE:
|
added_equations
|
The equations the composition added, ascending by name.
TYPE:
|
image
¶
image(symbol_kind: SymbolKind, node: str, name: str) -> str | None
The image of one source symbol.
| PARAMETER | DESCRIPTION |
|---|---|
symbol_kind
|
The kind of the symbol.
TYPE:
|
node
|
The label of its node.
TYPE:
|
name
|
Its name in that node.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
str or None
|
The name of its image, or |
Source code in src/quivers/gat/records.py
members
¶
members(symbol_kind: SymbolKind, image: str) -> tuple[SymbolRef, ...]
Every source symbol of one kind whose image is image.
| PARAMETER | DESCRIPTION |
|---|---|
symbol_kind
|
The kind.
TYPE:
|
image
|
The name in the composed theory.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
tuple of SymbolRef
|
The sources, ascending. |
Source code in src/quivers/gat/records.py
of_node
¶
of_node(node: str) -> tuple[ProvenanceEntry, ...]
Every entry whose source lies in one node.
| PARAMETER | DESCRIPTION |
|---|---|
node
|
The node label.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
tuple of ProvenanceEntry
|
The node's entries, in entry order. |
Source code in src/quivers/gat/records.py
DiagramSubject
didactic-model
¶
Bases: CheckSubject
The diagram as a whole.
| PARAMETER | DESCRIPTION |
|---|---|
kind
|
The discriminator; always
TYPE:
|
NodeSubject
didactic-model
¶
Bases: CheckSubject
One node of the diagram.
| PARAMETER | DESCRIPTION |
|---|---|
label
|
The node's label.
TYPE:
|
kind
|
The discriminator; always
TYPE:
|
EdgeSubject
didactic-model
¶
Bases: CheckSubject
One edge of the diagram.
| PARAMETER | DESCRIPTION |
|---|---|
index
|
The edge's position in the diagram's edge list.
TYPE:
|
kind
|
The discriminator; always
TYPE:
|
CoconeSubject
didactic-model
¶
Bases: CheckSubject
One leg of an alternative cocone.
| PARAMETER | DESCRIPTION |
|---|---|
index
|
The leg's position.
TYPE:
|
kind
|
The discriminator; always
TYPE:
|
CheckOutcome
didactic-model
¶
Bases: TaggedUnion
The outcome of one composition check.
Passed
didactic-model
¶
Bases: CheckOutcome
The check passed.
| PARAMETER | DESCRIPTION |
|---|---|
kind
|
The discriminator; always
TYPE:
|
PassedByEquation
didactic-model
¶
Bases: CheckOutcome
The check passed because an equation the composition added makes it hold.
| PARAMETER | DESCRIPTION |
|---|---|
equation
|
That equation's name.
TYPE:
|
kind
|
The discriminator; always
TYPE:
|
Failed
didactic-model
¶
Bases: CheckOutcome
The check failed.
| PARAMETER | DESCRIPTION |
|---|---|
detail
|
Why.
TYPE:
|
kind
|
The discriminator; always
TYPE:
|
Inapplicable
didactic-model
¶
Inapplicable(*, reason: Literal['open_theory', 'no_equations'], missing_sorts: tuple[str, ...] = (), kind: Literal['inapplicable'] = 'inapplicable')
Bases: CheckOutcome
The check did not apply.
| PARAMETER | DESCRIPTION |
|---|---|
reason
|
TYPE:
|
missing_sorts
|
The undeclared sort names, for
TYPE:
|
kind
|
The discriminator; always
TYPE:
|
Incomplete
didactic-model
¶
Incomplete(*, reason: Literal['rewrite_budget_exhausted', 'no_terminating_rewrite_system'], equation: str | None = None, steps: int | None = None, kind: Literal['incomplete'] = 'incomplete')
Bases: CheckOutcome
The check did not complete.
| PARAMETER | DESCRIPTION |
|---|---|
reason
|
TYPE:
|
equation
|
The equation being decided when the budget ran out.
TYPE:
|
steps
|
The budget spent.
TYPE:
|
kind
|
The discriminator; always
TYPE:
|
CheckRecord
didactic-model
¶
CheckRecord(*, check: str, subject: CheckSubject, outcome: CheckOutcome)
Bases: Model
One check a composition ran, and its outcome.
| PARAMETER | DESCRIPTION |
|---|---|
check
|
The check, as panproto names it (
TYPE:
|
subject
|
What it was about.
TYPE:
|
outcome
|
Its outcome.
TYPE:
|
Freshening
didactic-model
¶
Freshening(*, symbol_kind: SymbolKind, members: tuple[SymbolRef, ...], candidate: str, result: str)
Bases: Model
One renaming the freshen clash policy made.
| PARAMETER | DESCRIPTION |
|---|---|
symbol_kind
|
The kind of the renamed class.
TYPE:
|
members
|
The class's members, ascending.
TYPE:
|
candidate
|
The name the naming rule chose before the clash.
TYPE:
|
result
|
The name the class got.
TYPE:
|
CompositionReport
didactic-model
¶
CompositionReport(*, mode: CompositionMode, status: CheckStatus, name_clash_free: bool, checks: tuple[CheckRecord, ...] = (), freshened: tuple[Freshening, ...] = ())
Bases: Model
Every check a composition ran, and the verdict they add up to.
| PARAMETER | DESCRIPTION |
|---|---|
mode
|
The mode the composition ran in.
TYPE:
|
status
|
The conjunction of every record's verdict.
TYPE:
|
name_clash_free
|
Whether no two nodes share a same-kind name that the diagram's morphisms do not relate.
TYPE:
|
checks
|
The records, sorted by check then subject.
TYPE:
|
freshened
|
Every renaming the
TYPE:
|
records
¶
records(check: str) -> tuple[CheckRecord, ...]
The records of one check.
| PARAMETER | DESCRIPTION |
|---|---|
check
|
The check's name.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
tuple of CheckRecord
|
Its records, in subject order. |
Source code in src/quivers/gat/records.py
SignatureDefect
didactic-model
¶
Bases: Model
A defect of a theory's signature, as panproto's typechecker reports it.
| PARAMETER | DESCRIPTION |
|---|---|
defect
|
The defect's kind (
TYPE:
|
site
|
Where it sits, rendered (
TYPE:
|
sort
|
The sort the defect is about, when it names one.
TYPE:
|
payload
|
The defect's remaining fields, as canonical JSON.
TYPE:
|
CompositionConflict
didactic-model
¶
Bases: TaggedUnion
Why a composition was refused.
One variant per refusal of panproto's compose. Conflicts between
symbols carry both sources, so a caller can show where each came from.
DuplicateNodeLabel
didactic-model
¶
Bases: CompositionConflict
Two nodes share a label.
| PARAMETER | DESCRIPTION |
|---|---|
label
|
The label.
TYPE:
|
kind
|
The discriminator.
TYPE:
|
InvalidNodeLabel
didactic-model
¶
Bases: CompositionConflict
A label is empty or contains . or #.
| PARAMETER | DESCRIPTION |
|---|---|
label
|
The label.
TYPE:
|
kind
|
The discriminator.
TYPE:
|
UnknownNodeLabel
didactic-model
¶
Bases: CompositionConflict
An edge names a node the diagram does not have.
| PARAMETER | DESCRIPTION |
|---|---|
label
|
The label.
TYPE:
|
kind
|
The discriminator.
TYPE:
|
InvalidNode
didactic-model
¶
InvalidNode(*, label: str, defects: tuple[SignatureDefect, ...], kind: Literal['invalid_node'] = 'invalid_node')
Bases: CompositionConflict
A node's signature is ill formed beyond using undeclared sorts.
| PARAMETER | DESCRIPTION |
|---|---|
label
|
The node.
TYPE:
|
defects
|
Its defects.
TYPE:
|
kind
|
The discriminator.
TYPE:
|
InvalidLeg
didactic-model
¶
Bases: CompositionConflict
An edge's morphism is not a morphism between its endpoints.
| PARAMETER | DESCRIPTION |
|---|---|
edge
|
The edge's position.
TYPE:
|
detail
|
The morphism check's error.
TYPE:
|
kind
|
The discriminator.
TYPE:
|
SortSignatureMismatch
didactic-model
¶
SortSignatureMismatch(*, first: SymbolRef, second: SymbolRef, mismatch: str, detail: str = '{}', kind: Literal['sort_signature_mismatch'] = 'sort_signature_mismatch')
Bases: CompositionConflict
Two sorts the diagram identifies disagree on their signatures.
| PARAMETER | DESCRIPTION |
|---|---|
first
|
One member.
TYPE:
|
second
|
Another member.
TYPE:
|
mismatch
|
How they disagree:
TYPE:
|
detail
|
The mismatch's fields, as canonical JSON.
TYPE:
|
kind
|
The discriminator.
TYPE:
|
OpSignatureMismatch
didactic-model
¶
OpSignatureMismatch(*, first: SymbolRef, second: SymbolRef, kind: Literal['op_signature_mismatch'] = 'op_signature_mismatch')
Bases: CompositionConflict
Two operations the diagram identifies disagree on their signatures.
| PARAMETER | DESCRIPTION |
|---|---|
first
|
One member.
TYPE:
|
second
|
Another member.
TYPE:
|
kind
|
The discriminator.
TYPE:
|
QuotientNotRepresentable
didactic-model
¶
QuotientNotRepresentable(*, first: SymbolRef, second: SymbolRef, reason: str, kind: Literal['quotient_not_representable'] = 'quotient_not_representable')
Bases: CompositionConflict
An identification needs a sort equation, which a theory cannot state.
| PARAMETER | DESCRIPTION |
|---|---|
first
|
One member.
TYPE:
|
second
|
Another member.
TYPE:
|
reason
|
What would be needed.
TYPE:
|
kind
|
The discriminator.
TYPE:
|
NameConflict
didactic-model
¶
NameConflict(*, symbol_kind: SymbolKind, name: str, first: SymbolRef, second: SymbolRef, kind: Literal['name_conflict'] = 'name_conflict')
Bases: CompositionConflict
Under amalgamation, two same-name symbols are incompatible.
| PARAMETER | DESCRIPTION |
|---|---|
symbol_kind
|
Their kind.
TYPE:
|
name
|
Their name.
TYPE:
|
first
|
One of them.
TYPE:
|
second
|
The other.
TYPE:
|
kind
|
The discriminator.
TYPE:
|
NameClash
didactic-model
¶
NameClash(*, symbol_kind: SymbolKind, name: str, classes: tuple[tuple[SymbolRef, ...], ...], kind: Literal['name_clash'] = 'name_clash')
Bases: CompositionConflict
Distinct classes would get the same name.
| PARAMETER | DESCRIPTION |
|---|---|
symbol_kind
|
Their kind.
TYPE:
|
name
|
The name.
TYPE:
|
classes
|
The clashing classes, each ascending.
TYPE:
|
kind
|
The discriminator.
TYPE:
|
IllTypedTransport
didactic-model
¶
IllTypedTransport(*, source: SymbolRef, detail: str, kind: Literal['ill_typed_transport'] = 'ill_typed_transport')
Bases: CompositionConflict
A translated equation does not typecheck in the composed theory.
| PARAMETER | DESCRIPTION |
|---|---|
source
|
The source equation, or the operation an added equation identifies.
TYPE:
|
detail
|
The typechecker's error.
TYPE:
|
kind
|
The discriminator.
TYPE:
|
IllTypedResult
didactic-model
¶
IllTypedResult(*, defects: tuple[SignatureDefect, ...] = (), kind: Literal['ill_typed_result'] = 'ill_typed_result')
Bases: CompositionConflict
The composed theory is ill typed.
| PARAMETER | DESCRIPTION |
|---|---|
defects
|
Its signature defects; empty when a check beyond the signature failed.
TYPE:
|
kind
|
The discriminator.
TYPE:
|
NotACocone
didactic-model
¶
NotACocone(*, members: tuple[SymbolRef, ...] = (), kind: Literal['not_a_cocone'] = 'not_a_cocone')
Bases: CompositionConflict
An alternative cocone sends the members of one class to different images.
| PARAMETER | DESCRIPTION |
|---|---|
members
|
The class, ascending; empty when the legs do not match the diagram.
TYPE:
|
kind
|
The discriminator.
TYPE:
|
MorphismRecord
didactic-model
¶
MorphismRecord(*, name: str, domain: str, codomain: str, sort_map: dict[str, str] = {}, op_renames: dict[str, str] = {}, derived_terms: dict[str, str] = {})
Bases: Model
A theory morphism: sorts to sorts, operations to operations or terms.
| PARAMETER | DESCRIPTION |
|---|---|
name
|
The morphism's name.
TYPE:
|
domain
|
The domain theory's name.
TYPE:
|
codomain
|
The codomain theory's name.
TYPE:
|
sort_map
|
Domain sort to codomain sort.
TYPE:
|
op_renames
|
Domain operation to the codomain operation it is renamed to.
TYPE:
|
derived_terms
|
Domain operation to the codomain term it is sent to, in the theory-DSL term syntax; its free variables are the domain operation's parameter names.
TYPE:
|
NodeInclusion
didactic-model
¶
NodeInclusion(*, label: str, morphism: MorphismRecord)
Bases: Model
The inclusion of one diagram node into a composition.
| PARAMETER | DESCRIPTION |
|---|---|
label
|
The node's label.
TYPE:
|
morphism
|
Its inclusion into the composed theory.
TYPE:
|
DiagramEdge
didactic-model
¶
DiagramEdge(*, source: str, target: str, morphism: MorphismRecord)
Bases: Model
One edge of a theory diagram.
| PARAMETER | DESCRIPTION |
|---|---|
source
|
The label of the morphism's domain node.
TYPE:
|
target
|
The label of the morphism's codomain node.
TYPE:
|
morphism
|
The morphism.
TYPE:
|
Witness
didactic-model
¶
Witness(*, lhs: str, rhs: str, witness_kind: WitnessKind, axiom: str | None = None, op: str | None = None, description: str | None = None, premises: tuple[Witness, ...] = ())
Bases: Model
A witness that two terms are equal in a theory.
| PARAMETER | DESCRIPTION |
|---|---|
lhs
|
The left-hand side.
TYPE:
|
rhs
|
The right-hand side.
TYPE:
|
witness_kind
|
How the equality is justified.
TYPE:
|
axiom
|
The axiom used, for
TYPE:
|
op
|
The operation applied, for
TYPE:
|
description
|
What was checked, for
TYPE:
|
premises
|
The witnesses this one is built from.
TYPE:
|
is_certified
property
¶
Whether no step of the witness is a trusted runtime check.
| RETURNS | DESCRIPTION |
|---|---|
bool
|
|
Obligation
didactic-model
¶
Bases: TaggedUnion
The status of one domain equation under a view.
Every equation of a view's domain is a proof obligation in its codomain: the image of the equation must hold there.
Discharged
didactic-model
¶
Discharged(*, equation: str, lhs: str, rhs: str, image_lhs: str, image_rhs: str, witness: Witness, kind: Literal['discharged'] = 'discharged')
Bases: Obligation
The image holds, by a derivation from the codomain's axioms.
| PARAMETER | DESCRIPTION |
|---|---|
equation
|
The domain equation's name.
TYPE:
|
lhs
|
Its left-hand side.
TYPE:
|
rhs
|
Its right-hand side.
TYPE:
|
image_lhs
|
The image of the left-hand side.
TYPE:
|
image_rhs
|
The image of the right-hand side.
TYPE:
|
witness
|
The derivation.
TYPE:
|
kind
|
The discriminator.
TYPE:
|
Derivable
didactic-model
¶
Derivable(*, equation: str, lhs: str, rhs: str, image_lhs: str, image_rhs: str, witness: Witness, kind: Literal['derivable'] = 'derivable')
Bases: Obligation
The image holds by congruence closure, which panproto trusts but does not certify.
| PARAMETER | DESCRIPTION |
|---|---|
equation
|
The domain equation's name.
TYPE:
|
lhs
|
Its left-hand side.
TYPE:
|
rhs
|
Its right-hand side.
TYPE:
|
image_lhs
|
The image of the left-hand side.
TYPE:
|
image_rhs
|
The image of the right-hand side.
TYPE:
|
witness
|
The witness, which has a runtime-checked step.
TYPE:
|
kind
|
The discriminator.
TYPE:
|
Assumed
didactic-model
¶
Assumed(*, equation: str, lhs: str, rhs: str, image_lhs: str, image_rhs: str, reason: str, kind: Literal['assumed'] = 'assumed')
Bases: Obligation
The checker could not decide the image, so it holds only by assumption.
| PARAMETER | DESCRIPTION |
|---|---|
equation
|
The domain equation's name.
TYPE:
|
lhs
|
Its left-hand side.
TYPE:
|
rhs
|
Its right-hand side.
TYPE:
|
image_lhs
|
The image of the left-hand side.
TYPE:
|
image_rhs
|
The image of the right-hand side.
TYPE:
|
reason
|
Why the check was inconclusive.
TYPE:
|
kind
|
The discriminator.
TYPE:
|
Refused
didactic-model
¶
Refused(*, equation: str, lhs: str, rhs: str, image_lhs: str, image_rhs: str, reason: str, kind: Literal['refused'] = 'refused')
Bases: Obligation
The image does not hold: the view breaks the equation.
| PARAMETER | DESCRIPTION |
|---|---|
equation
|
The domain equation's name.
TYPE:
|
lhs
|
Its left-hand side.
TYPE:
|
rhs
|
Its right-hand side.
TYPE:
|
image_lhs
|
The image of the left-hand side.
TYPE:
|
image_rhs
|
The image of the right-hand side.
TYPE:
|
reason
|
The checker's refusal.
TYPE:
|
kind
|
The discriminator.
TYPE:
|
ViewCheck
didactic-model
¶
ViewCheck(*, morphism: MorphismRecord, obligations: tuple[Obligation, ...] = ())
Bases: Model
A view whose signature is a theory morphism, with one obligation per equation.
| PARAMETER | DESCRIPTION |
|---|---|
morphism
|
The view.
TYPE:
|
obligations
|
One per domain equation, in declaration order.
TYPE:
|
status
property
¶
status: CheckStatus
The verdict the obligations add up to.
| RETURNS | DESCRIPTION |
|---|---|
CheckStatus
|
|
refused
¶
refused() -> tuple[Refused, ...]
The obligations the view breaks.
| RETURNS | DESCRIPTION |
|---|---|
tuple of Refused
|
In declaration order. |
ComposedTheory
didactic-model
¶
ComposedTheory(*, name: str, theory_json: str, inclusions: tuple[NodeInclusion, ...], provenance: Provenance, report: CompositionReport, sort_names: tuple[str, ...] = (), op_names: tuple[str, ...] = (), equation_names: tuple[str, ...] = ())
Bases: Model
A colimit of a theory diagram, with its cocone, provenance, and report.
| PARAMETER | DESCRIPTION |
|---|---|
name
|
The composed theory's name.
TYPE:
|
theory_json
|
The composed theory in panproto's serialized theory shape.
TYPE:
|
inclusions
|
One inclusion per diagram node, in node order.
TYPE:
|
provenance
|
Where every source symbol went.
TYPE:
|
report
|
Every check the composition ran.
TYPE:
|
sort_names
|
The composed theory's sorts, ascending.
TYPE:
|
op_names
|
Its operations, ascending.
TYPE:
|
equation_names
|
Its equations, ascending.
TYPE:
|
inclusion
¶
inclusion(label: str) -> MorphismRecord
The inclusion of one node.
| PARAMETER | DESCRIPTION |
|---|---|
label
|
The node's label.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
MorphismRecord
|
The node's inclusion into the composed theory. |
| RAISES | DESCRIPTION |
|---|---|
KeyError
|
If the composition has no node with that label. |
Source code in src/quivers/gat/records.py
CriticalPair
didactic-model
¶
Bases: Model
A critical pair between two directed equations.
| PARAMETER | DESCRIPTION |
|---|---|
rule_a
|
The outer rule.
TYPE:
|
rule_b
|
The inner rule.
TYPE:
|
left
|
The left reduct.
TYPE:
|
right
|
The right reduct.
TYPE:
|
joins
|
Whether the reducts normalize to the same term within the budget.
TYPE:
|
RuleViolation
didactic-model
¶
Bases: Model
A directed equation the lexicographic path ordering does not decrease.
| PARAMETER | DESCRIPTION |
|---|---|
rule
|
The rule.
TYPE:
|
reason
|
Why the comparison failed.
TYPE:
|
RewriteSystemReport
didactic-model
¶
RewriteSystemReport(*, critical_pairs: tuple[CriticalPair, ...] = (), termination_violations: tuple[RuleViolation, ...] = (), warnings: tuple[str, ...] = ())
Bases: Model
Local confluence and LPO termination of a theory's directed equations.
| PARAMETER | DESCRIPTION |
|---|---|
critical_pairs
|
Every critical pair found.
TYPE:
|
termination_violations
|
Every rule that fails the ordering.
TYPE:
|
warnings
|
One description per non-joining pair and per violation.
TYPE:
|
is_locally_confluent
property
¶
Whether every critical pair joins.
| RETURNS | DESCRIPTION |
|---|---|
bool
|
|
is_lpo_terminating
property
¶
Whether every rule decreases in the ordering.
| RETURNS | DESCRIPTION |
|---|---|
bool
|
|
is_sound
property
¶
Whether the system is locally confluent and terminating.
| RETURNS | DESCRIPTION |
|---|---|
bool
|
Both checks hold. |
NormalForm
didactic-model
¶
Bases: Model
The result of rewriting a term by a theory's directed equations.
| PARAMETER | DESCRIPTION |
|---|---|
term
|
The term reached.
TYPE:
|
exhausted
|
Whether the step budget ran out first, so that
TYPE:
|
IntValue
didactic-model
¶
Bases: Value
An integer.
| PARAMETER | DESCRIPTION |
|---|---|
value
|
The integer.
TYPE:
|
kind
|
The discriminator.
TYPE:
|
StrValue
didactic-model
¶
Bases: Value
A string.
| PARAMETER | DESCRIPTION |
|---|---|
value
|
The string.
TYPE:
|
kind
|
The discriminator.
TYPE:
|
BoolValue
didactic-model
¶
Bases: Value
A boolean.
| PARAMETER | DESCRIPTION |
|---|---|
value
|
The boolean.
TYPE:
|
kind
|
The discriminator.
TYPE:
|
NullValue
didactic-model
¶
Bases: Value
The absent value.
| PARAMETER | DESCRIPTION |
|---|---|
kind
|
The discriminator.
TYPE:
|
ListValue
didactic-model
¶
ListValue(*, items: tuple[Value, ...] = (), kind: Literal['list'] = 'list')
Bases: Value
A list of values.
| PARAMETER | DESCRIPTION |
|---|---|
items
|
The items.
TYPE:
|
kind
|
The discriminator.
TYPE:
|
MapEntry
didactic-model
¶
MapEntry(*, key: str, value: Value)
Bases: Model
One entry of a map value.
| PARAMETER | DESCRIPTION |
|---|---|
key
|
The key.
TYPE:
|
value
|
The value.
TYPE:
|
MapValue
didactic-model
¶
MapValue(*, entries: tuple[MapEntry, ...] = (), kind: Literal['map'] = 'map')
Bases: Value
A map from strings to values.
| PARAMETER | DESCRIPTION |
|---|---|
entries
|
The entries, ascending by key.
TYPE:
|
kind
|
The discriminator.
TYPE:
|
ConstructorValue
didactic-model
¶
ConstructorValue(*, tag: str, args: tuple[Value, ...] = (), kind: Literal['constructor'] = 'constructor')
Bases: Value
A constructor-tagged value.
| PARAMETER | DESCRIPTION |
|---|---|
tag
|
The constructor's name.
TYPE:
|
args
|
Its arguments.
TYPE:
|
kind
|
The discriminator.
TYPE:
|
Carrier
didactic-model
¶
Carrier(*, sort: str, elements: tuple[Value, ...] = ())
Bases: Model
The carrier set of one sort.
| PARAMETER | DESCRIPTION |
|---|---|
sort
|
The sort.
TYPE:
|
elements
|
Its elements.
TYPE:
|
TableEntry
didactic-model
¶
Bases: Model
One row of an operation's table.
| PARAMETER | DESCRIPTION |
|---|---|
args
|
The arguments.
TYPE:
|
result
|
The operation's value on them.
TYPE:
|
OperationTable
didactic-model
¶
OperationTable(*, op: str, entries: tuple[TableEntry, ...] = ())
Bases: Model
The finite table of one operation.
| PARAMETER | DESCRIPTION |
|---|---|
op
|
The operation.
TYPE:
|
entries
|
One row per tuple of arguments from the input carriers.
TYPE:
|
FiniteModel
didactic-model
¶
FiniteModel(*, theory: str, carriers: tuple[Carrier, ...] = (), tables: tuple[OperationTable, ...] = ())
Bases: Model
A finite set-theoretic model of a theory, given by carriers and tables.
| PARAMETER | DESCRIPTION |
|---|---|
theory
|
The name of the theory it interprets.
TYPE:
|
carriers
|
One carrier per sort.
TYPE:
|
tables
|
One table per operation.
TYPE:
|
carrier
¶
carrier(sort: str) -> tuple[Value, ...]
The carrier of one sort.
| PARAMETER | DESCRIPTION |
|---|---|
sort
|
The sort.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
tuple of Value
|
Its elements. |
| RAISES | DESCRIPTION |
|---|---|
KeyError
|
If the model has no carrier for the sort. |
Source code in src/quivers/gat/records.py
lookup
¶
The value of one operation on one tuple of arguments.
| PARAMETER | DESCRIPTION |
|---|---|
op
|
The operation.
TYPE:
|
args
|
The arguments.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Value
|
The table's entry. |
| RAISES | DESCRIPTION |
|---|---|
KeyError
|
If the model has no table for the operation, or the table has no row for the arguments. |
Source code in src/quivers/gat/records.py
EquationViolation
didactic-model
¶
EquationViolation(*, equation: str, assignment: tuple[MapEntry, ...], lhs_value: Value, rhs_value: Value)
Bases: Model
A variable assignment under which an equation fails in a model.
| PARAMETER | DESCRIPTION |
|---|---|
equation
|
The equation.
TYPE:
|
assignment
|
The assignment, ascending by variable.
TYPE:
|
lhs_value
|
The value of the left-hand side.
TYPE:
|
rhs_value
|
The value of the right-hand side.
TYPE:
|
ModelVerification
didactic-model
¶
ModelVerification(*, status: CheckStatus, violations: tuple[EquationViolation, ...] = (), incomplete: str | None = None)
Bases: Model
What checking a model against its theory established.
| PARAMETER | DESCRIPTION |
|---|---|
status
|
TYPE:
|
violations
|
The counterexamples found.
TYPE:
|
incomplete
|
Why the check did not finish.
TYPE:
|
UnitPair
didactic-model
¶
SigmaExtension
didactic-model
¶
SigmaExtension(*, model: FiniteModel, unit: tuple[UnitPair, ...] = ())
Bases: Model
The free extension of a model along a theory morphism.
| PARAMETER | DESCRIPTION |
|---|---|
model
|
The free extension, a model of the codomain.
TYPE:
|
unit
|
The unit, from the original model into the reduct of
TYPE:
|
TheoryChange
didactic-model
¶
TheoryChange(*, change: ChangeKind, name: str, breaks_clients: bool, breaks_models: bool)
Bases: Model
One change between two versions of a theory.
| PARAMETER | DESCRIPTION |
|---|---|
change
|
What changed.
TYPE:
|
name
|
The symbol it concerns.
TYPE:
|
breaks_clients
|
Whether it breaks clients of the old theory: terms and views over it no longer transport along the inclusion into the new one.
TYPE:
|
breaks_models
|
Whether it breaks models of the old theory: they are no longer models of the new one.
TYPE:
|
TheoryChangeReport
didactic-model
¶
TheoryChangeReport(*, classification: ChangeClassification, clients: CheckStatus, models: CheckStatus, changes: tuple[TheoryChange, ...] = (), client_error: str | None = None, model_error: str | None = None)
Bases: Model
How a change of theory affects its clients and its models.
| PARAMETER | DESCRIPTION |
|---|---|
classification
|
TYPE:
|
clients
|
Whether the identity-on-names inclusion old into new is a theory morphism, so every term and view over the old theory transports.
TYPE:
|
models
|
Whether the inclusion new into old is a theory morphism, so every model of the old theory is a model of the new one.
TYPE:
|
changes
|
The changes, in panproto's order.
TYPE:
|
client_error
|
Why the old-into-new inclusion is not established.
TYPE:
|
model_error
|
Why the new-into-old inclusion is not established.
TYPE:
|