Skip to content

Commit

Permalink
NLW: add nl-opcodes.h #30
Browse files Browse the repository at this point in the history
  • Loading branch information
glebbelov committed Feb 21, 2024
1 parent 3ce510b commit 8b79e12
Show file tree
Hide file tree
Showing 2 changed files with 98 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Testing

.vscode
/src/expr-info.cc
/nl-writer2/include/mp/nl-opcodes.h
# /nl-writer2/include/mp/nl-opcodes.h
/test/end2end/.vs
/test/end2end/env
/test/end2end/cases/*.lp
Expand Down
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

0 comments on commit 8b79e12

Please sign in to comment.