@@ -313,6 +313,29 @@ def test_bitvec_ranked_closure_matches_native_closure(
313313 assert ranked_closure == native_aba ._closure (framework , selected )
314314
315315
316+ def test_rules_by_consequent_groups_rules_deterministically () -> None :
317+ a1 = literal ("a1" )
318+ a2 = literal ("a2" )
319+ x = literal ("x" )
320+ y = literal ("y" )
321+ z = literal ("z" )
322+ first = Rule ((a2 ,), x , "strict" )
323+ second = Rule ((a1 ,), x , "strict" )
324+ third = Rule ((x ,), y , "strict" )
325+ framework = ABAFramework (
326+ language = frozenset ({a1 , a2 , x , y , z }),
327+ rules = frozenset ({third , first , second }),
328+ assumptions = frozenset ({a1 , a2 }),
329+ contrary = {a1 : y , a2 : z },
330+ )
331+
332+ grouped = aba_sat ._rules_by_consequent (framework , tuple (sorted (framework .language , key = repr )))
333+
334+ assert grouped [x ] == tuple (sorted ((first , second ), key = repr ))
335+ assert grouped [y ] == (third ,)
336+ assert grouped [z ] == ()
337+
338+
316339@given (flat_aba_frameworks (), st .data ())
317340@settings (deadline = 10000 , max_examples = 40 )
318341def test_preferred_support_sat_preserves_required_assumptions (
0 commit comments