Probabilistic query evaluation by the rewritten query
Lax392996.ProbabilisticEvaluationByRewriting · concepts/Lax392996/ProbabilisticEvaluationByRewriting.lean · lax-392996
No public endorsements yet.
Loading review…
Sign in with ORCIDNatural Language Statement
Theorem
For a probability assignment on a finite set of variables, a -instance , a source query and a tuple , if is the query rewritten from by the rules (R1) to (R4), then : the marginal probability of is the probability of its annotation in the plain evaluation of on the composite reading of , each answer tuple read back as an annotated one. This is the paper's Corollary 13, combining the correctness of the rewriting with the theorem on probabilistic evaluation; as for the former, the paper states it with the aggregation rule (R5) included, which this submission does not cover.
Concept map
In the paper
- page 5 of this submission's paper
Lean source view on GitHub
| 1 | import Lax392996.SemiringsWithMonus |
| 2 | import Lax392996.BooleanFunctions |
| 3 | import Lax392996.Databases |
| 4 | import Lax392996.AnnotatedDatabases |
| 5 | import Lax392996.RelationalAlgebra |
| 6 | import Lax392996.MultisetSemantics |
| 7 | import Lax392996.RewritingRules |
| 8 | import Lax392996.ProbabilisticDatabases |
| 9 | |
| 10 | /-! |
| 11 | --- |
| 12 | title: Probabilistic query evaluation by the rewritten query |
| 13 | type: theorem |
| 14 | --- |
| 15 | For a probability assignment on a finite set of variables, a |
| 16 | -instance , a source query and a tuple , |
| 17 | if is the query rewritten from by the rules (R1) to (R4), then |
| 18 | |
| 19 | : the marginal probability of is the probability of its |
| 20 | annotation in the plain evaluation of on the composite reading of |
| 21 | , each answer tuple read back as an annotated one. This is the |
| 22 | paper's Corollary 13, combining the correctness of the rewriting with the |
| 23 | theorem on probabilistic evaluation; as for the former, the paper states it |
| 24 | with the aggregation rule (R5) included, which this submission does not |
| 25 | cover. |
| 26 | -/ |
| 27 | |
| 28 | namespace Lax392996.ProbabilisticEvaluationByRewriting |
| 29 | |
| 30 | open Lax392996.SemiringsWithMonus Lax392996.BooleanFunctions Lax392996.Databases |
| 31 | open Lax392996.AnnotatedDatabases Lax392996.RelationalAlgebra Lax392996.MultisetSemantics |
| 32 | open Lax392996.RewritingRules Lax392996.ProbabilisticDatabases |
| 33 | |
| 34 | /-- **Corollary 13.** The marginal probability of a tuple is the probability |
| 35 | of its annotation in the answer of the rewritten query. -/ |
| 36 | axiom corollary_13 : ∀ {X : Type} [Fintype X] [DecidableEq X] {T : Type} [ValueType T] |
| 37 | (P : ProbAssignment X) [HasAltLinearOrder (BoolFunc X)] {n : ℕ} (q : Query T n) (hq : q.source) |
| 38 | (Î : AnnotatedDatabase T (BoolFunc X)) (t : Tuple T n), |
| 39 | ProbAssignment.marginalProb P q Î t |
| 40 | = ProbAssignment.funcProb P (tupleAnnotation |
| 41 | (Multiset.map Tuple.fromComposite (Query.evaluate (Query.rewriting q hq) Î.toComposite)) t) |
| 42 | |
| 43 | end Lax392996.ProbabilisticEvaluationByRewriting |
| 44 |
Discussion
Ask a question or add context. Endorsements and structured flags are kept in the review panel above.
0 comments