equal
deleted
inserted
replaced
990 lemma real_inv_code [code]: "inverse (Ratreal x) = Ratreal (Ninv x)" |
990 lemma real_inv_code [code]: "inverse (Ratreal x) = Ratreal (Ninv x)" |
991 unfolding Ratreal_def Ninv real_divide_def by simp |
991 unfolding Ratreal_def Ninv real_divide_def by simp |
992 |
992 |
993 lemma real_div_code [code]: "Ratreal x / Ratreal y = Ratreal (x \<div>\<^sub>N y)" |
993 lemma real_div_code [code]: "Ratreal x / Ratreal y = Ratreal (x \<div>\<^sub>N y)" |
994 unfolding Ratreal_def by simp |
994 unfolding Ratreal_def by simp |
|
995 |
|
996 instance int :: lordered_ring |
|
997 proof |
|
998 fix a::int |
|
999 show "abs a = sup a (- a)" |
|
1000 by (auto simp add: zabs_def sup_int_def) |
|
1001 qed |
|
1002 |
|
1003 instance real :: lordered_ring |
|
1004 proof |
|
1005 fix a::real |
|
1006 show "abs a = sup a (-a)" |
|
1007 by (auto simp add: real_abs_def sup_real_def) |
|
1008 qed |
995 |
1009 |
996 text {* Setup for SML code generator *} |
1010 text {* Setup for SML code generator *} |
997 |
1011 |
998 types_code |
1012 types_code |
999 real ("(int */ int)") |
1013 real ("(int */ int)") |