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

CHR: constraints allow hyps, not considered in the clique error check #246

Merged
merged 10 commits into from
Jul 30, 2024

Conversation

FissoreD
Copy link
Collaborator

The grammar has been extended to support the new behavior

A test has been added

Copy link
Contributor

@gares gares left a comment

Choose a reason for hiding this comment

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

Please define a type with names so that there is no risk of confusing the hyps with the rest. Also, I think ?- is a better symbol than |- since it is the same.

src/compiler.ml Outdated Show resolved Hide resolved
@gares
Copy link
Contributor

gares commented Jul 23, 2024

There is something I don't get. CHR.new_clique should now have a different type, a clique should be two sets on symbols, not the union of the two sets. And the code filtering the context should use only that set of predicate names.

@gares
Copy link
Contributor

gares commented Jul 23, 2024

Also, I expect to see some code making the union of all the context filters (for the same clique).

@gares
Copy link
Contributor

gares commented Jul 23, 2024

elpi/src/runtime.ml

Lines 3417 to 3422 in af3bb10

match CHR.clique_of (head_of g) !chrules with
| Some clique -> (* real constraint *)
(* XXX head_of is weak because no clausify ? XXX *)
delay_goal ~filter_ctx:(fun { hsrc = x } -> C.Set.mem (head_of x) clique)
~depth prog ~goal:g (gid[@trace]) ~on:keys
| None -> delay_goal ~depth prog ~goal:g (gid[@trace]) ~on:keys

@gares
Copy link
Contributor

gares commented Jul 23, 2024

clique_of should also return the context filter, I guess

@FissoreD
Copy link
Collaborator Author

Yeah, I'm going in that direction:
type clique = {ctx_filter: Constants.Set.t; clique: Constants.Set.t} [@@deriving show]

@FissoreD
Copy link
Collaborator Author

I'm however a bit lost on how to correctly manage the ctx_filter

@gares
Copy link
Contributor

gares commented Jul 30, 2024

please rebase and update the README.md

@FissoreD FissoreD force-pushed the constraint-store-hypotheses branch from 3ff13c6 to 387e6fc Compare July 30, 2024 12:59
ELPI.md Outdated Show resolved Hide resolved
ELPI.md Outdated Show resolved Hide resolved
ELPI.md Outdated Show resolved Hide resolved
ELPI.md Outdated Show resolved Hide resolved
ELPI.md Outdated Show resolved Hide resolved
ELPI.md Outdated Show resolved Hide resolved
@gares gares merged commit 4cac107 into LPCIC:master Jul 30, 2024
7 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants