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

[serapi] Add document creation NewDoc protocol call. #69

Merged
merged 1 commit into from
Nov 29, 2018
Merged

Conversation

ejgallego
Copy link
Owner

@ejgallego ejgallego commented Nov 2, 2018

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.

@ejgallego
Copy link
Owner Author

This is ready, will merge soon.

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant