]> matita.cs.unibo.it Git - helm.git/blobdiff - matita/matita/lib/basics/bool.ma
inject/eject replaced by mk_Sig/pi1.
[helm.git] / matita / matita / lib / basics / bool.ma
index 7b26064856545b510fabb55073aa2393bdd00d5a..98b14ad2984e878981ad0f118e906a58fbaabb67 100644 (file)
@@ -76,11 +76,16 @@ lemma orb_true_l: ∀b1,b2:bool.
   (b1 ∨ b2) = true → (b1 = true) ∨ (b2 = true).
 * normalize /2/ qed.
 
-definition if_then_else: ∀A:Type[0]. bool → A → A → A ≝ 
-λA.λb.λ P,Q:A. match b with [ true ⇒ P | false  ⇒ Q].
+definition xorb : bool → bool → bool ≝
+λb1,b2:bool.
+ match b1 with
+  [ true ⇒  match b2 with [ true ⇒ false | false ⇒ true ]
+  | false ⇒  match b2 with [ true ⇒ true | false ⇒ false ]].
 
-notation "'if' term 19 e 'then' term 19 t 'else' term 19 f" non associative with precedence 19 for @{ 'if_then_else $e $t $f }.
-interpretation "if_then_else" 'if_then_else e t f = (if_then_else ? e t f).
+notation > "'if' term 46 e 'then' term 46 t 'else' term 46 f" non associative with precedence 46
+ for @{ match $e in bool with [ true ⇒ $t | false ⇒ $f]  }.
+notation < "hvbox('if' \nbsp term 46 e \nbsp break 'then' \nbsp term 46 t \nbsp break 'else' \nbsp term 49 f \nbsp)" non associative with precedence 46
+ for @{ match $e with [ true ⇒ $t | false ⇒ $f]  }.
 
 theorem bool_to_decidable_eq: 
   ∀b1,b2:bool. decidable (b1=b2).
@@ -109,4 +114,4 @@ record EnumSet : Type[1] ≝ { carr :> DeqSet;
    eqb_true: ∀x,y. (eqb x y = true) ↔ (x = y)
 }.
 
-*)
\ No newline at end of file
+*)