#include "csolver.h"
+/**
+ * e1={0, 1, 2}
+ * e2={0, 1, 2}
+ * e1 == e2
+ * e3= e1+e2 {0, 1, 2, 3, 4}
+ * e4 = f(e1, e2)
+ * 0 1 => 0
+ * 1 1 => 0
+ * 2 1 => 2
+ * 2 2 => 2
+ * e3 == e4
+ * Result: UNSAT!
+ */
int main(int numargs, char ** argv) {
CSolver * solver=allocCSolver();
uint64_t set1[]={0, 1, 2};
Set * domain[]={s, s};
Predicate *equals=createPredicateOperator(solver, EQUALS, domain, 2);
Element * inputs[]={e1, e2};
- Boolean* overflow = getBooleanVar(solver , 2);
- Boolean * b=applyPredicate(solver, equals, inputs, 2, overflow);
+ Boolean * b=applyPredicate(solver, equals, inputs, 2, NULL);
addConstraint(solver, b);
uint64_t set2[] = {2, 3};
addTableEntry(solver, table, row3, 2, 2);
addTableEntry(solver, table, row4, 2, 2);
Function * f2 = completeTable(solver, table, IGNOREBEHAVIOR); //its range would be as same as s
-
+ Boolean* overflow = getBooleanVar(solver , 2);
Element * e3 = applyFunction(solver, f1, inputs, 2, overflow);
Element * e4 = applyFunction(solver, f2, inputs, 2, overflow);
Set* domain2[] = {s,rangef1};
#include "csolver.h"
-
+/**
+ * e1 = {6}
+ * e2={4, 2}
+ * e3=Fsub(e1,e2) {4, 2}
+ * e4= f(e1, e2)
+ * 6 2 => 3
+ * 6 4 => 1
+ * e5 = f(e1)=>e1 {6}
+ * e6 = (e3, e4, e5) {2, 3, 1}
+ * 4 3 6 => 3
+ * 2 1 6 => 1
+ * 2 3 6 => 2
+ * 4 1 6 => 1
+ * e7 = {2, 1, 0}
+ * e7 > e6
+ * Result: e1=6, e2=4, e7=2
+ */
int main(int numargs, char ** argv) {
CSolver * solver=allocCSolver();
uint64_t set1[]={6};
#include "csolver.h"
-
+/**
+ * TotalOrder(5, 1, 4)
+ * 5 => 1
+ * 1 => 4
+ * Result: O(5,1)=0 O(1,4)=0 O(5,4)=0 O(1,5)=1 O(1111,5)=2
+ */
int main(int numargs, char ** argv) {
CSolver * solver=allocCSolver();
uint64_t set1[]={5, 1, 4};