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

Manage incomplete functions when calculating value #242

Merged
merged 4 commits into from
Mar 13, 2023

Conversation

IgnaceBleukx
Copy link
Collaborator

Implemented a new type of exception to work with incomplete functions.
Changed .value() computation of -> and or accordingly

@IgnaceBleukx IgnaceBleukx linked an issue Mar 1, 2023 that may be closed by this pull request
# Conflicts:
#	tests/test_expressions.py
try:
return a.value() if hasattr(a, "value") else a
except IncompleteFunctionError as e:
if a.is_bool(): return False
Copy link
Collaborator

Choose a reason for hiding this comment

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

One problem that could arise is: (x/0>0) == (x/0<0) which seems a bit counter-intuitive.

Copy link
Collaborator

Choose a reason for hiding this comment

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

E.g., if we unnest some nested x/0>0 we get p <-> x/0>0 and then p -> x/0>0 and ~p -> x/0 <= 0. If we now evaluate this, we get p -> false and ~p -> false, which is inconsistent. Maybe this will give weird unexpected unsatisfiabilities in the future, where passing the IncompleteFunctionError may have been more useful.

Copy link
Collaborator

@JoD JoD left a comment

Choose a reason for hiding this comment

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

If we accept the weirdness arising from treating incomplete function comparisons as false, then this MR looks good.

@IgnaceBleukx IgnaceBleukx merged commit c8b4d2c into master Mar 13, 2023
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.

Incomplete functions on rhs of implication
2 participants