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 *)
19 (* Cosimo Oliboni, oliboni@cs.unibo.it *)
21 (* Questo materiale fa parte della tesi: *)
22 (* "Formalizzazione Interattiva dei Microcontroller a 8bit FreeScale" *)
24 (* data ultima modifica 15/11/2007 *)
25 (* ********************************************************************** *)
27 include "freescale/pts.ma".
33 ninductive bool : Type ≝
37 ndefinition bool_ind : ΠP:bool → Prop.P true → P false → Πb:bool.P b ≝
38 λP:bool → Prop.λp:P true.λp1:P false.λb:bool.
39 match b with [ true ⇒ p | false ⇒ p1 ].
41 ndefinition bool_rec : ΠP:bool → Set.P true → P false → Πb:bool.P b ≝
42 λP:bool → Set.λp:P true.λp1:P false.λb:bool.
43 match b with [ true ⇒ p | false ⇒ p1 ].
45 ndefinition bool_rect : ΠP:bool → Type.P true → P false → Πb:bool.P b ≝
46 λP:bool → Type.λp:P true.λp1:P false.λb:bool.
47 match b with [ true ⇒ p | false ⇒ p1 ].
49 (* operatori booleani *)
52 λb1,b2:bool.match b1 with
53 [ true ⇒ match b2 with [ true ⇒ true | false ⇒ false ]
54 | false ⇒ match b2 with [ true ⇒ false | false ⇒ true ]
57 ndefinition not_bool ≝
58 λb:bool.match b with [ true ⇒ false | false ⇒ true ].
60 ndefinition and_bool ≝
61 λb1,b2:bool.match b1 with
62 [ true ⇒ b2 | false ⇒ false ].
65 λb1,b2:bool.match b1 with
66 [ true ⇒ true | false ⇒ b2 ].
68 ndefinition xor_bool ≝
69 λb1,b2:bool.match b1 with
74 notation "hvbox(⊖ a)" non associative with precedence 36
75 for @{ 'not_bool $a }.
76 interpretation "not_bool" 'not_bool x = (not_bool x).
79 notation "hvbox(a break ⊗ b)" left associative with precedence 35
80 for @{ 'and_bool $a $b }.
81 interpretation "and_bool" 'and_bool x y = (and_bool x y).
84 notation "hvbox(a break ⊕ b)" left associative with precedence 34
85 for @{ 'or_bool $a $b }.
86 interpretation "or_bool" 'or_bool x y = (or_bool x y).
89 notation "hvbox(a break ⊙ b)" left associative with precedence 33
90 for @{ 'xor_bool $a $b }.
91 interpretation "xor_bool" 'xor_bool x y = (xor_bool x y).
93 ndefinition boolRelation : Type → Type ≝