Correctness of the provenance-aware rewriting, rules (R1) to (R4)
Lax392996.RewritingCorrectness · concepts/Lax392996/RewritingCorrectness.lean · lax-392996
No public endorsements yet.
Loading review…
Sign in with ORCIDNatural Language Statement
Theorem
Let be a source query, an m-semiring with decidable equality and an alternative linear order, a -instance, and the query obtained from by applying the rewriting rules bottom up. Then : the annotated semantics of on , read as a plain relation with the annotation in the last column, is the multiset semantics of on the composite reading of . This is the theorem of the paper restricted to rules (R1) to (R4): the paper's statement also covers the aggregation rule (R5), which this submission does not state; the library proves an analogue of it, on its general syntax with symbolic aggregate tokens, outside the paper's syntax.
Concept map
Lean source view on GitHub
| 1 | import Lax392996.SemiringsWithMonus |
| 2 | import Lax392996.Databases |
| 3 | import Lax392996.AnnotatedDatabases |
| 4 | import Lax392996.RelationalAlgebra |
| 5 | import Lax392996.MultisetSemantics |
| 6 | import Lax392996.AnnotatedSemantics |
| 7 | import Lax392996.RewritingRules |
| 8 | |
| 9 | /-! |
| 10 | --- |
| 11 | title: Correctness of the provenance-aware rewriting, rules (R1) to (R4) |
| 12 | type: theorem |
| 13 | --- |
| 14 | Let be a source query, an m-semiring with decidable |
| 15 | equality and an alternative linear order, a -instance, |
| 16 | and the query obtained from by applying the rewriting rules |
| 17 | bottom up. Then |
| 18 | : the annotated semantics of on , read as a plain |
| 19 | relation with the annotation in the last column, is the multiset semantics |
| 20 | of on the composite reading of . This is the theorem of the |
| 21 | paper restricted to rules (R1) to (R4): the paper's statement also covers |
| 22 | the aggregation rule (R5), which this submission does not state; the |
| 23 | library proves an analogue of it, on its general syntax with symbolic |
| 24 | aggregate tokens, outside the paper's syntax. |
| 25 | -/ |
| 26 | |
| 27 | namespace Lax392996.RewritingCorrectness |
| 28 | |
| 29 | open Lax392996.SemiringsWithMonus Lax392996.Databases Lax392996.AnnotatedDatabases |
| 30 | open Lax392996.RelationalAlgebra Lax392996.MultisetSemantics Lax392996.AnnotatedSemantics |
| 31 | open Lax392996.RewritingRules |
| 32 | |
| 33 | /-- `⟪q⟫_Î = ⟦q̂⟧_Î`, for `q` in the fragment the rules (R1)–(R4) cover. -/ |
| 34 | axiom rewriting_valid : ∀ {T : Type} [ValueType T] {K : Type} {n : ℕ} |
| 35 | [SemiringWithMonus K] [DecidableEq K] [HasAltLinearOrder K] |
| 36 | (q : Query T n) (hq : q.source) (d : AnnotatedDatabase T K), |
| 37 | (Query.evaluateAnnotated q hq d).toComposite |
| 38 | = Query.evaluate (Query.rewriting q hq) d.toComposite |
| 39 | |
| 40 | end Lax392996.RewritingCorrectness |
| 41 |
Discussion
Ask a question or add context. Endorsements and structured flags are kept in the review panel above.
0 comments