-
Notifications
You must be signed in to change notification settings - Fork 0
/
Lattice.fm
118 lines (109 loc) · 4.14 KB
/
Lattice.fm
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
import Dependencies
import Relation
import Operation
import Magma
// ========================================================
// = Definition =
// ========================================================
T Lattice<A : Type, s : Setoid(A)>
| lattice
( meet : Op2(A)
, join : Op2(A)
, meet.commutative : Commutative(A,s,meet)
, meet.associative : Associative(A,s,meet)
, join.commutative : Commutative(A,s,join)
, join.associative : Associative(A,s,join)
, absorption : Absorption(A,s,meet,join)
)
T Semilattice<A : Type, s : Setoid(A)>
| semilattice
( f : Op2(A)
, commutative : Commutative(A,s,f)
, associative : Associative(A,s,f)
, idempotent : Idempotent(A,s,f)
)
T BoundedLattice<A : Type, s : Setoid(A)>
| bounded_lattice
( meet : Op2(A)
, join : Op2(A)
, e0 : A
, e1 : A
, meet.commutative : Commutative(A,s,meet)
, meet.associative : Associative(A,s,meet)
, meet.identity : Identity(A,s,meet,e1)
, join.commutative : Commutative(A,s,join)
, join.associative : Associative(A,s,join)
, join.identity : Identity(A,s,join,e0)
, absorption : Absorption(A,s,meet,join)
)
T ComplementedLattice<A : Type, s : Setoid(A)>
| complemeted_lattice
( meet : Op2(A)
, join : Op2(A)
, e0 : A
, e1 : A
, meet.commutative : Commutative(A,s,meet)
, meet.associative : Associative(A,s,meet)
, meet.identity : Identity(A,s,meet,e1)
, meet.complement : Inverse(A,s,meet,e1,meet.identity)
, join.commutative : Commutative(A,s,join)
, join.associative : Associative(A,s,join)
, join.identity : Identity(A,s,join,e0)
, join.complement : Inverse(A,s,join,e0,join.identity)
, absorption : Absorption(A,s,meet,join)
)
T DistributiveLattice<A : Type, s : Setoid(A)>
| distributive_lattice
( meet : Op2(A)
, join : Op2(A)
, meet.commutative : Commutative(A,s,meet)
, meet.associative : Associative(A,s,meet)
, join.commutative : Commutative(A,s,join)
, join.associative : Associative(A,s,join)
, absorption : Absorption(A,s,meet,join)
, distributive : Distributive(A,s,meet,join)
)
T HeytingAlgebra<A : Type, s : Setoid(A)>
| heyting_algebra
( meet : Op2(A)
, join : Op2(A)
, implies : Op2(A)
, e0 : A
, e1 : A
, meet.commutative : Commutative(A,s,meet)
, meet.associative : Associative(A,s,meet)
, meet.identity : Identity(A,s,meet,e1)
, join.commutative : Commutative(A,s,join)
, join.associative : Associative(A,s,join)
, join.identity : Identity(A,s,join,e0)
, absorption : Absorption(A,s,meet,join)
, distributive : Distributive(A,s,meet,join)
, implies.identity : Identity(A,s,implies,e1)
, meet.antecedent : (x : A, y : A) ->
Eq(A,s,meet(x,implies(x,y)), meet(x,y))
, meet.consequent : (x : A, y : A) -> Eq(A,s,meet(y,implies(x,y)),y)
, implies.distributive : Distributive(A,s,implies,meet)
)
T BooleanAlgebra<A : Type, s : Setoid(A)>
| boolean_algebra
( meet : Op2(A)
, join : Op2(A)
, implies : Op2(A)
, e0 : A
, e1 : A
, meet.commutative : Commutative(A,s,meet)
, meet.associative : Associative(A,s,meet)
, meet.identity : Identity(A,s,meet,e1)
, meet.complement : Inverse(A,s,meet,e1,meet.identity)
, join.commutative : Commutative(A,s,join)
, join.associative : Associative(A,s,join)
, join.identity : Identity(A,s,join,e0)
, join.complement : Inverse(A,s,join,e0,join.identity)
, absorption : Absorption(A,s,meet,join)
, distributive : Distributive(A,s,meet,join)
, implies.identity : Identity(A,s,implies,e1)
, meet.antecedent : (x : A, y : A) ->
Eq(A,s,meet(x,implies(x,y)), meet(x,y))
, meet.consequent : (x : A, y : A) -> Eq(A,s,meet(y,implies(x,y)),y)
, implies.distributive : Distributive(A,s,implies,meet)
)