Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
stdpp
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
Monitor
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
Iris
stdpp
Commits
0ab4fb1e
Commit
0ab4fb1e
authored
2 years ago
by
Jan-Oliver Kaiser
Browse files
Options
Downloads
Patches
Plain Diff
Annotate telescope notations to support literal telescope arguments.
parent
4fb85912
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!375
Annotate telescope notations to support literal telescope arguments.
Pipeline
#65400
passed
2 years ago
Stage: build
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
tests/telescopes.v
+24
-0
24 additions, 0 deletions
tests/telescopes.v
theories/telescopes.v
+14
-2
14 additions, 2 deletions
theories/telescopes.v
with
38 additions
and
2 deletions
tests/telescopes.v
+
24
−
0
View file @
0ab4fb1e
...
...
@@ -52,3 +52,27 @@ Definition no_bump@{u} (t : tele@{u}) : Type@{u} := tele_arg@{u} t.
Lemma
texist_exist_universes
(
X
:
Type
)
(
P
:
TeleS
(
λ
_
:
X
,
TeleO
)
→
Prop
)
:
texist
P
↔
ex
P
.
Proof
.
by
rewrite
texist_exist
.
Qed
.
(** [tele_arg ..] notation tests.
These tests mainly test type annotations and casts in the [tele_arg]
notations.
*)
Example
tele_arg_notation_0
:
[
tele
]
.
assert_succeeds
exact
[
tele_arg
]
.
assert_succeeds
refine
[
tele_arg
]
.
Abort
.
Example
tele_arg_notation_1
:
[
tele
(_:
nat
)]
.
assert_succeeds
exact
[
tele_arg
0
]
.
assert_succeeds
refine
[
tele_arg
0
]
.
Abort
.
Example
tele_arg_notation_2
:
[
tele
(_
:
bool
)
(_
:
nat
)]
.
assert_succeeds
exact
[
tele_arg
true
;
0
]
.
assert_succeeds
refine
[
tele_arg
true
;
0
]
.
Abort
.
Example
tele_arg_notation_2_dep
:
[
tele
(
b
:
bool
)
(_
:
if
b
then
nat
else
False
)]
.
assert_succeeds
exact
[
tele_arg
true
;
0
]
.
assert_succeeds
refine
[
tele_arg
true
;
0
]
.
Abort
.
This diff is collapsed.
Click to expand it.
theories/telescopes.v
+
14
−
2
View file @
0ab4fb1e
...
...
@@ -52,8 +52,20 @@ Fixpoint tele_arg@{u} (t : tele@{u}) : Type@{u} :=
|
TeleS
f
=>
tele_arg_cons
(
λ
x
,
tele_arg
(
f
x
))
end
.
Global
Arguments
tele_arg
_
:
simpl
never
.
Notation
TargO
:=
tt
(
only
parsing
)
.
Notation
TargS
a
b
:=
(
@
TeleArgCons
_
(
λ
x
,
tele_arg
_)
a
b
)
(
only
parsing
)
.
(* Coq has no idea that [unit] and [tele_arg_cons] have anything to do with
telescopes. This only becomes a problem when concrete telescope arguments
(of concrete telescopes) need to be typechecked. To work around this, we
annotate the notations below with extra information to guide unification.
*)
(* The cast in the notation below is necessary to make Coq understand that
[TargO] can be unified with [tele_arg TeleO]. *)
Notation
TargO
:=
(
tt
:
tele_arg
TeleO
)
(
only
parsing
)
.
(* The casts and annotations are necessary for Coq to typecheck nested [TargS]
as well as the final [TargO] in a chain of [TargS]. *)
Notation
TargS
a
b
:=
((
@
TeleArgCons
_
(
λ
x
,
tele_arg
(_
x
))
a
b
)
:
(
tele_arg
(
TeleS
_)))
(
only
parsing
)
.
Coercion
tele_arg
:
tele
>->
Sortclass
.
Lemma
tele_arg_ind
(
P
:
∀
TT
,
tele_arg
TT
→
Prop
)
:
...
...
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