

























Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


























8/29/
Simple Language IMP
8/29/
Simple Language IMP
8/29/
Simple Language IMP
8/29/
Simple Language IMP
8/29/
Simple Language IMP
8/29/
Simple Language IMP
8/29/
Simple Language IMP
closure: if s1 and s2 are in set S, then s1 * s2 is in S (Closure of multiplication gives us no more operations than does closure of addition with inverse.)
identify: there is a member of S, 1, such that s * 1 = 1 * s for all s in S
associativity: if s1, s2, and s3 are in set S, then (s1 * s2)
commutativity: if s1 and s2 are in set S, then s1 * s2 = s2 * s
8/29/
Simple Language IMP
8/29/
Simple Language IMP
=> a - b * c + d=> a - b * c + LOC=> a - b * c + AEXP=> a - b * LOC + AEXP=> a - b * AEXP + AEXP=> a -b * AEXP=> a - LOC * AEXP=> a - AEXP * AEXP=> a - AEXP=> LOC - AEXPAEXP => AEXP - AEXP
8/29/
Simple Language IMP
=> a - b * c + d=> a - b * c + LOC=> a - b * c + AEXP=> a - b * LOC + AEXP=> a - b * AEXP + AEXP=> a - LOC * AEXP + AEXP=> a - AEXP * AEXP + AEXP=> a - AEXP + AEXP=> LOC - AEXP + AEXP=> AEXP - AEXP + AEXPAEXP => AEXP + AEXP
8/29/
Simple Language IMP
LOC ::= string of one or more letters followed by zero orNUM ::= string of one or more digitsAFACTOR ::= LOCAFACTOR ::= NUMATERM ::= ATERM * AFACTORA EXP ::= AEXP - ATERMAEXP ::= AEXP + ATERM more digits
8/29/
Simple Language IMP
8/29/
Simple Language IMP
8/29/
Simple Language IMP