Skip to content

Commit

Permalink
Added expr-info.cc (normally automatically generated) to repository t…
Browse files Browse the repository at this point in the history
…o enable cross compilation.
  • Loading branch information
mapgccv committed Apr 24, 2024
1 parent 320c0a9 commit 3819651
Show file tree
Hide file tree
Showing 3 changed files with 337 additions and 5 deletions.
5 changes: 0 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,11 @@ Testing
*.pyc
*.user
*~

.idea
*.csv

.vscode
/src/expr-info.cc
# /nl-writer2/include/mp/nl-opcodes.h
/test/end2end/.vs
/test/end2end/env
/test/end2end/cases/*.lp
/test/end2end/*.pyproj
/nl-writer2/include/mp/nl-opcodes.h
/doc/env
97 changes: 97 additions & 0 deletions nl-writer2/include/mp/nl-opcodes.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
// This file is automatically generated. Do not edit!

namespace mp {

/// Namespace nl.
/// Defines NL opcodes to be used, e.g., by the NL writer.
namespace nl {

/// Struct Opcode
struct Opcode {
int code; // the opcode
const char* name; // name
};

const Opcode ADD = { 0, "+" };
const Opcode SUB = { 1, "-" };
const Opcode MUL = { 2, "*" };
const Opcode DIV = { 3, "/" };
const Opcode MOD = { 4, "mod" };
const Opcode POW = { 5, "^" };
const Opcode LESS = { 6, "less" };
// Unused opcode: 7
// Unused opcode: 8
// Unused opcode: 9
// Unused opcode: 10
const Opcode MIN = { 11, "min" };
const Opcode MAX = { 12, "max" };
const Opcode FLOOR = { 13, "floor" };
const Opcode CEIL = { 14, "ceil" };
const Opcode ABS = { 15, "abs" };
const Opcode MINUS = { 16, "unary -" };
// Unused opcode: 17
// Unused opcode: 18
// Unused opcode: 19
const Opcode OR = { 20, "||" };
const Opcode AND = { 21, "&&" };
const Opcode LT = { 22, "<" };
const Opcode LE = { 23, "<=" };
const Opcode EQ = { 24, "=" };
// Unused opcode: 25
// Unused opcode: 26
// Unused opcode: 27
const Opcode GE = { 28, ">=" };
const Opcode GT = { 29, ">" };
const Opcode NE = { 30, "!=" };
// Unused opcode: 31
// Unused opcode: 32
// Unused opcode: 33
const Opcode NOT = { 34, "!" };
const Opcode IF = { 35, "if" };
// Unused opcode: 36
const Opcode TANH = { 37, "tanh" };
const Opcode TAN = { 38, "tan" };
const Opcode SQRT = { 39, "sqrt" };
const Opcode SINH = { 40, "sinh" };
const Opcode SIN = { 41, "sin" };
const Opcode LOG10 = { 42, "log10" };
const Opcode LOG = { 43, "log" };
const Opcode EXP = { 44, "exp" };
const Opcode COSH = { 45, "cosh" };
const Opcode COS = { 46, "cos" };
const Opcode ATANH = { 47, "atanh" };
const Opcode ATAN2 = { 48, "atan2" };
const Opcode ATAN = { 49, "atan" };
const Opcode ASINH = { 50, "asinh" };
const Opcode ASIN = { 51, "asin" };
const Opcode ACOSH = { 52, "acosh" };
const Opcode ACOS = { 53, "acos" };
const Opcode SUM = { 54, "sum" };
const Opcode TRUNC_DIV = { 55, "div" };
const Opcode PRECISION = { 56, "precision" };
const Opcode ROUND = { 57, "round" };
const Opcode TRUNC = { 58, "trunc" };
const Opcode COUNT = { 59, "count" };
const Opcode NUMBEROF = { 60, "numberof" };
const Opcode NUMBEROF_SYM = { 61, "symbolic numberof" };
const Opcode ATLEAST = { 62, "atleast" };
const Opcode ATMOST = { 63, "atmost" };
const Opcode PLTERM = { 64, "piecewise-linear term" };
const Opcode IFSYM = { 65, "symbolic if" };
const Opcode EXACTLY = { 66, "exactly" };
const Opcode NOT_ATLEAST = { 67, "!atleast" };
const Opcode NOT_ATMOST = { 68, "!atmost" };
const Opcode NOT_EXACTLY = { 69, "!exactly" };
const Opcode FORALL = { 70, "forall" };
const Opcode EXISTS = { 71, "exists" };
const Opcode IMPLICATION = { 72, "==>" };
const Opcode IFF = { 73, "<==>" };
const Opcode ALLDIFF = { 74, "alldiff" };
const Opcode NOT_ALLDIFF = { 75, "!alldiff" };
const Opcode POW_CONST_EXP = { 76, "^" };
const Opcode POW2 = { 77, "^2" };
const Opcode POW_CONST_BASE = { 78, "^" };

} // namespace nl
} // namespace mp

240 changes: 240 additions & 0 deletions src/expr-info.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,240 @@
// This file is automatically generated. Do not edit!

#include "mp/common.h"
#include "expr-writer.h"

const mp::internal::OpCodeInfo mp::internal::OpCodeInfo::INFO[] = {
{expr::ADD, expr::FIRST_BINARY},
{expr::SUB, expr::FIRST_BINARY},
{expr::MUL, expr::FIRST_BINARY},
{expr::DIV, expr::FIRST_BINARY},
{expr::MOD, expr::FIRST_BINARY},
{expr::POW, expr::FIRST_BINARY},
{expr::LESS, expr::FIRST_BINARY},
{expr::UNKNOWN, expr::UNKNOWN},
{expr::UNKNOWN, expr::UNKNOWN},
{expr::UNKNOWN, expr::UNKNOWN},
{expr::UNKNOWN, expr::UNKNOWN},
{expr::MIN, expr::FIRST_VARARG},
{expr::MAX, expr::FIRST_VARARG},
{expr::FLOOR, expr::FIRST_UNARY},
{expr::CEIL, expr::FIRST_UNARY},
{expr::ABS, expr::FIRST_UNARY},
{expr::MINUS, expr::FIRST_UNARY},
{expr::UNKNOWN, expr::UNKNOWN},
{expr::UNKNOWN, expr::UNKNOWN},
{expr::UNKNOWN, expr::UNKNOWN},
{expr::OR, expr::FIRST_BINARY_LOGICAL},
{expr::AND, expr::FIRST_BINARY_LOGICAL},
{expr::LT, expr::FIRST_RELATIONAL},
{expr::LE, expr::FIRST_RELATIONAL},
{expr::EQ, expr::FIRST_RELATIONAL},
{expr::UNKNOWN, expr::UNKNOWN},
{expr::UNKNOWN, expr::UNKNOWN},
{expr::UNKNOWN, expr::UNKNOWN},
{expr::GE, expr::FIRST_RELATIONAL},
{expr::GT, expr::FIRST_RELATIONAL},
{expr::NE, expr::FIRST_RELATIONAL},
{expr::UNKNOWN, expr::UNKNOWN},
{expr::UNKNOWN, expr::UNKNOWN},
{expr::UNKNOWN, expr::UNKNOWN},
{expr::NOT, expr::NOT},
{expr::IF, expr::IF},
{expr::UNKNOWN, expr::UNKNOWN},
{expr::TANH, expr::FIRST_UNARY},
{expr::TAN, expr::FIRST_UNARY},
{expr::SQRT, expr::FIRST_UNARY},
{expr::SINH, expr::FIRST_UNARY},
{expr::SIN, expr::FIRST_UNARY},
{expr::LOG10, expr::FIRST_UNARY},
{expr::LOG, expr::FIRST_UNARY},
{expr::EXP, expr::FIRST_UNARY},
{expr::COSH, expr::FIRST_UNARY},
{expr::COS, expr::FIRST_UNARY},
{expr::ATANH, expr::FIRST_UNARY},
{expr::ATAN2, expr::FIRST_BINARY},
{expr::ATAN, expr::FIRST_UNARY},
{expr::ASINH, expr::FIRST_UNARY},
{expr::ASIN, expr::FIRST_UNARY},
{expr::ACOSH, expr::FIRST_UNARY},
{expr::ACOS, expr::FIRST_UNARY},
{expr::SUM, expr::SUM},
{expr::TRUNC_DIV, expr::FIRST_BINARY},
{expr::PRECISION, expr::FIRST_BINARY},
{expr::ROUND, expr::FIRST_BINARY},
{expr::TRUNC, expr::FIRST_BINARY},
{expr::COUNT, expr::COUNT},
{expr::NUMBEROF, expr::NUMBEROF},
{expr::NUMBEROF_SYM, expr::NUMBEROF_SYM},
{expr::ATLEAST, expr::FIRST_LOGICAL_COUNT},
{expr::ATMOST, expr::FIRST_LOGICAL_COUNT},
{expr::PLTERM, expr::PLTERM},
{expr::IFSYM, expr::IFSYM},
{expr::EXACTLY, expr::FIRST_LOGICAL_COUNT},
{expr::NOT_ATLEAST, expr::FIRST_LOGICAL_COUNT},
{expr::NOT_ATMOST, expr::FIRST_LOGICAL_COUNT},
{expr::NOT_EXACTLY, expr::FIRST_LOGICAL_COUNT},
{expr::FORALL, expr::FIRST_ITERATED_LOGICAL},
{expr::EXISTS, expr::FIRST_ITERATED_LOGICAL},
{expr::IMPLICATION, expr::IMPLICATION},
{expr::IFF, expr::FIRST_BINARY_LOGICAL},
{expr::ALLDIFF, expr::FIRST_PAIRWISE},
{expr::NOT_ALLDIFF, expr::FIRST_PAIRWISE},
{expr::POW_CONST_EXP, expr::FIRST_BINARY},
{expr::POW2, expr::FIRST_UNARY},
{expr::POW_CONST_BASE, expr::FIRST_BINARY},
{expr::CALL, expr::CALL},
{expr::NUMBER, expr::NUMBER},
{expr::STRING, expr::STRING},
{expr::VARIABLE, expr::VARIABLE}
};

const mp::internal::ExprInfo mp::internal::ExprInfo::INFO[] = {
{-1, "unknown"},
{80, "number"},
{82, "variable"},
{-1, "common expression"},
{16, "unary -"},
{15, "abs"},
{13, "floor"},
{14, "ceil"},
{39, "sqrt"},
{77, "^2"},
{44, "exp"},
{43, "log"},
{42, "log10"},
{41, "sin"},
{40, "sinh"},
{46, "cos"},
{45, "cosh"},
{38, "tan"},
{37, "tanh"},
{51, "asin"},
{50, "asinh"},
{53, "acos"},
{52, "acosh"},
{49, "atan"},
{47, "atanh"},
{0, "+"},
{1, "-"},
{6, "less"},
{2, "*"},
{3, "/"},
{55, "div"},
{4, "mod"},
{5, "^"},
{78, "^"},
{76, "^"},
{48, "atan2"},
{56, "precision"},
{57, "round"},
{58, "trunc"},
{35, "if"},
{64, "piecewise-linear term"},
{79, "function call"},
{11, "min"},
{12, "max"},
{54, "sum"},
{60, "numberof"},
{61, "symbolic numberof"},
{59, "count"},
{80, "bool"},
{34, "!"},
{20, "||"},
{21, "&&"},
{73, "<==>"},
{22, "<"},
{23, "<="},
{24, "="},
{28, ">="},
{29, ">"},
{30, "!="},
{62, "atleast"},
{63, "atmost"},
{66, "exactly"},
{67, "!atleast"},
{68, "!atmost"},
{69, "!exactly"},
{72, "==>"},
{71, "exists"},
{70, "forall"},
{74, "alldiff"},
{75, "!alldiff"},
{81, "string"},
{65, "symbolic if"}
};

const mp::prec::Precedence mp::expr::PrecInfo::INFO[] = {
prec::UNKNOWN,
prec::PRIMARY,
prec::PRIMARY,
prec::PRIMARY,
prec::UNARY,
prec::CALL,
prec::CALL,
prec::CALL,
prec::CALL,
prec::EXPONENTIATION,
prec::CALL,
prec::CALL,
prec::CALL,
prec::CALL,
prec::CALL,
prec::CALL,
prec::CALL,
prec::CALL,
prec::CALL,
prec::CALL,
prec::CALL,
prec::CALL,
prec::CALL,
prec::CALL,
prec::CALL,
prec::ADDITIVE,
prec::ADDITIVE,
prec::ADDITIVE,
prec::MULTIPLICATIVE,
prec::MULTIPLICATIVE,
prec::MULTIPLICATIVE,
prec::MULTIPLICATIVE,
prec::EXPONENTIATION,
prec::EXPONENTIATION,
prec::EXPONENTIATION,
prec::CALL,
prec::CALL,
prec::CALL,
prec::CALL,
prec::CONDITIONAL,
prec::CALL,
prec::CALL,
prec::CALL,
prec::CALL,
prec::ITERATIVE,
prec::CALL,
prec::CALL,
prec::CALL,
prec::PRIMARY,
prec::NOT,
prec::LOGICAL_OR,
prec::LOGICAL_AND,
prec::IFF,
prec::RELATIONAL,
prec::RELATIONAL,
prec::RELATIONAL,
prec::RELATIONAL,
prec::RELATIONAL,
prec::RELATIONAL,
prec::CALL,
prec::CALL,
prec::CALL,
prec::CALL,
prec::CALL,
prec::CALL,
prec::IMPLICATION,
prec::CALL,
prec::CALL,
prec::CALL,
prec::CALL,
prec::PRIMARY,
prec::CONDITIONAL
};

0 comments on commit 3819651

Please sign in to comment.