-
-
Notifications
You must be signed in to change notification settings - Fork 46.6k
Fixes recursion exception in davisb_putnamb_logemann_loveland #5647
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
Conversation
The formula {{A3' , A1} , {A3} , {A4}} is satisfiable with the assignment {'A1': True, 'A4': True, 'A3': True}. The formula {{A3' , A1} , {A4} , {A3}} is raises a RecursionError and is not satisfiable. The formula {{A2' , A3} , {A2 , A3 , A5' , A1} , {A3} , {A5 , A1'}} is raises a RecursionError and is not satisfiable.
+ copies model to allow independent mutation. + python assigns by reference. both tmp models mutated the original model and the second over wrote the first. Recursion was going down the same branch each time.
…nevaluated symbols
+ filter out P during the copy rather than removing after the copy is both clearer and marginally more efficient. 1.5n -> n
|
print(f"satisfiable with the assignment {model}.") | ||
else: | ||
print("not satisfiable.") | ||
# recursion example: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would remove this block of code
@@ -292,6 +299,9 @@ def dpll_algorithm( | |||
>>> model | |||
{'A4': True} | |||
""" | |||
|
|||
# 2. Check any False |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2 and then 1?
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Describe your change:
Checklist:
Fixes: #{$ISSUE_NO}
.