This class defines the interface used to "wrap" weights on rules and transitions. More...
Public Member Functions | |
Wrapper () | |
virtual | ~Wrapper () |
virtual sem_elem_t | wrap (wfa::ITrans const &t) |
virtual sem_elem_t | wrap (wpds::Rule const &r) |
virtual merge_fn_t | wrap (wpds::ewpds::ERule const &r, merge_fn_t user_merge) |
Wrapping of a rule's weight happens before wrapping of its merge function. | |
virtual sem_elem_t | unwrap (sem_elem_t se) |
virtual merge_fn_t | unwrap (merge_fn_t mf) |
This class defines the interface used to "wrap" weights on rules and transitions.
A Wrapper can be passed to a WPDS when it is created for adding functionality, e.g. Witnesses. The base class Wrapper is simply the identity wrapper. It returns the weight on the Rule and Trans when wrap is invoked and the same weight when unwrap is invoked.
Wrappers can be chained together. It is up to the Wrapper definer (i.e., the user) to take care of proper chaining. WALi assumes that unwrap will return an element from the user defined weight domain.
wali::wpds::Wrapper::Wrapper | ( | ) |
virtual wali::wpds::Wrapper::~Wrapper | ( | ) | [virtual] |
sem_elem_t wali::wpds::Wrapper::wrap | ( | wfa::ITrans const & | t | ) | [virtual] |
Reimplemented in wali::witness::WitnessWrapper.
References wali::wfa::ITrans::weight().
sem_elem_t wali::wpds::Wrapper::wrap | ( | wpds::Rule const & | r | ) | [virtual] |
Reimplemented in wali::witness::WitnessWrapper.
References wali::wpds::Rule::weight().
virtual merge_fn_t wali::wpds::Wrapper::wrap | ( | wpds::ewpds::ERule const & | r, | |
merge_fn_t | user_merge | |||
) | [virtual] |
Wrapping of a rule's weight happens before wrapping of its merge function.
Thus, the weight
r->weight()
has already been wrapped. For example, see how this is handled in wali::witness::WitnessWrapper.
Reimplemented in wali::witness::WitnessWrapper.
sem_elem_t wali::wpds::Wrapper::unwrap | ( | sem_elem_t | se | ) | [virtual] |
Reimplemented in wali::witness::WitnessWrapper.
merge_fn_t wali::wpds::Wrapper::unwrap | ( | merge_fn_t | mf | ) | [virtual] |
Reimplemented in wali::witness::WitnessWrapper.