CBMC
|
Non-leaf enumerator enumerates expressions of form f(a_1, a_2, ..., a_n) where a_i's are sub-expressions enumerated by sub-enumerators. More...
#include <expr_enumerator.h>
Public Member Functions | |
non_leaf_enumeratort (const enumeratorst &enumerators, const std::function< bool(const partitiont &)> partition_check, const namespacet &ns) | |
non_leaf_enumeratort (const enumeratorst &enumerators, const namespacet &ns) | |
As default: no optimization. partition_check Accept all partitions. More... | |
expr_sett | enumerate (const std::size_t size) const override |
std::set< expr_listt > | cartesian_product_of_enumerators (const enumeratorst &enumerators, const enumeratorst::const_iterator &it, const partitiont &partition, const partitiont::const_iterator &it_partition) const |
Given a list enumerators of enumerators, return the Cartesian product of expressions enumerated by each enumerator in the list. More... | |
std::list< partitiont > | get_partitions (const std::size_t n, const std::size_t k) const |
Enumerate all partitions of n into k components. More... | |
virtual bool | is_equivalence_class_representation (const expr_listt &es) const |
As default, keep all expression tuples. More... | |
Public Member Functions inherited from enumerator_baset | |
enumerator_baset (const namespacet &ns) | |
enumerator_baset (const enumerator_baset &other)=delete | |
enumerator_baset & | operator= (const enumerator_baset &other)=delete |
virtual | ~enumerator_baset ()=default |
Protected Member Functions | |
virtual exprt | instantiate (const expr_listt &exprs) const =0 |
Combine a list of sub-expressions to construct the top-level expression. More... | |
Protected Attributes | |
const std::size_t | arity |
const enumeratorst | sub_enumerators |
const std::function< bool(const partitiont &)> | is_good_partition |
Protected Attributes inherited from enumerator_baset | |
const namespacet & | ns |
Non-leaf enumerator enumerates expressions of form f(a_1, a_2, ..., a_n) where a_i's are sub-expressions enumerated by sub-enumerators.
Definition at line 154 of file expr_enumerator.h.
|
inline |
enumerators | a list of enumerator (e_1,...,e_n), where a_i in the expressions enumerated by this enumerator can be enumerated by the enumerator e_i. |
partition_check | an optional function checking whether a partition can be safely discarded. |
ns | namespace used by simplify_expr . |
Definition at line 163 of file expr_enumerator.h.
|
inline |
As default: no optimization. partition_check
Accept all partitions.
Definition at line 177 of file expr_enumerator.h.
std::set< expr_listt > non_leaf_enumeratort::cartesian_product_of_enumerators | ( | const enumeratorst & | enumerators, |
const enumeratorst::const_iterator & | it, | ||
const partitiont & | partition, | ||
const partitiont::const_iterator & | it_partition | ||
) | const |
Given a list enumerators
of enumerators, return the Cartesian product of expressions enumerated by each enumerator in the list.
Current enumerator is the last enumerator. Add all expressions enumerated by it_enumerators
to result
.
First compute the Cartesian product of enumerators after it_enumerators
. And then append the expressions enumerated by the it_enumerators
to every list in the Cartesian product.
Definition at line 57 of file expr_enumerator.cpp.
|
overridevirtual |
Implements enumerator_baset.
Definition at line 24 of file expr_enumerator.cpp.
std::list< partitiont > non_leaf_enumeratort::get_partitions | ( | const std::size_t | n, |
const std::size_t | k | ||
) | const |
Enumerate all partitions of n into k components.
Order of partitions is considered relevant.
Definition at line 234 of file expr_enumerator.cpp.
|
protectedpure virtual |
Combine a list of sub-expressions to construct the top-level expression.
Implemented in binary_functional_enumeratort.
|
inlinevirtual |
As default, keep all expression tuples.
Reimplemented in binary_functional_enumeratort.
Definition at line 201 of file expr_enumerator.h.
|
protected |
Definition at line 210 of file expr_enumerator.h.
|
protected |
Definition at line 212 of file expr_enumerator.h.
|
protected |
Definition at line 211 of file expr_enumerator.h.