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
65a0b1c7
Commit
65a0b1c7
authored
6 years ago
by
Max New
Browse files
Options
Downloads
Patches
Plain Diff
[agda] start implementing renaming
parent
877c0bfc
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
+31
-3
31 additions, 3 deletions
code/gcbpv.agda
with
31 additions
and
3 deletions
code/gcbpv.agda
+
31
−
3
View file @
65a0b1c7
...
...
@@ -148,12 +148,27 @@ _⟪_⟫v : VCtx onevar -> Dimension -> VCtx (cdot _)
Vars (Γ ⟪ i ⟫v) = Vars Γ
vty (Γ ⟪ i ⟫v) = map (\A -> A ⟨ i ⟩v) (vty Γ)
-- ctx-app-lem : ∀ Γ i -> Γ ⟪ i ⟫v
vctxrefl : VCtx (cdot _) -> VCtx onevar
Vars (vctxrefl Γ) = Vars Γ
vty (vctxrefl Γ) = map vrefl (vty Γ)
record Var {I} (Γ : VCtx I) (A : VType I) : Set where
constructor mkVar
field
name : Fin (Vars Γ)
types : A ≡ lookup name (vty Γ)
-- | Based on Allais-Chapman-McBride-McKenna "Type-and-Scope Safe Programs and Their Proofs"
VModel : Set₁
VModel = forall {I} -> VCtx I -> VType I -> Set
record VEnv {I} (V : VModel) (Γ : VCtx I) (Γ' : VCtx I) : Set
where constructor pack
field env-lookup : forall A -> Var Γ' A -> V Γ A
open VEnv
Renaming : forall {I} -> VCtx I -> VCtx I -> Set
Renaming = VEnv Var
record VCtxTC : Set where
field
Vars : ℕ
...
...
@@ -201,6 +216,7 @@ cctxrefl (stctx None ty) = stctx None tt
cctxrefl (stctx One ty) = stctx One (crefl ty)
data Value : forall {I} -> VCtx I -> VType I -> Set
renV : forall {I} {Γ : VCtx I} {Γ'}{A} -> Renaming Γ Γ' -> Value Γ' A -> Value Γ A
_⟨_⟩vv : forall {Γ : VCtx onevar} {A} ->
Value Γ A ->
(i : Dimension) ->
...
...
@@ -211,6 +227,7 @@ _⟨_⟩cc : forall {Γ : VCtx onevar}{Δ}{B} ->
Term Γ Δ B ->
(i : Dimension) ->
Term (Γ ⟪ i ⟫v) (Δ ⟪ i ⟫c) (B ⟨ i ⟩c)
renC : forall {I} {Γ : VCtx I}{Δ}{Γ'}{A} -> Renaming Γ Γ' -> Term Γ' Δ A -> Term Γ Δ A
record ValTC where
inductive
...
...
@@ -245,6 +262,17 @@ data Value where
Aord ->
Value (vcdot _ ,, Aord) (vrefl (Aord ⟨ GT ⟩v))
renV ρ (var Γ x A p) with env-lookup ρ A (mkVar x p)
... | y = var _ (Var.name y) _ (Var.types y)
renV ρ (vunit Γ) = vunit _
renV ρ (vpair V V') = vpair (renV ρ V) (renV ρ V')
renV ρ (vdestr V V₁) = {!!}
renV ρ (vthunk M) = vthunk (renC ρ M)
renV ρ (valtrans sq) = {!!}
renV ρ (vupcast Aord V) = {!!}
renV ρ (vupl Aord) = {!!}
renV ρ (vupr Aord) = {!!}
var Γ x A p ⟨ i ⟩vv = var (Γ ⟪ i ⟫v) x (A ⟨ i ⟩v)
(begin
A ⟨ i ⟩v
...
...
@@ -283,7 +311,7 @@ data Term where
Term Γ Δ (F A) ->
Term Γ (cdot _) B ->
Term Γ Δ B
renC ρ M = {!!}
hole ⟨ i ⟩cc = hole
lambda M ⟨ i ⟩cc = lambda (M ⟨ i ⟩cc)
app M V ⟨ i ⟩cc = app (M ⟨ i ⟩cc) (V ⟨ i ⟩vv)
...
...
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