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

Filter reflexive subset relations eagerly #177

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

ecstatic-morse
Copy link

Depends on rust-lang/datafrog#37.

Filter reflexive subset relations before they are added to the recent tuples list.

@ecstatic-morse ecstatic-morse marked this pull request as draft August 12, 2021 21:41
&live_to_dying_regions_o2pq,
&dying_can_reach_live,
|&(_origin2, _point1, point2), &origin1, &origin3| ((origin1, point2), origin3),
|&(_origin2, _point1, point2), &origin1, &origin3| {
(origin1 != origin3).then(|| ((origin1, point2), origin3))
Copy link
Member

Choose a reason for hiding this comment

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

Personally not a big fan of bool::then, but I don't mind if you and the others like it.

Copy link
Author

Choose a reason for hiding this comment

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

I quite like it. If you and/or Niko find it too obtuse, we can change it of course.

@lqd
Copy link
Member

lqd commented Aug 15, 2021

This is how I envisioned we would do this in the end, so this looks good to me once we publish a datafrog release including rust-lang/datafrog#37.

Do you remember if such predicates are accepted by Soufflé btw ? So that we can potentially extract datalog rules from our comments/book and easily run them with it (which is one of the reason they are (intended to be) written with upper-cased variables for example, and not the rust-like naming that they used to have).

Doesn't matter much if it doesn't support it, maybe we just add the symmetry-removing predicate as a comment rather than part of the rule, or not.

@ecstatic-morse
Copy link
Author

Souffle supports inequality as a predicate, along with many others, so that shouldn't be an issue. I like that it makes the rules correspond directly to the datafrog code.

@ecstatic-morse ecstatic-morse force-pushed the filter-symmetries-eagerly branch from ac7f36d to a6dbde6 Compare August 18, 2021 16:54
@lyxell
Copy link

lyxell commented Aug 18, 2021

I don't know the context here, but FYI, Soufflé has no requirements on the case of variables, you can even use the same identifier for the type and the attribute: i.e. .decl errors(loan: loan, point: point) is valid Soufflé.

@ecstatic-morse
Copy link
Author

Force pushed with rustfmt changes applied. There were some missing trailing commas as well.

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.

3 participants