Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

rv/rvgen: fix isinstance check in Variable.expand()

The Variable.expand() method in ltl2ba.py performs contradiction
detection by checking if a negated variable already exists in the
graph node's old set. However, the isinstance check was incorrectly
testing the ASTNode wrapper instead of the wrapped operator, causing
the check to always return False.

The old set contains ASTNode instances which wrap LTL operators via
their .op attribute. The fix changes isinstance(f, NotOp) to
isinstance(f.op, NotOp) to correctly examine the wrapped operator
type. This follows the established pattern used elsewhere in the
file, such as the iteration at lines 572-574 which accesses
o.op.is_temporal() on items from node.old.

Signed-off-by: Wander Lairson Costa <wander@redhat.com>
Reviewed-by: Nam Cao <namcao@linutronix.de>
Link: https://lore.kernel.org/r/20260223162407.147003-16-wander@redhat.com
Signed-off-by: Gabriele Monaco <gmonaco@redhat.com>

authored by

Wander Lairson Costa and committed by
Gabriele Monaco
8aee49c5 d7ee9623

+1 -1
+1 -1
tools/verification/rvgen/rvgen/ltl2ba.py
··· 395 395 @staticmethod 396 396 def expand(n: ASTNode, node: GraphNode, node_set) -> set[GraphNode]: 397 397 for f in node.old: 398 - if isinstance(f, NotOp) and f.op.child is n: 398 + if isinstance(f.op, NotOp) and f.op.child is n: 399 399 return node_set 400 400 node.old |= {n} 401 401 return node.expand(node_set)