diff --git a/sledge/dune b/sledge/dune index 6bf4fcf64..7f06860d1 100644 --- a/sledge/dune +++ b/sledge/dune @@ -33,25 +33,14 @@ ppx_sexp_conv ppx_sexp_value) (preprocess no_preprocessing)) -(subdir - src/import - (library - (name import) - (public_name sledge.import) - (libraries core core_kernel.fheap zarith trace) - (flags (:standard)) - (preprocess - (pps ppx_sledge ppx_trace)) - (inline_tests))) - (subdir src (library (name sledge) (public_name sledge) - (libraries import) + (libraries nonstdlib) (flags - (:standard -open Import)) + (:standard -open NS)) (preprocess (pps ppx_sledge ppx_trace)) (inline_tests))) @@ -85,9 +74,9 @@ (package sledge) (libraries apron apron.boxMPQ ctypes ctypes.foreign dune-build-info llvm llvm.irreader llvm.analysis llvm.scalar_opts llvm.target llvm.ipo - llvm.linker shexp.process yojson trace import sledge model) + llvm.linker shexp.process yojson trace nonstdlib sledge model) (flags - (:standard -w -58 -open Import -open Sledge -open Model)) + (:standard -w -58 -open NS -open Sledge -open Model)) (preprocess (pps ppx_sledge ppx_trace)))) diff --git a/sledge/dune-project b/sledge/dune-project index a0727d625..2ca2950db 100644 --- a/sledge/dune-project +++ b/sledge/dune-project @@ -1,5 +1,8 @@ (lang dune 2.5) +(package + (name nonstdlib)) + (package (name ppx_trace)) diff --git a/sledge/src/import/import.ml b/sledge/nonstdlib/NS.ml similarity index 97% rename from sledge/src/import/import.ml rename to sledge/nonstdlib/NS.ml index 7fb219024..ccb6f2b78 100644 --- a/sledge/src/import/import.ml +++ b/sledge/nonstdlib/NS.ml @@ -5,9 +5,9 @@ * LICENSE file in the root directory of this source tree. *) -(** Global namespace opened in each source file by the build system *) +(** Global namespace intended to be opened in each source file *) -include Import0 +include NS0 (** Failures *) diff --git a/sledge/src/import/import.mli b/sledge/nonstdlib/NS.mli similarity index 97% rename from sledge/src/import/import.mli rename to sledge/nonstdlib/NS.mli index 312a3f1ab..baec24e6d 100644 --- a/sledge/src/import/import.mli +++ b/sledge/nonstdlib/NS.mli @@ -5,9 +5,9 @@ * LICENSE file in the root directory of this source tree. *) -(** Global namespace opened in each source file by the build system *) +(** Global namespace intended to be opened in each source file *) -include module type of Import0 +include module type of NS0 (** Function combinators *) diff --git a/sledge/src/import/import0.ml b/sledge/nonstdlib/NS0.ml similarity index 100% rename from sledge/src/import/import0.ml rename to sledge/nonstdlib/NS0.ml diff --git a/sledge/nonstdlib/dune b/sledge/nonstdlib/dune new file mode 100644 index 000000000..6b8552c03 --- /dev/null +++ b/sledge/nonstdlib/dune @@ -0,0 +1,13 @@ +; Copyright (c) Facebook, Inc. and its affiliates. +; +; This source code is licensed under the MIT license found in the +; LICENSE file in the root directory of this source tree. + +(library + (name NS) + (public_name nonstdlib) + (libraries core core_kernel.fheap zarith trace) + (flags (:standard)) + (preprocess + (pps ppx_sledge ppx_trace)) + (inline_tests)) diff --git a/sledge/src/import/iArray.ml b/sledge/nonstdlib/iArray.ml similarity index 99% rename from sledge/src/import/iArray.ml rename to sledge/nonstdlib/iArray.ml index 82346f257..ddb847f70 100644 --- a/sledge/src/import/iArray.ml +++ b/sledge/nonstdlib/iArray.ml @@ -7,7 +7,7 @@ (** IArray - Immutable view of an array *) -open Import0 +open NS0 include ( Array.Permissioned : diff --git a/sledge/src/import/iArray.mli b/sledge/nonstdlib/iArray.mli similarity index 99% rename from sledge/src/import/iArray.mli rename to sledge/nonstdlib/iArray.mli index affb41ef5..4ea161cb7 100644 --- a/sledge/src/import/iArray.mli +++ b/sledge/nonstdlib/iArray.mli @@ -13,7 +13,7 @@ structure, it only attempts to make it inconvenient to unintentionally mutate. *) -open Import0 +open NS0 include module type of Array.Permissioned diff --git a/sledge/src/import/list.ml b/sledge/nonstdlib/list.ml similarity index 99% rename from sledge/src/import/list.ml rename to sledge/nonstdlib/list.ml index d5b7b1e34..014a1b594 100644 --- a/sledge/src/import/list.ml +++ b/sledge/nonstdlib/list.ml @@ -5,7 +5,7 @@ * LICENSE file in the root directory of this source tree. *) -open Import0 +open NS0 include Core.List let rec pp ?pre ?suf sep pp_elt fs = function diff --git a/sledge/src/import/list.mli b/sledge/nonstdlib/list.mli similarity index 99% rename from sledge/src/import/list.mli rename to sledge/nonstdlib/list.mli index a068ceb02..d5e8eb98d 100644 --- a/sledge/src/import/list.mli +++ b/sledge/nonstdlib/list.mli @@ -5,7 +5,7 @@ * LICENSE file in the root directory of this source tree. *) -open Import0 +open NS0 include module type of Core.List val pp : diff --git a/sledge/src/import/map.ml b/sledge/nonstdlib/map.ml similarity index 99% rename from sledge/src/import/map.ml rename to sledge/nonstdlib/map.ml index 7910ff2ad..91791740c 100644 --- a/sledge/src/import/map.ml +++ b/sledge/nonstdlib/map.ml @@ -5,7 +5,7 @@ * LICENSE file in the root directory of this source tree. *) -open Import0 +open NS0 include Map_intf module Make (Key : sig diff --git a/sledge/src/import/map.mli b/sledge/nonstdlib/map.mli similarity index 100% rename from sledge/src/import/map.mli rename to sledge/nonstdlib/map.mli diff --git a/sledge/src/import/map_intf.ml b/sledge/nonstdlib/map_intf.ml similarity index 99% rename from sledge/src/import/map_intf.ml rename to sledge/nonstdlib/map_intf.ml index 6bac231cb..8966cfdb1 100644 --- a/sledge/src/import/map_intf.ml +++ b/sledge/nonstdlib/map_intf.ml @@ -5,7 +5,7 @@ * LICENSE file in the root directory of this source tree. *) -open Import0 +open NS0 module type S = sig type key diff --git a/sledge/src/import/option.ml b/sledge/nonstdlib/option.ml similarity index 97% rename from sledge/src/import/option.ml rename to sledge/nonstdlib/option.ml index 4aeb58bc9..6f94a4844 100644 --- a/sledge/src/import/option.ml +++ b/sledge/nonstdlib/option.ml @@ -5,7 +5,7 @@ * LICENSE file in the root directory of this source tree. *) -open! Import0 +open! NS0 include Core.Option let pp fmt pp_elt fs = function diff --git a/sledge/src/import/option.mli b/sledge/nonstdlib/option.mli similarity index 97% rename from sledge/src/import/option.mli rename to sledge/nonstdlib/option.mli index 370bebba0..e7e54beea 100644 --- a/sledge/src/import/option.mli +++ b/sledge/nonstdlib/option.mli @@ -5,7 +5,7 @@ * LICENSE file in the root directory of this source tree. *) -open! Import0 +open! NS0 include module type of Core.Option val pp : ('a_pp -> 'a -> unit, unit) fmt -> 'a_pp -> 'a option pp diff --git a/sledge/src/import/qset.ml b/sledge/nonstdlib/qset.ml similarity index 99% rename from sledge/src/import/qset.ml rename to sledge/nonstdlib/qset.ml index dc38469a5..b1ff1f006 100644 --- a/sledge/src/import/qset.ml +++ b/sledge/nonstdlib/qset.ml @@ -7,7 +7,7 @@ (** Qset - Set with (signed) rational multiplicity for each element *) -open Import0 +open NS0 include Qset_intf module Make (Elt : sig diff --git a/sledge/src/import/qset.mli b/sledge/nonstdlib/qset.mli similarity index 100% rename from sledge/src/import/qset.mli rename to sledge/nonstdlib/qset.mli diff --git a/sledge/src/import/qset_intf.ml b/sledge/nonstdlib/qset_intf.ml similarity index 99% rename from sledge/src/import/qset_intf.ml rename to sledge/nonstdlib/qset_intf.ml index 5446290f9..8db51e830 100644 --- a/sledge/src/import/qset_intf.ml +++ b/sledge/nonstdlib/qset_intf.ml @@ -7,7 +7,7 @@ (** Qset - Set with (signed) rational multiplicity for each element *) -open Import0 +open NS0 module type S = sig type elt diff --git a/sledge/src/import/set.ml b/sledge/nonstdlib/set.ml similarity index 99% rename from sledge/src/import/set.ml rename to sledge/nonstdlib/set.ml index ce224bb57..f2a0e0c2e 100644 --- a/sledge/src/import/set.ml +++ b/sledge/nonstdlib/set.ml @@ -5,7 +5,7 @@ * LICENSE file in the root directory of this source tree. *) -open Import0 +open NS0 include Set_intf module Make (Elt : sig diff --git a/sledge/src/import/set.mli b/sledge/nonstdlib/set.mli similarity index 100% rename from sledge/src/import/set.mli rename to sledge/nonstdlib/set.mli diff --git a/sledge/src/import/set_intf.ml b/sledge/nonstdlib/set_intf.ml similarity index 98% rename from sledge/src/import/set_intf.ml rename to sledge/nonstdlib/set_intf.ml index 91f02c5ef..0bdca1ed1 100644 --- a/sledge/src/import/set_intf.ml +++ b/sledge/nonstdlib/set_intf.ml @@ -5,7 +5,7 @@ * LICENSE file in the root directory of this source tree. *) -open Import0 +open NS0 module type S = sig type elt diff --git a/sledge/src/term.ml b/sledge/src/term.ml index 5f351f5f8..0599636cf 100644 --- a/sledge/src/term.ml +++ b/sledge/src/term.ml @@ -38,13 +38,13 @@ type op3 = Conditional | Extract [@@deriving compare, equal, hash, sexp] type opN = Concat | Record [@@deriving compare, equal, hash, sexp] module rec Set : sig - include Import.Set.S with type elt := T.t + include NS.Set.S with type elt := T.t val hash : t -> int val hash_fold_t : t Hash.folder val t_of_sexp : Sexp.t -> t end = struct - include Import.Set.Make (T) + include NS.Set.Make (T) let hash_fold_t = hash_fold_t T.hash_fold_t let hash = Hash.of_fold hash_fold_t @@ -53,13 +53,13 @@ end = struct end and Qset : sig - include Import.Qset.S with type elt := T.t + include NS.Qset.S with type elt := T.t val hash : t -> int val hash_fold_t : t Hash.folder val t_of_sexp : Sexp.t -> t end = struct - include Import.Qset.Make (T) + include NS.Qset.Make (T) let hash_fold_t = hash_fold_t T.hash_fold_t let hash = Hash.of_fold hash_fold_t diff --git a/sledge/src/term.mli b/sledge/src/term.mli index 59d6ac5d1..026e6fcd7 100644 --- a/sledge/src/term.mli +++ b/sledge/src/term.mli @@ -58,14 +58,14 @@ type opN = [@@deriving compare, equal, hash, sexp] module rec Set : sig - include Import.Set.S with type elt := T.t + include NS.Set.S with type elt := T.t val hash_fold_t : t Hash.folder val t_of_sexp : Sexp.t -> t end and Qset : sig - include Import.Qset.S with type elt := T.t + include NS.Qset.S with type elt := T.t val hash_fold_t : t Hash.folder val t_of_sexp : Sexp.t -> t @@ -110,7 +110,7 @@ module Var : sig module Map : Map.S with type key := t module Set : sig - include Import.Set.S with type elt := t + include NS.Set.S with type elt := t val hash_fold_t : t Hash.folder val sexp_of_t : t -> Sexp.t