Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
personoj
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
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
koizel
personoj
Commits
2460fef3
Commit
2460fef3
authored
4 years ago
by
gabrielhdt
Browse files
Options
Downloads
Patches
Plain Diff
Correction: eqcast must operate on top types
Plus proof irrelevance for other casts
parent
3b6102fc
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
encodings/subtype_poly.lp
+11
-5
11 additions, 5 deletions
encodings/subtype_poly.lp
with
11 additions
and
5 deletions
encodings/subtype_poly.lp
+
11
−
5
View file @
2460fef3
...
...
@@ -22,10 +22,12 @@ with μ (μ $T) ↪ μ $T // FIXME: can be proved
symbol π (T: Set): η (μ T) → Bool
// Casting from/to maximal supertype
constant
symbol maxcast {t: Set}: η t → η (μ t)
constant
symbol downcast {t: Set} (x: η (μ t)): ε (π t x) → η t
symbol maxcast {t: Set}: η t → η (μ t)
symbol downcast {t: Set} (x: η (μ t)): ε (π t x) → η t
definition ↑ {t} ≔ maxcast {t}
definition ↓ {t} ≔ downcast {t}
symbol _downcast {t: Set}: η (μ t) → η t
rule downcast {$t} $x _ ↪ _downcast {$t} $x
rule π ($t ~> $u) ↪ λx: η $t → η (μ $u), ∀ (λy, π $u (x y))
with π (tuple_t $t $u)
...
...
@@ -33,9 +35,9 @@ with π (tuple_t $t $u)
with π (psub {$t} $a)
↪ λx: η (μ $t), (π $t x) ∧ (λy: ε (π $t x), $a (↓ x y))
with π (arrd $b)
↪ λx: η (arrd (λx, μ ($b x))), ∀ (λy, π
(μ
($b y)
)
(x y))
↪ λx: η (arrd (λx, μ ($b x))), ∀ (λy, π ($b y) (x y))
/// A term ‘x’ that has been cast up still v
erifi
es the properties to be of its
/// A term ‘x’ that has been cast up still v
alidat
es the properties to be of its
/// former type.
symbol cstr_maxcast_idem: ε (∀B (λt, ∀ {t} (λx, π t (maxcast x))))
// or as a rewrite-rule:
...
...
@@ -44,7 +46,11 @@ symbol cstr_maxcast_idem: ε (∀B (λt, ∀ {t} (λx, π t (maxcast x))))
private constant symbol max_eq: Set → Set → Bool
set infix 6 "≃" ≔ max_eq
symbol eqcast {fr: Set} {to: Set}: ε (fr ≃ to) → η fr → η to
// fr and to must be supertypes
symbol eqcast {fr: Set} {to: Set}: ε (fr ≃ to) → η (μ fr) → η (μ to)
protected symbol _eqcast {fr: Set} {to: Set}: η (μ fr) → η (μ to)
rule eqcast {$fr} {$to} _ $e ↪ _eqcast {$fr} {$to} $e
rule _eqcast {$t} {$t} $e ↪ $e
definition compatible (t u: Set) ≔ μ t ≃ μ u
set infix 6 "~" ≔ compatible
...
...
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