Commit bd7ebdec authored by Robbert Krebbers's avatar Robbert Krebbers

Use new Import/Export syntax everywhere.

Also, make our redefinition of done more robust under different
orders of Importing modules.
parent 3a18b722
Require Export algebra.cmra. From algebra Require Export cmra.
Require Import algebra.functor. From algebra Require Import functor.
Local Hint Extern 10 (_ _) => omega. Local Hint Extern 10 (_ _) => omega.
Record agree (A : Type) : Type := Agree { Record agree (A : Type) : Type := Agree {
......
Require Export algebra.excl. From algebra Require Export excl.
Require Import algebra.functor. From algebra Require Import functor.
Local Arguments validN _ _ _ !_ /. Local Arguments validN _ _ _ !_ /.
Record auth (A : Type) : Type := Auth { authoritative : excl A ; own : A }. Record auth (A : Type) : Type := Auth { authoritative : excl A ; own : A }.
......
Require Export mathcomp.ssreflect.ssreflect. From mathcomp.ssreflect Require Export ssreflect.
Require Export prelude.prelude. From prelude Require Export prelude.
Global Set Bullet Behavior "Strict Subproofs". Global Set Bullet Behavior "Strict Subproofs".
Global Open Scope general_if_scope. Global Open Scope general_if_scope.
\ No newline at end of file Ltac done := prelude.tactics.done.
\ No newline at end of file
Require Export algebra.cofe. From algebra Require Export cofe.
Class Unit (A : Type) := unit : A A. Class Unit (A : Type) := unit : A A.
Instance: Params (@unit) 2. Instance: Params (@unit) 2.
......
Require Export algebra.cmra. From algebra Require Export cmra.
Require Import prelude.fin_maps. From prelude Require Import fin_maps.
Fixpoint big_op {A : cmraT} `{Empty A} (xs : list A) : A := Fixpoint big_op {A : cmraT} `{Empty A} (xs : list A) : A :=
match xs with [] => | x :: xs => x big_op xs end. match xs with [] => | x :: xs => x big_op xs end.
......
Require Export algebra.cmra. From algebra Require Export cmra.
Require Import algebra.cmra_big_op. From algebra Require Import cmra_big_op.
(** * Simple solver for validity and inclusion by reflection *) (** * Simple solver for validity and inclusion by reflection *)
Module ra_reflection. Section ra_reflection. Module ra_reflection. Section ra_reflection.
......
Require Export algebra.base. From algebra Require Export base.
(** Unbundeled version *) (** Unbundeled version *)
Class Dist A := dist : nat relation A. Class Dist A := dist : nat relation A.
......
Require Export algebra.cofe. From algebra Require Export cofe.
Record solution (F : cofeT cofeT cofeT) := Solution { Record solution (F : cofeT cofeT cofeT) := Solution {
solution_car :> cofeT; solution_car :> cofeT;
......
Require Export algebra.cmra. From algebra Require Export cmra.
(** From disjoint pcm *) (** From disjoint pcm *)
Record validity {A} (P : A Prop) : Type := Validity { Record validity {A} (P : A Prop) : Type := Validity {
......
Require Export algebra.cmra. From algebra Require Export cmra.
Require Import algebra.functor. From algebra Require Import functor.
Local Arguments validN _ _ _ !_ /. Local Arguments validN _ _ _ !_ /.
Local Arguments valid _ _ !_ /. Local Arguments valid _ _ !_ /.
......
Require Export algebra.cmra prelude.gmap algebra.option. From algebra Require Export cmra option.
Require Import algebra.functor. From prelude Require Export gmap.
From algebra Require Import functor.
Section cofe. Section cofe.
Context `{Countable K} {A : cofeT}. Context `{Countable K} {A : cofeT}.
......
Require Export algebra.cmra. From algebra Require Export cmra.
(** * Functors from COFE to CMRA *) (** * Functors from COFE to CMRA *)
(* TODO RJ: Maybe find a better name for this? It is not PL-specific any more. *) (* TODO RJ: Maybe find a better name for this? It is not PL-specific any more. *)
......
Require Export algebra.cmra. From algebra Require Export cmra.
Require Import algebra.functor. From algebra Require Import functor.
(** * Indexed product *) (** * Indexed product *)
(** Need to put this in a definition to make canonical structures to work. *) (** Need to put this in a definition to make canonical structures to work. *)
......
Require Export algebra.cmra. From algebra Require Export cmra.
Require Import algebra.functor. From algebra Require Import functor.
(* COFE *) (* COFE *)
Section cofe. Section cofe.
......
Require Export algebra.cmra. From algebra Require Export cmra.
Require Import prelude.sets algebra.dra. From prelude Require Import sets.
From algebra Require Import dra.
Local Arguments valid _ _ !_ /. Local Arguments valid _ _ !_ /.
Local Arguments op _ _ !_ !_ /. Local Arguments op _ _ !_ !_ /.
Local Arguments unit _ _ !_ /. Local Arguments unit _ _ !_ /.
......
Require Export algebra.cmra. From algebra Require Export cmra.
Local Hint Extern 1 (_ _) => etransitivity; [eassumption|]. Local Hint Extern 1 (_ _) => etransitivity; [eassumption|].
Local Hint Extern 1 (_ _) => etransitivity; [|eassumption]. Local Hint Extern 1 (_ _) => etransitivity; [|eassumption].
Local Hint Extern 10 (_ _) => omega. Local Hint Extern 10 (_ _) => omega.
......
Require Export heap_lang.lifting. From heap_lang Require Export lifting.
Import uPred. Import uPred.
(** Define some derived forms, and derived lemmas about them. *) (** Define some derived forms, and derived lemmas about them. *)
......
Require Export program_logic.language prelude.strings. From program_logic Require Export language.
Require Import prelude.gmap. From prelude Require Export strings.
From prelude Require Import gmap.
Module heap_lang. Module heap_lang.
Open Scope Z_scope. Open Scope Z_scope.
......
Require Export program_logic.weakestpre heap_lang.heap_lang. From program_logic Require Export weakestpre.
Require Import program_logic.lifting. From heap_lang Require Export heap_lang.
Require Import program_logic.ownership. (* for ownP *) From program_logic Require Import lifting.
Require Import heap_lang.tactics. From program_logic Require Import ownership. (* for ownP *)
From heap_lang Require Import tactics.
Export heap_lang. (* Prefer heap_lang names over language names. *) Export heap_lang. (* Prefer heap_lang names over language names. *)
Import uPred. Import uPred.
Local Hint Extern 0 (language.reducible _ _) => do_step ltac:(eauto 2). Local Hint Extern 0 (language.reducible _ _) => do_step ltac:(eauto 2).
......
Require Export heap_lang.derived. From heap_lang Require Export derived.
(* What about Arguments for hoare triples?. *) (* What about Arguments for hoare triples?. *)
Arguments wp {_ _} _ _%L _. Arguments wp {_ _} _ _%L _.
...@@ -62,4 +62,4 @@ Notation "'rec:' f x y := e" := (RecV f x (Lam y e%L)) ...@@ -62,4 +62,4 @@ Notation "'rec:' f x y := e" := (RecV f x (Lam y e%L))
Notation "'rec:' f x y z := e" := (Rec f x (Lam y (Lam z e%L))) Notation "'rec:' f x y z := e" := (Rec f x (Lam y (Lam z e%L)))
(at level 102, f, x, y, z at level 1, e at level 200) : lang_scope. (at level 102, f, x, y, z at level 1, e at level 200) : lang_scope.
Notation "'rec:' f x y z := e" := (RecV f x (Lam y (Lam z e%L))) Notation "'rec:' f x y z := e" := (RecV f x (Lam y (Lam z e%L)))
(at level 102, f, x, y, z at level 1, e at level 200) : lang_scope. (at level 102, f, x, y, z at level 1, e at level 200) : lang_scope.
\ No newline at end of file
Require Export heap_lang.derived. From heap_lang Require Export derived.
(** We define an alternative notion of substitution [gsubst e x ev] that (** We define an alternative notion of substitution [gsubst e x ev] that
preserves the expression [e] syntactically in case the variable [x] does not preserves the expression [e] syntactically in case the variable [x] does not
......
Require Export heap_lang.heap_lang. From heap_lang Require Export heap_lang.
Require Import prelude.fin_maps. From prelude Require Import fin_maps.
Import heap_lang. Import heap_lang.
(** The tactic [inv_step] performs inversion on hypotheses of the shape (** The tactic [inv_step] performs inversion on hypotheses of the shape
......
(** This file is essentially a bunch of testcases. *) (** This file is essentially a bunch of testcases. *)
Require Import program_logic.ownership. From program_logic Require Import ownership.
From heap_lang Require Import substitution tactics notation. From heap_lang Require Import substitution tactics notation.
Import uPred. Import uPred.
......
...@@ -7,7 +7,7 @@ structures. *) ...@@ -7,7 +7,7 @@ structures. *)
Global Generalizable All Variables. Global Generalizable All Variables.
Global Set Automatic Coercions Import. Global Set Automatic Coercions Import.
Global Set Asymmetric Patterns. 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. Obligation Tactic := idtac.
(** * General *) (** * General *)
......
(* Copyright (c) 2012-2015, Robbert Krebbers. *) (* Copyright (c) 2012-2015, Robbert Krebbers. *)
(* This file is distributed under the terms of the BSD license. *) (* This file is distributed under the terms of the BSD license. *)
(** This file implements bsets as functions into Prop. *) (** This file implements bsets as functions into Prop. *)
Require Export prelude.prelude. From prelude Require Export prelude.
Record bset (A : Type) : Type := mkBSet { bset_car : A bool }. Record bset (A : Type) : Type := mkBSet { bset_car : A bool }.
Arguments mkBSet {_} _. Arguments mkBSet {_} _.
......
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
(* This file is distributed under the terms of the BSD license. *) (* This file is distributed under the terms of the BSD license. *)
(** This files implements an efficient implementation of finite/cofinite sets (** This files implements an efficient implementation of finite/cofinite sets
of positive binary naturals [positive]. *) of positive binary naturals [positive]. *)
Require Export prelude.collections. From prelude Require Export collections.
Require Import prelude.pmap prelude.gmap prelude.mapset. From prelude Require Import pmap gmap mapset.
Local Open Scope positive_scope. Local Open Scope positive_scope.
(** * The tree data structure *) (** * The tree data structure *)
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
(** This file collects definitions and theorems on collections. Most (** This file collects definitions and theorems on collections. Most
importantly, it implements some tactics to automatically solve goals involving importantly, it implements some tactics to automatically solve goals involving
collections. *) collections. *)
Require Export prelude.base prelude.tactics prelude.orders. From prelude Require Export base tactics orders.
Instance collection_subseteq `{ElemOf A C} : SubsetEq C := λ X Y, Instance collection_subseteq `{ElemOf A C} : SubsetEq C := λ X Y,
x, x X x Y. x, x X x Y.
......
(* Copyright (c) 2012-2015, Robbert Krebbers. *) (* Copyright (c) 2012-2015, Robbert Krebbers. *)
(* This file is distributed under the terms of the BSD license. *) (* This file is distributed under the terms of the BSD license. *)
Require Export prelude.list. From prelude Require Export list.
Local Open Scope positive. Local Open Scope positive.
Class Countable A `{ x y : A, Decision (x = y)} := { Class Countable A `{ x y : A, Decision (x = y)} := {
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
(** This file collects theorems, definitions, tactics, related to propositions (** This file collects theorems, definitions, tactics, related to propositions
with a decidable equality. Such propositions are collected by the [Decision] with a decidable equality. Such propositions are collected by the [Decision]
type class. *) type class. *)
Require Export prelude.proof_irrel. From prelude Require Export proof_irrel.
Hint Extern 200 (Decision _) => progress (lazy beta) : typeclass_instances. Hint Extern 200 (Decision _) => progress (lazy beta) : typeclass_instances.
......
(* Copyright (c) 2012-2015, Robbert Krebbers. *) (* Copyright (c) 2012-2015, Robbert Krebbers. *)
(* This file is distributed under the terms of the BSD license. *) (* This file is distributed under the terms of the BSD license. *)
Require Export prelude.list. From prelude Require Export list.
Definition error (S E A : Type) : Type := S E + (A * S). Definition error (S E A : Type) : Type := S E + (A * S).
......
...@@ -3,8 +3,9 @@ ...@@ -3,8 +3,9 @@
(** This file collects definitions and theorems on finite collections. Most (** This file collects definitions and theorems on finite collections. Most
importantly, it implements a fold and size function and some useful induction importantly, it implements a fold and size function and some useful induction
principles on finite collections . *) principles on finite collections . *)
Require Import Permutation prelude.relations prelude.listset. From Coq Require Import Permutation.
Require Export prelude.numbers prelude.collections. From prelude Require Import relations listset.
From prelude Require Export numbers collections.
Instance collection_size `{Elements A C} : Size C := length elements. Instance collection_size `{Elements A C} : Size C := length elements.
Definition collection_fold `{Elements A C} {B} Definition collection_fold `{Elements A C} {B}
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
(** This file provides an axiomatization of the domain function of finite (** This file provides an axiomatization of the domain function of finite
maps. We provide such an axiomatization, instead of implementing the domain maps. We provide such an axiomatization, instead of implementing the domain
function in a generic way, to allow more efficient implementations. *) function in a generic way, to allow more efficient implementations. *)
Require Export prelude.collections prelude.fin_maps. From prelude Require Export collections fin_maps.
Class FinMapDom K M D `{FMap M, Class FinMapDom K M D `{FMap M,
A, Lookup K A (M A), A, Empty (M A), A, PartialAlter K A (M A), A, Lookup K A (M A), A, Empty (M A), A, PartialAlter K A (M A),
......
...@@ -4,8 +4,8 @@ ...@@ -4,8 +4,8 @@
finite maps and collects some theory on it. Most importantly, it proves useful finite maps and collects some theory on it. Most importantly, it proves useful
induction principles for finite maps and implements the tactic induction principles for finite maps and implements the tactic
[simplify_map_equality] to simplify goals involving finite maps. *) [simplify_map_equality] to simplify goals involving finite maps. *)
Require Import Permutation. From Coq Require Import Permutation.
Require Export prelude.relations prelude.vector prelude.orders. From prelude Require Export relations vector orders.
(** * Axiomatization of finite maps *) (** * Axiomatization of finite maps *)
(** We require Leibniz equality to be extensional on finite maps. This of (** We require Leibniz equality to be extensional on finite maps. This of
......
(* Copyright (c) 2012-2015, Robbert Krebbers. *) (* Copyright (c) 2012-2015, Robbert Krebbers. *)
(* This file is distributed under the terms of the BSD license. *) (* This file is distributed under the terms of the BSD license. *)
Require Export prelude.countable prelude.list. From prelude Require Export countable list.
Class Finite A `{ x y : A, Decision (x = y)} := { Class Finite A `{ x y : A, Decision (x = y)} := {
enum : list A; enum : list A;
......
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
(* This file is distributed under the terms of the BSD license. *) (* This file is distributed under the terms of the BSD license. *)
(** This file implements finite maps and finite sets with keys of any countable (** 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. *) type. The implementation is based on [Pmap]s, radix-2 search trees. *)
Require Export prelude.countable prelude.fin_maps prelude.fin_map_dom. From prelude Require Export countable fin_maps fin_map_dom.
Require Import prelude.pmap prelude.mapset. From prelude Require Import pmap mapset.
(** * The data structure *) (** * The data structure *)
(** We pack a [Pmap] together with a proof that ensures that all keys correspond (** We pack a [Pmap] together with a proof that ensures that all keys correspond
......
...@@ -3,8 +3,8 @@ ...@@ -3,8 +3,8 @@
(** This file implements finite set using hash maps. Hash sets are represented (** 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 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. *) integer of type [Z], and contains an unordered list without duplicates. *)
Require Export prelude.fin_maps prelude.listset. From prelude Require Export fin_maps listset.
Require Import prelude.zmap. From prelude Require Import zmap.
Record hashset {A} (hash : A Z) := Hashset { Record hashset {A} (hash : A Z) := Hashset {
hashset_car : Zmap (list A); hashset_car : Zmap (list A);
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
(* This file is distributed under the terms of the BSD license. *) (* This file is distributed under the terms of the BSD license. *)
(** This files defines a lexicographic order on various common data structures (** 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. *) and proves that it is a partial order having a strong variant of trichotomy. *)
Require Import prelude.numbers. From prelude Require Import numbers.
Notation cast_trichotomy T := Notation cast_trichotomy T :=
match T with match T with
......
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
(* This file is distributed under the terms of the BSD license. *) (* This file is distributed under the terms of the BSD license. *)
(** This file collects general purpose definitions and theorems on lists that (** This file collects general purpose definitions and theorems on lists that
are not in the Coq standard library. *) are not in the Coq standard library. *)
Require Export Permutation. From Coq Require Export Permutation.
Require Export prelude.numbers prelude.base prelude.decidable prelude.option. From prelude Require Export numbers base decidable option.
Arguments length {_} _. Arguments length {_} _.
Arguments cons {_} _ _. Arguments cons {_} _ _.
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
(* This file is distributed under the terms of the BSD license. *) (* This file is distributed under the terms of the BSD license. *)
(** This file implements finite set as unordered lists without duplicates (** This file implements finite set as unordered lists without duplicates
removed. This implementation forms a monad. *) removed. This implementation forms a monad. *)
Require Export prelude.base prelude.decidable prelude.collections prelude.list. From prelude Require Export base decidable collections list.
Record listset A := Listset { listset_car: list A }. Record listset A := Listset { listset_car: list A }.
Arguments listset_car {_} _. Arguments listset_car {_} _.
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
(** This file implements finite as unordered lists without duplicates. (** This file implements finite as unordered lists without duplicates.
Although this implementation is slow, it is very useful as decidable equality Although this implementation is slow, it is very useful as decidable equality
is the only constraint on the carrier set. *) is the only constraint on the carrier set. *)
Require Export prelude.base prelude.decidable prelude.collections prelude.list. From prelude Require Export base decidable collections list.
Record listset_nodup A := ListsetNoDup { Record listset_nodup A := ListsetNoDup {
listset_nodup_car : list A; listset_nodup_prf : NoDup listset_nodup_car listset_nodup_car : list A; listset_nodup_prf : NoDup listset_nodup_car
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
(** This files gives an implementation of finite sets using finite maps with (** This files gives an implementation of finite sets using finite maps with
elements of the unit type. Since maps enjoy extensional equality, the elements of the unit type. Since maps enjoy extensional equality, the
constructed finite sets do so as well. *) constructed finite sets do so as well. *)
Require Export prelude.fin_map_dom. From prelude Require Export fin_map_dom.
Record mapset (M : Type Type) : Type := Record mapset (M : Type Type) : Type :=
Mapset { mapset_car: M (unit : Type) }. Mapset { mapset_car: M (unit : Type) }.
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
(** This files implements a type [natmap A] of finite maps whose keys range (** 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 over Coq's data type of unary natural numbers [nat]. The implementation equips
a list with a proof of canonicity. *) a list with a proof of canonicity. *)
Require Import prelude.fin_maps prelude.mapset. From prelude Require Import fin_maps mapset.
Notation natmap_raw A := (list (option A)). Notation natmap_raw A := (list (option A)).
Definition natmap_wf {A} (l : natmap_raw A) := Definition natmap_wf {A} (l : natmap_raw A) :=
......
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
(* This file is distributed under the terms of the BSD license. *) (* This file is distributed under the terms of the BSD license. *)
(** This files extends the implementation of finite over [positive] to finite (** This files extends the implementation of finite over [positive] to finite
maps whose keys range over Coq's data type of binary naturals [N]. *) maps whose keys range over Coq's data type of binary naturals [N]. *)
Require Import prelude.pmap prelude.mapset. From prelude Require Import pmap mapset.
Require Export prelude.prelude prelude.fin_maps. From prelude Require Export prelude fin_maps.
Local Open Scope N_scope. Local Open Scope N_scope.
......
...@@ -3,9 +3,9 @@ ...@@ -3,9 +3,9 @@
(** This file collects some trivial facts on the Coq types [nat] and [N] for (** 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