Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
stdpp
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
36
Issues
36
List
Boards
Labels
Milestones
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Iris
stdpp
Commits
dcff8ded
Commit
dcff8ded
authored
Nov 16, 2015
by
Robbert Krebbers
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use qualified module names and coqc Q instead of R.
parent
11790649
Changes
32
Hide whitespace changes
Inline
Sidebyside
Showing
32 changed files
with
54 additions
and
54 deletions
+54
54
theories/assoc.v
theories/assoc.v
+2
2
theories/collections.v
theories/collections.v
+1
1
theories/countable.v
theories/countable.v
+1
1
theories/decidable.v
theories/decidable.v
+1
1
theories/error.v
theories/error.v
+1
1
theories/fin_collections.v
theories/fin_collections.v
+2
2
theories/fin_map_dom.v
theories/fin_map_dom.v
+1
1
theories/fin_maps.v
theories/fin_maps.v
+1
1
theories/finite.v
theories/finite.v
+1
1
theories/hashset.v
theories/hashset.v
+2
2
theories/lexico.v
theories/lexico.v
+1
1
theories/list.v
theories/list.v
+1
1
theories/listset.v
theories/listset.v
+1
1
theories/listset_nodup.v
theories/listset_nodup.v
+1
1
theories/mapset.v
theories/mapset.v
+1
1
theories/natmap.v
theories/natmap.v
+1
1
theories/nmap.v
theories/nmap.v
+2
2
theories/numbers.v
theories/numbers.v
+1
1
theories/option.v
theories/option.v
+1
1
theories/optionmap.v
theories/optionmap.v
+2
2
theories/orders.v
theories/orders.v
+1
1
theories/pmap.v
theories/pmap.v
+2
2
theories/prelude.v
theories/prelude.v
+13
13
theories/pretty.v
theories/pretty.v
+2
2
theories/proof_irrel.v
theories/proof_irrel.v
+1
1
theories/relations.v
theories/relations.v
+1
1
theories/sets.v
theories/sets.v
+2
2
theories/streams.v
theories/streams.v
+1
1
theories/stringmap.v
theories/stringmap.v
+2
2
theories/tactics.v
theories/tactics.v
+1
1
theories/vector.v
theories/vector.v
+1
1
theories/zmap.v
theories/zmap.v
+2
2
No files found.
theories/assoc.v
View file @
dcff8ded
...
...
@@ 6,8 +6,8 @@ main advantage of these association lists compared to search trees, is that it
has canonical representatives and thus extensional Leibniz equality. Compared
to a naive unordered association list, the merge operation (used for unions,
intersections, and difference) is also lineartime. *)
Require
Import
mapset
.
Require
Export
fin_maps
.
Require
Import
prelude
.
mapset
.
Require
Export
prelude
.
fin_maps
.
(** Because the association list is sorted using [strict lexico] instead of
[lexico], it automatically guarantees that no duplicates exist. *)
...
...
theories/collections.v
View file @
dcff8ded
...
...
@@ 3,7 +3,7 @@
(** This file collects definitions and theorems on collections. Most
importantly, it implements some tactics to automatically solve goals involving
collections. *)
Require
Export
base
tactics
orders
.
Require
Export
prelude
.
base
prelude
.
tactics
prelude
.
orders
.
Instance
collection_subseteq
`
{
ElemOf
A
C
}
:
SubsetEq
C
:
=
λ
X
Y
,
∀
x
,
x
∈
X
→
x
∈
Y
.
...
...
theories/countable.v
View file @
dcff8ded
(* Copyright (c) 20122015, Robbert Krebbers. *)
(* This file is distributed under the terms of the BSD license. *)
Require
Export
list
.
Require
Export
prelude
.
list
.
Local
Obligation
Tactic
:
=
idtac
.
Local
Open
Scope
positive
.
...
...
theories/decidable.v
View file @
dcff8ded
...
...
@@ 3,7 +3,7 @@
(** This file collects theorems, definitions, tactics, related to propositions
with a decidable equality. Such propositions are collected by the [Decision]
type class. *)
Require
Export
proof_irrel
.
Require
Export
pr
elude
.
pr
oof_irrel
.
Hint
Extern
200
(
Decision
_
)
=>
progress
(
lazy
beta
)
:
typeclass_instances
.
...
...
theories/error.v
View file @
dcff8ded
(* Copyright (c) 20122015, Robbert Krebbers. *)
(* This file is distributed under the terms of the BSD license. *)
Require
Export
list
.
Require
Export
prelude
.
list
.
Definition
error
(
S
E
A
:
Type
)
:
Type
:
=
S
→
E
+
(
A
*
S
).
...
...
theories/fin_collections.v
View file @
dcff8ded
...
...
@@ 3,8 +3,8 @@
(** This file collects definitions and theorems on finite collections. Most
importantly, it implements a fold and size function and some useful induction
principles on finite collections . *)
Require
Import
Permutation
relations
listset
.
Require
Export
numbers
collections
.
Require
Import
Permutation
prelude
.
relations
prelude
.
listset
.
Require
Export
prelude
.
numbers
prelude
.
collections
.
Instance
collection_size
`
{
Elements
A
C
}
:
Size
C
:
=
length
∘
elements
.
Definition
collection_fold
`
{
Elements
A
C
}
{
B
}
...
...
theories/fin_map_dom.v
View file @
dcff8ded
...
...
@@ 3,7 +3,7 @@
(** This file provides an axiomatization of the domain function of finite
maps. We provide such an axiomatization, instead of implementing the domain
function in a generic way, to allow more efficient implementations. *)
Require
Export
collections
fin_maps
.
Require
Export
prelude
.
collections
prelude
.
fin_maps
.
Class
FinMapDom
K
M
D
`
{
FMap
M
,
∀
A
,
Lookup
K
A
(
M
A
),
∀
A
,
Empty
(
M
A
),
∀
A
,
PartialAlter
K
A
(
M
A
),
...
...
theories/fin_maps.v
View file @
dcff8ded
...
...
@@ 5,7 +5,7 @@ finite maps and collects some theory on it. Most importantly, it proves useful
induction principles for finite maps and implements the tactic
[simplify_map_equality] to simplify goals involving finite maps. *)
Require
Import
Permutation
.
Require
Export
relations
vector
orders
.
Require
Export
prelude
.
relations
prelude
.
vector
prelude
.
orders
.
(** * Axiomatization of finite maps *)
(** We require Leibniz equality to be extensional on finite maps. This of
...
...
theories/finite.v
View file @
dcff8ded
(* Copyright (c) 20122015, Robbert Krebbers. *)
(* This file is distributed under the terms of the BSD license. *)
Require
Export
countable
list
.
Require
Export
prelude
.
countable
prelude
.
list
.
Obligation
Tactic
:
=
idtac
.
Class
Finite
A
`
{
∀
x
y
:
A
,
Decision
(
x
=
y
)}
:
=
{
...
...
theories/hashset.v
View file @
dcff8ded
...
...
@@ 3,8 +3,8 @@
(** This file implements finite set using hash maps. Hash sets are represented
using radix2 search trees. Each hash bucket is thus indexed using an binary
integer of type [Z], and contains an unordered list without duplicates. *)
Require
Export
fin_maps
listset
.
Require
Import
zmap
.
Require
Export
prelude
.
fin_maps
prelude
.
listset
.
Require
Import
prelude
.
zmap
.
Record
hashset
{
A
}
(
hash
:
A
→
Z
)
:
=
Hashset
{
hashset_car
:
Zmap
(
list
A
)
;
...
...
theories/lexico.v
View file @
dcff8ded
...
...
@@ 2,7 +2,7 @@
(* This file is distributed under the terms of the BSD license. *)
(** This files defines a lexicographic order on various common data structures
and proves that it is a partial order having a strong variant of trichotomy. *)
Require
Import
numbers
.
Require
Import
prelude
.
numbers
.
Notation
cast_trichotomy
T
:
=
match
T
with
...
...
theories/list.v
View file @
dcff8ded
...
...
@@ 3,7 +3,7 @@
(** This file collects general purpose definitions and theorems on lists that
are not in the Coq standard library. *)
Require
Export
Permutation
.
Require
Export
numbers
base
decidable
option
.
Require
Export
prelude
.
numbers
prelude
.
base
prelude
.
decidable
prelude
.
option
.
Arguments
length
{
_
}
_
.
Arguments
cons
{
_
}
_
_
.
...
...
theories/listset.v
View file @
dcff8ded
...
...
@@ 2,7 +2,7 @@
(* This file is distributed under the terms of the BSD license. *)
(** This file implements finite set as unordered lists without duplicates
removed. This implementation forms a monad. *)
Require
Export
base
decidable
collections
list
.
Require
Export
prelude
.
base
prelude
.
decidable
prelude
.
collections
prelude
.
list
.
Record
listset
A
:
=
Listset
{
listset_car
:
list
A
}.
Arguments
listset_car
{
_
}
_
.
...
...
theories/listset_nodup.v
View file @
dcff8ded
...
...
@@ 3,7 +3,7 @@
(** This file implements finite as unordered lists without duplicates.
Although this implementation is slow, it is very useful as decidable equality
is the only constraint on the carrier set. *)
Require
Export
base
decidable
collections
list
.
Require
Export
prelude
.
base
prelude
.
decidable
prelude
.
collections
prelude
.
list
.
Record
listset_nodup
A
:
=
ListsetNoDup
{
listset_nodup_car
:
list
A
;
listset_nodup_prf
:
NoDup
listset_nodup_car
...
...
theories/mapset.v
View file @
dcff8ded
...
...
@@ 3,7 +3,7 @@
(** This files gives an implementation of finite sets using finite maps with
elements of the unit type. Since maps enjoy extensional equality, the
constructed finite sets do so as well. *)
Require
Export
fin_map_dom
.
Require
Export
prelude
.
fin_map_dom
.
Record
mapset
(
M
:
Type
→
Type
)
:
Type
:
=
Mapset
{
mapset_car
:
M
(
unit
:
Type
)
}.
...
...
theories/natmap.v
View file @
dcff8ded
...
...
@@ 3,7 +3,7 @@
(** This files implements a type [natmap A] of finite maps whose keys range
over Coq's data type of unary natural numbers [nat]. The implementation equips
a list with a proof of canonicity. *)
Require
Import
fin_maps
mapset
.
Require
Import
prelude
.
fin_maps
prelude
.
mapset
.
Notation
natmap_raw
A
:
=
(
list
(
option
A
)).
Definition
natmap_wf
{
A
}
(
l
:
natmap_raw
A
)
:
=
...
...
theories/nmap.v
View file @
dcff8ded
...
...
@@ 2,8 +2,8 @@
(* This file is distributed under the terms of the BSD license. *)
(** This files extends the implementation of finite over [positive] to finite
maps whose keys range over Coq's data type of binary naturals [N]. *)
Require
Import
p
map
mapset
.
Require
Export
prelude
fin_maps
.
Require
Import
p
relude
.
pmap
prelude
.
mapset
.
Require
Export
prelude
.
prelude
prelude
.
fin_maps
.
Local
Open
Scope
N_scope
.
...
...
theories/numbers.v
View file @
dcff8ded
...
...
@@ 5,7 +5,7 @@ natural numbers, and the type [Z] for integers. It also declares some useful
notations. *)
Require
Export
Eqdep
PArith
NArith
ZArith
NPeano
.
Require
Import
QArith
Qcanon
.
Require
Export
base
decidable
.
Require
Export
prelude
.
base
prelude
.
decidable
.
Open
Scope
nat_scope
.
Coercion
Z
.
of_nat
:
nat
>>
Z
.
...
...
theories/option.v
View file @
dcff8ded
...
...
@@ 2,7 +2,7 @@
(* This file is distributed under the terms of the BSD license. *)
(** This file collects general purpose definitions and theorems on the option
data type that are not in the Coq standard library. *)
Require
Export
base
tactics
decidable
.
Require
Export
prelude
.
base
prelude
.
tactics
prelude
.
decidable
.
Inductive
option_reflect
{
A
}
(
P
:
A
→
Prop
)
(
Q
:
Prop
)
:
option
A
→
Type
:
=

ReflectSome
x
:
P
x
→
option_reflect
P
Q
(
Some
x
)
...
...
theories/optionmap.v
View file @
dcff8ded
(* Copyright (c) 20122015, Robbert Krebbers. *)
(* This file is distributed under the terms of the BSD license. *)
Require
Import
mapset
.
Require
Export
prelude
fin_maps
.
Require
Import
prelude
.
mapset
.
Require
Export
prelude
.
prelude
prelude
.
fin_maps
.
Record
optionmap
(
M
:
Type
→
Type
)
(
A
:
Type
)
:
Type
:
=
OptionMap
{
optionmap_None
:
option
A
;
optionmap_Some
:
M
A
}.
...
...
theories/orders.v
View file @
dcff8ded
...
...
@@ 3,7 +3,7 @@
(** This file collects common properties of preorders and semi lattices. This
theory will mainly be used for the theory on collections and finite maps. *)
Require
Export
Sorted
.
Require
Export
base
decidable
tactics
list
.
Require
Export
prelude
.
base
prelude
.
decidable
prelude
.
tactics
prelude
.
list
.
(** * Arbitrary pre, parial and total orders *)
(** Properties about arbitrary pre, partial, and total orders. We do not use
...
...
theories/pmap.v
View file @
dcff8ded
...
...
@@ 7,8 +7,8 @@ trees (uncompressed Patricia trees) and guarantees logarithmictime operations.
However, we extend Leroy's implementation by packing the trees into a Sigma
type such that canonicity of representation is ensured. This is necesarry for
Leibniz equality to become extensional. *)
Require
Import
PArith
mapset
.
Require
Export
fin_maps
.
Require
Import
PArith
prelude
.
mapset
.
Require
Export
prelude
.
fin_maps
.
Local
Open
Scope
positive_scope
.
Local
Hint
Extern
0
(@
eq
positive
_
_
)
=>
congruence
.
...
...
theories/prelude.v
View file @
dcff8ded
(* Copyright (c) 20122015, Robbert Krebbers. *)
(* This file is distributed under the terms of the BSD license. *)
Require
Export
base
tactics
decidable
orders
option
vector
numbers
relations
collections
fin_collections
listset
list
lexico
.
prelude
.
base
prelude
.
tactics
prelude
.
decidable
prelude
.
orders
prelude
.
option
prelude
.
vector
prelude
.
numbers
prelude
.
relations
prelude
.
collections
prelude
.
fin_collections
prelude
.
listset
prelude
.
list
prelude
.
lexico
.
theories/pretty.v
View file @
dcff8ded
(* Copyright (c) 20122015, Robbert Krebbers. *)
(* This file is distributed under the terms of the BSD license. *)
Require
Export
numbers
option
.
Require
Import
Ascii
String
relations
.
Require
Export
prelude
.
numbers
prelude
.
option
.
Require
Import
Ascii
String
prelude
.
relations
.
Infix
"+:+"
:
=
String
.
append
(
at
level
60
,
right
associativity
)
:
C_scope
.
Arguments
String
.
append
_
_
:
simpl
never
.
...
...
theories/proof_irrel.v
View file @
dcff8ded
(* Copyright (c) 20122015, Robbert Krebbers. *)
(* This file is distributed under the terms of the BSD license. *)
(** This file collects facts on proof irrelevant types/propositions. *)
Require
Export
Eqdep_dec
tactics
.
Require
Export
Eqdep_dec
prelude
.
tactics
.
Hint
Extern
200
(
ProofIrrel
_
)
=>
progress
(
lazy
beta
)
:
typeclass_instances
.
...
...
theories/relations.v
View file @
dcff8ded
...
...
@@ 5,7 +5,7 @@ These are particularly useful as we define the operational semantics as a
small step semantics. This file defines a hint database [ars] containing
some theorems on abstract rewriting systems. *)
Require
Import
Wf_nat
.
Require
Export
tactics
base
.
Require
Export
prelude
.
tactics
prelude
.
base
.
(** * Definitions *)
Section
definitions
.
...
...
theories/sets.v
View file @
dcff8ded
(* Copyright (c) 20122015, Robbert Krebbers. *)
(* This file is distributed under the terms of the BSD license. *)
(** This file implements sets as functions into Prop. *)
Require
Export
prelude
.
Require
Export
prelude
.
prelude
.
Record
set
(
A
:
Type
)
:
Type
:
=
mkSet
{
set_car
:
A
→
Prop
}.
Arguments
mkSet
{
_
}
_
.
...
...
@@ 28,4 +28,4 @@ Instance set_join : MJoin set := λ A (XX : set (set A)),
Instance
set_collection_monad
:
CollectionMonad
set
.
Proof
.
by
split
;
try
apply
_
.
Qed
.
Global
Opaque
set_union
set_intersection
.
\ No newline at end of file
Global
Opaque
set_union
set_intersection
.
theories/streams.v
View file @
dcff8ded
(* Copyright (c) 20122015, Robbert Krebbers. *)
(* This file is distributed under the terms of the BSD license. *)
Require
Export
tactics
.
Require
Export
prelude
.
tactics
.
CoInductive
stream
(
A
:
Type
)
:
Type
:
=
scons
:
A
→
stream
A
→
stream
A
.
Arguments
scons
{
_
}
_
_
.
...
...
theories/stringmap.v
View file @
dcff8ded
...
...
@@ 4,8 +4,8 @@
range over Coq's data type of strings [string]. The implementation uses radix2
search trees (uncompressed Patricia trees) as implemented in the file [pmap]
and guarantees logarithmictime operations. *)
Require
Export
fin_maps
pretty
.
Require
Import
Ascii
String
list
pmap
mapset
.
Require
Export
prelude
.
fin_maps
prelude
.
pretty
.
Require
Import
Ascii
String
prelude
.
list
prelude
.
pmap
prelude
.
mapset
.
(** * Encoding and decoding *)
(** In order to reuse or existing implementation of radix2 search trees over
...
...
theories/tactics.v
View file @
dcff8ded
...
...
@@ 3,7 +3,7 @@
(** This file collects general purpose tactics that are used throughout
the development. *)
Require
Export
Psatz
.
Require
Export
base
.
Require
Export
prelude
.
base
.
Lemma
f_equal_dep
{
A
B
}
(
f
g
:
∀
x
:
A
,
B
x
)
x
:
f
=
g
→
f
x
=
g
x
.
Proof
.
intros
>
;
reflexivity
.
Qed
.
...
...
theories/vector.v
View file @
dcff8ded
...
...
@@ 5,7 +5,7 @@
definitions from the standard library, but renames or changes their notations,
so that it becomes more consistent with the naming conventions in this
development. *)
Require
Import
list
finite
.
Require
Import
prelude
.
list
prelude
.
finite
.
Open
Scope
vector_scope
.
(** * The fin type *)
...
...
theories/zmap.v
View file @
dcff8ded
...
...
@@ 2,8 +2,8 @@
(* This file is distributed under the terms of the BSD license. *)
(** This files extends the implementation of finite over [positive] to finite
maps whose keys range over Coq's data type of binary naturals [Z]. *)
Require
Import
p
map
mapset
.
Require
Export
prelude
fin_maps
.
Require
Import
p
relude
.
pmap
prelude
.
mapset
.
Require
Export
prelude
.
prelude
prelude
.
fin_maps
.
Local
Open
Scope
Z_scope
.
Record
Zmap
(
A
:
Type
)
:
Type
:
=
...
...
Write
Preview
Markdown
is supported
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