Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
term.cpp
Go to the documentation of this file.
2#include "term.hpp"
3
4namespace smt_terms {
5
14STerm STerm::Var(const std::string& name, Solver* slv, TermType type)
15{
16 return STerm(name, slv, false, 16, type);
17};
18
29STerm STerm::Const(const std::string& val, Solver* slv, uint32_t base, TermType type)
30{
31 return STerm(val, slv, true, base, type);
32};
33
44STerm STerm::Const(const bb::fr& val, Solver* slv, TermType type)
45{
46 std::stringstream buf; // TODO(#893)
47 buf << val;
48 std::string tmp = buf.str();
49 tmp[1] = '0'; // avoiding `x` in 0x prefix
50
51 return Const(tmp, slv, 16, type);
52};
53
54STerm::STerm(const std::string& t, Solver* slv, bool isconst, uint32_t base, TermType type)
55 : solver(slv)
56 , type(type)
57 , operations(typed_operations.at(type))
58{
59 if (!isconst) {
60 cvc5::Term ge;
61 cvc5::Term lt;
62 cvc5::Term modulus;
63 switch (type) {
65 this->term = slv->term_manager.mkConst(slv->ff_sort, t);
66 break;
68 this->term = slv->term_manager.mkConst(slv->term_manager.getIntegerSort(), t);
69 ge = slv->term_manager.mkTerm(cvc5::Kind::GEQ, { this->term, slv->term_manager.mkInteger(0) });
70 modulus = slv->term_manager.mkInteger(slv->modulus);
71 lt = slv->term_manager.mkTerm(cvc5::Kind::LT, { this->term, modulus });
72 slv->assertFormula(ge);
73 slv->assertFormula(lt);
74 break;
75 case TermType::ITerm:
76 this->term = slv->term_manager.mkConst(slv->term_manager.getIntegerSort(), t);
77 break;
79 this->term = slv->term_manager.mkConst(slv->bv_sort, t);
80 break;
81 default:
82 info("Invalid TermType was provided for STerm constructor. Expected: FFTerm, FFITerm, ITerm, BVTerm. Got: ",
83 type);
84 abort();
85 }
86 } else {
87 std::string strvalue;
88 switch (type) {
90 this->term = slv->term_manager.mkFiniteFieldElem(t, slv->ff_sort, base);
91 break;
93 // TODO(alex): CVC5 doesn't provide integer initialization from hex. Yet.
94 strvalue = slv->term_manager.mkFiniteFieldElem(t, slv->ff_sort, base).getFiniteFieldValue();
95 this->term = slv->term_manager.mkInteger(strvalue);
96 this->term = this->mod().term;
97 break;
98 case TermType::ITerm:
99 strvalue = slv->term_manager.mkFiniteFieldElem(t, slv->ff_sort, base).getFiniteFieldValue();
100 this->term = slv->term_manager.mkInteger(strvalue);
101 break;
102 case TermType::BVTerm:
103 // it's better to have (-p/2, p/2) representation due to overflows
104 strvalue = slv->term_manager.mkFiniteFieldElem(t, slv->ff_sort, base).getFiniteFieldValue();
105 this->term = slv->term_manager.mkBitVector(slv->bv_sort.getBitVectorSize(), strvalue, 10);
106 break;
107 default:
108 info("Invalid TermType was provided for STerm constructor. Expected: FFTerm, FFITerm, ITerm, BVTerm. Got: ",
109 type);
110 abort();
111 }
112 }
113}
114
120{
121 if (!this->operations.contains(OpType::MOD)) {
122 info("Taking a remainder is not compatible with ", this->type);
123 return *this;
124 }
125 cvc5::Term modulus = this->solver->term_manager.mkInteger(solver->modulus);
126 cvc5::Term res_s = this->solver->term_manager.mkTerm(this->operations.at(OpType::MOD), { this->term, modulus });
127 return { res_s, this->solver, this->type };
128}
129
141{
142 bool needs_normalization = this->type == TermType::FFITerm && this->term.getNumChildren() > 1;
143 return needs_normalization ? this->mod() : *this;
144}
145
146STerm STerm::operator+(const STerm& other) const
147{
148 cvc5::Term res = this->solver->term_manager.mkTerm(this->operations.at(OpType::ADD), { this->term, other.term });
149 return { res, this->solver, this->type };
150}
151
152void STerm::operator+=(const STerm& other)
153{
154 this->term = this->solver->term_manager.mkTerm(this->operations.at(OpType::ADD), { this->term, other.term });
155}
156
157STerm STerm::operator-(const STerm& other) const
158{
159 cvc5::Term res = this->solver->term_manager.mkTerm(this->operations.at(OpType::NEG), { other.term });
160 res = solver->term_manager.mkTerm(this->operations.at(OpType::ADD), { this->term, res });
161 return { res, this->solver, this->type };
162}
163
164void STerm::operator-=(const STerm& other)
165{
166 cvc5::Term tmp_term = this->solver->term_manager.mkTerm(this->operations.at(OpType::NEG), { other.term });
167 this->term = this->solver->term_manager.mkTerm(this->operations.at(OpType::ADD), { this->term, tmp_term });
168}
169
171{
172 cvc5::Term res = this->solver->term_manager.mkTerm(this->operations.at(OpType::NEG), { this->term });
173 return { res, this->solver, this->type };
174}
175
176STerm STerm::operator*(const STerm& other) const
177{
178 cvc5::Term res = solver->term_manager.mkTerm(this->operations.at(OpType::MUL), { this->term, other.term });
179 return { res, this->solver, this->type };
180}
181
182void STerm::operator*=(const STerm& other)
183{
184 this->term = this->solver->term_manager.mkTerm(this->operations.at(OpType::MUL), { this->term, other.term });
185}
186
197STerm STerm::operator/(const STerm& other) const
198{
199 if (!this->operations.contains(OpType::DIV)) {
200 info("Division is not compatible with ", this->type);
201 return *this;
202 }
203 other != bb::fr(0);
204 if (this->type == TermType::FFTerm || this->type == TermType::FFITerm) {
205 // Random value added to the name to prevent collisions. This value is MD5('Aztec')
206 STerm res = Var("df8b586e3fa7a1224ec95a886e17a7da_div_" + static_cast<std::string>(*this) + "_" +
207 static_cast<std::string>(other),
208 this->solver,
209 this->type);
210 res* other == *this;
211 return res;
212 }
213 cvc5::Term res_s = this->solver->term_manager.mkTerm(this->operations.at(OpType::DIV), { this->term, other.term });
214 return { res_s, this->solver, this->type };
215}
216
217void STerm::operator/=(const STerm& other)
218{
219 if (!this->operations.contains(OpType::DIV)) {
220 info("Division is not compatible with ", this->type);
221 return;
222 }
223 other != bb::fr(0);
224 if (this->type == TermType::FFTerm || this->type == TermType::FFITerm) {
225 // Random value added to the name to prevent collisions. This value is MD5('Aztec')
226 STerm res = Var("df8b586e3fa7a1224ec95a886e17a7da_div_" + static_cast<std::string>(*this) + "_" +
227 static_cast<std::string>(other),
228 this->solver,
229 this->type);
230 res* other == *this;
231 this->term = res.term;
232 return;
233 }
234 this->term = this->solver->term_manager.mkTerm(this->operations.at(OpType::DIV), { this->term, other.term });
235}
236
241void STerm::operator==(const STerm& other) const
242{
243 STerm left = this->normalize();
244 STerm right = other.normalize();
245
246 cvc5::Term eq = this->solver->term_manager.mkTerm(cvc5::Kind::EQUAL, { left.term, right.term });
247 this->solver->assertFormula(eq);
248}
249
254void STerm::operator!=(const STerm& other) const
255{
256 STerm left = this->normalize();
257 STerm right = other.normalize();
258
259 cvc5::Term eq = this->solver->term_manager.mkTerm(cvc5::Kind::EQUAL, { left.term, right.term });
260 eq = this->solver->term_manager.mkTerm(cvc5::Kind::NOT, { eq });
261 this->solver->assertFormula(eq);
262}
263
264void STerm::operator<(const STerm& other) const
265{
266 if (!this->operations.contains(OpType::LT)) {
267 info("LT is not compatible with ", this->type);
268 return;
269 }
270
271 STerm left = this->normalize();
272 STerm right = other.normalize();
273
274 cvc5::Term lt = this->solver->term_manager.mkTerm(this->operations.at(OpType::LT), { left.term, right.term });
275 this->solver->assertFormula(lt);
276}
277
278void STerm::operator<=(const STerm& other) const
279{
280 if (!this->operations.contains(OpType::LE)) {
281 info("LE is not compatible with ", this->type);
282 return;
283 }
284
285 STerm left = this->normalize();
286 STerm right = other.normalize();
287
288 cvc5::Term le = this->solver->term_manager.mkTerm(this->operations.at(OpType::LE), { left.term, right.term });
289 this->solver->assertFormula(le);
290}
291
292void STerm::operator>(const STerm& other) const
293{
294 if (!this->operations.contains(OpType::GT)) {
295 info("GT is not compatible with ", this->type);
296 return;
297 }
298
299 STerm left = this->normalize();
300 STerm right = other.normalize();
301
302 cvc5::Term gt = this->solver->term_manager.mkTerm(this->operations.at(OpType::GT), { left.term, right.term });
303 this->solver->assertFormula(gt);
304}
305
306void STerm::operator>=(const STerm& other) const
307{
308 if (!this->operations.contains(OpType::GE)) {
309 info("GE is not compatible with ", this->type);
310 return;
311 }
312
313 STerm left = this->normalize();
314 STerm right = other.normalize();
315
316 cvc5::Term ge = this->solver->term_manager.mkTerm(this->operations.at(OpType::GE), { left.term, other.term });
317 this->solver->assertFormula(ge);
318}
319
320STerm STerm::operator%(const STerm& other) const
321{
322 if (!this->operations.contains(OpType::MOD)) {
323 info("MOD is not compatible with ", this->type);
324 return *this;
325 }
326 cvc5::Term res = solver->term_manager.mkTerm(this->operations.at(OpType::MOD), { this->term, other.term });
327 return { res, this->solver, this->type };
328}
329
330STerm STerm::operator^(const STerm& other) const
331{
332 if (!this->operations.contains(OpType::XOR)) {
333 info("XOR is not compatible with ", this->type);
334 return *this;
335 }
336 cvc5::Term res = solver->term_manager.mkTerm(this->operations.at(OpType::XOR), { this->term, other.term });
337 return { res, this->solver, this->type };
338}
339
340void STerm::operator^=(const STerm& other)
341{
342 if (!this->operations.contains(OpType::XOR)) {
343 info("XOR is not compatible with ", this->type);
344 return;
345 }
346 this->term = solver->term_manager.mkTerm(this->operations.at(OpType::XOR), { this->term, other.term });
347}
348
349STerm STerm::operator&(const STerm& other) const
350{
351 if (!this->operations.contains(OpType::AND)) {
352 info("AND is not compatible with ", this->type);
353 return *this;
354 }
355 cvc5::Term res = solver->term_manager.mkTerm(this->operations.at(OpType::AND), { this->term, other.term });
356 return { res, this->solver, this->type };
357}
358
359void STerm::operator&=(const STerm& other)
360{
361 if (!this->operations.contains(OpType::AND)) {
362 info("AND is not compatible with ", this->type);
363 return;
364 }
365 this->term = solver->term_manager.mkTerm(this->operations.at(OpType::AND), { this->term, other.term });
366}
367
368STerm STerm::operator|(const STerm& other) const
369{
370 if (!this->operations.contains(OpType::OR)) {
371 info("OR is not compatible with ", this->type);
372 return *this;
373 }
374 cvc5::Term res = solver->term_manager.mkTerm(this->operations.at(OpType::OR), { this->term, other.term });
375 return { res, this->solver, this->type };
376}
377
378void STerm::operator|=(const STerm& other)
379{
380 if (!this->operations.contains(OpType::OR)) {
381 info("OR is not compatible with ", this->type);
382 return;
383 }
384 this->term = solver->term_manager.mkTerm(this->operations.at(OpType::OR), { this->term, other.term });
385}
386
388{
389 if (!this->operations.contains(OpType::NOT)) {
390 info("NOT is not compatible with ", this->type);
391 return *this;
392 }
393 cvc5::Term res = solver->term_manager.mkTerm(this->operations.at(OpType::NOT), { this->term });
394 return { res, this->solver, this->type };
395}
396
397STerm STerm::operator<<(const uint32_t& n) const
398{
399 if (!this->operations.contains(OpType::LSH)) {
400 info("SHIFT LEFT is not compatible with ", this->type);
401 return *this;
402 }
403 cvc5::Term shift = this->solver->term_manager.mkBitVector(this->solver->bv_sort.getBitVectorSize(), n);
404 cvc5::Term res = this->solver->term_manager.mkTerm(this->operations.at(OpType::LSH), { this->term, shift });
405 return { res, this->solver, this->type };
406}
407
408void STerm::operator<<=(const uint32_t& n)
409{
410 if (!this->operations.contains(OpType::LSH)) {
411 info("SHIFT LEFT is not compatible with ", this->type);
412 return;
413 }
414 cvc5::Term shift = solver->term_manager.mkBitVector(this->solver->bv_sort.getBitVectorSize(), n);
415 this->term = this->solver->term_manager.mkTerm(this->operations.at(OpType::LSH), { this->term, shift });
416}
417
418STerm STerm::operator>>(const uint32_t& n) const
419{
420 if (!this->operations.contains(OpType::RSH)) {
421 info("SHIFT RIGHT is not compatible with ", this->type);
422 return *this;
423 }
424 cvc5::Term shift = this->solver->term_manager.mkBitVector(this->solver->bv_sort.getBitVectorSize(), n);
425 cvc5::Term res = this->solver->term_manager.mkTerm(this->operations.at(OpType::RSH), { this->term, shift });
426 return { res, this->solver, this->type };
427}
428
429void STerm::operator>>=(const uint32_t& n)
430{
431 if (!this->operations.contains(OpType::RSH)) {
432 info("SHIFT RIGHT is not compatible with ", this->type);
433 return;
434 }
435 cvc5::Term shift = this->solver->term_manager.mkBitVector(this->solver->bv_sort.getBitVectorSize(), n);
436 this->term = this->solver->term_manager.mkTerm(this->operations.at(OpType::RSH), { this->term, shift });
437}
438
439STerm STerm::rotr(const uint32_t& n) const
440{
441 if (!this->operations.contains(OpType::ROTR)) {
442 info("ROTR is not compatible with ", this->type);
443 return *this;
444 }
445 cvc5::Op rotr = solver->term_manager.mkOp(this->operations.at(OpType::ROTR), { n });
446 cvc5::Term res = solver->term_manager.mkTerm(rotr, { this->term });
447 return { res, this->solver, this->type };
448}
449
450STerm STerm::rotl(const uint32_t& n) const
451{
452 if (!this->operations.contains(OpType::ROTL)) {
453 info("ROTL is not compatible with ", this->type);
454 return *this;
455 }
456 cvc5::Op rotl = solver->term_manager.mkOp(this->operations.at(OpType::ROTL), { n });
457 cvc5::Term res = solver->term_manager.mkTerm(rotl, { this->term });
458 return { res, this->solver, this->type };
459}
460
461STerm STerm::truncate(const uint32_t& to_size)
462{
463 if (!this->operations.contains(OpType::EXTRACT) || !this->operations.contains(OpType::BITVEC_PAD)) {
464 info("TRUNC is not compatible with ", this->type);
465 return *this;
466 }
467 cvc5::Op extraction = solver->term_manager.mkOp(this->operations.at(OpType::EXTRACT), { to_size, 0 });
468 cvc5::Term temp = solver->term_manager.mkTerm(extraction, { this->term });
469 cvc5::Op padding =
471 { this->solver->bv_sort.getBitVectorSize() - temp.getSort().getBitVectorSize() });
472 cvc5::Term res = solver->term_manager.mkTerm(padding, { temp });
473 return { res, this->solver, this->type };
474}
475
476STerm STerm::extract_bit(const uint32_t& bit_index)
477{
478 if (!this->operations.contains(OpType::EXTRACT) || !this->operations.contains(OpType::BITVEC_PAD)) {
479 info("EXTRACT is not compatible with ", this->type);
480 return *this;
481 }
482 cvc5::Op extraction = solver->term_manager.mkOp(this->operations.at(OpType::EXTRACT), { bit_index, bit_index });
483 cvc5::Term temp = solver->term_manager.mkTerm(extraction, { this->term });
484 cvc5::Op padding =
486 { this->solver->bv_sort.getBitVectorSize() - temp.getSort().getBitVectorSize() });
487 cvc5::Term res = solver->term_manager.mkTerm(padding, { temp });
488 return { res, this->solver, this->type };
489}
490
491STerm operator+(const bb::fr& lhs, const STerm& rhs)
492{
493 return rhs + lhs;
494}
495
496STerm operator-(const bb::fr& lhs, const STerm& rhs)
497{
498 return (-rhs) + lhs;
499}
500
501STerm operator*(const bb::fr& lhs, const STerm& rhs)
502{
503 return rhs * lhs;
504}
505
506STerm operator^(const bb::fr& lhs, const STerm& rhs)
507{
508 return rhs ^ lhs;
509}
510
511STerm operator&(const bb::fr& lhs, const STerm& rhs)
512{
513 return rhs & lhs;
514}
515
516STerm operator|(const bb::fr& lhs, const STerm& rhs)
517{
518 return rhs | lhs;
519}
520
521STerm operator/(const bb::fr& lhs, const STerm& rhs)
522{
523 return STerm(lhs, rhs.solver, rhs.type) / rhs;
524}
525
526void operator==(const bb::fr& lhs, const STerm& rhs)
527{
528 rhs == lhs;
529}
530
531void operator!=(const bb::fr& lhs, const STerm& rhs)
532{
533 rhs != lhs;
534}
535
536std::ostream& operator<<(std::ostream& os, const TermType type)
537{
538 switch (type) {
539 case TermType::FFTerm:
540 os << "FFTerm";
541 break;
543 os << "FFITerm";
544 break;
545 case TermType::BVTerm:
546 os << "BVTerm";
547 break;
548 case TermType::ITerm:
549 os << "ITerm";
550 break;
551 case TermType::SBool:
552 os << "SBool";
553 break;
554 case TermType::STuple:
555 os << "STuple";
556 break;
558 os << "SymArray";
559 break;
560 case TermType::SymSet:
561 os << "SymSet";
562 break;
563 };
564 return os;
565}
566
567// Parametrized calls to STerm constructor
568// so you won't need to use TermType each time to define a new variable.
569
570STerm FFVar(const std::string& name, Solver* slv)
571{
572 return STerm::Var(name, slv, TermType::FFTerm);
573}
574
575STerm FFConst(const std::string& val, Solver* slv, uint32_t base)
576{
577 return STerm::Const(val, slv, base, TermType::FFTerm);
578}
579
580STerm FFConst(const bb::fr& val, Solver* slv)
581{
582 return STerm(val, slv, TermType::FFTerm);
583}
584
585STerm FFIVar(const std::string& name, Solver* slv)
586{
587 return STerm::Var(name, slv, TermType::FFITerm);
588}
589
590STerm FFIConst(const std::string& val, Solver* slv, uint32_t base)
591{
592 return STerm::Const(val, slv, base, TermType::FFITerm);
593}
594
595STerm FFIConst(const bb::fr& val, Solver* slv)
596{
597 return STerm(val, slv, TermType::FFITerm);
598}
599
600STerm IVar(const std::string& name, Solver* slv)
601{
602 return STerm::Var(name, slv, TermType::ITerm);
603}
604
605STerm IConst(const std::string& val, Solver* slv, uint32_t base)
606{
607 return STerm::Const(val, slv, base, TermType::ITerm);
608}
609
610STerm IConst(const bb::fr& val, Solver* slv)
611{
612 return STerm(val, slv, TermType::ITerm);
613}
614
615STerm BVVar(const std::string& name, Solver* slv)
616{
617 return STerm::Var(name, slv, TermType::BVTerm);
618}
619
620STerm BVConst(const std::string& val, Solver* slv, uint32_t base)
621{
622 return STerm::Const(val, slv, base, TermType::BVTerm);
623}
624
625STerm BVConst(const bb::fr& val, Solver* slv)
626{
627 return STerm(val, slv, TermType::BVTerm);
628}
629
630} // namespace smt_terms
Class for the solver.
Definition solver.hpp:80
void assertFormula(const cvc5::Term &term) const
Definition solver.hpp:158
std::string modulus
Definition solver.hpp:86
cvc5::Sort bv_sort
Definition solver.hpp:85
cvc5::TermManager term_manager
Definition solver.hpp:82
cvc5::Sort ff_sort
Definition solver.hpp:84
Symbolic term element class.
Definition term.hpp:114
void operator<(const STerm &other) const
Definition term.cpp:264
void operator<<=(const uint32_t &n)
Definition term.cpp:408
STerm operator*(const STerm &other) const
Definition term.cpp:176
STerm rotl(const uint32_t &n) const
Definition term.cpp:450
friend std::ostream & operator<<(std::ostream &out, const STerm &term)
Definition term.hpp:197
TermType type
Definition term.hpp:123
STerm operator%(const STerm &other) const
Definition term.cpp:320
void operator+=(const STerm &other)
Definition term.cpp:152
void operator/=(const STerm &other)
Definition term.cpp:217
void operator==(const STerm &other) const
Definition term.cpp:241
STerm rotr(const uint32_t &n) const
Definition term.cpp:439
void operator<=(const STerm &other) const
Definition term.cpp:278
std::unordered_map< OpType, cvc5::Kind > operations
Definition term.hpp:124
STerm operator/(const STerm &other) const
Division operation.
Definition term.cpp:197
STerm operator-() const
Definition term.cpp:170
void operator>(const STerm &other) const
Definition term.cpp:292
void operator^=(const STerm &other)
Definition term.cpp:340
static STerm Var(const std::string &name, Solver *slv, TermType type=TermType::FFTerm)
Definition term.cpp:14
STerm operator^(const STerm &other) const
Definition term.cpp:330
void operator*=(const STerm &other)
Definition term.cpp:182
STerm mod() const
Reduce the term modulo circuit prime.
Definition term.cpp:119
cvc5::Term term
Definition term.hpp:121
STerm normalize() const
Reduce the integer symbolic term modulo circuit prime if needed.
Definition term.cpp:140
void operator&=(const STerm &other)
Definition term.cpp:359
Solver * solver
Definition term.hpp:120
void operator>>=(const uint32_t &n)
Definition term.cpp:429
STerm operator&(const STerm &other) const
Definition term.cpp:349
void operator!=(const STerm &other) const
Definition term.cpp:254
STerm operator|(const STerm &other) const
Definition term.cpp:368
STerm operator~() const
Definition term.cpp:387
void operator>=(const STerm &other) const
Definition term.cpp:306
void operator|=(const STerm &other)
Definition term.cpp:378
STerm operator>>(const uint32_t &n) const
Definition term.cpp:418
static STerm Const(const std::string &val, Solver *slv, uint32_t base=16, TermType type=TermType::FFTerm)
Definition term.cpp:29
void operator-=(const STerm &other)
Definition term.cpp:164
STerm extract_bit(const uint32_t &bit_index)
Returns ith bit of variable.
Definition term.cpp:476
STerm operator+(const STerm &other) const
Definition term.cpp:146
STerm truncate(const uint32_t &to_size)
Returns last to_size bits of variable.
Definition term.cpp:461
void info(Args... args)
Definition log.hpp:70
GreaterThan gt
uint8_t const * buf
Definition data_store.hpp:9
field< Bn254FrParams > fr
Definition fr.hpp:174
STerm IVar(const std::string &name, Solver *slv)
Definition term.cpp:600
STerm operator+(const bb::fr &lhs, const STerm &rhs)
Definition term.cpp:491
STerm FFVar(const std::string &name, Solver *slv)
Definition term.cpp:570
STerm IConst(const std::string &val, Solver *slv, uint32_t base)
Definition term.cpp:605
STerm BVVar(const std::string &name, Solver *slv)
Definition term.cpp:615
STerm operator&(const bb::fr &lhs, const STerm &rhs)
Definition term.cpp:511
STerm FFConst(const std::string &val, Solver *slv, uint32_t base)
Definition term.cpp:575
const std::unordered_map< TermType, std::unordered_map< OpType, cvc5::Kind > > typed_operations
precomputed map that contains allowed operations for each of three symbolic types
Definition term.hpp:47
STerm operator|(const bb::fr &lhs, const STerm &rhs)
Definition term.cpp:516
void operator!=(const bb::fr &lhs, const STerm &rhs)
Definition term.cpp:531
STerm operator*(const bb::fr &lhs, const STerm &rhs)
Definition term.cpp:501
STerm FFIVar(const std::string &name, Solver *slv)
Definition term.cpp:585
STerm operator^(const bb::fr &lhs, const STerm &rhs)
Definition term.cpp:506
STerm BVConst(const std::string &val, Solver *slv, uint32_t base)
Definition term.cpp:620
TermType
Allows to define three types of symbolic terms STerm - Symbolic Variables acting like a Finte Field e...
Definition term.hpp:15
STerm operator/(const bb::fr &lhs, const STerm &rhs)
Definition term.cpp:521
STerm operator-(const bb::fr &lhs, const STerm &rhs)
Definition term.cpp:496
STerm FFIConst(const std::string &val, Solver *slv, uint32_t base)
Definition term.cpp:590
std::ostream & operator<<(std::ostream &os, const TermType type)
Definition term.cpp:536
void operator==(const bb::fr &lhs, const STerm &rhs)
Definition term.cpp:526