Skip to content

Commit eafefbd

Browse files
committed
NonlinWork: added new functions, rework of the accessible parts
1 parent 8a06e78 commit eafefbd

File tree

4 files changed

+17
-14
lines changed

4 files changed

+17
-14
lines changed

src/logics/ArithLogic.cc

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -114,10 +114,8 @@ ArithLogic::ArithLogic(Logic_t type)
114114
sym_Real_MINUS(declareFun_NoScoping_LeftAssoc(tk_real_minus, sort_REAL, {sort_REAL, sort_REAL})),
115115
sym_Real_PLUS(declareFun_Commutative_NoScoping_LeftAssoc(tk_real_plus, sort_REAL, {sort_REAL, sort_REAL})),
116116
sym_Real_TIMES(declareFun_Commutative_NoScoping_LeftAssoc(tk_real_times, sort_REAL, {sort_REAL, sort_REAL})),
117-
sym_Real_TIMES_LIN(
118-
declareFun_Commutative_NoScoping_LeftAssoc(tk_real_times, sort_REAL, {sort_REAL, sort_REAL}, true)),
119-
sym_Real_TIMES_NONLIN(
120-
declareFun_Commutative_NoScoping_LeftAssoc(tk_real_times, sort_REAL, {sort_REAL, sort_REAL}, true)),
117+
sym_Real_TIMES_LIN(declareFun_Multiplication_Duplicate(tk_real_times, sort_REAL, {sort_REAL, sort_REAL})),
118+
sym_Real_TIMES_NONLIN(declareFun_Multiplication_Duplicate(tk_real_times, sort_REAL, {sort_REAL, sort_REAL})),
121119
sym_Real_DIV(declareFun_NoScoping_LeftAssoc(tk_real_div, sort_REAL, {sort_REAL, sort_REAL})),
122120
sym_Real_EQ(sortToEquality[sort_REAL]),
123121
sym_Real_LEQ(declareFun_NoScoping_Chainable(tk_real_leq, sort_BOOL, {sort_REAL, sort_REAL})),
@@ -138,9 +136,8 @@ ArithLogic::ArithLogic(Logic_t type)
138136
sym_Int_MINUS(declareFun_NoScoping_LeftAssoc(tk_int_minus, sort_INT, {sort_INT, sort_INT})),
139137
sym_Int_PLUS(declareFun_Commutative_NoScoping_LeftAssoc(tk_int_plus, sort_INT, {sort_INT, sort_INT})),
140138
sym_Int_TIMES(declareFun_Commutative_NoScoping_LeftAssoc(tk_int_times, sort_INT, {sort_INT, sort_INT})),
141-
sym_Int_TIMES_LIN(declareFun_Commutative_NoScoping_LeftAssoc(tk_int_times, sort_INT, {sort_INT, sort_INT}, true)),
142-
sym_Int_TIMES_NONLIN(
143-
declareFun_Commutative_NoScoping_LeftAssoc(tk_int_times, sort_INT, {sort_INT, sort_INT}, true)),
139+
sym_Int_TIMES_LIN(declareFun_Multiplication_Duplicate(tk_int_times, sort_INT, {sort_INT, sort_INT})),
140+
sym_Int_TIMES_NONLIN(declareFun_Multiplication_Duplicate(tk_int_times, sort_INT, {sort_INT, sort_INT})),
144141
sym_Int_DIV(declareFun_NoScoping_LeftAssoc(tk_int_div, sort_INT, {sort_INT, sort_INT})),
145142
sym_Int_MOD(declareFun_NoScoping(tk_int_mod, sort_INT, {sort_INT, sort_INT})),
146143
sym_Int_EQ(sortToEquality[sort_INT]),

src/logics/Logic.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -728,11 +728,11 @@ PTRef Logic::mkSelect(vec<PTRef> && args) {
728728
}
729729

730730
SymRef Logic::declareFun(std::string const & fname, SRef rsort, vec<SRef> const & args,
731-
SymbolConfig const & symbolConfig, bool subSymb) {
731+
SymbolConfig const & symbolConfig) {
732732
assert(rsort != SRef_Undef);
733733
assert(std::find(args.begin(), args.end(), SRef_Undef) == args.end());
734734

735-
SymRef sr = sym_store.newSymb(fname.c_str(), rsort, args, symbolConfig, subSymb);
735+
SymRef sr = sym_store.newSymb(fname.c_str(), rsort, args, symbolConfig);
736736
return sr;
737737
}
738738

src/logics/Logic.h

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -164,8 +164,7 @@ class Logic {
164164
virtual PTRef mkConst(char const *);
165165
virtual PTRef mkConst(SRef, char const *);
166166

167-
SymRef declareFun(std::string const & fname, SRef rsort, vec<SRef> const & args, SymbolConfig const & symbolConfig,
168-
bool duplicate = false);
167+
SymRef declareFun(std::string const & fname, SRef rsort, vec<SRef> const & args, SymbolConfig const & symbolConfig);
169168
SymRef declareFun(std::string const & fname, SRef rsort, vec<SRef> const & args) {
170169
return declareFun(fname, rsort, args, SymConf::Default);
171170
}
@@ -184,9 +183,12 @@ class Logic {
184183
SymRef declareFun_NoScoping_Pairwise(std::string const & s, SRef rsort, vec<SRef> const & args) {
185184
return declareFun(s, rsort, args, SymConf::NoScopingPairwise);
186185
}
187-
SymRef declareFun_Commutative_NoScoping_LeftAssoc(std::string const & s, SRef rsort, vec<SRef> const & args,
188-
bool subSymb = false) {
189-
return declareFun(s, rsort, args, SymConf::CommutativeNoScopingLeftAssoc, subSymb);
186+
SymRef declareFun_Commutative_NoScoping_LeftAssoc(std::string const & s, SRef rsort, vec<SRef> const & args) {
187+
return declareFun(s, rsort, args, SymConf::CommutativeNoScopingLeftAssoc);
188+
}
189+
SymRef declareFun_Multiplication_Duplicate(std::string const & s, SRef rsort, vec<SRef> const & args) {
190+
SymRef sr = sym_store.newUnparsableSymb(s.c_str(), rsort, args, SymConf::CommutativeNoScopingLeftAssoc);
191+
return sr;
190192
}
191193
SymRef declareFun_Commutative_NoScoping_Chainable(std::string const & s, SRef rsort, vec<SRef> const & args) {
192194
return declareFun(s, rsort, args, SymConf::CommutativeNoScopingChainable);

src/symbols/SymStore.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,15 @@ class SymStore {
4040
SymStore(SymStore &&) = default;
4141
SymStore & operator=(SymStore &&) = default;
4242
// Constructs a new symbol.
43+
4344
SymRef newSymb(char const * fname, SRef rsort, vec<SRef> const & args, SymbolConfig const & symConfig,
4445
bool subSymb = false);
4546
SymRef newSymb(char const * fname, SRef rsort, vec<SRef> const & args) {
4647
return newSymb(fname, rsort, args, SymConf::Default);
4748
}
49+
SymRef newUnparsableSymb(char const * fname, SRef rsort, vec<SRef> const & args, SymbolConfig const & symConfig) {
50+
return newSymb(fname, rsort, args, symConfig, true);
51+
}
4852
bool contains(char const * fname) const { return symbolTable.has(fname); }
4953
vec<SymRef> const & nameToRef(char const * s) const { return symbolTable[s]; }
5054
vec<SymRef> & nameToRef(char const * s) { return symbolTable[s]; }

0 commit comments

Comments
 (0)