1 / 17

A precise analysis

A precise analysis. Determinism, soundness, completeness for Determinism for Additional properties of Comparisons. Analysis for with errors : Observation : (determinism for  for )

gladys
Download Presentation

A precise analysis

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. A precise analysis • Determinism, soundness, completeness for • Determinism for • Additional properties of • Comparisons Pls – analysis – Catriel Beeri

  2. Analysis for with errors : Observation: (determinism for  for ) Theme: Prove by induction on length of selected path For the proof, we need some concepts and results Pls – analysis – Catriel Beeri

  3. (op-apply) (eval-tuple) (eval-rand) Applicability of rules: A rule r is applicable (ישים) to E, if there is a proof tree for EE’, with r associated with the root. A group of rules is applicable to E if one of them is applicable Why is it an interesting concept? Note: it is a semantic concept! Pls – analysis – Catriel Beeri

  4. A characterization (if & only if ) of applicability for an application expression E1 E2: For you: Similar characterization for if, tuple Pls – analysis – Catriel Beeri

  5. Q: Are the conditions mutually exclusive? Q: Have we proved determinism? Q: Have we proved completeness? A: we still depend on a semantic condition of having a transition Pls – analysis – Catriel Beeri

  6. A reformulation (with some redundancy) of the (iff ) characterization of applicability (for E1 E2): Pls – analysis – Catriel Beeri

  7. By removing the transition condition  mutually exclusive, syntactic, only if conditions: But, it is still possible that two rules in a group are applicable, Or a rule generates more than one transition Pls – analysis – Catriel Beeri

  8. Corollary (Inversion): If E has a transition, then • Its primary construct • value tests for (some) direct sub-expressions determine the sub-expression of E that has a transition why “inversion” ? Pls – analysis – Catriel Beeri

  9. Observations: • Knowing primary construct of E  all rules not for E’s expression kind are excluded • Value tests on (some) direct sub-expressions  more rules excluded rules not excluded are potentially applicable (given current knowledge) • If the remaining rules are proper, they select a unique direct sub-expression else, E is a candidate for a reduction This leads to the notions of selected pathselected sub-expression (using the conditions in last table) Pls – analysis – Catriel Beeri

  10. The selection path in a composite expression E (ford): • Contains its root • If it contains node n labeled by • Application: n = E1 E2, then • It contains E1 (operator) if E1 is not a value • It contains E2 (operand) if E2 is not a value, but E1 is • Stops at n if both E1 E2 are values • Tuple: ….. • If: … Its end is the (root of) the selected sub-expressionof E As we go down the path, a set of (potentially applicable) rules is associated with each node, that all select the same child as next node Pls – analysis – Catriel Beeri

  11. applic A value tuple (eval-rand) (rand-error) (App-rand) A non-value v1 v2 Example: , The condition: v1 in Op (1st expr) selects a unique axiom, then we climb up Application rules Non-value tuple rules with i = 1 applic (apply-op) (apply-error) (app-axioms) Application rules Pls – analysis – Catriel Beeri

  12. Soundness (=determinism) and completeness (progress): A composite expression E has a unique proof tree for a transition, hence a unique transition. and • E’s selected sub-expression is a redex, (always true for the rules with error) • If E’  E’’ (regular), then the transition for E is E  {E’’/E’}E • Else, E’  ER, and also E  ER Pls – analysis – Catriel Beeri

  13. Proof: induction on length of selection path • 0: E is a candidate for a reduction always a redex obviously all the claims hold • N>0: Induction hypothesis: claim is true for the unique child E1 one level down on the selected path. The (unique) transition of E1 determines a unique applicable rule for E hence there is a unique proof tree/transition for E. Pls – analysis – Catriel Beeri

  14. Determinism for : Can prove directly, using same technique Or, recall that But, for some expressions, there is no d transition Pls – analysis – Catriel Beeri

  15. Additional properties  is not a functionalrelation! Possibly many successors to an expression, many computations Claim (confluence): All  computations from an expression E terminate in same final (extended) value (proof in chapter) Pls – analysis – Catriel Beeri

  16. Functionality, Soundness & completeness for natural: • For , for each E there is at most one: • applicable rule, • proof tree, • value V, s.t. Proved by induction on E (we did that already) • For , replace • at most by unique • Value V by XV (V or ER) Here, uniqueness of proof tree fails for derivations of ER, but there is never an evaluation to a value, another to ER Pls – analysis – Catriel Beeri

  17. Comparison of transition, natural • (w/o ER) • (with ER) The semantics express the same intuitive semantics(for values ofexpressions) in different styles (which one is easier to write – transition or natural?) Pls – analysis – Catriel Beeri

More Related