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
6a74f2f2
Commit
6a74f2f2
authored
1 year ago
by
Max New
Browse files
Options
Downloads
Patches
Plain Diff
a (full?) formulation of a term model
parent
bb9a8862
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
formalizations/guarded-cubical/Semantics/Abstract/TermModel/Convenient.agda
+47
-2
47 additions, 2 deletions
...rded-cubical/Semantics/Abstract/TermModel/Convenient.agda
with
47 additions
and
2 deletions
formalizations/guarded-cubical/Semantics/Abstract/TermModel/Convenient.agda
+
47
−
2
View file @
6a74f2f2
...
...
@@ -9,29 +9,74 @@ module Semantics.Abstract.TermModel.Convenient where
open import Cubical.Foundations.Prelude
open import Cubical.Categories.Category
open import Cubical.Categories.Functor
open import Cubical.Categories.Limits.Terminal
open import Cubical.Categories.Limits.BinProduct
open import Cubical.Categories.Limits.BinCoproduct
open import Cubical.Categories.Monad.Base
open import Cubical.Categories.Exponentials
open import Cubical.Categories.Presheaf.Representable
open import Semantics.Abstract.TermModel.Strength
private
variable
ℓ ℓ' : Level
record Model {ℓ}{ℓ'} : Type (ℓ-suc (ℓ-max ℓ ℓ')) where
open Category
open Functor
open BinCoproduct
open BinProduct
record Model ℓ ℓ' ℓ'' : Type (ℓ-suc (ℓ-max ℓ (ℓ-max ℓ' ℓ''))) where
field
-- A cartesian closed category
cat : Category ℓ ℓ'
term : Terminal cat
binProd : BinProducts cat
exponentials : Exponentials cat binProd
binCoprod : BinCoproducts cat
𝟙 = term .fst
_×_ : (a b : cat .ob) → cat .ob
a × b = binProd a b .binProdOb
_+_ : (a b : cat .ob) → cat .ob
a + b = binCoprod a b .binCoprodOb
_⇒_ : (a b : cat .ob) → cat .ob
a ⇒ b = ExponentialF cat binProd exponentials ⟅ a , b ⟆
field
-- with a strong monad
monad : Monad cat
strength : Strength cat term binProd monad
T = monad .fst
-- a model of the natural numbers
_⇀_ : (a b : cat .ob) → cat .ob
a ⇀ b = a ⇒ T ⟅ b ⟆
field
-- a weak model of the natural numbers, but good enough for our syntax
nat : cat .ob
nat-fp : CatIso cat (𝟙 + nat) nat
-- now the dyn stuff
-- a model of dyn/casts
dyn : cat .ob
-- type precision
_⊑_ : (cat .ob) → (cat .ob) → Type ℓ''
isReflexive⊑ : ∀ {a} → a ⊑ a
isTransitive⊑ : ∀ {a b c} → a ⊑ b → b ⊑ c → a ⊑ c
isProp⊑ : ∀ {a b} → isProp (a ⊑ b)
-- monotonicity of type constructors
prod-is-monotone : ∀ {a a' b b'} → a ⊑ a' → b ⊑ b' → (a × b) ⊑ (a' × b')
parfun-is-monotone : ∀ {a a' b b'} → a ⊑ a' → b ⊑ b' → (a ⇀ b) ⊑ (a' ⇀ b')
inj-nat : nat ⊑ dyn
inj-arr : (dyn ⇀ dyn) ⊑ dyn
up : ∀ {a b} → a ⊑ b → cat [ a , b ]
dn : ∀ {a b} → a ⊑ b → cat [ b , T ⟅ a ⟆ ]
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