{"content":[{"text":"substitution follo wing expression is applied: ev aluates S Z . T o in tro duce the notation w \n let (lhs to T rue . e express this in Hask ell syn tax: the \n The functions in appSubst Just ; rhs s ) s rhs = = == S plusZer match Z lhs o (S Z :+: Z ) \n appSubst in v olv wing: (for t = Expr ) \n match ( == ) :: ed are \n :: :: T T erm erm the t follo \n T erm t ) \n F unction appSubst t ) ) Sub t t ! ! t t t ! ! ! (t Bo Mayb ! ol t e ) (Sub t ) \n The of appSubst t yp and an tak t yp instance es e a constructor substitution of a t yp for e class and Sub a for term, T erm and substitution \n (de�ned e in Expr 3.1. F unction to the match term. \n Section is the 3.2) tak es a term con taining stitutions matc v ariables, are s de�ned applies in the Section 2.1. The de�nitions \n The A returns rule term set Just equalit is a a collection substitution \n eep y test, (==), of s if is the de�ned and terms rule in can Section set b matc e 2.2. hes hed b y giv and means en in a term Section \n T o k a In practice this means that at of s , \n our one and without \n rule of Nothing v ariables, \n set the rules otherwise. and \n the that rules term. the use system the rules, �rst deterministic, matc ev en a \n t yp e and R alw a ys [ R ule h. when term more if than least one rule matc hes, \n ules a rule w matc e list. order hes \n exprrules exprrules t = = :: [ R plusZer ules t Expr ℄ is \n where plusZer plusSuc timesZer o c o = = = (x (x :+: :+: Z S o ; y x ; plusSuc ) c ; timesZer o ; timesSuc c ℄ \n F unction r ewrite (x timesSuc ; (de�ned y ) c \n in Section = = (EV (x (x :�: :�: \n 4.2) ar S Z \n rewrites 0; ; y Z EV ; ; ) (x S (x \n ar :�: :+ \n 1) y ) : :+ y )) : x ) \n rules from r ewrite a rule :: T erm list: a term to normal form b y rep eatedly applying \n Because the rule list exprrules t ) R ules is t normalizing, ! t ! t \n to resp normal ect to the form. rule In list general, rs . r ewrite rs t terminates function if and r ewrite only will if the rewrite term an t y is term normalizing of t yp e Expr with \n 1.2 The t yp P es olyt in the ypic previous rewriting subsection and already the term suggest in terface \n instance de�ned on an abstract t yp e (class) of terms. An y regular that functions lik e r ewrite and match are \n This strategy pap . of er W the e dev ha T elops v erm e c hosen class, a p olyt and ypic it rewriting follo ws that function functions that r ewrite datat uses yp the and e suc parallel match h as Expr are innermost p olytypic. can b e made an \n the up the parallel innermost rewriting strategy \n Firstly on rewriting our , the earlier program function w ork uses on in to p olyt a an term asymptotically ypic in rewriting terface that optimal hides w o solution. The b results ecause in this this lets pap us er transform rewriting impro \n program. The term in terface, whic h app eared [8℄ in in t ypic part from the rest of the v e \n 2 the t fundamen the yp es p in olyt the tal w previous a ys. subsection as class","bbox":{"left":0.147058,"top":-0.06452,"width":0.691372,"height":0.989243}}],"images_bbox":[],"images_bbox_not_text_overlap":[]}