File tree Expand file tree Collapse file tree 1 file changed +0
-20
lines changed
Expand file tree Collapse file tree 1 file changed +0
-20
lines changed Original file line number Diff line number Diff line change @@ -1729,26 +1729,6 @@ def decision(
17291729 """
17301730 return (var & if_true ) | (~ var & if_false )
17311731
1732- def flatten_one_level (nnf : NNF ):
1733- """Flattens the first "level" of a formula by removing unnecessary extra nestings.
1734-
1735- param var: The formula to be flattened.
1736- """
1737- new_children = set ()
1738- outer_operator = type (nnf )
1739- # iterate through all children
1740- for c in nnf .children :
1741- if type (c ) == Var :
1742- new_children .add (c )
1743- # if the operator type is the same as the outer operator, flatten the formula
1744- # and remove the nested operator by only taking the children (i.e. And(And()) or Or(Or()))
1745- elif type (c ) == outer_operator :
1746- new_children .update (c .children )
1747- else :
1748- # otherwise, keep the operator as is if it is a different type (i.e. And(Or) or Or(And))
1749- new_children .add (c )
1750- return outer_operator (new_children )
1751-
17521732#: A node that's always true. Technically an And node without children.
17531733true = And () # type: And[Bottom]
17541734#: A node that's always false. Technically an Or node without children.
You can’t perform that action at this time.
0 commit comments