@@ -84,8 +84,6 @@ class random_tracest
84
84
85
85
constant_exprt random_value (const typet &);
86
86
87
- symbolst inputs () const ;
88
- symbolst state_variables () const ;
89
87
symbolst remove_constrained (const symbolst &) const ;
90
88
91
89
void
@@ -440,80 +438,6 @@ constant_exprt random_tracest::random_value(const typet &type)
440
438
441
439
/* ******************************************************************\
442
440
443
- Function: random_tracest::inputs
444
-
445
- Inputs:
446
-
447
- Outputs:
448
-
449
- Purpose:
450
-
451
- \*******************************************************************/
452
-
453
- random_tracest::symbolst random_tracest::inputs () const
454
- {
455
- symbolst inputs;
456
-
457
- const auto &module_symbol = *transition_system.main_symbol ;
458
-
459
- if (module_symbol.type .id () != ID_module)
460
- throw ebmc_errort () << " expected a module but got "
461
- << module_symbol.type .id ();
462
-
463
- const auto &ports = module_symbol.type .find (ID_ports);
464
-
465
- // filter out the inputs
466
- for (auto &port : static_cast <const exprt &>(ports).operands ())
467
- {
468
- DATA_INVARIANT (port.id () == ID_symbol, " port must be a symbol" );
469
- if (port.get_bool (ID_input) && !port.get_bool (ID_output))
470
- {
471
- symbol_exprt input_symbol (port.get (ID_identifier), port.type ());
472
- input_symbol.add_source_location () = port.source_location ();
473
- inputs.push_back (std::move (input_symbol));
474
- }
475
- }
476
-
477
- return inputs;
478
- }
479
-
480
- /* ******************************************************************\
481
-
482
- Function: random_tracest::state_variables
483
-
484
- Inputs:
485
-
486
- Outputs:
487
-
488
- Purpose:
489
-
490
- \*******************************************************************/
491
-
492
- random_tracest::symbolst random_tracest::state_variables () const
493
- {
494
- symbolst state_variables;
495
-
496
- const auto &module_symbol = *transition_system.main_symbol ;
497
- const namespacet ns (transition_system.symbol_table );
498
-
499
- const auto &symbol_module_map =
500
- transition_system.symbol_table .symbol_module_map ;
501
- auto lower = symbol_module_map.lower_bound (module_symbol.name );
502
- auto upper = symbol_module_map.upper_bound (module_symbol.name );
503
-
504
- for (auto it = lower; it != upper; it++)
505
- {
506
- const symbolt &symbol = ns.lookup (it->second );
507
-
508
- if (symbol.is_state_var )
509
- state_variables.push_back (symbol.symbol_expr ());
510
- }
511
-
512
- return state_variables;
513
- }
514
-
515
- /* ******************************************************************\
516
-
517
441
Function: random_tracest::remove_constrained
518
442
519
443
Inputs:
@@ -665,12 +589,12 @@ void random_tracest::operator()(
665
589
ns,
666
590
true);
667
591
668
- auto inputs = this -> inputs ();
592
+ auto inputs = transition_system. inputs ();
669
593
670
594
if (inputs.empty ())
671
595
throw ebmc_errort () << " module does not have inputs" ;
672
596
673
- auto state_variables = this -> state_variables ();
597
+ auto state_variables = transition_system. state_variables ();
674
598
675
599
message.statistics () << " Found " << inputs.size () << " input(s) and "
676
600
<< state_variables.size () << " state variable(s)"
0 commit comments