#include #include #include class Gate { public: std::string name; enum { AND, NAND, OR, NOR, XOR, XNOR, NOT, BUF, INPUT, OUTPUT } type; enum { VAL_ZERO, VAL_ONE, VAL_X } value; std::vector outputs; std::vector inputs; }; class Circuit { public: std::vector PIs; std::vector POs; std::unordered_map name2gate; void parse_from_file(const char *filename); };