Theory Egg_Flat_Explanation
section ‹Importing egg flat explanations›
theory Egg_Flat_Explanation
imports
Equality_Saturation_Checker
First_Order_Terms.Matching
begin
text ‹
The public explanation API of egg 0.11.0 emits a flat proof as one
S-expression per term. The first term is unannotated. Every later term
contains exactly one subexpression of the form
‹(Rewrite=> name term)› or ‹(Rewrite<= name term)›. The former rewrites
the previous term to the current term; the latter applies the named rule to
the current term to recover the previous term.
This theory parses that actual textual format (for unquoted atoms), infers
the substitution with the AFP matcher, compiles every annotation to
\<^const>‹Rule_At›, and finally invokes the independently verified checker.
Parsing and compilation are therefore outside the trusted claim: malformed
or mistranslated input is accepted only if replay against the AFP rewrite
rules succeeds.
›