Skip to content

Commit

Permalink
add backward test for naesat2maxcut
Browse files Browse the repository at this point in the history
  • Loading branch information
msakai committed Dec 11, 2024
1 parent c8176b8 commit 44e3495
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions test/Test/Converter.hs
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,16 @@ prop_naesat2maxcut_forward =
forAllAssignments (fst nae) $ \m ->
evalNAESAT m nae === (MaxCut.eval (transformForward info m) maxcut >= threshold)

prop_naesat2maxcut_backward :: Property
prop_naesat2maxcut_backward = forAll arbitraryNAESAT $ \nae ->
let ret@((g, threshold),info) = naesat2maxcut nae
in counterexample (show ret) $
forAll (arbitraryCut g) $ \cut ->
if MaxCut.eval cut g >= threshold then
evalNAESAT (transformBackward info cut) nae
else
True

prop_naesat2maxcut_json :: Property
prop_naesat2maxcut_json =
forAll arbitraryNAESAT $ \nae ->
Expand Down

0 comments on commit 44e3495

Please sign in to comment.