CafeOBJ> in pnat-ps-citp.cafe processing input : /Users/kokichi/Documents/d-f090205/lectureF0902/160916+23-NII-Tokyo/homePage/lecture1/pnat-ps-citp.cafe --> **************************************************************** --> proof scores for associativity and commutativity of --> _+_ and _*_ over Nat.PNAT with SpecCalc/CITP --> **************************************************************** --> ----------------------------------------------------------------- --> PNAT: Peano NATural numbers --> ----------------------------------------------------------------- -- defining module! PNAT -- reading in file : bool processing input : /Users/kokichi/Documents/cafeobjSystemsF0908/cafeobj155-151228/cafeobj-1.5.5-sbcl-x64Darwin/share/cafeobj-1.5/lib/bool.cafe processing input : /Users/kokichi/Documents/cafeobjSystemsF0908/cafeobj155-151228/cafeobj-1.5.5-sbcl-x64Darwin/share/cafeobj-1.5/lib/base_bool.cafe processing input : /Users/kokichi/Documents/cafeobjSystemsF0908/cafeobj155-151228/cafeobj-1.5.5-sbcl-x64Darwin/share/cafeobj-1.5/lib/truth.cafe -- defining module! TRUTH -- reading in file : truth -- done reading in file: truth .............._...........* done. -- defining module! BASE-BOOL.. -- reading in file : eql processing input : /Users/kokichi/Documents/cafeobjSystemsF0908/cafeobj155-151228/cafeobj-1.5.5-sbcl-x64Darwin/share/cafeobj-1.5/lib/eql.cafe -- defining module! EQL.._...* done. -- done reading in file: eql ........._* done. processing input : /Users/kokichi/Documents/cafeobjSystemsF0908/cafeobj155-151228/cafeobj-1.5.5-sbcl-x64Darwin/share/cafeobj-1.5/lib/sys_bool.cafe -- defining module! BOOL....._......................* done. -- done reading in file: bool ..._* done. --> ---------------------------------------------------------------- --> PNAT with the addition _+_ --> ---------------------------------------------------------------- -- defining module! PNAT+.._..* done. --> ================================================================ --> proof score for proving right 0 of _+_: --> eq[+r0]: X:Nat + 0 = X . --> with the induction on X:Nat --> ---------------------------------------------------------------- --> proof with CITP -- reading in file : int -- reading in file : nat -- reading in file : nznat -- done reading in file: nznat -- done reading in file: nat -- done reading in file: int :goal { ** root ----------------------------------------- -- context module: PNAT+ -- sentence to be proved eq [+r0]: X:Nat.PNAT + 0 = X . } ** Initial goal (root) is generated. ** **> Induction will be conducted on X:Nat [si]=> :goal{root} ** Generated 2 goals [tc]=> :goal{1} [rd]=> :goal{1} [rd] discharged: eq [+r0]: 0 + 0 = 0 [rd] discharged goal "1". [tc]=> :goal{2} [rd]=> :goal{2} [rd] discharged: eq [+r0]: s X#Nat + 0 = s X#Nat [rd] discharged goal "2". (consumed 0.0130 sec, including 5 rewrites + 9 matches) ** All goals are successfully discharged. --> QED --> ================================================================ --> ================================================================ --> proof score for proving right s_ of _+_: --> eq[+rs]: X:Nat + s Y:Nat = s (X + Y) . --> with the induction on X:Nat --> ---------------------------------------------------------------- :goal { ** root ----------------------------------------- -- context module: PNAT+ -- sentence to be proved eq [+rs]: X:Nat.PNAT + s Y:Nat.PNAT = s (X + Y) . } ** Initial goal (root) is generated. ** **> Induction will be conducted on X:Nat [si]=> :goal{root} ** Generated 2 goals [tc]=> :goal{1} ** Generated 1 goal [rd]=> :goal{1-1} [rd] discharged: eq [TC +rs]: 0 + s Y@Nat = s (0 + Y@Nat) [rd] discharged goal "1-1". [tc]=> :goal{2} ** Generated 1 goal [rd]=> :goal{2-1} [rd] discharged: eq [TC +rs]: s X#Nat + s Y@Nat = s (s X#Nat + Y@Nat) [rd] discharged goal "2-1". (consumed 0.0290 sec, including 7 rewrites + 25 matches) ** All goals are successfully discharged. --> QED --> ================================================================ --> ================================================================ --> proof score for proving commutativity of _+_: --> eq (X:Nat + Y:Nat) = (Y + X) . --> with the induction on X:Nat --> ---------------------------------------------------------------- -- defining module PNAT+comm._..* done. :goal { ** root ----------------------------------------- -- context module: PNAT+comm -- sentence to be proved eq [+comm]: X:Nat.PNAT + Y:Nat.PNAT = Y + X . } ** Initial goal (root) is generated. ** **> Induction will be conducted on X:Nat [si]=> :goal{root} ** Generated 2 goals [tc]=> :goal{1} ** Generated 1 goal [rd]=> :goal{1-1} [rd] discharged: eq [TC +comm]: 0 + Y@Nat = Y@Nat + 0 [rd] discharged goal "1-1". [tc]=> :goal{2} ** Generated 1 goal [rd]=> :goal{2-1} [rd] discharged: eq [TC +comm]: s X#Nat + Y@Nat = Y@Nat + s X#Nat [rd] discharged goal "2-1". (consumed 0.0280 sec, including 7 rewrites + 37 matches) ** All goals are successfully discharged. --> QED --> ================================================================ --> ================================================================ --> proof score for proving associativity of _+_: --> eq[+assoc]: (X:Nat + Y:Nat) + Z:Nat = X + (Y + Z) . --> with the induction on X:Nat --> ---------------------------------------------------------------- :goal { ** root ----------------------------------------- -- context module: PNAT+ -- sentence to be proved eq [+assoc]: (X:Nat.PNAT + Y:Nat.PNAT) + Z:Nat.PNAT = X + (Y + Z) . } ** Initial goal (root) is generated. ** **> Induction will be conducted on X:Nat [si]=> :goal{root} ** Generated 2 goals [tc]=> :goal{1} ** Generated 1 goal [rd]=> :goal{1-1} [rd] discharged: eq [TC +assoc]: (0 + Y@Nat) + Z@Nat = 0 + (Y@Nat + Z@Nat) [rd] discharged goal "1-1". [tc]=> :goal{2} ** Generated 1 goal [rd]=> :goal{2-1} [rd] discharged: eq [TC +assoc]: (s X#Nat + Y@Nat) + Z@Nat = s X#Nat + (Y@Nat + Z@Nat) [rd] discharged goal "2-1". (consumed 0.0280 sec, including 8 rewrites + 92 matches) ** All goals are successfully discharged. --> QED --> ================================================================ --> ---------------------------------------------------------------- --> PNAT with associative and commutative addition _+_ --> ---------------------------------------------------------------- -- defining module! PNAT+ac.._..* done. --> ---------------------------------------------------------------- --> PNAT with multiplication _*_ --> ---------------------------------------------------------------- -- defining module! PNAT*.._..* done. --> ================================================================ --> proof score for proving right 0 of _*_: --> eq[*r0] X:Nat * 0 = X . --> with the induction on X:Nat --> ---------------------------------------------------------------- :goal { ** root ----------------------------------------- -- context module: PNAT* -- sentence to be proved eq [*r0]: X:Nat.PNAT * 0 = 0 . } ** Initial goal (root) is generated. ** **> Induction will be conducted on X:Nat [si]=> :goal{root} ** Generated 2 goals [tc]=> :goal{1} [rd]=> :goal{1} [rd] discharged: eq [*r0]: 0 * 0 = 0 [rd] discharged goal "1". [tc]=> :goal{2} [rd]=> :goal{2} [rd] discharged: eq [*r0]: s X#Nat * 0 = 0 [rd] discharged goal "2". (consumed 0.0180 sec, including 6 rewrites + 10 matches) ** All goals are successfully discharged. --> QED --> ================================================================ --> ================================================================ :goal { ** root ----------------------------------------- -- context module: PNAT* -- sentence to be proved eq [*rs]: X:Nat.PNAT * s Y:Nat.PNAT = X + X * Y . } ** Initial goal (root) is generated. ** **> Induction will be conducted on X:Nat [si]=> :goal{root} ** Generated 2 goals [tc]=> :goal{1} ** Generated 1 goal [rd]=> :goal{1-1} [rd] discharged: eq [TC *rs]: 0 * s Y@Nat = 0 + 0 * Y@Nat [rd] discharged goal "1-1". [tc]=> :goal{2} ** Generated 1 goal [rd]=> :goal{2-1} [rd] discharged: eq [TC *rs]: s X#Nat * s Y@Nat = s X#Nat + s X#Nat * Y@Nat [rd] discharged goal "2-1". (consumed 0.0270 sec, including 10 rewrites + 78 matches) ** All goals are successfully discharged. --> QED --> ================================================================ --> ================================================================ --> proof score for proving commutativity of _*_: --> eq[*comm]: (X:Nat * Y:Nat) = (Y * X) . --> with the induction on X:Nat --> ----------------------------------------------------------------- -- defining module PNAT*comm._..* done. :goal { ** root ----------------------------------------- -- context module: PNAT*comm -- sentence to be proved eq [*comm]: X:Nat.PNAT * Y:Nat.PNAT = Y * X . } ** Initial goal (root) is generated. ** **> Induction will be conducted on X:Nat [si]=> :goal{root} ** Generated 2 goals [tc]=> :goal{1} ** Generated 1 goal [rd]=> :goal{1-1} [rd] discharged: eq [TC *comm]: 0 * Y@Nat = Y@Nat * 0 [rd] discharged goal "1-1". [tc]=> :goal{2} ** Generated 1 goal [rd]=> :goal{2-1} [rd] discharged: eq [TC *comm]: s X#Nat * Y@Nat = Y@Nat * s X#Nat [rd] discharged goal "2-1". (consumed 0.0300 sec, including 7 rewrites + 53 matches) ** All goals are successfully discharged. --> QED --> ================================================================ --> ================================================================ --> proof score for proving distributivity of _*_ over _+_ --> from right: --> eq[*distr] (X:Nat + Y:Nat) * Z:Nat = X * Z + Y * Z . --> with the induction on X:Nat --> ---------------------------------------------------------------- :goal { ** root ----------------------------------------- -- context module: PNAT* -- sentence to be proved eq [*distr]: (X:Nat.PNAT + Y:Nat.PNAT) * Z:Nat.PNAT = X * Z + Y * Z . } ** Initial goal (root) is generated. ** **> Induction will be conducted on X:Nat [si]=> :goal{root} ** Generated 2 goals [tc]=> :goal{1} ** Generated 1 goal [rd]=> :goal{1-1} [rd] discharged: eq [TC *distr]: (0 + Y@Nat) * Z@Nat = 0 * Z@Nat + Y@Nat * Z@Nat [rd] discharged goal "1-1". [tc]=> :goal{2} ** Generated 1 goal [rd]=> :goal{2-1} [rd] discharged: eq [TC *distr]: (s X#Nat + Y@Nat) * Z@Nat = s X#Nat * Z@Nat + Y@Nat * Z@Nat [rd] discharged goal "2-1". (consumed 0.0280 sec, including 9 rewrites + 125 matches) ** All goals are successfully discharged. --> QED --> ================================================================ --> ================================================================ --> proof score for proving associativity of _*_: --> eq[*assoc]: (X:Nat * Y:Nat) * Z:Nat = X * (Y * Z) . --> with the induction on X:Nat --> ---------------------------------------------------------------- -- defining module PNAT*assoc._.* done. :goal { ** root ----------------------------------------- -- context module: PNAT*assoc -- sentence to be proved eq [*assoc]: (X:Nat.PNAT * Y:Nat.PNAT) * Z:Nat.PNAT = X * (Y * Z) . } ** Initial goal (root) is generated. ** **> Induction will be conducted on X:Nat [si]=> :goal{root} ** Generated 2 goals [tc]=> :goal{1} ** Generated 1 goal [rd]=> :goal{1-1} [rd] discharged: eq [TC *assoc]: (0 * Y@Nat) * Z@Nat = 0 * (Y@Nat * Z@Nat) [rd] discharged goal "1-1". [tc]=> :goal{2} ** Generated 1 goal [rd]=> :goal{2-1} [rd] discharged: eq [TC *assoc]: (s X#Nat * Y@Nat) * Z@Nat = s X#Nat * (Y@Nat * Z@Nat) [rd] discharged goal "2-1". (consumed 0.0300 sec, including 9 rewrites + 137 matches) ** All goals are successfully discharged. --> QED --> ================================================================ --> ---------------------------------------------------------------- --> Peano style natural numbers with assoc+comm _+_, _*_ --> which satisfy distributive law --> ---------------------------------------------------------------- -- defining module! PNAT*ac.._...* done. --> ---------------------------------------------------------------- --> factorial functions on Nat.PNAT*ac --> ---------------------------------------------------------------- -- defining module! FACT..._....* done. --> ================================================================ --> proof score for the property: --> eq[f2f1]: fact2(N1:Nat,N2:Nat) = fact1(N1) * N2 . --> with the induction on N1:Nat --> ---------------------------------------------------------------- :goal { ** root ----------------------------------------- -- context module: FACT -- sentence to be proved eq [f2f1]: fact2(N1:Nat.PNAT, N2:Nat.PNAT) = fact1(N1) * N2 . } ** Initial goal (root) is generated. ** **> Induction will be conducted on N1:Nat [si]=> :goal{root} ** Generated 2 goals [tc]=> :goal{1} ** Generated 1 goal [rd]=> :goal{1-1} [rd] discharged: eq [TC f2f1]: fact2(0, N2@Nat) = fact1(0) * N2@Nat [rd] discharged goal "1-1". [tc]=> :goal{2} ** Generated 1 goal [rd]=> :goal{2-1} [rd] discharged: eq [TC f2f1]: fact2(s N1#Nat, N2@Nat) = fact1(s N1#Nat) * N2@Nat [rd] discharged goal "2-1". (consumed 0.0320 sec, including 14 rewrites + 159 matches) ** All goals are successfully discharged. --> QED --> ================================================================ --> **************************************************************** --> end of file FACT>