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

Adding NES.Export #212

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 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
5 changes: 5 additions & 0 deletions apps/NES/elpi/nes.elpi
Original file line number Diff line number Diff line change
Expand Up @@ -120,4 +120,9 @@ open-super-path [P|PS] ACC :-
open-path Cur,
open-super-path PS Cur.

pred export i:list string.
export Path :- std.do! [
std.map {std.findall (ns Path M_)} nes.ns->modpath Mods,
std.forall Mods coq.env.export-module
].
}
12 changes: 12 additions & 0 deletions apps/NES/examples/usage_NES.v
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,15 @@ Fail Check nat_def.
Fail Check @default _ : nat.
(* This behavior requires Libobject to be aware of the role played by
a module: if it is a namespace some "actions" have to be propagated upward *)

(* NES Export *)
(* this allows to take a "export" of a namespace at
CohenCyril marked this conversation as resolved.
Show resolved Hide resolved
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hem...

a given time in order to reuse it without using NES *)
Module Export.
NES.Export This.Is.A.Long.Namespace.
End Export.

Section TestExport.
Import Export.
Check stuff.
End TestExport.
12 changes: 12 additions & 0 deletions apps/NES/theories/NES.v
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,15 @@ Elpi Accumulate lp:{{
}}.
Elpi Typecheck.
Elpi Export NES.Open.

Elpi Command NES.Export.
Elpi Accumulate Db NES.db.
Elpi Accumulate File "elpi/nes.elpi".
Elpi Accumulate lp:{{

main [str NS] :- !, nes.export {nes.string->ns NS}.
main _ :- coq.error "usage: NES.Export <DotSeparatedPath>".

}}.
Elpi Typecheck.
Elpi Export NES.Export.