This preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
Unformatted text preview: Term Rewriting Systems Ferucio Laurent¸iu T ¸iplea Visiting Professor School of Computer Science University of Central Florida Email: [email protected] November 18, 2004 Term Rewriting Systems Contents : • Motivations • Terms and term rewriting systems • Canonical form • Proving termination • Proving confluence UCFSCS/Term Rewriting Systems/Nov 18,2004/F.L. Tiplea 1 Term Rewriting Systems Bibliography : 1. Term Rewriting Systems , Cambridge Tracts in Theoret ical Computer Science 55, Cambridge University Press, 2003 (884 pages) 2. F. Baader, T. Nipkow. Term Rewriting and All That , Cambridge University Press, 1998 (301 pages) UCFSCS/Term Rewriting Systems/Nov 18,2004/F.L. Tiplea 2 Motivations Syntactically, rewrite rules are a special kind of equations that can be applied in one direction only . A term rewriting system (trs, for short) is a set of rewrite rules. They have many applications to: • theorem proving • algebraic specification (of data types, programs etc.) • computer algebra • λcalculus • implementation of declarative languages • operational semantics of programming languages UCFSCS/Term Rewriting Systems/Nov 18,2004/F.L. Tiplea 3 Motivations Example: AckermanPeter function f : N × N → N (R1) f (0 ,y ) = y + 1 (R2) f ( x + 1 , 0) = f ( x, 1) (R3) f ( x + 1 ,y + 1) = f ( x,f ( x + 1 ,y )) for all x,y ∈ N . A few values of this function: • f (0 ,y ) = y + 1 • f (1 ,y ) = y + 2 • f (2 ,y ) = 2 y + 3 for all y ∈ N . UCFSCS/Term Rewriting Systems/Nov 18,2004/F.L. Tiplea 4 Motivations Example of computation: f (2 , 1) ( R 3) , x → 1 , y → = f (1 ,f (2 , 0)) f (1 , f (2 , 0) ) ( R 2) , x → 1 = f (1 ,f (1 , 1)) f (1 , f (1 , 1) ) ( R 3) , x → , y → = f (1 ,f (0 ,f (1 , 0))) f (1 ,f (0 , f (1 , 0) )) ( R 2) , x → = f (1 ,f (0 ,f (0 , 1))) f (1 ,f (0 , f (0 , 1) )) ( R 1) , y → 1 = f (1 ,f (0 , 2)) f (1 , f (0 , 2) ) ( R 1) , y → 2 = f (1 , 3) ··· UCFSCS/Term Rewriting Systems/Nov 18,2004/F.L. Tiplea 5 Motivations Conclusions: • each element of this computation is a term • each computation step is based on applying one of the equations (R1), (R2) or (R3) • each equation is used in one direction only (“from left to right”) • each equation is based on a substitution (“ x → 1, y → 0”) which matches the left hand side of the equation to some subterm of the current term • the immediate successor of a term t is obtained by re placing a subterm of t by an instance of the right hand side of some equation UCFSCS/Term Rewriting Systems/Nov 18,2004/F.L. Tiplea 6 Terms and Term Rewriting Systems Let F be a set of function symbols each of which having associated an arity, and let X be a set of variables. Assume that F and X are disjoint sets. The set of terms over F and X is defined inductively as follows: • each function symbol of arity 0 is a term; • each variable is a term; • if t 1 ,...,t n are terms and f is a function symbol of arity n ≥ 1, then f ( t 1 ,...,t,....
View
Full Document
 Spring '08
 Staff
 Computer Science, Rewriting, UCFSCS/Term Rewriting Systems/Nov, Systems/Nov 18,2004/F.L

Click to edit the document details