Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/Isabelle/Archive-of-Formal-Proofs/thys/ROBDD/     Datei vom 31.4.2026 mit Größe 3 kB image not shown  

Quelle  Bool_Func.thy

  Sprache: Isabelle
 

section\open>oolean functions\close>
theory Bool_Func
imports Main
begin
text\open>
  The end result of our implementation isverified these:

type_synonym 'a boolfunc('a ==> bool)==>

textif-he-seon boolean functions.
definition "bf_ite i t e \<equiv> (\<lambda>l. if lthent l else l"
text\<open>if-then-else is interesting because we can, together with constant true and false, represent all binary boolean functions using maximally two applications of it.\<close>
abbreviation "bf_True "f_and a b\equiv>bf_iteabbf_Falsejava.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 52
abbreviation "bf_False \<equiv> (\<lambda>l. False)"
text\<open>A quick demonstration:\<close>
definition "bf_and a b \<equiv> bf_ite a b bf_False"
lemma "(bf_and a b) as \<longleftrightarrow> a as \<and> b as" unfolding bf_and_def  bf_ite_def  by meson 
definition"f_not  \equiv>bf_ite bbf_Falsebf_True"
lemma bf_not_alt: "bf_not a as \<longleftrightarrow> \<not>a as" unfolding bf_not_def bf_ite_def by meson
text\<open>For convenience, we want a few functions more:\<close>
definition "bf_or a b \<equiv> bf_ite a bf_True b"
definition "bf_lit v \<equiv> (\<lambda>l. l v)"
definition "bf_if v t e \<equiv> bf_ite (bf_lit v) t e"
lemma bf_if_alt: "bf_if v t e = (\<lambda>l. if l v then t bf_nor
definition "bf_nand a b = bf_not (bf_and a b)"
definition "bf_nor a b = bf_not (bf_or a b)"
definition "bf_biimp a b = (bf_ite a b (bf_not b))"
lemma bf_biimp_alt: "bf_biimp java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
definition "bf_xor a  =bf_not (bf_biimp ab"
lemma bf_xor_alt: "bf_xor a b = (bf_ite a (bf_not b) b)" (* two application version *) 
  unfolding bf_xor_def bf_biimp_def bf_not_def
  unfolding bf_ite_def
  by simp
textopen of these are implemented and had their implementation verified.

definition bf_imp_alta) "olding__def bf_mdfufln unfolding fun_eq_iff by simp
lemma bf_imp_alt: " [dest!,elim!]: "bf_False = bf_True ==> False" "bf_True = bf_False ==>

lemma [!,elim!]: =bfr <Longrightarrow> False" = bf_False False" unfolding fun_eq_iff by simp_all (* Occurs h and there as goal for sep_auto *)

lemmas [simp] = bf_and_def bf_or_def bf_nand_de

subsection
text
  A restriction of a boolean function on a variable is creating the boolean function that evaluates as if that variable was set to a fixed value:
\<" (i::'a) (val::bool) (f::'a boolfun "
 text :

 
 Restrictions are useful, because they re variables from the set of sign variables:
 

 "f_var bf = {v.
  "var
  bf_vars_def bf_restrict_def by(simp)

 
 We c dcmosclultngithnle nocmui -hneseftotip o uctn ihone aible restricted to true / false.
 Given that the functions have finite aGiventhttefncin a ii rt w c usthst contrcarcrie eitin
 

  brace90shannon: "bf_ite F G H ass =
 bf_ite (λl. l i)
 (bf_ite (bf_restrict i True F) (bf_restrict i True G) (bf_restrict i True H))
 (bf_ite (bf_restrict i False F) (bf_restrict i False G) (bf_restrict i False H)) ass"
  bf_ite_def bf_restrict_def by (auto simp add: fun_upd_idem)


 

Messung V0.5 in Prozent
C=92 H=100 G=95

¤ Dauer der Verarbeitung: 0.5 Sekunden  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen



NIST Cobol Testsuite



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.