Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
sgdt
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
gradual-typing
sgdt
Commits
3d3f3e64
Commit
3d3f3e64
authored
6 years ago
by
Max New
Browse files
Options
Downloads
Patches
Plain Diff
Add computation transitivity, some sanity checking
parent
c2aae633
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
code/gcbpv.agda
+33
-0
33 additions, 0 deletions
code/gcbpv.agda
with
33 additions
and
0 deletions
code/gcbpv.agda
+
33
−
0
View file @
3d3f3e64
...
...
@@ -59,9 +59,14 @@ vtrans Atop Abot p ⟨ Bot ⟩v = Abot ⟨ Bot ⟩v
data CType where
_⇀_ : forall {I} -> VType I -> CType I -> CType I
F : forall {I} -> VType I -> CType I
ctrans : forall (Btop : CType onevar) (Bbot : CType onevar) ->
Btop ⟨ Bot ⟩c ≡ Bbot ⟨ Top ⟩c ->
CType onevar
(A ⇀ B) ⟨ i ⟩c = (A ⟨ i ⟩v) ⇀ (B ⟨ i ⟩c)
F A ⟨ i ⟩c = F (A ⟨ i ⟩v)
ctrans Btop Bbot p ⟨ Top ⟩c = Btop ⟨ Top ⟩c
ctrans Btop Bbot p ⟨ Bot ⟩c = Bbot ⟨ Bot ⟩c
vrefl : VType (cdot _) -> VType onevar
crefl : CType (cdot _) -> CType onevar
...
...
@@ -72,3 +77,31 @@ vrefl (U B) = U (crefl B)
crefl (A ⇀ B) = vrefl A ⇀ crefl B
crefl (F A) = F (vrefl A)
vreflretract : forall A i -> vrefl A ⟨ i ⟩v ≡ A
creflretract : forall B i -> crefl B ⟨ i ⟩c ≡ B
vreflretract (VUnit .(ctx None ⊥-elim)) i = refl
vreflretract (A × A₁) i = cong₂ _×_ (vreflretract A i) (vreflretract A₁ i)
vreflretract (U B) i = cong U (creflretract B i)
creflretract (A ⇀ B) i = cong₂ _⇀_ (vreflretract A i) (creflretract B i)
creflretract (F A) i = cong F (vreflretract A i)
-- | For a more traditional presentation of ordering
data VLt (A A' : VType (cdot _)) : Set where
lt : forall (Aord : VType onevar) -> Aord ⟨ Top ⟩v ≡ A -> Aord ⟨ Bot ⟩v ≡ A' -> VLt A A'
data CLt (B B' : CType (cdot _)) : Set where
lt : forall (Bord : CType onevar) -> Bord ⟨ Top ⟩c ≡ B -> Bord ⟨ Bot ⟩c ≡ B' -> CLt B B'
-- | Some sanity checking
vltrefl : forall A -> VLt A A
vltrefl A = lt (vrefl A) (vreflretract A Top) ((vreflretract A Bot))
vlttrans : forall A1 A2 A3 -> VLt A1 A2 -> VLt A2 A3 -> VLt A1 A3
vlttrans A1 A2 A3 (lt A12 x x₁) (lt A23 x₂ x₃) = lt (vtrans A12 A23 (trans x₁ (sym x₂))) x x₃
cltrefl : forall B -> CLt B B
cltrefl B = lt (crefl B) (creflretract B Top) ((creflretract B Bot))
clttrans : forall B1 B2 B3 -> CLt B1 B2 -> CLt B2 B3 -> CLt B1 B3
clttrans B1 B2 B3 (lt B12 x x₁) (lt B23 x₂ x₃) = lt (ctrans B12 B23 (trans x₁ (sym x₂))) x x₃
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment