Predicting the BNF of a Normal Form - PowerPoint PPT Presentation

About This Presentation
Title:

Predicting the BNF of a Normal Form

Description:

(Joint Work with Predrag Janicic and Alan Smaill) University of Edinburgh. 8/21/09. 2 ... unfold to Di':= Di1| ...| Dik, add as new context sensitive equation, ... – PowerPoint PPT presentation

Number of Views:26
Avg rating:3.0/5.0
Slides: 17
Provided by: homepage7
Category:

less

Transcript and Presenter's Notes

Title: Predicting the BNF of a Normal Form


1
Predicting the BNF of a Normal Form
  • Alan Bundy
  • (Joint Work with Predrag Janicic and Alan Smaill)
  • University of Edinburgh

2
The Problem
Rewrite Rules
Output BNF?
Input BNF?
Normalise
Input Formula
Output Formulae
3
Decision Procedure Synthesis
Input Formula
Remove
BNF
Stratify
BNF
Thin
BNF
Assoc
BNF
Trivial Formula
BNF
4
Example Remove
  • Input BNF
  • Term Atom f(Term) g(Term)
  • Rewrite Rule
  • g(x) ?f(f(x))
  • Output BNF
  • Norm Atom f(Norm)

5
Example Thin
  • Input BNF
  • Term Atom f(Term)
  • Rewrite Rule
  • f(f(x)) ?x
  • Output BNF
  • Norm Atom f(Atom)

6
Example Assoc
  • Input BNF
  • Term Atom h(Term,Term)
  • Rewrite Rule
  • h(h(x,y),z) ?h(x,h(y,z))
  • Output BNF
  • Norm Atom h(Atom,Norm)

7
Example Stratify
  • Input BNF
  • Term Atom f(Term)h(Term,Term)
  • Rewrite Rule
  • f(h(x,y)) ?h(f(x),f(y))
  • Output BNF
  • Norm Atomf(Sub)h(Norm,Norm)
  • Sub Atomf(Sub)

8
Predrags Counterexample
  • Input BNF Term ? a.Term.b
  • Rewrite Rules b ?d.c, c.d ?d.c
  • Output set an.dn.cn
  • Cannot be expressed as context-free BNF.
  • So desired BNF may not always exist.

9
Unfolding and Separation
  • Thin Rewrite Rule f(f(x)) ?x
  • Input BNF Term Atom f(Term)
  • Unfold
  • Term Atom f(Atom) f(f(Term))
  • Replace matched terms
  • Norm Atom f(Atom) Norm
  • Simplify Norm Atom f(Atom)

10
Separation match and unify
  • Replace terms that match f(f(Term))
  • or omit them?
  • Retain terms that dont unify f(Atom)
  • Unfold terms that unify, but dont match f(Term)

11
Infinite Regress Avoided
  • Input BNF Term Atom h(Term,Term)
  • Rewrite Rule h(h(x,y),z) ?h(x,h(y,z))
  • Unfold and Replace
  • Term Atom h(Atom,Term) h(Term,h(Term,Term))
  • Term Atom h(Atom,Term) h(Atom,h(Term,Term))
    h(Term,h(Term,h(Term,Term)))
  • Unfold and Omit
  • Term Atom h(Atom,Term)

12
Smaill Algorithm Background
  • Assume output BNF ? input BNF.
  • Only singleton, terminating rule set l ?r.
  • Input BNF Term D1 Dn.
  • Standardise apart Terms.
  • Construct Norm recursively for each Di by cases.
  • Di is Di with each Termj replaced by Normj.
  • Di is Di with each Termj replaced by Subj.

13
Smaill Algorithm Cases
  • Di and l match omit ith disjunct.
  • Di and l dont unify include Di.
  • Di and l unify but dont match
  • include Di.
  • unfold to Di Di1 Dik,
  • add as new context sensitive equation,
  • apply algorithm recursively.

14
Example Stratify
  • Input BNF Term Atomf(Term)h(Term,Term)
  • Rewrite Rule f(h(x,y)) ?h(f(x),f(y))
  • Apply algorithm
  • Norm Atomf(Term1)h(Norm2,Norm3)
  • f(Term1) f(Atom)f(f(Term2))f(h(Term3,Term4))
  • Recurse on 2nd equation
  • f(Sub1) f(Atom)f(f(Sub2))
  • Simplify 2nd equation
  • Sub1 Atomf(Sub2)

15
Theoretical Questions
  • Is algorithm sound?
  • Is algorithm complete?
  • Does algorithm terminate
  • when rewrite rules do?
  • Can we lift restrictions
  • to singleton rule sets?
  • to output BNF ? input BNF?

16
Conclusion
  • Output BNF prediction
  • Important for decision procedure synthesis.
  • Separation and unfolding as key.
  • Algorithm based on this.
  • Theoretical questions.
Write a Comment
User Comments (0)
About PowerShow.com