Skip to content

Adapt to https://github.com/coq/coq/pull/19530 #15

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions lf-current/Extraction.v
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@
OCaml (the most mature), Haskell (mostly works), and Scheme (a bit
out of date). *)

Require Coq.extraction.Extraction.
From Coq Require Extraction.
Extraction Language OCaml.

(** Now we load up the Coq environment with some definitions, either
directly or by importing them from other modules. *)

From Coq Require Import Arith.Arith.
From Coq Require Import Arith.
From Coq Require Import Init.Nat.
From Coq Require Import Arith.EqNat.
From Coq Require Import EqNat.
From LF Require Import ImpCEvalFun.

(** Finally, we tell Coq the name of a definition to extract and the
Expand Down
8 changes: 4 additions & 4 deletions lf-current/Imp.v
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@
reasoning about imperative programs. *)

Set Warnings "-notation-overridden,-parsing,-deprecated-hint-without-locality".
From Coq Require Import Bool.Bool.
From Coq Require Import Bool.
From Coq Require Import Init.Nat.
From Coq Require Import Arith.Arith.
From Coq Require Import Arith.EqNat. Import Nat.
From Coq Require Import Arith.
From Coq Require Import EqNat. Import Nat.
From Coq Require Import Lia.
From Coq Require Import Lists.List. Import ListNotations.
From Coq Require Import List. Import ListNotations.
From Coq Require Import Strings.String.
From LF Require Import Maps.
Set Default Goal Selector "!".
Expand Down
6 changes: 3 additions & 3 deletions lf-current/ImpCEvalFun.v
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
(** * A Broken Evaluator *)

From Coq Require Import Lia.
From Coq Require Import Arith.Arith.
From Coq Require Import Arith.PeanoNat.
From Coq Require Import Arith.
From Coq Require Import PeanoNat.
Import Nat.
From Coq Require Import Arith.EqNat.
From Coq Require Import EqNat.
From LF Require Import Imp Maps.

(** Here was our first try at an evaluation function for commands,
Expand Down
6 changes: 3 additions & 3 deletions lf-current/ImpParser.v
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@
Set Warnings "-notation-overridden,-parsing,-deprecated-hint-without-locality".
From Coq Require Import Strings.String.
From Coq Require Import Strings.Ascii.
From Coq Require Import Arith.Arith.
From Coq Require Import Arith.
From Coq Require Import Init.Nat.
From Coq Require Import Arith.EqNat.
From Coq Require Import Lists.List. Import ListNotations.
From Coq Require Import EqNat.
From Coq Require Import List. Import ListNotations.
From LF Require Import Maps Imp.

(* ################################################################# *)
Expand Down
10 changes: 5 additions & 5 deletions lf-current/Maps.v
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@
own definitions and theorems the same as their counterparts in the
standard library, wherever they overlap. *)

From Coq Require Import Arith.Arith.
From Coq Require Import Bool.Bool.
Require Export Coq.Strings.String.
From Coq Require Import Logic.FunctionalExtensionality.
From Coq Require Import Lists.List.
From Coq Require Import Arith.
From Coq Require Import Bool.
From Coq Require Export String.
From Coq Require Import FunctionalExtensionality.
From Coq Require Import List.
Import ListNotations.
Set Default Goal Selector "!".

Expand Down
52 changes: 26 additions & 26 deletions lf-current/imp.ml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,9 @@ let rec app l m =
| [] -> m
| a :: l1 -> a :: (app l1 m)

module Coq__1 = struct
(** val add : int -> int -> int **)
(** val add : int -> int -> int **)

let rec add = ( + )
end
include Coq__1
let rec add = ( + )

(** val mul : int -> int -> int **)

Expand Down Expand Up @@ -133,6 +130,22 @@ type n =
| Npos of positive

module Pos =
struct
(** val iter_op : ('a1 -> 'a1 -> 'a1) -> positive -> 'a1 -> 'a1 **)

let rec iter_op op p a =
match p with
| XI p0 -> op a (iter_op op p0 (op a a))
| XO p0 -> iter_op op p0 (op a a)
| XH -> a

(** val to_nat : positive -> int **)

let to_nat x =
iter_op add x ((fun x -> x + 1) 0)
end

module Coq_Pos =
struct
(** val succ : positive -> positive **)

Expand Down Expand Up @@ -187,19 +200,6 @@ module Pos =
| XI p -> add y (XO (mul p y))
| XO p -> XO (mul p y)
| XH -> y

(** val iter_op : ('a1 -> 'a1 -> 'a1) -> positive -> 'a1 -> 'a1 **)

let rec iter_op op p a =
match p with
| XI p0 -> op a (iter_op op p0 (op a a))
| XO p0 -> iter_op op p0 (op a a)
| XH -> a

(** val to_nat : positive -> int **)

let to_nat x =
iter_op Coq__1.add x ((fun x -> x + 1) 0)
end

module N =
Expand All @@ -211,7 +211,7 @@ module N =
| N0 -> m
| Npos p -> (match m with
| N0 -> n0
| Npos q -> Npos (Pos.add p q))
| Npos q -> Npos (Coq_Pos.add p q))

(** val mul : n -> n -> n **)

Expand All @@ -220,7 +220,7 @@ module N =
| N0 -> N0
| Npos p -> (match m with
| N0 -> N0
| Npos q -> Npos (Pos.mul p q))
| Npos q -> Npos (Coq_Pos.mul p q))

(** val to_nat : n -> int **)

Expand All @@ -229,18 +229,18 @@ module N =
| Npos p -> Pos.to_nat p
end

(** val rev : 'a1 list -> 'a1 list **)

let rec rev = function
| [] -> []
| x :: l' -> app (rev l') (x :: [])

(** val map : ('a1 -> 'a2) -> 'a1 list -> 'a2 list **)

let rec map f = function
| [] -> []
| a :: t -> (f a) :: (map f t)

(** val rev : 'a1 list -> 'a1 list **)

let rec rev = function
| [] -> []
| x :: l' -> app (rev l') (x :: [])

(** val fold_left : ('a1 -> 'a2 -> 'a1) -> 'a2 list -> 'a1 -> 'a1 **)

let rec fold_left f l a0 =
Expand Down
15 changes: 9 additions & 6 deletions lf-current/imp.mli
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,13 @@ type n =
| Npos of positive

module Pos :
sig
val iter_op : ('a1 -> 'a1 -> 'a1) -> positive -> 'a1 -> 'a1

val to_nat : positive -> int
end

module Coq_Pos :
sig
val succ : positive -> positive

Expand All @@ -44,10 +51,6 @@ module Pos :
val add_carry : positive -> positive -> positive

val mul : positive -> positive -> positive

val iter_op : ('a1 -> 'a1 -> 'a1) -> positive -> 'a1 -> 'a1

val to_nat : positive -> int
end

module N :
Expand All @@ -59,10 +62,10 @@ module N :
val to_nat : n -> int
end

val rev : 'a1 list -> 'a1 list

val map : ('a1 -> 'a2) -> 'a1 list -> 'a2 list

val rev : 'a1 list -> 'a1 list

val fold_left : ('a1 -> 'a2 -> 'a1) -> 'a2 list -> 'a1 -> 'a1

val fold_right : ('a2 -> 'a1 -> 'a1) -> 'a1 -> 'a2 list -> 'a1
Expand Down
12 changes: 6 additions & 6 deletions plf-current/Equiv.v
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

Set Warnings "-notation-overridden,-parsing,-deprecated-hint-without-locality".
From PLF Require Import Maps.
From Coq Require Import Bool.Bool.
From Coq Require Import Arith.Arith.
From Coq Require Import Bool.
From Coq Require Import Arith.
From Coq Require Import Init.Nat.
From Coq Require Import Arith.PeanoNat. Import Nat.
From Coq Require Import Arith.EqNat.
From Coq Require Import PeanoNat. Import Nat.
From Coq Require Import EqNat.
From Coq Require Import Lia.
From Coq Require Import Lists.List. Import ListNotations.
From Coq Require Import Logic.FunctionalExtensionality.
From Coq Require Import List. Import ListNotations.
From Coq Require Import FunctionalExtensionality.
From PLF Require Export Imp.
Set Default Goal Selector "!".

Expand Down
8 changes: 4 additions & 4 deletions plf-current/Hoare.v
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

Set Warnings "-notation-overridden,-parsing,-deprecated-hint-without-locality".
From PLF Require Import Maps.
From Coq Require Import Bool.Bool.
From Coq Require Import Arith.Arith.
From Coq Require Import Arith.EqNat.
From Coq Require Import Arith.PeanoNat. Import Nat.
From Coq Require Import Bool.
From Coq Require Import Arith.
From Coq Require Import EqNat.
From Coq Require Import PeanoNat. Import Nat.
From Coq Require Import Lia.
From PLF Require Export Imp.
Set Default Goal Selector "!".
Expand Down
8 changes: 4 additions & 4 deletions plf-current/Hoare2.v
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ Set Warnings "-notation-overridden,-parsing,-deprecated-hint-without-locality".
Set Warnings "-intuition-auto-with-star".
From Coq Require Import Strings.String.
From PLF Require Import Maps.
From Coq Require Import Bool.Bool.
From Coq Require Import Arith.Arith.
From Coq Require Import Arith.EqNat.
From Coq Require Import Arith.PeanoNat. Import Nat.
From Coq Require Import Bool.
From Coq Require Import Arith.
From Coq Require Import EqNat.
From Coq Require Import PeanoNat. Import Nat.
From Coq Require Import Lia.
From PLF Require Export Imp.
From PLF Require Import Hoare.
Expand Down
8 changes: 4 additions & 4 deletions plf-current/Imp.v
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@
reasoning about imperative programs. *)

Set Warnings "-notation-overridden,-parsing,-deprecated-hint-without-locality".
From Coq Require Import Bool.Bool.
From Coq Require Import Bool.
From Coq Require Import Init.Nat.
From Coq Require Import Arith.Arith.
From Coq Require Import Arith.EqNat. Import Nat.
From Coq Require Import Arith.
From Coq Require Import EqNat. Import Nat.
From Coq Require Import Lia.
From Coq Require Import Lists.List. Import ListNotations.
From Coq Require Import List. Import ListNotations.
From Coq Require Import Strings.String.
From PLF Require Import Maps.
Set Default Goal Selector "!".
Expand Down
10 changes: 5 additions & 5 deletions plf-current/LibTactics.v
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ Ltac fast_rm_inside E :=
Note: the tactic [number_to_nat] is extended in [LibInt] to
take into account the [Z] type. *)

Require Coq.Numbers.BinNums Coq.ZArith.BinInt.
From Coq Require BinNums BinInt.

Definition ltac_int_to_nat (x:BinInt.Z) : nat :=
match x with
Expand Down Expand Up @@ -2536,7 +2536,7 @@ Tactic Notation "subst_eq" constr(E) :=
(* ================================================================= *)
(** ** Tactics to Work with Proof Irrelevance *)

Require Import Coq.Logic.ProofIrrelevance.
From Coq Require Import ProofIrrelevance.

(** [pi_rewrite E] replaces [E] of type [Prop] with a fresh
unification variable, and is thus a practical way to
Expand Down Expand Up @@ -3138,7 +3138,7 @@ Tactic Notation "cases_if'" :=
[inductions E gen X1 .. XN] is a shorthand for
[dependent induction E generalizing X1 .. XN]. *)

Require Import Coq.Program.Equality.
From Coq.Program Require Import Equality.

Ltac inductions_post :=
unfold eq' in *.
Expand Down Expand Up @@ -3215,8 +3215,8 @@ Tactic Notation "induction_wf" ident(IH) ":" constr(E) ident(X) :=
judgment that includes a counter for the maximal height
(see LibTacticsDemos for an example) *)

Require Import Coq.Arith.Compare_dec.
Require Import Coq.micromega.Lia.
From Coq Require Import Compare_dec.
From Coq Require Import Lia.

Lemma induct_height_max2 : forall n1 n2 : nat,
exists n, n1 < n /\ n2 < n.
Expand Down
8 changes: 4 additions & 4 deletions plf-current/Maps.v
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@
own definitions and theorems the same as their counterparts in the
standard library, wherever they overlap. *)

From Coq Require Import Arith.Arith.
From Coq Require Import Bool.Bool.
From Coq Require Import Arith.
From Coq Require Import Bool.
Require Export Coq.Strings.String.
From Coq Require Import Logic.FunctionalExtensionality.
From Coq Require Import Lists.List.
From Coq Require Import FunctionalExtensionality.
From Coq Require Import List.
Import ListNotations.
Set Default Goal Selector "!".

Expand Down
2 changes: 1 addition & 1 deletion plf-current/Norm.v
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
(** * Norm: Normalization of STLC *)

Set Warnings "-notation-overridden,-parsing,-deprecated-hint-without-locality".
From Coq Require Import Lists.List.
From Coq Require Import List.
From Coq Require Import Strings.String.
From PLF Require Import Maps.
From PLF Require Import Smallstep.
Expand Down
12 changes: 6 additions & 6 deletions plf-current/PE.v
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@
without knowing the initial value of [Y]. *)

From PLF Require Import Maps.
From Coq Require Import Bool.Bool.
From Coq Require Import Arith.Arith.
From Coq Require Import Arith.EqNat.
From Coq Require Import Arith.PeanoNat. Import Nat.
From Coq Require Import Bool.
From Coq Require Import Arith.
From Coq Require Import EqNat.
From Coq Require Import PeanoNat. Import Nat.
From Coq Require Import Lia.
From Coq Require Import Logic.FunctionalExtensionality.
From Coq Require Import Lists.List.
From Coq Require Import FunctionalExtensionality.
From Coq Require Import List.
Import ListNotations.

From PLF Require Import Smallstep.
Expand Down
6 changes: 3 additions & 3 deletions plf-current/References.v
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@ Set Warnings "-notation-overridden,-parsing,-deprecated-hint-without-locality".
Set Warnings "-deprecated-syntactic-definition".
From Coq Require Import Strings.String.
From Coq Require Import Init.Nat.
From Coq Require Import Arith.Arith.
From Coq Require Import Arith.PeanoNat.
From Coq Require Import Arith.
From Coq Require Import PeanoNat.
From Coq Require Import Lia.
From PLF Require Import Maps.
From PLF Require Import Smallstep.
From Coq Require Import Lists.List. Import Datatypes.
From Coq Require Import List. Import Datatypes.
Check length.

Import Nat.
Expand Down
Loading