# HG changeset patch # User haftmann # Date 1186667846 -7200 # Node ID a365995c043b95ec4b101d57f7a2a01e2f5e29a5 # Parent 9e77397eba8ebd25be9d35982b5541c9acac8842 dropped diff -r 9e77397eba8e -r a365995c043b src/HOL/ex/Codegenerator_Rat.thy --- a/src/HOL/ex/Codegenerator_Rat.thy Thu Aug 09 15:52:57 2007 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,41 +0,0 @@ -(* Title: HOL/Library/ExecutableRat.thy - ID: $Id$ - Author: Florian Haftmann, TU Muenchen -*) - -header {* Simple example for executable rational numbers *} - -theory Codegenerator_Rat -imports Executable_Rat Efficient_Nat -begin - -definition - foo :: "rat \ rat \ rat \ rat" where - "foo r s t = (t + s) / t" - -definition - bar :: "rat \ rat \ rat \ bool" where - "bar r s t \ (r - s) \ t \ (s - t) \ r" - -definition - "R1 = Fract 3 7" - -definition - "R2 = Fract (-7) 5" - -definition - "R3 = Fract 11 (-9)" - -definition - "foobar = (foo R1 1 R3, bar R2 0 R3, foo R1 R3 R2)" - -code_gen foobar in SML to Foo - in OCaml file - - in Haskell file - -ML {* Foo.foobar *} - -code_module Foo - contains foobar -ML {* Foo.foobar *} - -end