Eine aufbereitete Darstellung der Quelle

 
     
 
 
 
Anforderungen  |   Konzepte  |   Entwurf  |   Entwicklung  |   Qualitätssicherung  |   Lebenszyklus  |   Steuerung


Quelle  BinEx.thy   Sprache: Isabelle

 

(*  Title:      ZF/ex/BinEx.thy
    Author:     Lawrence C Paulson, Cambridge University Computer Laboratory
    Copyright   1994  University of Cambridge

Examples of performing binary arithmetic by simplification.
*)


theory BinEx imports ZF begin

lemma "#13 $+ #19 = #32"
by simp

lemma "#1234 $+ #5678 = #6912"
by simp

lemma "#1359 $+ #-2468 = #-1109"
by simp

lemma "#93746 $+ #-46375 = #47371"
by simp

lemma "$- #65745 = #-65745"
by simp

lemma "$- #-54321 = #54321"
by simp

lemma "#13 $* #19 = #247"
by simp

lemma "#-84 $* #51 = #-4284"
by simp

(*The worst case for 8-bit operands *)
lemma "#255 $* #255 = #65025"
by simp

lemma "#1359 $* #-2468 = #-3354012"
by simp


(** Comparisons **)

lemma "(#89) $* #10 ≠ #889"
by simp

lemma "(#13) $< #18 $- #4"
by simp

lemma "(#-345) $< #-242 $+ #-100"
by simp

lemma "(#13557456) $< #18678654"
by simp

lemma "(#999999) $≤ (#1000001 $+ #1) $- #2"
by simp

lemma "(#1234567) $≤ #1234567"
by simp


(*** Quotient and remainder [they could be faster] ***)

lemma "#23 zdiv #3 = #7"
by simp

lemma "#23 zmod #3 = #2"
by simp

(** negative dividend **)

lemma "#-23 zdiv #3 = #-8"
by simp

lemma "#-23 zmod #3 = #1"
by simp

(** negative divisor **)

lemma "#23 zdiv #-3 = #-8"
by simp

lemma "#23 zmod #-3 = #-1"
by simp

(** negative dividend and divisor **)

lemma "#-23 zdiv #-3 = #7"
by simp

lemma "#-23 zmod #-3 = #-2"
by simp

end

Messung
CHZG
929910096

¤ Dauer der Verarbeitung: 0.2 Sekunden  ¤

*© Formatika GbR, Deutschland







                                                                                                                                                                                                                                                                                                                                                                                                     

 

Neuigkeiten

Aktuelles
Motto des Tages

Open Source Software


Gedichte
Musik
Bilder

Jenseits des Üblichen

Besucherstatistik

Besucherstatistik

Statistik
#Sources=1,187,965
#Domains=975,935