-- Lecture 3 : TRS -- page 5 mod! BASIC-NAT{ [Zero NzNat < Nat] op 0 : -> Zero op s_ : Nat -> NzNat } mod! NAT+ { pr(BASIC-NAT) op _+_ : Nat Nat -> Nat vars M N : Nat eq N + 0 = N . eq M + s N = s(M + N) . } -- page 7 select NAT+ + EQL . set trace whole on . red 0 + s 0 = s 0 + 0 . set trace whole off . -- page 8 mod! NAT-BADAXIOM{ pr(NAT+) op _*_ : Nat Nat -> Nat . var N : Nat eq N = N + 0 . eq 0 = N * 0 . } select NAT-BADAXIOM . -- eq N = N + 0 causes an infinite loop start 0 . apply 1 with N = 0 at term . apply 1 with N = (0 + 0) at term . apply 1 with N = (0 + 0) + 0 at term . -- eq 0 = N * 0 causes an infinite rewrite start 0 . apply 2 with N = 0 at term . start 0 . apply 2 with N = s 0 at term . start 0 . apply 2 with N = s s 0 at term . start 0 . apply 2 with N = s s s 0 at term . -- The reduction command ignore the equation red 0 . -- page 10 mod! ABC{ ops a b c : -> Bool eq a = b . eq a = c . } red in ABC + EQL : b = c .