]> matita.cs.unibo.it Git - helm.git/blob - helm/software/matita/nlibrary/datatypes/sums.ma
c5a73b4b5071424fdd1c571af9d61733f2c3a43a
[helm.git] / helm / software / matita / nlibrary / datatypes / sums.ma
1 (**************************************************************************)
2 (*       ___                                                                *)
3 (*      ||M||                                                             *)
4 (*      ||A||       A project by Andrea Asperti                           *)
5 (*      ||T||                                                             *)
6 (*      ||I||       Developers:                                           *)
7 (*      ||T||       A.Asperti, C.Sacerdoti Coen,                          *)
8 (*      ||A||       E.Tassi, S.Zacchiroli                                 *)
9 (*      \   /                                                             *)
10 (*       \ /        This file is distributed under the terms of the       *)
11 (*        v         GNU Lesser General Public License Version 2.1         *)
12 (*                                                                        *)
13 (**************************************************************************)
14
15 include "datatypes/pairs.ma".
16
17 ninductive void : Type[0] ≝.
18
19 ninductive unit : Type[0] ≝ something: unit.
20
21 ninductive Sum (A,B:Type[0]) : Type[0] ≝
22 | inl : A → Sum A B
23 | inr : B → Sum A B.
24
25 interpretation "Disjoint union" 'plus A B = (Sum A B).
26
27 ninductive option (A:Type[0]) : Type[0] ≝
28  | None : option A
29  | Some : A → option A.