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

wrapper mixin step0 #370

Draft
wants to merge 64 commits into
base: master
Choose a base branch
from
Draft
Changes from 1 commit
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
6f1dee6
test for step 0 of CoREACT
gares Jun 2, 2023
1ceb6ea
update
gares Jun 2, 2023
f6c1970
more
gares Jun 2, 2023
17d6561
more
gares Jun 2, 2023
d2bc00f
Update tests/monoid_enriched_cat.v
CohenCyril Jun 19, 2023
6726472
Update tests/monoid_enriched_cat.v
CohenCyril Jun 19, 2023
0821793
Update tests/monoid_enriched_cat.v
CohenCyril Jun 19, 2023
234e3f5
Update tests/monoid_enriched_cat.v
CohenCyril Jun 19, 2023
92e1f68
Update tests/monoid_enriched_cat.v
CohenCyril Jun 19, 2023
b7f3789
Update tests/monoid_enriched_cat.v
CohenCyril Jun 19, 2023
80e17f2
added enriched_cat.v
ptorrx Jun 19, 2023
314c6b9
copied Cyril's monoid_enriched_cat.v to enriched_cat.v
ptorrx Jun 19, 2023
67526eb
added monoid_enriched_cat.v as the original pull request by Cyril, in…
ptorrx Jun 20, 2023
a3bcee5
add enriched_cat to _CoqProject
ptorrx Jun 21, 2023
f472ce6
changes to enriched_cat.v
ptorrx Jun 21, 2023
b3ba8c1
changes related to monoid_enriched_cat.v and wrappers in various file…
ptorrx Jun 21, 2023
9f0bde5
change to enriched_cat.v
ptorrx Jun 22, 2023
056f6e0
minor changes
ptorrx Jun 22, 2023
b78c77c
added Elpi code in monoid_enriched_cat.v
ptorrx Jun 23, 2023
0d0e9b7
changes in monoid_enriched_cat.v
ptorrx Jun 26, 2023
b6b8278
added improved version of extraction predicates in monoid_enriched_cat.v
ptorrx Jun 27, 2023
145aa0d
minor changes in monoid_enriched_cat.v
ptorrx Jun 27, 2023
8d0310e
moved Elpi code from monoid_enriched_cat.v to factory.v. monoid-enric…
ptorrx Jun 27, 2023
0b2b79f
minor changes in monoid_enriched_cat.v
ptorrx Jun 28, 2023
7fbd129
added instance in monoid_enriched_cat.v
ptorrx Jun 28, 2023
5ded009
added some tests to monoid_enriched_cat.v
ptorrx Jun 28, 2023
2ea2be6
pseudo-code to add new instances for each wrapper mixin
CohenCyril Jun 28, 2023
2fccea4
added some comment
ptorrx Jun 29, 2023
1ffc93d
tentative changes in structure.elpi (reexport-wrapper-as-instance is …
ptorrx Jun 29, 2023
d9c7980
changes in structure.elpi and monoid_enriched_cat.v - compiles
ptorrx Jun 30, 2023
7158c54
added comments in structure.elpi
ptorrx Jun 30, 2023
7ec530a
changes in structure.elpi, to prepare the derivation of the wrapper i…
ptorrx Jul 3, 2023
7e83bd9
added comments in structure.elpi
ptorrx Jul 3, 2023
40eef02
tentative changes to structure.elpi
ptorrx Jul 3, 2023
a26cf4b
changes in structure.elpi - mainly comments
ptorrx Jul 4, 2023
09b0222
changes in structure.elpi - mainly comments
ptorrx Jul 4, 2023
e5f56a1
main changes in instance.elpi
ptorrx Jul 4, 2023
36dc631
added commments in instance.elpi
ptorrx Jul 4, 2023
b46a369
minor changes in monoid_enriched_cat.v (wrapper instance definition n…
ptorrx Jul 4, 2023
d93a11d
Update tests/monoid_enriched_cat.v
ptorrx Jul 5, 2023
e4c3732
added summary of today's discussion at the bottom of instance.elpi
ptorrx Jul 5, 2023
8c30d1a
Merge remote-tracking branch 'origin/wrapper' into wrapper
ptorrx Jul 5, 2023
911ede1
setup nix
CohenCyril Jul 3, 2023
4e47908
blind attempt
CohenCyril Jul 6, 2023
3d0961c
minor changes to comments in instance.elpi
ptorrx Jul 6, 2023
314dadc
added debug printouts
ptorrx Jul 13, 2023
5f18ee4
revised comments and printouts, minor change in structure.elpi to nam…
ptorrx Jul 17, 2023
ce51cc4
Switched to tentive version of add-all-mixins with extra parameter. B…
ptorrx Jul 18, 2023
641d35d
gone back to old add-all-mixins (without std.forall), revised comment…
ptorrx Jul 19, 2023
6bdfd59
gone back to old add-all-mixins (without std.forall), revised comment…
ptorrx Jul 19, 2023
790ca44
added predicates to handle cumulative output over forall, avoiding du…
ptorrx Jul 20, 2023
f0975bb
added redirect-instances (instances.elpi), in progress
ptorrx Jul 20, 2023
73e614b
instance.elpi, redirect-instances - in progress (section problem)
ptorrx Jul 21, 2023
ab87dd8
instance.elpi, redirect-instances - in progress (section problem)
ptorrx Jul 21, 2023
11baf58
instance.elpi: redirect-instances in progress, still need to add call…
ptorrx Jul 21, 2023
8e22bb3
instance.elpi: redirect-instances in progress, added call to declare-…
ptorrx Jul 24, 2023
3dbe65e
instance.elpi: redirect-instances in progress, added call to declare-…
ptorrx Jul 24, 2023
e7361bf
more comments in instance.elpi, added lemma in enriched_cat.v and fac…
ptorrx Jul 24, 2023
9d80cdf
enriched_cat.v: minor changes
ptorrx Jul 26, 2023
7835883
enriched_cat.v: minor changes
ptorrx Jul 26, 2023
f8da435
test commit, minor changes
ptorrx Aug 3, 2023
2338a1f
adding examples in cmon_enriched_cat.v
ptorrx Aug 4, 2023
7907b7f
updated cmonoid_enriched_cat.v with new examples; some problems
ptorrx Aug 9, 2023
ce88b3d
updated cmon_enriched_cat.v - now the file contains three examples; c…
ptorrx Aug 10, 2023
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
Prev Previous commit
Next Next commit
instance.elpi: redirect-instances in progress, still need to add call…
… to declare-instance
  • Loading branch information
ptorrx committed Jul 21, 2023
commit 11baf58ba1147b161e7a5a9e4c44273bfc926c7d
30 changes: 17 additions & 13 deletions HB/instance.elpi
Original file line number Diff line number Diff line change
Expand Up @@ -100,15 +100,15 @@ declare-const Name BodySkel TyWPSkel CSL :- std.do! [

% Clauses and CSL are outputs. QUESTION: what is the context here?
% private.declare-instance Factory TheType TheFactory Clauses CSL,
private.redirect-instances Factory TheType TheFactory Body Clauses CSL,
private.redirect-instances RealName Factory TheType TheFactory Body Clauses CSL,

% handle parameters via a section -- end
if (TyWP = arity _) true (
if-verbose (coq.say {header} "closing instance section"),
log.coq.env.end-section-name SectionName
),


/*
%%%%%%%%%%%%%%% temporary test code
%%% (type-check failure if called from inside the section)
coq.safe-dest-app TheType TheTypeKey _,
Expand All @@ -118,14 +118,14 @@ declare-const Name BodySkel TyWPSkel CSL :- std.do! [
coq.say "REDIN!!!!!!! WRAPPERS = " Wrappers,
if (Wrappers = [W|_])
% there is a wrapper (we actually don't want more than one)
(private.dry-run TheFactory W _ _)
(private.dry-run Body W _ _)
% there happens to be no wrapper, just treat it as a normal instance
true
]
)
true,
%%%%%%%%%%%%%%%%%%%%%%%%

*/

% we accumulate clauses now that the section is over
% QUESTION - what is this really accumulating? appears to be always empty
Expand Down Expand Up @@ -733,28 +733,32 @@ derive-wrapper-instances Instance (wrapper-mixin WrapperMixin Subject Mixin)
derive-wrapper-instances _ _ [] [].

% split between direct call to declare-instance and indirect one through derive-wrapper-instances
pred redirect-instances i:factoryname, i:term, i:term, i:term,
pred redirect-instances i:id, i:factoryname, i:term, i:term, i:term,
o:list prop, o:list (pair id constant).
redirect-instances Factory TheType TheFactory Body Clauses CSL :- std.do! [
redirect-instances RealName Factory TheType TheFactory Body Clauses CSL :- std.do! [
coq.safe-dest-app TheType TheTypeKey _,

coq.say "NOW RUNNING****************************** REDIN "
coq.say "REDIN!!!!!!! TheTypeKey = " TheTypeKey,

if (TheTypeKey = global TheTypeKeyGR)
if (RealName = "hom_isMon__ELIM")
(private.declare-instance Factory TheType TheFactory Clauses CSL)
(if (TheTypeKey = global TheTypeKeyGR)
(std.do! [
std.findall (wrapper-mixin _ TheTypeKeyGR Factory) Wrappers,
coq.say "REDIN!!!!!!! WRAPPERS = " Wrappers,
if (Wrappers = [W|_])
% there is a wrapper (we actually don't want more than one)
(%private.derive-wrapper-instances TheFactory W Clauses CSL
private.declare-instance Factory TheType TheFactory Clauses CSL)
(private.derive-wrapper-instances Body W Clauses CSL
% private.declare-instance Factory TheType TheFactory Clauses CSL
)
% there happens to be no wrapper, just treat it as a normal instance
(private.declare-instance Factory TheType TheFactory Clauses CSL)
]
)
% there can be no wrapper, just treat it as a normal instance
(private.declare-instance Factory TheType TheFactory Clauses CSL)
)
].

% test predicate
Expand Down Expand Up @@ -793,10 +797,10 @@ dry-run Instance (wrapper-mixin WrapperMixin Subject Mixin) [] [] :- std.do! [
coq.say "DWI!!!!!!!!! Ty = " Ty,
coq.say "DWI!!!!!!!!! Dgn = " Dgn,

%if (Dgn = error S) (coq.say "error in NewInstance" S)
%(% coq.count-prods Ty N0,
% instance.declare-instance WrapperMixin _ NewInstance Clauses CSL
%),
if (Dgn = error S) (coq.say "error in NewInstance" S)
(coq.count-prods Ty N0
% instance.declare-instance WrapperMixin _ NewInstance Clauses CSL
),
].
dry-run _ _ [] [].

Expand Down