Open benbrastmckie opened 1 week ago
Just doing some testing and got the following:
File "/home/benjamin/Documents/Philosophy/Projects/ModelChecker/Code/src/new
_checker/hidden_things.py", line 355, in __init__
semantics.premise_behavior(prem, semantics.main_world)
File "/home/benjamin/Documents/Philosophy/Projects/ModelChecker/Code/src/new
_checker/exposed_things.py", line 134, in true_at
return operator.true_at(*args, eval_world)
^^^^^^^^^^^^^^^^
AttributeError: 'BiconditionalOperator' object has no attribute 'true_at'
I ran the following:
premises = ["(D \\leftrightarrow A)", "((A \\rightarrow (B \\wedge C)) \\wedge D)"]
conclusions = ["\\neg B"]
Here is the definition I used:
# NOTE: third try
def derived_definition(self, leftarg, rightarg):
neg_left = [NegOperator, leftarg]
neg_right = [NegOperator, rightarg]
both_true = [AndOperator, leftarg, rightarg]
both_false = [AndOperator, neg_left, neg_right]
return [OrOperator, both_true, both_false]
I also experimented with the following but got the same error:
# NOTE: four try
def derived_definition(self, leftarg, rightarg):
right_to_left = [ConditionalOperator, leftarg, rightarg]
left_to_right = [ConditionalOperator, rightarg, leftarg]
return [AndOperator, right_to_left, left_to_right]
The ConditionalOperator
works great and the definition is similar.
Fixed it. I had BiconditionalOperator(Operator)
instead of BiconditionalOperator(DerivedOperator)
. Seems to all be working great! This is a really nice utility and will definitely save time later on.
To avoid the linter errors I made
derived_definition
inDerivedOperator
return an empty list, addedself
as a first argument to each, removed the decorator, and changed from the commented lines to the uncommented lines below fromDerivedOperator
:This seems to handle all of the linter errors. I'm wondering if
op_subclass
can also be dropped as now it only appears in error messages, changing those instances toself
. Let me know if you think this is a reasonable fix. If so, I'll clean up the comments, but if anything seems worth saving let me know.