Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
lambda-rust
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Service Desk
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
Iris
lambda-rust
Commits
018e8b64
There was a problem fetching the pipeline summary.
Commit
018e8b64
authored
8 years ago
by
Jacques-Henri Jourdan
Browse files
Options
Downloads
Patches
Plain Diff
Some tricks.
parent
07c7a553
No related branches found
No related tags found
No related merge requests found
Pipeline
#
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
theories/typing/product.v
+21
-3
21 additions, 3 deletions
theories/typing/product.v
theories/typing/uninit.v
+8
-6
8 additions, 6 deletions
theories/typing/uninit.v
with
29 additions
and
9 deletions
theories/typing/product.v
+
21
−
3
View file @
018e8b64
...
...
@@ -118,9 +118,17 @@ Section product.
Qed
.
Definition
product
:=
foldr
product2
unit
.
(* Given that in practice, product will be used with concrete lists,
there should be no need to declare [Copy] and [Proper] instances
for [product]. *)
Global
Instance
product_mono
E
L
:
Proper
(
Forall2
(
subtype
E
L
)
==>
subtype
E
L
)
product
.
Proof
.
intros
??
.
induction
1
.
done
.
by
simpl
;
f_equiv
.
Qed
.
Global
Instance
product_proper
E
L
:
Proper
(
Forall2
(
eqtype
E
L
)
==>
eqtype
E
L
)
product
.
Proof
.
intros
??
.
induction
1
.
done
.
by
simpl
;
f_equiv
.
Qed
.
(* FIXME : this instance is never going to be used, because Forall is
not a typeclass. *)
Global
Instance
product_copy
tys
:
Forall
Copy
tys
→
Copy
(
product
tys
)
.
Proof
.
induction
1
;
apply
_
.
Qed
.
End
product
.
Arguments
product
:
simpl
never
.
...
...
@@ -174,4 +182,14 @@ Section typing.
unfold
product
.
induction
tyl1
;
simpl
;
last
by
f_equiv
.
induction
tyl2
.
by
rewrite
left_id
.
by
rewrite
/=
-
assoc
;
f_equiv
.
Qed
.
Lemma
eqtype_prod_nil_flatten
E
L
tyl1
tyl2
:
eqtype
E
L
(
Π
(
Π
tyl1
::
tyl2
))
(
Π
(
tyl1
++
tyl2
))
.
Proof
.
apply
(
eqtype_prod_flatten
_
_
[])
.
Qed
.
Lemma
eqtype_prod_flatten_nil
E
L
tyl1
tyl2
:
eqtype
E
L
(
Π
(
tyl1
++
[
Π
tyl2
]))
(
Π
(
tyl1
++
tyl2
))
.
Proof
.
by
rewrite
(
eqtype_prod_flatten
E
L
tyl1
tyl2
[])
app_nil_r
.
Qed
.
Lemma
eqtype_prod_app
E
L
tyl1
tyl2
:
eqtype
E
L
(
Π
[
Π
tyl1
;
Π
tyl2
])
(
Π
(
tyl1
++
tyl2
))
.
Proof
.
by
rewrite
-
eqtype_prod_flatten_nil
-
eqtype_prod_nil_flatten
.
Qed
.
End
typing
.
This diff is collapsed.
Click to expand it.
theories/typing/uninit.v
+
8
−
6
View file @
018e8b64
...
...
@@ -11,14 +11,16 @@ Section uninit.
Definition
uninit
(
n
:
nat
)
:
type
:=
Π
(
replicate
n
uninit_1
)
.
Global
Instance
uninit_copy
n
:
Copy
(
uninit
n
)
.
Proof
.
apply
product_copy
,
Forall_replicate
,
_
.
Qed
.
Lemma
uninit_sz
n
:
ty_size
(
uninit
n
)
=
n
.
Proof
.
induction
n
.
done
.
simpl
.
by
f_equal
.
Qed
.
Lemma
eqtype_uninit_product
E
L
ns
:
eqtype
E
L
(
uninit
(
foldr
plus
0
%
nat
ns
))
(
Π
(
uninit
<$>
ns
))
.
Proof
.
induction
ns
as
[|
n
ns
IH
]
.
done
.
rewrite
/=
/
uninit
replicate_plus
(
eqtype_prod_flatten
E
L
[])
.
induction
n
.
done
.
rewrite
/
product
/=.
by
f_equiv
.
induction
ns
as
[|
n
ns
IH
]
.
done
.
revert
IH
.
by
rewrite
/=
/
uninit
replicate_plus
eqtype_prod_nil_flatten
-!
eqtype_prod_app
=>
->
.
Qed
.
Lemma
uninit_sz
n
:
ty_size
(
uninit
n
)
=
n
.
Proof
.
induction
n
.
done
.
simpl
.
by
f_equal
.
Qed
.
End
uninit
.
\ No newline at end of file
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