src/HOL/Code_Numeral.thy
changeset 31377 a48f9ef9de15
parent 31266 55e70b6d812e
child 31998 2c7a24f74db9
     1.1 --- a/src/HOL/Code_Numeral.thy	Tue Jun 02 15:53:04 2009 +0200
     1.2 +++ b/src/HOL/Code_Numeral.thy	Tue Jun 02 15:53:05 2009 +0200
     1.3 @@ -279,7 +279,7 @@
     1.4  
     1.5  code_type code_numeral
     1.6    (SML "int")
     1.7 -  (OCaml "int")
     1.8 +  (OCaml "Big'_int.big'_int")
     1.9    (Haskell "Int")
    1.10  
    1.11  code_instance code_numeral :: eq
    1.12 @@ -287,45 +287,46 @@
    1.13  
    1.14  setup {*
    1.15    fold (Numeral.add_code @{const_name number_code_numeral_inst.number_of_code_numeral}
    1.16 -    false false) ["SML", "OCaml", "Haskell"]
    1.17 +    false false) ["SML", "Haskell"]
    1.18 +  #> Numeral.add_code @{const_name number_code_numeral_inst.number_of_code_numeral} false true "OCaml"
    1.19  *}
    1.20  
    1.21  code_reserved SML Int int
    1.22 -code_reserved OCaml Pervasives int
    1.23 +code_reserved OCaml Big_int
    1.24  
    1.25  code_const "op + \<Colon> code_numeral \<Rightarrow> code_numeral \<Rightarrow> code_numeral"
    1.26    (SML "Int.+/ ((_),/ (_))")
    1.27 -  (OCaml "Pervasives.( + )")
    1.28 +  (OCaml "Big'_int.add'_big'_int")
    1.29    (Haskell infixl 6 "+")
    1.30  
    1.31  code_const "subtract_code_numeral \<Colon> code_numeral \<Rightarrow> code_numeral \<Rightarrow> code_numeral"
    1.32    (SML "Int.max/ (_/ -/ _,/ 0 : int)")
    1.33 -  (OCaml "Pervasives.max/ (_/ -/ _)/ (0 : int) ")
    1.34 +  (OCaml "Big'_int.max'_big'_int/ (Big'_int.sub'_big'_int/ _/ _)/ Big'_int.zero'_big'_int")
    1.35    (Haskell "max/ (_/ -/ _)/ (0 :: Int)")
    1.36  
    1.37  code_const "op * \<Colon> code_numeral \<Rightarrow> code_numeral \<Rightarrow> code_numeral"
    1.38    (SML "Int.*/ ((_),/ (_))")
    1.39 -  (OCaml "Pervasives.( * )")
    1.40 +  (OCaml "Big'_int.mult'_big'_int")
    1.41    (Haskell infixl 7 "*")
    1.42  
    1.43  code_const div_mod_code_numeral
    1.44    (SML "(fn n => fn m =>/ if m = 0/ then (0, n) else/ (n div m, n mod m))")
    1.45 -  (OCaml "(fun n -> fun m ->/ if m = 0/ then (0, n) else/ (n '/ m, n mod m))")
    1.46 +  (OCaml "(fun k -> fun l ->/ Big'_int.quomod'_big'_int/ (Big'_int.abs'_big'_int k)/ (Big'_int.abs'_big'_int l))")
    1.47    (Haskell "divMod")
    1.48  
    1.49  code_const "eq_class.eq \<Colon> code_numeral \<Rightarrow> code_numeral \<Rightarrow> bool"
    1.50    (SML "!((_ : Int.int) = _)")
    1.51 -  (OCaml "!((_ : int) = _)")
    1.52 +  (OCaml "Big'_int.eq'_big'_int")
    1.53    (Haskell infixl 4 "==")
    1.54  
    1.55  code_const "op \<le> \<Colon> code_numeral \<Rightarrow> code_numeral \<Rightarrow> bool"
    1.56    (SML "Int.<=/ ((_),/ (_))")
    1.57 -  (OCaml "!((_ : int) <= _)")
    1.58 +  (OCaml "Big'_int.le'_big'_int")
    1.59    (Haskell infix 4 "<=")
    1.60  
    1.61  code_const "op < \<Colon> code_numeral \<Rightarrow> code_numeral \<Rightarrow> bool"
    1.62    (SML "Int.</ ((_),/ (_))")
    1.63 -  (OCaml "!((_ : int) < _)")
    1.64 +  (OCaml "Big'_int.lt'_big'_int")
    1.65    (Haskell infix 4 "<")
    1.66  
    1.67  end