-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[serapi] Add document creation
NewDoc
protocol call.
The protocol now supports a method: ``` (NewDoc ((top_name "Module") (iload_path (path_1 ... path_n) (require_libs (require_1 ... require_n)))) ``` where `path_i` is of type ``` Mltop.coq_path = { path_spec: coq_path_spec; recursive: bool; } type coq_path_spec = | VoPath of vo_path_spec | MlPath of string type vo_path_spec = { unix_path : string; coq_path : Names.DirPath.t; implicit : bool; has_ml : add_ml; } ``` and `require_i` is of type: ``` string * string option * bool option ``` where `(module, root, import)` corresponds to `From root Require import module` `iload_path` and `require_libs` are optional, if absent, SerAPI will resort to the defaults. By default, invoking `sertop` will create a document with the standard paths and `Prelude` loaded. To avoid that, use the commit line option `--no_init`. **Important** in practice the user still can only use this option to create one single document using `NewDoc`, as the protocol doesn't yet include per-document addressing. This PR improves a certain number of things, including `compser` and `sercomp` will now create documents with the proper module path cc: #84. This also improves #49 and #59.
- Loading branch information
Showing
19 changed files
with
597 additions
and
417 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 1,41 @@ | ||
(************************************************************************) | ||
(* * The Coq Proof Assistant / The Coq Development Team *) | ||
(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *) | ||
(* <O___,, * (see CREDITS file for the list of authors) *) | ||
(* \VV/ **************************************************************) | ||
(* // * This file is distributed under the terms of the *) | ||
(* * GNU Lesser General Public License Version 2.1 *) | ||
(* * (see LICENSE file for the text of the license) *) | ||
(************************************************************************) | ||
|
||
(************************************************************************) | ||
(* Coq serialization API/Plugin *) | ||
(* Copyright 2016-2018 MINES ParisTech -- Dual License LGPL 2.1 / GPL3 *) | ||
(* Written by: Emilio J. Gallego Arias *) | ||
(************************************************************************) | ||
(* Status: Very Experimental *) | ||
(************************************************************************) | ||
|
||
(******************************************************************************) | ||
(* Coq Prelude Loading Defaults (to be improved) *) | ||
(******************************************************************************) | ||
|
||
let coq_loadpath_default ~implicit ~coq_path = | ||
let open Mltop in | ||
let mk_path prefix = coq_path ^ "/" ^ prefix in | ||
let mk_lp ~ml ~root ~dir ~implicit = | ||
{ recursive = true; | ||
path_spec = VoPath { | ||
unix_path = mk_path dir; | ||
coq_path = root; | ||
has_ml = ml; | ||
implicit; | ||
}; | ||
} in | ||
(* in 8.8 we can use Libnames.default_* *) | ||
let coq_root = Names.DirPath.make [Libnames.coq_root] in | ||
let default_root = Libnames.default_root_prefix in | ||
[mk_lp ~ml:AddRecML ~root:coq_root ~implicit ~dir:"plugins"; | ||
mk_lp ~ml:AddNoML ~root:coq_root ~implicit ~dir:"theories"; | ||
mk_lp ~ml:AddRecML ~root:default_root ~implicit:false ~dir:"user-contrib"; | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 1,20 @@ | ||
(************************************************************************) | ||
(* * The Coq Proof Assistant / The Coq Development Team *) | ||
(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *) | ||
(* <O___,, * (see CREDITS file for the list of authors) *) | ||
(* \VV/ **************************************************************) | ||
(* // * This file is distributed under the terms of the *) | ||
(* * GNU Lesser General Public License Version 2.1 *) | ||
(* * (see LICENSE file for the text of the license) *) | ||
(************************************************************************) | ||
|
||
(************************************************************************) | ||
(* Coq serialization API/Plugin *) | ||
(* Copyright 2016-2018 MINES ParisTech -- Dual License LGPL 2.1 / GPL3 *) | ||
(* Written by: Emilio J. Gallego Arias *) | ||
(************************************************************************) | ||
(* Status: Very Experimental *) | ||
(************************************************************************) | ||
|
||
(* Default load path for Coq's stdlib *) | ||
val coq_loadpath_default : implicit:bool -> coq_path:string -> Mltop.coq_path list |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 1,37 @@ | ||
(************************************************************************) | ||
(* * The Coq Proof Assistant / The Coq Development Team *) | ||
(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *) | ||
(* <O___,, * (see CREDITS file for the list of authors) *) | ||
(* \VV/ **************************************************************) | ||
(* // * This file is distributed under the terms of the *) | ||
(* * GNU Lesser General Public License Version 2.1 *) | ||
(* * (see LICENSE file for the text of the license) *) | ||
(************************************************************************) | ||
|
||
(************************************************************************) | ||
(* Coq serialization API/Plugin *) | ||
(* Copyright 2016-2018 MINES ParisTech *) | ||
(* Written by: Emilio J. Gallego Arias *) | ||
(************************************************************************) | ||
(* Status: Very Experimental *) | ||
(************************************************************************) | ||
|
||
open Sexplib.Conv | ||
|
||
module Names = Ser_names | ||
|
||
type add_ml = | ||
[%import: Mltop.add_ml] | ||
[@@deriving sexp] | ||
|
||
type vo_path_spec = | ||
[%import: Mltop.vo_path_spec] | ||
[@@deriving sexp] | ||
|
||
type coq_path_spec = | ||
[%import: Mltop.coq_path_spec] | ||
[@@deriving sexp] | ||
|
||
type coq_path = | ||
[%import: Mltop.coq_path] | ||
[@@deriving sexp] |
Oops, something went wrong.