-
Notifications
You must be signed in to change notification settings - Fork 0
/
Lab2.v
46 lines (42 loc) · 1 KB
/
Lab2.v
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
Require Import Labels.
From mathcomp Require Import ssreflect ssrfun ssrbool ssrnat eqtype seq.
(** The two point finite lattice *)
Inductive Lab2 : Set :=
| L : Lab2
| H : Lab2.
Instance JoinSemiLattice_Lab2 : JoinSemiLattice Lab2 :=
{ bot := L
; join l1 l2 :=
match l1, l2 with
| H, _ => H
| _, H => H
| L, L => L
end
; flows l1 l2 :=
match l1, l2 with
| L, _ => true
| _, H => true
| _, _ => false
end
; meet l1 l2 :=
match l1, l2 with
| L, _ => L
| _, L => L
| H, H => H
end
}.
Proof.
auto.
intros l; destruct l; auto.
intros l1 l2 l3; destruct l1, l2, l3; auto.
intros l1 l2; destruct l1, l2; auto.
by [].
by [].
intros l1 l2; destruct l1, l2; auto.
intros l1 l2; destruct l1, l2; auto.
intros l1 l2 l; destruct l1, l2, l; auto.
Defined.
Instance Lattice_Lab2 : Lattice Lab2 := { top := H }.
Proof. intros l; destruct l; auto. Defined.
Instance FiniteLattice_Lab2 : FiniteLattice Lab2 := { elems := [:: L;H] }.
Proof. by case. Defined.