diff --git a/src/ifcopenshell-python/ifcopenshell/express/rule_compiler.py b/src/ifcopenshell-python/ifcopenshell/express/rule_compiler.py index 990608d792..bbc66674fd 100644 --- a/src/ifcopenshell-python/ifcopenshell/express/rule_compiler.py +++ b/src/ifcopenshell-python/ifcopenshell/express/rule_compiler.py @@ -8,6 +8,7 @@ import functools import itertools import ifcopenshell.express +import ifcopenshell.express.express_parser import networkx as nx @@ -331,7 +332,7 @@ def calc_{class_name}_{str(derived_attr.attribute_decl.redeclared_attribute.qual def process_domain_rule(context): return f""" -assert {context.expression} +assert ({context.expression}) is not False """ def process_expression(context): diff --git a/src/ifcopenshell-python/ifcopenshell/express/rule_executor.py b/src/ifcopenshell-python/ifcopenshell/express/rule_executor.py index 8b0f282608..5579d3cf41 100644 --- a/src/ifcopenshell-python/ifcopenshell/express/rule_executor.py +++ b/src/ifcopenshell-python/ifcopenshell/express/rule_executor.py @@ -7,7 +7,7 @@ from codegen import indent def reverse_compile(s): - return s.strip().replace("len(", "SIZEOF(").replace("assert ", "") + return s.strip().replace("len(", "SIZEOF(").replace("assert ", "").replace(" is not False", "") @dataclass