77 uint32_t output_pattern = input_pattern;
78 output_pattern ^= output_pattern << 13;
79 output_pattern ^= output_pattern >> 17;
80 output_pattern ^= output_pattern << 5;
82 std::vector<int> modelExpressions;
83 std::vector<int> forwardAssumptions, backwardAssumptions;
84 std::vector<bool> forwardModel, backwardModel;
92 if (!sat.
solve(modelExpressions, backwardModel, backwardAssumptions)) {
93 printf(
"backward solving failed!\n");
97 if (!sat.
solve(modelExpressions, forwardModel, forwardAssumptions)) {
98 printf(
"forward solving failed!\n");
102 printf(
"xorshift32 test with input pattern 0x%08x:\n", input_pattern);
104 printf(
"forward solution: input=0x%08x output=0x%08x\n",
108 printf(
"backward solution: input=0x%08x output=0x%08x\n",
112 if (forwardModel != backwardModel) {
113 printf(
"forward and backward results are inconsistend!\n");
117 printf(
"passed.\n\n");
std::vector< int > vec_var(int numBits)
uint64_t vec_model_get_unsigned(const std::vector< int > &modelExpressions, const std::vector< bool > &modelValues, const std::vector< int > &vec1) const
void vec_append_unsigned(std::vector< int > &vec, const std::vector< int > &vec1, uint64_t value)
bool solve(const std::vector< int > &modelExpressions, std::vector< bool > &modelValues, const std::vector< int > &assumptions)
void vec_append(std::vector< int > &vec, const std::vector< int > &vec1) const