We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Right now I use divmod for defining an is_prime rule but actually X % Y == 0 would be more concise.
divmod
X % Y == 0
pyDatalog.create_terms('divmod') @pyDatalog.program() def _(): divisible(X, Y) <= (divmod(X, Y)[1] == 0) divisible(X, Y) <= (X > Y+1) & divisible(X, Y+1) +is_prim(2) is_prim(X) <= (X > 2) & ~divisible(X, 2) print(X.in_(range(10)) & is_prim(X))
The text was updated successfully, but these errors were encountered:
There is a function version of % operator in the python library you can use.
Sorry, something went wrong.
No branches or pull requests
Right now I use
divmod
for defining an is_prime rule but actuallyX % Y == 0
would be more concise.The text was updated successfully, but these errors were encountered: