ProB API: Difference between revisions
From Event-B
Jump to navigationJump to search
imported>Jens No edit summary |
imported>Jens No edit summary |
||
Line 28: | Line 28: | ||
[[Image:Prob api1.png]] | [[Image:Prob api1.png]] | ||
== Communication API == | |||
* Builder to create well formed Prolog Queries | |||
* Communication Interface to send Queries to ProB | |||
** Hides possible distributed calculation, i.e. "feels" like having a single ProB | |||
* Parses the result from ProB (i.e. a Prolog term) | |||
* Creates a tree structure representing the term | |||
** Convenient to create Data-Objects from a term |
Revision as of 08:00, 4 February 2009
ProB API
Animator
- Animator represents one run of ProB
- Currently: At most one Animator per file (might change)
- Each animator has at least one corresponding probcli
- Getting the Animator associated with a file: AnimatorRegistry.getAnimator(file)
ICommand
- A Command encapsulate a sequence of ProB (Prolog) queries
- Commands can be composed from other Commands, e.g. Exploring a state
- Get enabled events
- Get values for constants and variables
- Get other properties (Invariant violation, Timeout, ...)
Note: Exploration could also be implemented by a sequence of Prolog Queries. This is a design decision that depends on whether we want to reuse parts of the sequence or not
Some implemented basic commands
- Load Machine
- Explore a State (i.e. calculate sucessors, invariant, ...)
- Execute (i.e. observe) an Event
- Evaluate an Expression or Predicate
- Consistency Checking
- LTL Model Checking
Using the API
Most Commands have a static method to create and execute an instance in a single method call
Communication API
- Builder to create well formed Prolog Queries
- Communication Interface to send Queries to ProB
- Hides possible distributed calculation, i.e. "feels" like having a single ProB
- Parses the result from ProB (i.e. a Prolog term)
- Creates a tree structure representing the term
- Convenient to create Data-Objects from a term