1 (**************************************************************************)
4 (* ||A|| A project by Andrea Asperti *)
6 (* ||I|| Developers: *)
7 (* ||T|| The HELM team. *)
8 (* ||A|| http://helm.cs.unibo.it *)
10 (* \ / This file is distributed under the terms of the *)
11 (* v GNU General Public License Version 2 *)
13 (**************************************************************************)
15 (* ********************************************************************** *)
16 (* Progetto FreeScale *)
18 (* Sviluppato da: Cosimo Oliboni, oliboni@cs.unibo.it *)
19 (* Cosimo Oliboni, oliboni@cs.unibo.it *)
21 (* ********************************************************************** *)
23 include "freescale/pts.ma".
29 ninductive bool : Type ≝
33 ndefinition bool_ind : ΠP:bool → Prop.P true → P false → Πb:bool.P b ≝
34 λP:bool → Prop.λp:P true.λp1:P false.λb:bool.
35 match b with [ true ⇒ p | false ⇒ p1 ].
37 ndefinition bool_rec : ΠP:bool → Set.P true → P false → Πb:bool.P b ≝
38 λP:bool → Set.λp:P true.λp1:P false.λb:bool.
39 match b with [ true ⇒ p | false ⇒ p1 ].
41 ndefinition bool_rect : ΠP:bool → Type.P true → P false → Πb:bool.P b ≝
42 λP:bool → Type.λp:P true.λp1:P false.λb:bool.
43 match b with [ true ⇒ p | false ⇒ p1 ].
45 (* operatori booleani *)
48 λb1,b2:bool.match b1 with
49 [ true ⇒ match b2 with [ true ⇒ true | false ⇒ false ]
50 | false ⇒ match b2 with [ true ⇒ false | false ⇒ true ]
53 ndefinition not_bool ≝
54 λb:bool.match b with [ true ⇒ false | false ⇒ true ].
56 ndefinition and_bool ≝
57 λb1,b2:bool.match b1 with
58 [ true ⇒ b2 | false ⇒ false ].
61 λb1,b2:bool.match b1 with
62 [ true ⇒ true | false ⇒ b2 ].
64 ndefinition xor_bool ≝
65 λb1,b2:bool.match b1 with
70 notation "hvbox(⊖ a)" non associative with precedence 36
71 for @{ 'not_bool $a }.
72 interpretation "not_bool" 'not_bool x = (not_bool x).
75 notation "hvbox(a break ⊗ b)" left associative with precedence 35
76 for @{ 'and_bool $a $b }.
77 interpretation "and_bool" 'and_bool x y = (and_bool x y).
80 notation "hvbox(a break ⊕ b)" left associative with precedence 34
81 for @{ 'or_bool $a $b }.
82 interpretation "or_bool" 'or_bool x y = (or_bool x y).
85 notation "hvbox(a break ⊙ b)" left associative with precedence 33
86 for @{ 'xor_bool $a $b }.
87 interpretation "xor_bool" 'xor_bool x y = (xor_bool x y).
89 ndefinition boolRelation : Type → Type ≝