#include "ezsat.h"
#include <cmath>
#include <algorithm>
#include <cassert>
#include <string>
#include <stdlib.h>
Go to the source code of this file.
|
#define | X(op) case ezSAT::op: text += #op; break; |
|
|
static std::string | my_int_to_string (int i) |
|
static void | fulladder (ezSAT *that, int a, int b, int c, int &y, int &x) |
|
static void | halfadder (ezSAT *that, int a, int b, int &y, int &x) |
|
static int | my_clog2 (int x) |
|
static std::string | expression2str (const std::pair< ezSAT::OpId, std::vector< int >> &data) |
|
#define X |
( |
|
op | ) |
case ezSAT::op: text += #op; break; |
static std::string expression2str |
( |
const std::pair< ezSAT::OpId, std::vector< int >> & |
data | ) |
|
|
static |
Definition at line 1242 of file ezsat.cc.
1245 switch (data.first) {
1246 #define X(op) case ezSAT::op: text += #op; break;
1258 for (
auto it : data.second)
static std::string my_int_to_string(int i)
static void fulladder |
( |
ezSAT * |
that, |
|
|
int |
a, |
|
|
int |
b, |
|
|
int |
c, |
|
|
int & |
y, |
|
|
int & |
x |
|
) |
| |
|
static |
Definition at line 765 of file ezsat.cc.
767 int tmp = that->
XOR(a, b);
768 int new_x = that->
XOR(tmp, c);
769 int new_y = that->
OR(that->
AND(a, b), that->
AND(c, tmp));
771 printf(
"FULLADD> a=%s, b=%s, c=%s, carry=%s, sum=%s\n", that->
to_string(a).c_str(), that->
to_string(b).c_str(),
774 x = new_x, y = new_y;
int AND(_V a=0, _V b=0, _V c=0, _V d=0, _V e=0, _V f=0)
std::string to_string(int id) const
int XOR(_V a=0, _V b=0, _V c=0, _V d=0, _V e=0, _V f=0)
int OR(_V a=0, _V b=0, _V c=0, _V d=0, _V e=0, _V f=0)
static void halfadder |
( |
ezSAT * |
that, |
|
|
int |
a, |
|
|
int |
b, |
|
|
int & |
y, |
|
|
int & |
x |
|
) |
| |
|
static |
Definition at line 778 of file ezsat.cc.
780 int new_x = that->
XOR(a, b);
781 int new_y = that->
AND(a, b);
783 printf(
"HALFADD> a=%s, b=%s, carry=%s, sum=%s\n", that->
to_string(a).c_str(), that->
to_string(b).c_str(),
786 x = new_x, y = new_y;
int AND(_V a=0, _V b=0, _V c=0, _V d=0, _V e=0, _V f=0)
std::string to_string(int id) const
int XOR(_V a=0, _V b=0, _V c=0, _V d=0, _V e=0, _V f=0)
static int my_clog2 |
( |
int |
x | ) |
|
|
static |
Definition at line 1008 of file ezsat.cc.
1011 for (x--; x > 0; result++)
static std::string my_int_to_string |
( |
int |
i | ) |
|
|
static |
Definition at line 32 of file ezsat.cc.
36 snprintf(buffer, 64,
"%d", i);
39 return std::to_string(i);