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

Improve and add basic miniKanren goals #20

Merged
merged 15 commits into from
Jan 31, 2020

Conversation

brandonwillard
Copy link
Member

@brandonwillard brandonwillard commented Jan 2, 2020

This PR introduces more of the standard miniKanren goals and rewrites current versions that rely on EarlyGoalError and are not able to handle all valid input types (e.g. goals that can't handle logic variables for some or all arguments).

Some new goals:

  • rembero: a goal representing the relation l.remove(b); l == out, where l and out are sequences and b is an element of l.
  • mapo: unlike map_anyo, a given binary relation must succeed for every corresponding element pair in the given sequences.

Ones that need to be rewritten:

  • appendo
  • membero
  • permuteq (rename to permuteo)
  • eq_assoc
  • eq_comm
  • eq_assoccomm

@brandonwillard brandonwillard added enhancement New feature or request important labels Jan 2, 2020
@brandonwillard brandonwillard self-assigned this Jan 2, 2020
@brandonwillard
Copy link
Member Author

Well, it looks like this PR also fixes some long-standing, fundamental issues with the associative/commutative relations. Both goals (and their combination) are now fully relational and they work with nested terms (i.e. it closes logpy/logpy#7).

There's definitely a lot that can be done to make them much more efficient, but first things first.

@brandonwillard brandonwillard merged commit cd96923 into pythological:master Jan 31, 2020
@brandonwillard brandonwillard deleted the improve-basic-goals branch January 31, 2020 06:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request important
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant