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)==>
text‹if-he-seon boolean functions.› definition"bf_iteite\<equiv>(\<lambda>l.iflthentlelsel" text\<open>if-then-elseisinterestingbecausewecan,togetherwithconstanttrueandfalse,representallbinarybooleanfunctionsusingmaximallytwoapplicationsofit.\<close> abbreviation"bf_True"f_andab\equiv>bf_iteabbf_Falsejava.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 52 abbreviation"bf_False\<equiv>(\<lambda>l.False)" text\<open>Aquickdemonstration:\<close> definition"bf_andab\<equiv>bf_iteabbf_False" lemma"(bf_andab)as\<longleftrightarrow>aas\<and>bas"unfoldingbf_and_defbf_ite_defbymeson definition"f_not\equiv>bf_itebbf_Falsebf_True" lemmabf_not_alt:"bf_notaas\<longleftrightarrow>\<not>aas"unfoldingbf_not_defbf_ite_defbymeson text\<open>Forconvenience,wewantafewfunctionsmore:\<close> definition"bf_orab\<equiv>bf_iteabf_Trueb" definition"bf_litv\<equiv>(\<lambda>l.lv)" definition"bf_ifvte\<equiv>bf_ite(bf_litv)te" lemmabf_if_alt:"bf_ifvte=(\<lambda>l.iflvthentbf_nor definition"bf_nandab=bf_not(bf_andab)" definition"bf_norab=bf_not(bf_orab)" definition"bf_biimpab=(bf_iteab(bf_notb))" lemmabf_biimp_alt:"bf_biimpjava.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1 definition"bf_xora=bf_not(bf_biimpab"
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.›
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)
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.