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
Tej Chajed
stdpp
Commits
4b73a5c1
Commit
4b73a5c1
authored
Nov 09, 2017
by
Robbert Krebbers
Browse files
Use `stdpp_scope` for all notations.
parent
b9ef84b4
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
theories/base.v
View file @
4b73a5c1
This diff is collapsed.
Click to expand it.
theories/fin_maps.v
View file @
4b73a5c1
...
...
@@ -92,10 +92,10 @@ Definition map_included `{∀ A, Lookup K A (M A)} {A}
(
R
:
relation
A
)
:
relation
(
M
A
)
:
=
map_relation
R
(
λ
_
,
False
)
(
λ
_
,
True
).
Definition
map_disjoint
`
{
∀
A
,
Lookup
K
A
(
M
A
)}
{
A
}
:
relation
(
M
A
)
:
=
map_relation
(
λ
_
_
,
False
)
(
λ
_
,
True
)
(
λ
_
,
True
).
Infix
"##ₘ"
:
=
map_disjoint
(
at
level
70
)
:
C
_scope
.
Infix
"##ₘ"
:
=
map_disjoint
(
at
level
70
)
:
stdpp
_scope
.
Hint
Extern
0
(
_
##
ₘ
_
)
=>
symmetry
;
eassumption
.
Notation
"( m ##ₘ.)"
:
=
(
map_disjoint
m
)
(
only
parsing
)
:
C
_scope
.
Notation
"(.##ₘ m )"
:
=
(
λ
m2
,
m2
##
ₘ
m
)
(
only
parsing
)
:
C
_scope
.
Notation
"( m ##ₘ.)"
:
=
(
map_disjoint
m
)
(
only
parsing
)
:
stdpp
_scope
.
Notation
"(.##ₘ m )"
:
=
(
λ
m2
,
m2
##
ₘ
m
)
(
only
parsing
)
:
stdpp
_scope
.
Instance
map_subseteq
`
{
∀
A
,
Lookup
K
A
(
M
A
)}
{
A
}
:
SubsetEq
(
M
A
)
:
=
map_included
(=).
...
...
theories/list.v
View file @
4b73a5c1
...
...
@@ -30,21 +30,21 @@ Arguments Permutation {_} _ _ : assert.
Arguments
Forall_cons
{
_
}
_
_
_
_
_
:
assert
.
Remove
Hints
Permutation_cons
:
typeclass_instances
.
Notation
"(::)"
:
=
cons
(
only
parsing
)
:
C
_scope
.
Notation
"( x ::)"
:
=
(
cons
x
)
(
only
parsing
)
:
C
_scope
.
Notation
"(:: l )"
:
=
(
λ
x
,
cons
x
l
)
(
only
parsing
)
:
C
_scope
.
Notation
"(++)"
:
=
app
(
only
parsing
)
:
C
_scope
.
Notation
"( l ++)"
:
=
(
app
l
)
(
only
parsing
)
:
C
_scope
.
Notation
"(++ k )"
:
=
(
λ
l
,
app
l
k
)
(
only
parsing
)
:
C
_scope
.
Infix
"≡ₚ"
:
=
Permutation
(
at
level
70
,
no
associativity
)
:
C
_scope
.
Notation
"(≡ₚ)"
:
=
Permutation
(
only
parsing
)
:
C
_scope
.
Notation
"( x ≡ₚ)"
:
=
(
Permutation
x
)
(
only
parsing
)
:
C
_scope
.
Notation
"(≡ₚ x )"
:
=
(
λ
y
,
y
≡
ₚ
x
)
(
only
parsing
)
:
C
_scope
.
Notation
"(≢ₚ)"
:
=
(
λ
x
y
,
¬
x
≡
ₚ
y
)
(
only
parsing
)
:
C
_scope
.
Notation
"x ≢ₚ y"
:
=
(
¬
x
≡
ₚ
y
)
(
at
level
70
,
no
associativity
)
:
C
_scope
.
Notation
"( x ≢ₚ)"
:
=
(
λ
y
,
x
≢ₚ
y
)
(
only
parsing
)
:
C
_scope
.
Notation
"(≢ₚ x )"
:
=
(
λ
y
,
y
≢ₚ
x
)
(
only
parsing
)
:
C
_scope
.
Notation
"(::)"
:
=
cons
(
only
parsing
)
:
stdpp
_scope
.
Notation
"( x ::)"
:
=
(
cons
x
)
(
only
parsing
)
:
stdpp
_scope
.
Notation
"(:: l )"
:
=
(
λ
x
,
cons
x
l
)
(
only
parsing
)
:
stdpp
_scope
.
Notation
"(++)"
:
=
app
(
only
parsing
)
:
stdpp
_scope
.
Notation
"( l ++)"
:
=
(
app
l
)
(
only
parsing
)
:
stdpp
_scope
.
Notation
"(++ k )"
:
=
(
λ
l
,
app
l
k
)
(
only
parsing
)
:
stdpp
_scope
.
Infix
"≡ₚ"
:
=
Permutation
(
at
level
70
,
no
associativity
)
:
stdpp
_scope
.
Notation
"(≡ₚ)"
:
=
Permutation
(
only
parsing
)
:
stdpp
_scope
.
Notation
"( x ≡ₚ)"
:
=
(
Permutation
x
)
(
only
parsing
)
:
stdpp
_scope
.
Notation
"(≡ₚ x )"
:
=
(
λ
y
,
y
≡
ₚ
x
)
(
only
parsing
)
:
stdpp
_scope
.
Notation
"(≢ₚ)"
:
=
(
λ
x
y
,
¬
x
≡
ₚ
y
)
(
only
parsing
)
:
stdpp
_scope
.
Notation
"x ≢ₚ y"
:
=
(
¬
x
≡
ₚ
y
)
(
at
level
70
,
no
associativity
)
:
stdpp
_scope
.
Notation
"( x ≢ₚ)"
:
=
(
λ
y
,
x
≢ₚ
y
)
(
only
parsing
)
:
stdpp
_scope
.
Notation
"(≢ₚ x )"
:
=
(
λ
y
,
y
≢ₚ
x
)
(
only
parsing
)
:
stdpp
_scope
.
Instance
maybe_cons
{
A
}
:
Maybe2
(@
cons
A
)
:
=
λ
l
,
match
l
with
x
::
l
=>
Some
(
x
,
l
)
|
_
=>
None
end
.
...
...
@@ -240,8 +240,8 @@ Fixpoint permutations {A} (l : list A) : list (list A) :=
The predicate [prefix] holds if the first list is a prefix of the second. *)
Definition
suffix
{
A
}
:
relation
(
list
A
)
:
=
λ
l1
l2
,
∃
k
,
l2
=
k
++
l1
.
Definition
prefix
{
A
}
:
relation
(
list
A
)
:
=
λ
l1
l2
,
∃
k
,
l2
=
l1
++
k
.
Infix
"`suffix_of`"
:
=
suffix
(
at
level
70
)
:
C
_scope
.
Infix
"`prefix_of`"
:
=
prefix
(
at
level
70
)
:
C
_scope
.
Infix
"`suffix_of`"
:
=
suffix
(
at
level
70
)
:
stdpp
_scope
.
Infix
"`prefix_of`"
:
=
prefix
(
at
level
70
)
:
stdpp
_scope
.
Hint
Extern
0
(
_
`
prefix_of
`
_
)
=>
reflexivity
.
Hint
Extern
0
(
_
`
suffix_of
`
_
)
=>
reflexivity
.
...
...
@@ -271,7 +271,7 @@ Inductive sublist {A} : relation (list A) :=
|
sublist_nil
:
sublist
[]
[]
|
sublist_skip
x
l1
l2
:
sublist
l1
l2
→
sublist
(
x
::
l1
)
(
x
::
l2
)
|
sublist_cons
x
l1
l2
:
sublist
l1
l2
→
sublist
l1
(
x
::
l2
).
Infix
"`sublist_of`"
:
=
sublist
(
at
level
70
)
:
C
_scope
.
Infix
"`sublist_of`"
:
=
sublist
(
at
level
70
)
:
stdpp
_scope
.
Hint
Extern
0
(
_
`
sublist_of
`
_
)
=>
reflexivity
.
(** A list [l2] submseteq a list [l1] if [l2] is obtained by removing elements
...
...
@@ -282,7 +282,7 @@ Inductive submseteq {A} : relation (list A) :=
|
submseteq_swap
x
y
l
:
submseteq
(
y
::
x
::
l
)
(
x
::
y
::
l
)
|
submseteq_cons
x
l1
l2
:
submseteq
l1
l2
→
submseteq
l1
(
x
::
l2
)
|
submseteq_trans
l1
l2
l3
:
submseteq
l1
l2
→
submseteq
l2
l3
→
submseteq
l1
l3
.
Infix
"⊆+"
:
=
submseteq
(
at
level
70
)
:
C
_scope
.
Infix
"⊆+"
:
=
submseteq
(
at
level
70
)
:
stdpp
_scope
.
Hint
Extern
0
(
_
⊆
+
_
)
=>
reflexivity
.
(** Removes [x] from the list [l]. The function returns a [Some] when the
...
...
theories/set.v
View file @
4b73a5c1
...
...
@@ -9,7 +9,7 @@ Add Printing Constructor set.
Arguments
mkSet
{
_
}
_
:
assert
.
Arguments
set_car
{
_
}
_
_
:
assert
.
Notation
"{[ x | P ]}"
:
=
(
mkSet
(
λ
x
,
P
))
(
at
level
1
,
format
"{[ x | P ]}"
)
:
C
_scope
.
(
at
level
1
,
format
"{[ x | P ]}"
)
:
stdpp
_scope
.
Instance
set_elem_of
{
A
}
:
ElemOf
A
(
set
A
)
:
=
λ
x
X
,
set_car
X
x
.
...
...
theories/strings.v
View file @
4b73a5c1
...
...
@@ -13,7 +13,7 @@ Notation length := List.length.
(** * Fix scopes *)
Open
Scope
string_scope
.
Open
Scope
list_scope
.
Infix
"+:+"
:
=
String
.
append
(
at
level
60
,
right
associativity
)
:
C
_scope
.
Infix
"+:+"
:
=
String
.
append
(
at
level
60
,
right
associativity
)
:
stdpp
_scope
.
Arguments
String
.
append
:
simpl
never
.
(** * Decision of equality *)
...
...
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