src/HOL/Library/Code_Target_Nat.thy
changeset 51113 222fb6cb2c3e
parent 51095 7ae79f2e3cc7
child 51114 3e913a575dc6
     1.1 --- a/src/HOL/Library/Code_Target_Nat.thy	Thu Feb 14 12:24:42 2013 +0100
     1.2 +++ b/src/HOL/Library/Code_Target_Nat.thy	Thu Feb 14 12:24:56 2013 +0100
     1.3 @@ -1,11 +1,11 @@
     1.4  (*  Title:      HOL/Library/Code_Target_Nat.thy
     1.5 -    Author:     Stefan Berghofer, Florian Haftmann, TU Muenchen
     1.6 +    Author:     Florian Haftmann, TU Muenchen
     1.7  *)
     1.8  
     1.9  header {* Implementation of natural numbers by target-language integers *}
    1.10  
    1.11  theory Code_Target_Nat
    1.12 -imports Main Code_Numeral_Types Code_Binary_Nat
    1.13 +imports Code_Abstract_Nat Code_Numeral_Types
    1.14  begin
    1.15  
    1.16  subsection {* Implementation for @{typ nat} *}
    1.17 @@ -52,18 +52,15 @@
    1.18    "integer_of_nat 1 = 1"
    1.19    by (simp add: integer_eq_iff integer_of_nat_def)
    1.20  
    1.21 +lemma [code]:
    1.22 +  "Suc n = n + 1"
    1.23 +  by simp
    1.24 +
    1.25  lemma [code abstract]:
    1.26    "integer_of_nat (m + n) = of_nat m + of_nat n"
    1.27    by (simp add: integer_eq_iff integer_of_nat_def)
    1.28  
    1.29  lemma [code abstract]:
    1.30 -  "integer_of_nat (Code_Binary_Nat.dup n) = Code_Numeral_Types.dup (of_nat n)"
    1.31 -  by (simp add: integer_eq_iff Code_Binary_Nat.dup_def integer_of_nat_def)
    1.32 -
    1.33 -lemma [code, code del]:
    1.34 -  "Code_Binary_Nat.sub = Code_Binary_Nat.sub" ..
    1.35 -
    1.36 -lemma [code abstract]:
    1.37    "integer_of_nat (m - n) = max 0 (of_nat m - of_nat n)"
    1.38    by (simp add: integer_eq_iff integer_of_nat_def)
    1.39