Skip to content
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

parameterize the metalib by the ATOM implementation #15

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
2 changes: 1 addition & 1 deletion Fsub/Fsub_LetSum_Definitions.v
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
*)

Require Export Metalib.Metatheory.

Export Metatheory.AtomMetatheory.

(* ********************************************************************** *)
(** * #<a name="syntax"></a># Syntax (pre-terms) *)
Expand Down
1 change: 1 addition & 0 deletions Metalib/LibLNgen.v
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
Require Export Metalib.LibDefaultSimp.
Require Import Metalib.Metatheory.
Require Import Omega.
Import Metatheory.AtomMetatheory.


(* ********************************************************************** *)
Expand Down
9 changes: 8 additions & 1 deletion Metalib/Metatheory.v
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,11 @@ Require Export Metalib.CoqListFacts.
Require Export Metalib.LibTactics.
Require Export Metalib.MetatheoryAtom.

Module Metatheory(Atom : ATOM).

Module AtomLib := ATOMLib(Atom).
Export AtomLib.

(* ********************************************************************** *)
(** * Notations for finite sets of atoms *)

Expand Down Expand Up @@ -236,7 +240,7 @@ Hint Resolve

(* SCW: this export must be at the end of the file so that eq_dec refers to
the type class member, not KeySetFacts.eq_dec. *)
Require Export Metalib.CoqEqDec.
Export Metalib.CoqEqDec.

(** We prefer that "==" refer to decidable equality at [eq], as
defined by the [EqDec_eq] class from the CoqEqDec library. *)
Expand Down Expand Up @@ -295,3 +299,6 @@ Ltac apply_fresh_base H gather_vars atom_name :=
Set Implicit Arguments.
Definition union_map (A:Set) (f:A -> vars) (l:list A) :=
(List.fold_right (fun t acc => f t \u acc) {}) l.
End Metatheory.

Module AtomMetatheory := Metatheory(Atom).
4 changes: 4 additions & 0 deletions Metalib/MetatheoryAtom.v
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,9 @@ Module Atom : ATOM.

End Atom.

Module ATOMLib(Atom : ATOM).


(** We make [atom], [fresh], [fresh_not_in] and [atom_fresh_for_list] available
without qualification. *)

Expand Down Expand Up @@ -284,3 +287,4 @@ Proof.
trivial.
Qed.
(* end show *)
End ATOMLib.
2 changes: 1 addition & 1 deletion Stlc/Connect.v
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
*)

Require Import Metalib.Metatheory.

Import Metatheory.AtomMetatheory.
Require Import Stlc.Definitions.
Require Import Stlc.Lemmas.

Expand Down
1 change: 1 addition & 0 deletions Stlc/Definitions.v
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@


Require Import Metalib.Metatheory.
Import Metatheory.AtomMetatheory.

(*************************************************************************)
(** * Syntax of STLC *)
Expand Down
1 change: 1 addition & 0 deletions Stlc/Lec1.v
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ version of that output. (For comparison, the raw output is in [Stlc_inf.v].)
This command will only succeed if you have already run [make] and [make
install] in the Metatheory directory to compile the Metatheory library. *)
Require Import Metalib.Metatheory.
Import Metatheory.AtomMetatheory.

(** Next, we import the definitions of the simply-typed lambda calculus.
If you haven't skimmed this file yet, you should do so now. You don't
Expand Down
1 change: 1 addition & 0 deletions Stlc/Lec2.v
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
(*************************************************************************)

Require Import Metalib.Metatheory.
Import Metatheory.AtomMetatheory.
Require Import Stlc.Definitions.
Import StlcNotations.

Expand Down
1 change: 1 addition & 0 deletions Stlc/Lemmas.v
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ Require Import Coq.Logic.FunctionalExtensionality.
Require Import Coq.Program.Equality.

Require Export Metalib.Metatheory.
Import Metatheory.AtomMetatheory.
Require Export Metalib.LibLNgen.

Require Export Stlc.Definitions.
Expand Down
3 changes: 2 additions & 1 deletion Stlc/Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
RULESFILE = stlc-rules.tex

GENCOQ = Stlc.v Stlc_inf.v Lec1_sol.v Lec1_full.v Lec2_sol.v Lec2_full.v Nominal_full.v Nominal_sol.v Connect_full.v Connect_sol.v
GENCOQ = Lec1_sol.v Lec1_full.v Lec2_sol.v Lec2_full.v Nominal_full.v Nominal_sol.v Connect_full.v Connect_sol.v

FULL = Lec1 Lec2 Nominal Connect
EXTRA = Stlc.v Stlc_inf.v stlc.ott stlc.mng ottalt.sty listproc.sty stlc.pdf gen.mk
Expand Down Expand Up @@ -34,6 +34,7 @@ zipclean:

clean: Stlc.mk paperclean zipclean
make -f Stlc.mk clean
rm -f $(GENCOQ)
rm -f Stlc.mk
rm -f *.cmi *.cmo coqsplit

Expand Down
1 change: 1 addition & 0 deletions Stlc/Nominal.v
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ Require Export Omega.
(** We will use the [atom] type from the metatheory library to
represent variable names. *)
Require Export Metalib.Metatheory.
Import Metatheory.AtomMetatheory.

(** Although we are not using LNgen, some of the tactics from
its library are useful for automating reasoning about
Expand Down
1 change: 1 addition & 0 deletions Stlc/Stlc.v
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
Require Import Metalib.Metatheory.
Import Metatheory.AtomMetatheory.
(** syntax *)
Definition index := nat.

Expand Down
1 change: 1 addition & 0 deletions Stlc/Stlc_inf.v
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ Require Import Coq.Logic.FunctionalExtensionality.
Require Import Coq.Program.Equality.

Require Export Metalib.Metatheory.
Import Metatheory.AtomMetatheory.
Require Export Metalib.LibLNgen.

Require Export Stlc.
Expand Down
4 changes: 2 additions & 2 deletions Stlc/coqsplit.ml
Original file line number Diff line number Diff line change
Expand Up @@ -292,9 +292,9 @@ let spec =

let readchan chan =
let nbytes = in_channel_length chan in
let string = String.create nbytes in
let string = Bytes.create nbytes in
really_input chan string 0 nbytes;
string
Bytes.to_string string

let findsubstring s1 s2 =
let l1 = String.length s1 in
Expand Down
2 changes: 1 addition & 1 deletion Tutorial/STLC.v
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
*)

Require Import Metalib.Metatheory.

Import Metatheory.AtomMetatheory.

(*************************************************************************)
(** * Syntax of STLC *)
Expand Down
2 changes: 1 addition & 1 deletion Tutorial/STLCsol.v
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
*)

Require Import Metalib.Metatheory.

Import Metatheory.AtomMetatheory.

(*************************************************************************)
(** * Syntax of STLC *)
Expand Down