@@ -3288,19 +3288,11 @@ TEST_CASE("mata::nfa::algorithms::minimize_hopcroft()") {
3288
3288
TEST_CASE (" mata::nfa::reduce_size_by_residual()" ) {
3289
3289
Nfa aut;
3290
3290
StateRenaming state_renaming;
3291
- ParameterMap params_after, params_with;
3292
- params_after[" algorithm" ] = " residual" ;
3293
- params_with[" algorithm" ] = " residual" ;
3294
3291
3295
3292
SECTION (" empty automaton" )
3296
3293
{
3297
- params_after[" type" ] = " after" ;
3298
- params_after[" direction" ] = " forward" ;
3299
- params_with[" type" ] = " with" ;
3300
- params_with[" direction" ] = " forward" ;
3301
-
3302
- Nfa result_after = reduce (aut, &state_renaming, params_after);
3303
- Nfa result_with = reduce (aut, &state_renaming, params_with);
3294
+ Nfa result_after = reduce (aut, &state_renaming, ReductionAlgorithm::RESIDUAL_AFTER);
3295
+ Nfa result_with = reduce (aut, &state_renaming, ReductionAlgorithm::RESIDUAL_WITH);
3304
3296
3305
3297
REQUIRE (result_after.delta .empty ());
3306
3298
REQUIRE (result_after.initial .empty ());
@@ -3311,16 +3303,12 @@ TEST_CASE("mata::nfa::reduce_size_by_residual()") {
3311
3303
3312
3304
SECTION (" simple automaton" )
3313
3305
{
3314
- params_after[" type" ] = " after" ;
3315
- params_after[" direction" ] = " forward" ;
3316
- params_with[" type" ] = " with" ;
3317
- params_with[" direction" ] = " forward" ;
3318
3306
aut.add_state (2 );
3319
3307
aut.initial .insert (1 );
3320
3308
3321
3309
aut.final .insert (2 );
3322
- Nfa result_after = reduce (aut, &state_renaming, params_after );
3323
- Nfa result_with = reduce (aut, &state_renaming, params_with );
3310
+ Nfa result_after = reduce (aut, &state_renaming, ReductionAlgorithm::RESIDUAL_AFTER );
3311
+ Nfa result_with = reduce (aut, &state_renaming, ReductionAlgorithm::RESIDUAL_WITH );
3324
3312
3325
3313
REQUIRE (result_after.num_of_states () == 0 );
3326
3314
REQUIRE (result_after.initial .empty ());
@@ -3330,8 +3318,8 @@ TEST_CASE("mata::nfa::reduce_size_by_residual()") {
3330
3318
REQUIRE (are_equivalent (aut, result_after));
3331
3319
3332
3320
aut.delta .add (1 , ' a' , 2 );
3333
- result_after = reduce (aut, &state_renaming, params_after );
3334
- result_with = reduce (aut, &state_renaming, params_with );
3321
+ result_after = reduce (aut, &state_renaming, ReductionAlgorithm::RESIDUAL_AFTER );
3322
+ result_with = reduce (aut, &state_renaming, ReductionAlgorithm::RESIDUAL_WITH );
3335
3323
3336
3324
REQUIRE (result_after.num_of_states () == 2 );
3337
3325
REQUIRE (result_after.initial [0 ]);
@@ -3343,10 +3331,6 @@ TEST_CASE("mata::nfa::reduce_size_by_residual()") {
3343
3331
3344
3332
SECTION (" medium automaton" )
3345
3333
{
3346
- params_after[" type" ] = " after" ;
3347
- params_after[" direction" ] = " forward" ;
3348
- params_with[" type" ] = " with" ;
3349
- params_with[" direction" ] = " forward" ;
3350
3334
aut.add_state (4 );
3351
3335
3352
3336
aut.initial = { 1 };
@@ -3359,8 +3343,8 @@ TEST_CASE("mata::nfa::reduce_size_by_residual()") {
3359
3343
aut.delta .add (3 , ' a' , 3 );
3360
3344
aut.delta .add (2 , ' a' , 1 );
3361
3345
3362
- Nfa result_after = reduce (aut, &state_renaming, params_after );
3363
- Nfa result_with = reduce (aut, &state_renaming, params_with );
3346
+ Nfa result_after = reduce (aut, &state_renaming, ReductionAlgorithm::RESIDUAL_AFTER );
3347
+ Nfa result_with = reduce (aut, &state_renaming, ReductionAlgorithm::RESIDUAL_WITH );
3364
3348
3365
3349
REQUIRE (result_after.num_of_states () == 4 );
3366
3350
REQUIRE (result_after.initial [0 ]);
@@ -3380,10 +3364,6 @@ TEST_CASE("mata::nfa::reduce_size_by_residual()") {
3380
3364
3381
3365
SECTION (" big automaton" )
3382
3366
{
3383
- params_after[" type" ] = " after" ;
3384
- params_after[" direction" ] = " forward" ;
3385
- params_with[" type" ] = " with" ;
3386
- params_with[" direction" ] = " forward" ;
3387
3367
aut.add_state (7 );
3388
3368
3389
3369
aut.initial = { 0 };
@@ -3423,8 +3403,8 @@ TEST_CASE("mata::nfa::reduce_size_by_residual()") {
3423
3403
aut.delta .add (6 , ' c' , 1 );
3424
3404
aut.delta .add (6 , ' d' , 1 );
3425
3405
3426
- Nfa result_after = reduce (aut, &state_renaming, params_after );
3427
- Nfa result_with = reduce (aut, &state_renaming, params_with );
3406
+ Nfa result_after = reduce (aut, &state_renaming, ReductionAlgorithm::RESIDUAL_AFTER );
3407
+ Nfa result_with = reduce (aut, &state_renaming, ReductionAlgorithm::RESIDUAL_WITH );
3428
3408
3429
3409
REQUIRE (result_after.num_of_states () == 5 );
3430
3410
REQUIRE (result_after.initial [0 ]);
@@ -3485,11 +3465,6 @@ TEST_CASE("mata::nfa::reduce_size_by_residual()") {
3485
3465
3486
3466
SECTION (" backward residual big automaton" )
3487
3467
{
3488
- params_after[" type" ] = " after" ;
3489
- params_after[" direction" ] = " backward" ;
3490
- params_with[" type" ] = " with" ;
3491
- params_with[" direction" ] = " backward" ;
3492
-
3493
3468
aut.add_state (7 );
3494
3469
3495
3470
aut.initial = { 0 };
@@ -3529,8 +3504,8 @@ TEST_CASE("mata::nfa::reduce_size_by_residual()") {
3529
3504
aut.delta .add (6 , ' c' , 1 );
3530
3505
aut.delta .add (6 , ' d' , 1 );
3531
3506
3532
- Nfa result_after = reduce (aut, &state_renaming, params_after );
3533
- Nfa result_with = reduce (aut, &state_renaming, params_with );
3507
+ Nfa result_after = reduce (aut, &state_renaming, ReductionAlgorithm::RESIDUAL_AFTER, ReductionDirection::BACKWARD );
3508
+ Nfa result_with = reduce (aut, &state_renaming, ReductionAlgorithm::RESIDUAL_WITH, ReductionDirection::BACKWARD );
3534
3509
3535
3510
REQUIRE (result_after.num_of_states () == 6 );
3536
3511
REQUIRE (result_after.initial [0 ]);
@@ -3562,28 +3537,6 @@ TEST_CASE("mata::nfa::reduce_size_by_residual()") {
3562
3537
REQUIRE (are_equivalent (aut, result_after));
3563
3538
3564
3539
}
3565
-
3566
- SECTION (" error checking" )
3567
- {
3568
- CHECK_THROWS_WITH (reduce (aut, &state_renaming, params_after),
3569
- Catch::Matchers::ContainsSubstring (" requires setting the \" type\" key in the \" params\" argument;" ));
3570
-
3571
- params_after[" type" ] = " bad_type" ;
3572
- CHECK_THROWS_WITH (reduce (aut, &state_renaming, params_after),
3573
- Catch::Matchers::ContainsSubstring (" requires setting the \" direction\" key in the \" params\" argument;" ));
3574
-
3575
- params_after[" direction" ] = " unknown_direction" ;
3576
- CHECK_THROWS_WITH (reduce (aut, &state_renaming, params_after),
3577
- Catch::Matchers::ContainsSubstring (" received an unknown value of the \" direction\" key" ));
3578
-
3579
- params_after[" direction" ] = " forward" ;
3580
- CHECK_THROWS_WITH (reduce (aut, &state_renaming, params_after),
3581
- Catch::Matchers::ContainsSubstring (" received an unknown value of the \" type\" key" ));
3582
-
3583
- params_after[" type" ] = " after" ;
3584
- CHECK_NOTHROW (reduce (aut, &state_renaming, params_after));
3585
-
3586
- }
3587
3540
}
3588
3541
3589
3542
TEST_CASE (" mata::nfa::union_norename()" ) {
0 commit comments