Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/Isabelle/Archive-of-Formal-Proofs/thys/Gauss_Jordan/   (Sammlung formaler Beweise Version 2026-5©)  Datei vom 31.4.2026 mit Größe 2 kB image not shown  

Quelle  Code_Z2.thy

  Sprache: Isabelle
 

(*  
    Title:      Code_Z2.thy
    Author:     Jose Divasón <jose.divasonm at unirioja.es>
    Author:     Jesús Aransay <jesus-maria.aransay at unirioja.es>
*)


sectionCode Generation for Z2

theory Code_Z2
imports "HOL-Library.Z2"
begin

textImplementation for the field of integer numbers module 2.
  we have checked that the implementation by means of booleans is the fastest one.


code_datatype "0::bit" "(1::bit)"
code_printing
  type_constructor bit  (SML) "Bool.bool"
 | constant "0::bit"  (SML) "false"
 | constant "1::bit"  (SML) "true"

code_printing
  type_constructor bit  (Haskell) "Bool"
 | constant "0::bit"  (Haskell) "False"
 | constant "1::bit"  (Haskell) "True"
 | class_instance bit :: "HOL.equal" => (Haskell) - (*This is necessary. See the tutorial on code generation, page 29*)


(*Other possible serialisation to Integers with arbitrary precision (performance is similar in PolyML, 
  worse in MLton and Haskell):*)

(*
code_printing
  type_constructor bit \<rightharpoonup> (SML) "IntInf.int"
 | constant "0::bit" \<rightharpoonup> (SML) "0"
 | constant "1::bit" \<rightharpoonup> (SML) "1"
 | constant "(+) :: bit => bit => bit" \<rightharpoonup> (SML) "IntInf.rem ((IntInf.+ ((_), (_))), 2)"
 | constant "( * ) :: bit => bit => bit" \<rightharpoonup> (SML) "IntInf.* ((_), (_))"
 | constant "(/) :: bit => bit => bit" \<rightharpoonup> (SML) "IntInf.* ((_), (_))"
*)

(*
code_printing
  type_constructor bit \<rightharpoonup> (Haskell) "Integer"
 | constant "0::bit" \<rightharpoonup> (Haskell) "0"
 | constant "1::bit" \<rightharpoonup> (Haskell) "1"
 | constant "(+) :: bit => bit => bit" \<rightharpoonup> (Haskell) "Prelude.rem ((_) + (_))  2"
 | constant "( * ) :: bit => bit => bit" \<rightharpoonup> (Haskell) "(_) * (_)"
 | constant "(/) :: bit => bit => bit" \<rightharpoonup> (Haskell) "(_) * (_)"
 | class_instance bit :: "HOL.equal" => (Haskell) - (*This is necessary. See the tutorial on code generation, page 29*)

*)


(*Other possible serialisation to Integers with finite precision (performance is worse):*)
(*
code_printing
  type_constructor bit \<rightharpoonup> (SML) "Int.int"
 | constant "0::bit" \<rightharpoonup> (SML) "0"
 | constant "1::bit" \<rightharpoonup> (SML) "1"
 | constant "(+) :: bit => bit => bit" \<rightharpoonup> (SML) "Int.rem ((Int.+ ((_), (_))), 2)"
 | constant "( * ) :: bit => bit => bit" \<rightharpoonup> (SML) "Int.* ((_), (_))"
 | constant "(/) :: bit => bit => bit" \<rightharpoonup> (SML) "Int.* ((_), (_))"
*)

end

Messung V0.5 in Prozent
C=72 H=96 G=84

¤ Dauer der Verarbeitung: 0.9 Sekunden  (vorverarbeitet am  2026-06-10) ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

Beweissystem der NASA

Beweissystem Isabelle

NIST Cobol Testsuite

Cephes Mathematical Library

Wiener Entwicklungsmethode

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.