-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPrimitives.agda
141 lines (102 loc) Β· 3.96 KB
/
Primitives.agda
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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
{-# OPTIONS --cubical #-}
module Primitives where
data π : Set where
i0 i1 : π
{-# BUILTIN BRIDGENAME π #-}
{-# BUILTIN BZERO i0 #-}
{-# BUILTIN BONE i1 #-}
-- The type β is obsolete as we rather use parametric quantification
-- over πΉ, however it's kept because currently it's still part of the
-- Prop interface.
-- data β : Set where
-- ΞΉ : πΉ β β
-- {-# BUILTIN PATHNAME β #-}
-- {-# BUILTIN IOTA ΞΉ #-}
--πΉ, β, ΞΉ, b0, b1, p0, p1 are obsolete
πΉ : Set
πΉ = π
β : Set
β = πΉ
ΞΉ : πΉ β β
ΞΉ x = x
b0 = i0
b1 = i1
p0 = ΞΉ b0
p1 = ΞΉ b1
data Prop : Set where
pβ€ : Prop
postulate
pβ₯ : Prop
{-# BUILTIN PROP Prop #-}
{-# BUILTIN PTOP pβ€ #-}
{-# BUILTIN PBOT pβ₯ #-}
module Original where
primitive
primPEq : _
-- primPBridge : _
primPMin : _
primPMax : _
primCoShapePi : _
primSharpPi : _
primNSSharpPi : _
primHCoShapePi : _
primHSharpPi : _
primHNSSharpPi : _
open Original public renaming (primPEq to _β£_; {- primPBridge to _βΞΉ;-} primPMin to _β§_; primPMax to _β¨_;
primCoShapePi to ΒΆΞ ; primSharpPi to #Ξ ; primNSSharpPi to Γ·#Ξ ;
primHCoShapePi to hΒΆΞ ; primHSharpPi to h#Ξ ; primHNSSharpPi to hΓ·#Ξ )
ΒΆΞ -syntax = ΒΆΞ
#Ξ -syntax = #Ξ
Γ·#Ξ -syntax = Γ·#Ξ
syntax ΒΆΞ -syntax A (Ξ» x β B) = ΒΆ[ x β A ]β B
syntax #Ξ -syntax A (Ξ» x β B) = #[ x β A ]β B
syntax Γ·#Ξ -syntax A (Ξ» x β B) = Γ·#[ x β A ]β B
{-# BUILTIN ISONE IsOne #-} -- IsOne : I β SetΟ
postulate
itIsOne : IsOne pβ€
IsOne1 : β i j β IsOne i β IsOne (i β¨ j)
IsOne2 : β i j β IsOne j β IsOne (i β¨ j)
{-# BUILTIN ITISONE itIsOne #-}
{-# BUILTIN ISONE1 IsOne1 #-}
{-# BUILTIN ISONE2 IsOne2 #-}
{-# BUILTIN PARTIAL Partial #-}
{-# BUILTIN PARTIALP PartialP #-}
module GluePrims where
primitive
primGlue : β {a b} (A : Set a) β β Ο β (T : Partial (Set b) Ο) β ΒΆΞ (PartialP Ο (Ξ» o β T o β A)) \ f β Set b
-- we comment out the types of the primitives so we get the nicer internal ones, with Ο named
prim^glue : _
-- β {a b} {A : Set a} β h#Ξ Prop \ Ο β {T : Partial (Set b) Ο}
-- β hΒΆΞ (PartialP Ο (Ξ» o β T o β A)) \ f β PartialP Ο T β A β primGlue A Ο T f
prim^unglue : _
-- β {a b} {A : Set a} β h#Ξ Prop \ Ο β {T : Partial (Set b) Ο}
-- β hΒΆΞ (PartialP Ο (Ξ» o β T o β A)) \ f β
-- primGlue A Ο T f β A
module GluePrims' (dummy : Setβ) = GluePrims
open GluePrims' Set using () renaming (prim^glue to unsafeGlue) public
open GluePrims public renaming (prim^glue to glue; prim^unglue to unglue)
-- primitive
-- primUnIota : {i : β} β Partial πΉ (i βΞΉ)
-- postulate
-- PathP : β {a} (A : β β Set a) β A p0 β A p1 β Set a
-- BridgeP : β {a} (A : πΉ β Set a) β A b0 β A b1 β Set a
-- {-# BUILTIN PATHP PathP #-}
-- {-# BUILTIN BRIDGEP BridgeP #-}
-- reflB : β {a} {A : Set a}{x : A} β BridgeP (\ _ β A) x x
-- reflB {x = x} = \ _ β x
-- reflP : β {a} {A : Set a}{x : A} β PathP (\ _ β A) x x
-- reflP {x = x} = \ _ β x
-- etaP : β {a} {A : Set a}{x y : A} β PathP (\ _ β A) x y β PathP (\ _ β A) x y
-- etaP b = \ x β b x
-- etaB : β {a} {A : Set a}{x y : A} β BridgeP (\ _ β A) x y β BridgeP (\ _ β A) x y
-- etaB b = \ x β b x
-- pathToBridge : β {a} {A : Set a}{x y : A} β PathP (\ _ β A) x y β BridgeP (\ _ β A) x y
-- pathToBridge p = \ x β p (ΞΉ x)
-- fun-ext : β {a} {A : Set a} {b} {B : Set b} β {f g : A β B} β (β x β PathP (\ _ β B) (f x) (g x)) β PathP (\ _ β A β B) f g
-- fun-ext p i x = p x i
-- {-# BUILTIN SUB Sub #-}
-- postulate
-- inc : β {a} {A : Set a} {Ο} (x : A) β Sub {A = A} Ο (\ _ β x)
-- {-# BUILTIN SUBIN inc #-}
-- primitive
-- primSubOut : {a : _} {A : Set a} {Ο : Prop} {u : Partial A Ο} β Sub Ο u β A