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, added call to declare-…
…instance, now working
  • Loading branch information
ptorrx committed Jul 24, 2023
commit 3dbe65e2cc02412210c3c6a027ba19f62b6d51fc
36 changes: 25 additions & 11 deletions HB/instance.elpi
Original file line number Diff line number Diff line change
Expand Up @@ -528,20 +528,28 @@ declare-canonical-instances-from-factory Factory T F CSL :- std.do! [
synthesis.under-local-canonical-mixins-of.do! T [
list-w-params_list {factory-provides Factory} ML,
coq.say "DCIFF!!!!!!! Ex ML (mixin names) = " ML,
%std.findall (mixin-src (sort _) _ _) YYY,

% Clauses, MCSL and AllSubjects are outputs. currently, AllSubjects = [T]
add-all-mixins T Factory ML tt Clauses MCSL AllSubjects,
add-all-mixins T Factory ML tt ClausesFromF MCSL AllSubjects,
coq.say "DCIFF!!!!!!!!!! Ex AllSubjects = " AllSubjects,
% old (Clauses not used)
% instance.declare-all T {findall-classes-for ML} CCSL,
% hcumul-forall AllSubjects (s \ instance.declare-all s {findall-classes-for ML}) CCSL,
hcumul-forall AllSubjects (s \
instance.declare-all s {findall-classes-for ML}) CCSL,
]
],

% Clauses => instance.declare-all T {findall-classes-for ML} CCSL,
% new (should use Clauses and AllSubjects)
Clauses => hcumul-forall AllSubjects (s \ instance.declare-all s {findall-classes-for ML}) CCSL,

%std.findall (mixin-src (sort _) _ _) XXX,
%coq.say "XXX" XXX,
%coq.say "Clauses" Clauses,
%coq.say "YYY dentro il under-*" YYY,
%std.spy(
%Clauses => hcumul-forall AllSubjects (s \
% instance.declare-all s {findall-classes-for ML}) CCSL
%),
/*
%% New code:
% this should output all the candidate subjects too, as a new output argument.
Expand Down Expand Up @@ -712,11 +720,15 @@ derive-wrapper-instances Instance (wrapper-mixin WrapperMixin Subject Mixin)
% name generation doesn't work because of dot occurrences
% mk_wrapper_instance_name Wrapper_Mixin Instance Nm,
% instance.declare-const "funq_instance_name" NewInstance {coq.term->arity Ty N0} _
coq.safe-dest-app Ty _Factory FArgs,
std.nth NParams FArgs WrapperSubject,
coq.say "REDIN!!!!!!!!!!!!!! OK",
coq.say "REDIN!!!!!!!!!!!!!! WrapperMixin = " WrapperMixin,
coq.say "REDIN!!!!!!!!!!!!!! NewInstance = " NewInstance,

instance.declare-instance WrapperMixin _ NewInstance Clauses CSL
coq.say "REDIN!!!!!!!!!!!!!! WrapperSubject = " WrapperSubject,


private.declare-instance WrapperMixin WrapperSubject NewInstance Clauses CSL
)

/*
Expand All @@ -739,9 +751,9 @@ derive-wrapper-instances Instance (wrapper-mixin WrapperMixin Subject Mixin)
].
derive-wrapper-instances _ _ [] [].

pred private.dec-inst-and-close i:factoryname, i:term, i:term, i:arity, i:id,
pred dec-inst-and-close i:factoryname, i:term, i:term, i:arity, i:id,
o:list prop, o:list (pair id constant).
private.dec-inst-and-close Factory TheType TheFactory TyWP SectionName Clauses CSL :- std.do! [
dec-inst-and-close Factory TheType TheFactory TyWP SectionName Clauses CSL :- std.do! [

private.declare-instance Factory TheType TheFactory Clauses CSL,
% handle parameters via a section -- end
Expand Down Expand Up @@ -773,16 +785,18 @@ redirect-instances RealName Factory TheType TheFactory Body TyWP SectionName Cla
if-verbose (coq.say {header} "closing instance section"),
log.coq.env.end-section-name SectionName ),
% we accumulate clauses now that the section is over
acc-clauses current Clauses0,
Clauses0 => private.derive-wrapper-instances Body W Clauses CSL
%acc-clauses current Clauses0,
%coq.say "REDIN!!!!!!! Clauses0 = " Clauses0,
%Clauses0 =>
private.derive-wrapper-instances TheFactory 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.dec-inst-and-close Factory TheType TheFactory TyWP SectionName Clauses CSL)
]
)
% there can be no wrapper, just treat it as a normal instance
(private.declare-instance Factory TheType TheFactory Clauses CSL)
(private.dec-inst-and-close Factory TheType TheFactory TyWP SectionName Clauses CSL)
)
].

Expand Down