bppy.model package
Subpackages
- bppy.model.event_selection package
- Submodules
- bppy.model.event_selection.event_selection_strategy module
- bppy.model.event_selection.experimental_smt_event_selection_strategy module
- bppy.model.event_selection.priority_based_event_selection_strategy module
- bppy.model.event_selection.rich_event_selection_strategy module
- bppy.model.event_selection.simple_event_selection_strategy module
- bppy.model.event_selection.smt_event_selection_strategy module
- bppy.model.event_selection.solver_based_event_selection_strategy module
- Module contents
Submodules
bppy.model.b_event module
bppy.model.b_thread module
bppy.model.bprogram module
- class bppy.model.bprogram.BProgram(bthreads=None, source_name=None, event_selection_strategy=None, listener=None)[source]
Bases:
objectA class to represent a Behavioral Program (BProgram) object.
Attributes
- source_namestr
A file name from which bthreads are imported.
- new_btlist
A list of new bthreads that have not been loaded yet.
- bthreadslist
A list of bthreads to be run in the BProgram.
- event_selection_strategy
EventSelectionStrategy A strategy object to select events and advance bthreads.
- listener
BProgramRunnerListener A listener object to be invoked at the start and end of the program, and at each event selection.
- variablesdict
A dictionary of variables declared in the source module (for SMT based event selection startegy).
- ticketslist
A list of bthread tickets (used in execution).
- external_events_queuelist
A queue to handle external events introduced into the BProgram.
- add_bthread(bt)[source]
Adds a new bthread to the BProgram (should be loaded after using
load_new_bthreads).Parameters
- btAny
The bthread to be added.
- advance_bthreads(tickets, m)[source]
Advances bthreads based on the selected event (m), using the event selection strategy satisfactions criteria (e.g., event was requested or waited for).
Parameters
- ticketslist
A list of bthread tickets.
- m
BEvent The selected event to be sent as message to the bthreads.
- enqueue_external_event(event)[source]
Enqueues an external event into the BProgram.
Parameters
- event
BEvent The external event to be enqueued.
- event
- load_new_bthreads()[source]
Loads all new bthreads into the BProgram.
The method uses
advance_bthreadsto load bthreads.
- next_event()[source]
Selects the next event in the BProgram using the event selection strategy.
If there are new bthreads that haven’t been loaded, a warning will be raised.
Returns
- event
BEvent The selected event to be processed.
- event
bppy.model.event_set module
- class bppy.model.event_set.AllExcept(event)[source]
Bases:
EventSetA class to represent a set of all events except some specified event or event set.
- class bppy.model.event_set.EmptyEventSet[source]
Bases:
EventSetA class to represent an empty event set.
- class bppy.model.event_set.EventSet(predicate, **kwargs)[source]
Bases:
objectA class to represent a symbolically defined set of events using a given predicate.
Attributes
- predicatecallable
The predicate that tests if an event is a member of this event set.
- datadict
Additional keyword arguments that could be used by the predicate.