Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Iris
RefinedC
Commits
9819dcb6
Commit
9819dcb6
authored
Aug 16, 2021
by
Michael Sammler
Browse files
add comments
parent
ce6b1063
Pipeline
#52119
passed with stage
in 17 minutes and 22 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
theories/typing/function.v
View file @
9819dcb6
...
@@ -12,15 +12,26 @@ Arguments introduce_typed_stmt : simpl never.
...
@@ -12,15 +12,26 @@ Arguments introduce_typed_stmt : simpl never.
Section
function
.
Section
function
.
Context
`
{!
typeG
Σ
}
{
A
:
Type
}.
Context
`
{!
typeG
Σ
}
{
A
:
Type
}.
Record
fn_ret
:
=
FR
{
Record
fn_ret
:
=
FR
{
(* return type (rc::returns) *)
fr_rty
:
mtype
;
fr_rty
:
mtype
;
(* postcondition (rc::ensures) *)
fr_R
:
iProp
Σ
;
fr_R
:
iProp
Σ
;
}.
}.
Definition
mk_FR
(
rty
:
type
)
`
{!
Movable
rty
}
(
R
:
iProp
Σ
)
:
=
FR
(
t2mt
rty
)
R
.
Definition
mk_FR
(
rty
:
type
)
`
{!
Movable
rty
}
(
R
:
iProp
Σ
)
:
=
FR
(
t2mt
rty
)
R
.
(* The specification of a function is given by [A → fn_params].
The full specification roughly looks like the following:
∀ x : A, args ◁ᵥ fp_atys ∗ fp_Pa → ∃ y : fp_rtype, ret ◁ᵥ fr_rty ∗ fr_R
*)
Record
fn_params
:
=
FP
{
Record
fn_params
:
=
FP
{
(* types of arguments (rc::args) *)
fp_atys
:
list
mtype
;
fp_atys
:
list
mtype
;
(* precondition (rc::requires) *)
fp_Pa
:
iProp
Σ
;
fp_Pa
:
iProp
Σ
;
(* type of the existential quantifier (rc::exists) *)
fp_rtype
:
Type
;
fp_rtype
:
Type
;
(* return type and postcondition (rc::returns and rc::ensures) *)
fp_fr
:
fp_rtype
→
fn_ret
;
fp_fr
:
fp_rtype
→
fn_ret
;
}.
}.
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment