Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
possum
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
Model registry
Operate
Environments
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
Conor McBride
possum
Commits
a32bec69
Commit
a32bec69
authored
5 years ago
by
Conor McBride
Browse files
Options
Downloads
Patches
Plain Diff
ml71 rides again!
parent
e84d88b6
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
README.md
+5
-4
5 additions, 4 deletions
README.md
src/Ch.hs
+33
-5
33 additions, 5 deletions
src/Ch.hs
src/Pat.hs
+5
-3
5 additions, 3 deletions
src/Pat.hs
with
43 additions
and
12 deletions
README.md
+
5
−
4
View file @
a32bec69
...
...
@@ -131,14 +131,15 @@ or an output place governed by a one-subject postcondition can be replaced by
the condition itself. For (thank goodness) example:
````
type {T}
{type T] :> {t}
(e) <: [type S}
judgement
type {T}
judgement
{type T] :> {t}
judgement
(e) <: [type S}
````
The above specifies three judgement forms
(there should probably be some keyword)
.
The above specifies three judgement forms.
The first has but a subject, a term, which we are judging to be a type.
The second also judges a term, with respect to another term already required to be
a type.
The third judges a usage, yielding a term which is promised to be a type.
This diff is collapsed.
Click to expand it.
src/Ch.hs
+
33
−
5
View file @
a32bec69
...
...
@@ -212,7 +212,7 @@ judge thy ga (Ju js)
ga'
=
shlCx
ga
n
<>
((
fmap
.
stb
)
<$>
bwdPos
<*>
de
)
judge
thy
ga
(
Eq
js
)
=
case
fmap
shy
js
of
js
|
Just
(
i
,
js
)
<-
jigJ
varqq
Nothing
js
->
judge
thy
ga
(
Ju
js
)
->
if
null
[
()
|
O
_
<-
js
]
then
return
[]
else
judge
thy
ga
(
Ju
js
)
|
Just
(
_
,
js
)
<-
jigJ
eliqq
Nothing
js
->
ju
js
|
otherwise
...
...
@@ -303,7 +303,7 @@ ml71 = Theory
{
typingRules
=
[
[
B0
:-
PJu
[
S
(
Sj
(
Syy
:?:
"e"
)),
X
"<:"
,
O
(
Chy
:<:
pA
TY
)]
]
:-----:
[
X
"type"
,
S
(
Chy
:<:
p
Y
"e"
)]
[
X
"type"
,
S
(
Chy
:<:
p
E
"e"
)]
,
[
]
:-----:
...
...
@@ -317,7 +317,7 @@ ml71 = Theory
,
[
B0
:-
PJu
[
S
(
Sj
(
Syy
:?:
"e"
)),
X
"<:"
,
O
(
Chy
:<:
pH
"S"
)]
,
B0
:-
PEq
[
X
"type"
,
S
(
Chy
:>=:
((
Chy
:?:
"S"
)
%-
[]
,
(
Chy
:?:
"T"
)
%-
[]
))]
]
:-----:
[
I
(
Chy
:<:
pH
"T"
),
X
":>"
,
S
(
Chy
:<:
p
Y
"e"
)]
[
I
(
Chy
:<:
pH
"T"
),
X
":>"
,
S
(
Chy
:<:
p
E
"e"
)]
,
[
B0
:-
PJu
[
X
"type"
,
S
(
Sj
(
Chy
:?:
"T"
))]
]
:-----:
...
...
@@ -328,15 +328,29 @@ ml71 = Theory
]
:-----:
[
I
(
Chy
:<:
(
PI
?-
[
pH
"S"
,
pS
(
pH
"T"
)])),
X
":>"
,
S
(
Chy
:<:
pS
(
pH
"t"
))]
,
[
B0
:-
PJu
[
S
(
Sj
(
Syy
:?:
"e"
)),
X
"<:"
,
O
(
Chy
:<:
(
PI
?-
[
pH
"S"
,
pS
(
pH
"T"
)]))]
,
B0
:-
PJu
[
I
(
Chy
:>:
((
Chy
:?:
"S"
)
%-
[]
)),
X
":>"
,
S
(
Sj
(
Chy
:?:
"s"
))]
]
:-----:
[
S
(
Syy
:<:
pE
"e"
),
S
(
Chy
:<:
pH
"s"
)
,
X
"<:"
,
O
(
Chy
:>:
((
Chy
:?:
"T"
)
%-
[((
Chy
:?:
"s"
)
%-
[]
)
<:>
((
Chy
:?:
"s"
)
%-
[]
)]))
]
,
[
B0
:-
PJu
[
X
"type"
,
S
(
Sj
(
Chy
:?:
"T"
))]
,
B0
:-
PJu
[
I
(
Chy
:>:
((
Chy
:?:
"T"
)
%-
[]
)),
X
":>"
,
S
(
Sj
(
Chy
:?:
"t"
))]
]
:-----:
[
S
(
Chy
:<:
pH
"t"
),
X
":"
,
S
(
Chy
:<:
pH
"T"
),
X
"<:"
,
O
(
Chy
:>:
((
Chy
:?:
"T"
)
%-
[]
))]
]
,
betaRules
=
[
[(
PI
?-
[
pH
"S"
,
pS
(
pH
"T"
)])
:~>
pS
(
pH
"t"
)
:~>
pH
"s"
:~>
let
sS
=
((
Chy
:?:
"s"
)
%-
[]
)
<:>
((
Chy
:?:
"S"
)
%-
[]
)
in
((
Chy
:?:
"t"
)
%-
[
sS
],
(
Chy
:?:
"T"
)
%-
[
sS
])
]
}
tests
::
[
Maybe
(
Env
(
TmT
NoMeta
))]
tests
=
map
(
judge
ml71
B0
.
Ju
)
[
[
X
"type"
,
S
(
Chy
:>:
(
PI
$-
[
tA
TY
,
tS
(
tA
TY
)]))]
[
{-
[X "type", S (Chy :>: (PI $- [tA TY, tS (tA TY)]))]
, [X "type", S (Chy :>: (PI $- [tA TY, tS (PI $- [tV 0, tS (tV 1)])]))]
, [I (Chy :>: tA TY), X ":>", S (Chy :>: tA TY)]
, [I (Chy :>: (PI $- [tA TY, tS (tA TY)])), X ":>", S (Chy :>: tS (tA TY))]
...
...
@@ -345,6 +359,20 @@ tests = map (judge ml71 B0 . Ju)
, X ":>"
, S (Chy :>: tS (tS (tV 0)))
]
, [I (Chy :>: (PI $- [tA TY, tS
(PI $- [PI $- [tV 0, tS (tV 1)], tS
(PI $- [tV 1, tS
(tV 2)])])]))
, X ":>"
, S (Chy :>: tS (tS (tS (tV 1 -$ (tV 1 -$ tV 0)))))
]
, [ S (Syy :>: (tS (tS (tV 0)) <:> (PI $- [tA TY, tS (PI $- [tV 0, tS (tV 1)])])))
, X "<:", O (Chy :<: pH "X")
]
,-}
[
I
(
Chy
:>:
((
tS
(
tV
0
)
<:>
PI
$-
[
tA
TY
,
tS
(
tA
TY
)])
-$
tA
TY
)),
X
":>"
,
S
(
Chy
:>:
tA
TY
)
]
]
{-
...
...
This diff is collapsed.
Click to expand it.
src/Pat.hs
+
5
−
3
View file @
a32bec69
{-# LANGUAGE GADTs, DataKinds, PolyKinds, KindSignatures, RankNTypes #-}
{-# LANGUAGE GADTs, DataKinds, PolyKinds, KindSignatures, RankNTypes
, ScopedTypeVariables
#-}
module
Pat
where
...
...
@@ -65,8 +65,10 @@ An open Cod Pat has a negative thinning.
pH
::
String
->
PaV
Ch
pH
y
=
PM
(
Chy
:?:
y
)
:^
idth
pY
::
String
->
PaV
Ch
pY
y
=
PE
(
PM
(
Syy
:?:
y
))
:^
idth
pE
::
forall
d
.
DIRY
d
=>
String
->
PaV
d
pE
y
=
case
(
diry
::
Diry
d
)
of
Syy
->
PM
(
Syy
:?:
y
)
:^
idth
Chy
->
PE
(
PM
(
Syy
:?:
y
))
:^
idth
pA
::
Atom
->
Cod
(
Pat
m
Ch
)
pA
a
=
PA
a
:^
0
...
...
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