From 7dd32d7d13355459a3f3095508bb8b80981241bc Mon Sep 17 00:00:00 2001
From: Robbert Krebbers <mail@robbertkrebbers.nl>
Date: Sat, 13 Feb 2016 12:39:54 +0100
Subject: [PATCH] Use new Import/Export syntax everywhere.

Also, make our redefinition of done more robust under different
orders of Importing modules.
---
 theories/base.v            |  2 +-
 theories/bsets.v           |  2 +-
 theories/co_pset.v         |  4 ++--
 theories/collections.v     |  2 +-
 theories/countable.v       |  2 +-
 theories/decidable.v       |  2 +-
 theories/error.v           |  2 +-
 theories/fin_collections.v |  5 +++--
 theories/fin_map_dom.v     |  2 +-
 theories/fin_maps.v        |  4 ++--
 theories/finite.v          |  2 +-
 theories/gmap.v            |  4 ++--
 theories/hashset.v         |  4 ++--
 theories/lexico.v          |  2 +-
 theories/list.v            |  4 ++--
 theories/listset.v         |  2 +-
 theories/listset_nodup.v   |  2 +-
 theories/mapset.v          |  2 +-
 theories/natmap.v          |  2 +-
 theories/nmap.v            |  4 ++--
 theories/numbers.v         |  8 ++++----
 theories/option.v          |  2 +-
 theories/orders.v          |  4 ++--
 theories/pmap.v            |  5 +++--
 theories/prelude.v         | 28 ++++++++++++++--------------
 theories/pretty.v          |  6 +++---
 theories/proof_irrel.v     |  3 ++-
 theories/relations.v       |  4 ++--
 theories/sets.v            |  2 +-
 theories/streams.v         |  2 +-
 theories/stringmap.v       |  6 +++---
 theories/strings.v         |  5 +++--
 theories/tactics.v         |  6 +++---
 theories/vector.v          |  2 +-
 theories/zmap.v            |  4 ++--
 35 files changed, 73 insertions(+), 69 deletions(-)

diff --git a/theories/base.v b/theories/base.v
index f711649e..63ddc650 100644
--- a/theories/base.v
+++ b/theories/base.v
@@ -7,7 +7,7 @@ structures. *)
 Global Generalizable All Variables.
 Global Set Automatic Coercions Import.
 Global Set Asymmetric Patterns.
-Require Export Morphisms RelationClasses List Bool Utf8 Program Setoid.
+From Coq Require Export Morphisms RelationClasses List Bool Utf8 Program Setoid.
 Obligation Tactic := idtac.
 
 (** * General *)
diff --git a/theories/bsets.v b/theories/bsets.v
index 87e1c50e..8ae132f1 100644
--- a/theories/bsets.v
+++ b/theories/bsets.v
@@ -1,7 +1,7 @@
 (* Copyright (c) 2012-2015, Robbert Krebbers. *)
 (* This file is distributed under the terms of the BSD license. *)
 (** This file implements bsets as functions into Prop. *)
-Require Export prelude.prelude.
+From stdpp Require Export prelude.
 
 Record bset (A : Type) : Type := mkBSet { bset_car : A → bool }.
 Arguments mkBSet {_} _.
diff --git a/theories/co_pset.v b/theories/co_pset.v
index 3b49cb37..85e80a46 100644
--- a/theories/co_pset.v
+++ b/theories/co_pset.v
@@ -2,8 +2,8 @@
 (* This file is distributed under the terms of the BSD license. *)
 (** This files implements an efficient implementation of finite/cofinite sets
 of positive binary naturals [positive]. *)
-Require Export prelude.collections.
-Require Import prelude.pmap prelude.gmap prelude.mapset.
+From stdpp Require Export collections.
+From stdpp Require Import pmap gmap mapset.
 Local Open Scope positive_scope.
 
 (** * The tree data structure *)
diff --git a/theories/collections.v b/theories/collections.v
index b34b5cdc..f3ed2dd9 100644
--- a/theories/collections.v
+++ b/theories/collections.v
@@ -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 prelude.base prelude.tactics prelude.orders.
+From stdpp Require Export base tactics orders.
 
 Instance collection_subseteq `{ElemOf A C} : SubsetEq C := λ X Y,
   ∀ x, x ∈ X → x ∈ Y.
diff --git a/theories/countable.v b/theories/countable.v
index 1635bac2..041da195 100644
--- a/theories/countable.v
+++ b/theories/countable.v
@@ -1,6 +1,6 @@
 (* Copyright (c) 2012-2015, Robbert Krebbers. *)
 (* This file is distributed under the terms of the BSD license. *)
-Require Export prelude.list.
+From stdpp Require Export list.
 Local Open Scope positive.
 
 Class Countable A `{∀ x y : A, Decision (x = y)} := {
diff --git a/theories/decidable.v b/theories/decidable.v
index 817357de..aecd65d0 100644
--- a/theories/decidable.v
+++ b/theories/decidable.v
@@ -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 prelude.proof_irrel.
+From stdpp Require Export proof_irrel.
 
 Hint Extern 200 (Decision _) => progress (lazy beta) : typeclass_instances.
 
diff --git a/theories/error.v b/theories/error.v
index b2eb1852..6a6ddbdb 100644
--- a/theories/error.v
+++ b/theories/error.v
@@ -1,6 +1,6 @@
 (* Copyright (c) 2012-2015, Robbert Krebbers. *)
 (* This file is distributed under the terms of the BSD license. *)
-Require Export prelude.list.
+From stdpp Require Export list.
 
 Definition error (S E A : Type) : Type := S → E + (A * S).
 
diff --git a/theories/fin_collections.v b/theories/fin_collections.v
index 7fe25290..7dbbb4b4 100644
--- a/theories/fin_collections.v
+++ b/theories/fin_collections.v
@@ -3,8 +3,9 @@
 (** 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 prelude.relations prelude.listset.
-Require Export prelude.numbers prelude.collections.
+From Coq Require Import Permutation.
+From stdpp Require Import relations listset.
+From stdpp Require Export numbers collections.
 
 Instance collection_size `{Elements A C} : Size C := length ∘ elements.
 Definition collection_fold `{Elements A C} {B}
diff --git a/theories/fin_map_dom.v b/theories/fin_map_dom.v
index 7c4e7697..343ea766 100644
--- a/theories/fin_map_dom.v
+++ b/theories/fin_map_dom.v
@@ -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 prelude.collections prelude.fin_maps.
+From stdpp Require Export collections 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),
diff --git a/theories/fin_maps.v b/theories/fin_maps.v
index 9ed4f698..1699bd0e 100644
--- a/theories/fin_maps.v
+++ b/theories/fin_maps.v
@@ -4,8 +4,8 @@
 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 prelude.relations prelude.vector prelude.orders.
+From Coq Require Import Permutation.
+From stdpp Require Export relations vector orders.
 
 (** * Axiomatization of finite maps *)
 (** We require Leibniz equality to be extensional on finite maps. This of
diff --git a/theories/finite.v b/theories/finite.v
index a529a1a0..11586869 100644
--- a/theories/finite.v
+++ b/theories/finite.v
@@ -1,6 +1,6 @@
 (* Copyright (c) 2012-2015, Robbert Krebbers. *)
 (* This file is distributed under the terms of the BSD license. *)
-Require Export prelude.countable prelude.list.
+From stdpp Require Export countable list.
 
 Class Finite A `{∀ x y : A, Decision (x = y)} := {
   enum : list A;
diff --git a/theories/gmap.v b/theories/gmap.v
index a3466c30..dd86e07c 100644
--- a/theories/gmap.v
+++ b/theories/gmap.v
@@ -2,8 +2,8 @@
 (* This file is distributed under the terms of the BSD license. *)
 (** This file implements finite maps and finite sets with keys of any countable
 type. The implementation is based on [Pmap]s, radix-2 search trees. *)
-Require Export prelude.countable prelude.fin_maps prelude.fin_map_dom.
-Require Import prelude.pmap prelude.mapset.
+From stdpp Require Export countable fin_maps fin_map_dom.
+From stdpp Require Import pmap mapset.
 
 (** * The data structure *)
 (** We pack a [Pmap] together with a proof that ensures that all keys correspond
diff --git a/theories/hashset.v b/theories/hashset.v
index c6327dad..aa375074 100644
--- a/theories/hashset.v
+++ b/theories/hashset.v
@@ -3,8 +3,8 @@
 (** This file implements finite set using hash maps. Hash sets are represented
 using radix-2 search trees. Each hash bucket is thus indexed using an binary
 integer of type [Z], and contains an unordered list without duplicates. *)
-Require Export prelude.fin_maps prelude.listset.
-Require Import prelude.zmap.
+From stdpp Require Export fin_maps listset.
+From stdpp Require Import zmap.
 
 Record hashset {A} (hash : A → Z) := Hashset {
   hashset_car : Zmap (list A);
diff --git a/theories/lexico.v b/theories/lexico.v
index 31ddc33b..05c53138 100644
--- a/theories/lexico.v
+++ b/theories/lexico.v
@@ -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 prelude.numbers.
+From stdpp Require Import numbers.
 
 Notation cast_trichotomy T :=
   match T with
diff --git a/theories/list.v b/theories/list.v
index 34645eeb..0614f0ab 100644
--- a/theories/list.v
+++ b/theories/list.v
@@ -2,8 +2,8 @@
 (* This file is distributed under the terms of the BSD license. *)
 (** This file collects general purpose definitions and theorems on lists that
 are not in the Coq standard library. *)
-Require Export Permutation.
-Require Export prelude.numbers prelude.base prelude.decidable prelude.option.
+From Coq Require Export Permutation.
+From stdpp Require Export numbers base decidable option.
 
 Arguments length {_} _.
 Arguments cons {_} _ _.
diff --git a/theories/listset.v b/theories/listset.v
index 147715aa..bcf8ed89 100644
--- a/theories/listset.v
+++ b/theories/listset.v
@@ -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 prelude.base prelude.decidable prelude.collections prelude.list.
+From stdpp Require Export base decidable collections list.
 
 Record listset A := Listset { listset_car: list A }.
 Arguments listset_car {_} _.
diff --git a/theories/listset_nodup.v b/theories/listset_nodup.v
index ab4341a8..d6850862 100644
--- a/theories/listset_nodup.v
+++ b/theories/listset_nodup.v
@@ -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 prelude.base prelude.decidable prelude.collections prelude.list.
+From stdpp Require Export base decidable collections list.
 
 Record listset_nodup A := ListsetNoDup {
   listset_nodup_car : list A; listset_nodup_prf : NoDup listset_nodup_car
diff --git a/theories/mapset.v b/theories/mapset.v
index 317b6fc7..bdf6c6bf 100644
--- a/theories/mapset.v
+++ b/theories/mapset.v
@@ -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 prelude.fin_map_dom.
+From stdpp Require Export fin_map_dom.
 
 Record mapset (M : Type → Type) : Type :=
   Mapset { mapset_car: M (unit : Type) }.
diff --git a/theories/natmap.v b/theories/natmap.v
index 309520af..a8ebf6e2 100644
--- a/theories/natmap.v
+++ b/theories/natmap.v
@@ -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 prelude.fin_maps prelude.mapset.
+From stdpp Require Import fin_maps mapset.
 
 Notation natmap_raw A := (list (option A)).
 Definition natmap_wf {A} (l : natmap_raw A) :=
diff --git a/theories/nmap.v b/theories/nmap.v
index 1adc1a63..f9f14341 100644
--- a/theories/nmap.v
+++ b/theories/nmap.v
@@ -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 prelude.pmap prelude.mapset.
-Require Export prelude.prelude prelude.fin_maps.
+From stdpp Require Import pmap mapset.
+From stdpp Require Export prelude fin_maps.
 
 Local Open Scope N_scope.
 
diff --git a/theories/numbers.v b/theories/numbers.v
index e2e728b3..d688ae71 100644
--- a/theories/numbers.v
+++ b/theories/numbers.v
@@ -3,9 +3,9 @@
 (** This file collects some trivial facts on the Coq types [nat] and [N] for
 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 prelude.base prelude.decidable prelude.option.
+From Coq Require Export Eqdep PArith NArith ZArith NPeano.
+From Coq Require Import QArith Qcanon.
+From stdpp Require Export base decidable option.
 Open Scope nat_scope.
 
 Coercion Z.of_nat : nat >-> Z.
@@ -50,7 +50,7 @@ Proof.
     * clear nat_le_pi. intros; exfalso; auto with lia.
     * injection 1. intros Hy. by case (nat_le_pi x y p y' q Hy). }
   intros x y p q.
-  by apply (eq_dep_eq_dec (λ x y, decide (x = y))), aux.
+  by apply (Eqdep_dec.eq_dep_eq_dec (λ x y, decide (x = y))), aux.
 Qed.
 Instance nat_lt_pi: ∀ x y : nat, ProofIrrel (x < y).
 Proof. apply _. Qed.
diff --git a/theories/option.v b/theories/option.v
index f6e21760..e7f14fd1 100644
--- a/theories/option.v
+++ b/theories/option.v
@@ -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 prelude.base prelude.tactics prelude.decidable.
+From stdpp Require Export base tactics decidable.
 
 Inductive option_reflect {A} (P : A → Prop) (Q : Prop) : option A → Type :=
   | ReflectSome x : P x → option_reflect P Q (Some x)
diff --git a/theories/orders.v b/theories/orders.v
index 22037648..cf17a85d 100644
--- a/theories/orders.v
+++ b/theories/orders.v
@@ -2,8 +2,8 @@
 (* This file is distributed under the terms of the BSD license. *)
 (** This file collects common properties of pre-orders and semi lattices. This
 theory will mainly be used for the theory on collections and finite maps. *)
-Require Export Sorted.
-Require Export prelude.base prelude.decidable prelude.tactics prelude.list.
+From Coq Require Export Sorted.
+From stdpp Require Export base decidable tactics list.
 
 (** * Arbitrary pre-, parial and total orders *)
 (** Properties about arbitrary pre-, partial, and total orders. We do not use
diff --git a/theories/pmap.v b/theories/pmap.v
index 00cd7e87..5875a799 100644
--- a/theories/pmap.v
+++ b/theories/pmap.v
@@ -7,8 +7,9 @@ trees (uncompressed Patricia trees) and guarantees logarithmic-time 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 prelude.mapset.
-Require Export prelude.fin_maps.
+From Coq Require Import PArith.
+From stdpp Require Import mapset.
+From stdpp Require Export fin_maps.
 
 Local Open Scope positive_scope.
 Local Hint Extern 0 (@eq positive _ _) => congruence.
diff --git a/theories/prelude.v b/theories/prelude.v
index 020b6535..34c65d5a 100644
--- a/theories/prelude.v
+++ b/theories/prelude.v
@@ -1,16 +1,16 @@
 (* Copyright (c) 2012-2015, Robbert Krebbers. *)
 (* This file is distributed under the terms of the BSD license. *)
-Require Export
-  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.
+From stdpp Require Export
+  base
+  tactics
+  decidable
+  orders
+  option
+  vector
+  numbers
+  relations
+  collections
+  fin_collections
+  listset
+  list
+  lexico.
diff --git a/theories/pretty.v b/theories/pretty.v
index b246ec42..c7b8d50e 100644
--- a/theories/pretty.v
+++ b/theories/pretty.v
@@ -1,8 +1,8 @@
 (* Copyright (c) 2012-2015, Robbert Krebbers. *)
 (* This file is distributed under the terms of the BSD license. *)
-Require Export prelude.strings.
-Require Import prelude.relations.
-Require Import Ascii.
+From stdpp Require Export strings.
+From stdpp Require Import relations.
+From Coq Require Import Ascii.
 
 Class Pretty A := pretty : A → string.
 Definition pretty_N_char (x : N) : ascii :=
diff --git a/theories/proof_irrel.v b/theories/proof_irrel.v
index d1eab741..afb9297a 100644
--- a/theories/proof_irrel.v
+++ b/theories/proof_irrel.v
@@ -1,7 +1,8 @@
 (* Copyright (c) 2012-2015, 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 prelude.tactics.
+From Coq Require Import Eqdep_dec.
+From stdpp Require Export tactics.
 
 Hint Extern 200 (ProofIrrel _) => progress (lazy beta) : typeclass_instances.
 
diff --git a/theories/relations.v b/theories/relations.v
index cd81c198..aa94487f 100644
--- a/theories/relations.v
+++ b/theories/relations.v
@@ -4,8 +4,8 @@
 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 prelude.tactics prelude.base.
+From Coq Require Import Wf_nat.
+From stdpp Require Export tactics base.
 
 (** * Definitions *)
 Section definitions.
diff --git a/theories/sets.v b/theories/sets.v
index bd80b8ee..f2543ebe 100644
--- a/theories/sets.v
+++ b/theories/sets.v
@@ -1,7 +1,7 @@
 (* Copyright (c) 2012-2015, Robbert Krebbers. *)
 (* This file is distributed under the terms of the BSD license. *)
 (** This file implements sets as functions into Prop. *)
-Require Export prelude.prelude.
+From stdpp Require Export prelude.
 
 Record set (A : Type) : Type := mkSet { set_car : A → Prop }.
 Arguments mkSet {_} _.
diff --git a/theories/streams.v b/theories/streams.v
index c660562c..8fe09cc5 100644
--- a/theories/streams.v
+++ b/theories/streams.v
@@ -1,6 +1,6 @@
 (* Copyright (c) 2012-2015, Robbert Krebbers. *)
 (* This file is distributed under the terms of the BSD license. *)
-Require Export prelude.tactics.
+From stdpp Require Export tactics.
 
 CoInductive stream (A : Type) : Type := scons : A → stream A → stream A.
 Arguments scons {_} _ _.
diff --git a/theories/stringmap.v b/theories/stringmap.v
index 58c8862d..e320a190 100644
--- a/theories/stringmap.v
+++ b/theories/stringmap.v
@@ -4,8 +4,8 @@
 range over Coq's data type of strings [string]. The implementation uses radix-2
 search trees (uncompressed Patricia trees) as implemented in the file [pmap]
 and guarantees logarithmic-time operations. *)
-Require Export prelude.fin_maps prelude.pretty.
-Require Import prelude.gmap.
+From stdpp Require Export fin_maps pretty.
+From stdpp Require Import gmap.
 
 Notation stringmap := (gmap string).
 Notation stringset := (gset string).
@@ -58,4 +58,4 @@ Fixpoint fresh_strings_of_set
   | S n =>
      let x := fresh_string_of_set s X in
      x :: fresh_strings_of_set s n ({[ x ]} ∪ X)
-  end%nat.
\ No newline at end of file
+  end%nat.
diff --git a/theories/strings.v b/theories/strings.v
index f2074f24..9fa15499 100644
--- a/theories/strings.v
+++ b/theories/strings.v
@@ -1,7 +1,8 @@
 (* Copyright (c) 2012-2015, Robbert Krebbers. *)
 (* This file is distributed under the terms of the BSD license. *)
-Require Import Ascii.
-Require Export String prelude.countable.
+From Coq Require Import Ascii.
+From Coq Require Export String.
+From stdpp Require Export countable.
 
 (** * Fix scopes *)
 Open Scope string_scope.
diff --git a/theories/tactics.v b/theories/tactics.v
index 357f4fbd..aee81d73 100644
--- a/theories/tactics.v
+++ b/theories/tactics.v
@@ -2,9 +2,9 @@
 (* This file is distributed under the terms of the BSD license. *)
 (** This file collects general purpose tactics that are used throughout
 the development. *)
-Require Import Omega.
-Require Export Psatz.
-Require Export prelude.base.
+From Coq Require Import Omega.
+From Coq Require Export Psatz.
+From stdpp Require Export base.
 
 Lemma f_equal_dep {A B} (f g : ∀ x : A, B x) x : f = g → f x = g x.
 Proof. intros ->; reflexivity. Qed.
diff --git a/theories/vector.v b/theories/vector.v
index 4b11efe4..18547be4 100644
--- a/theories/vector.v
+++ b/theories/vector.v
@@ -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 prelude.list prelude.finite.
+From stdpp Require Import list finite.
 Open Scope vector_scope.
 
 (** * The fin type *)
diff --git a/theories/zmap.v b/theories/zmap.v
index 04f016e1..d2621ba9 100644
--- a/theories/zmap.v
+++ b/theories/zmap.v
@@ -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 prelude.pmap prelude.mapset.
-Require Export prelude.prelude prelude.fin_maps.
+From stdpp Require Import pmap mapset.
+From stdpp Require Export prelude fin_maps.
 Local Open Scope Z_scope.
 
 Record Zmap (A : Type) : Type :=
-- 
GitLab