Skip to content

Commit

Permalink
rename subseteq to subset in smtlib, all kinds and smt operator names…
Browse files Browse the repository at this point in the history
… are now consistent
  • Loading branch information
kbansal committed Jun 25, 2014
1 parent b8ddf76 commit 2a734a3
Show file tree
Hide file tree
Showing 15 changed files with 31 additions and 31 deletions.
32 changes: 16 additions & 16 deletions examples/sets-translate/sets_translate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,37 +44,37 @@ const bool enableAxioms = false;
#endif

string setaxioms[] = {
"(declare-fun inHOLDA (HOLDB (Set HOLDB)) Bool)",
"(declare-fun memberHOLDA (HOLDB (Set HOLDB)) Bool)",
"",
"(declare-fun unionHOLDA ((Set HOLDB) (Set HOLDB)) (Set HOLDB))",
"(assert (forall ((?X (Set HOLDB)) (?Y (Set HOLDB)) (?x HOLDB))",
" (= (inHOLDA ?x (unionHOLDA ?X ?Y))",
" (or (inHOLDA ?x ?X) (inHOLDA ?x ?Y))",
" (= (memberHOLDA ?x (unionHOLDA ?X ?Y))",
" (or (memberHOLDA ?x ?X) (memberHOLDA ?x ?Y))",
" ) ) )",
"",
"",
"(declare-fun intersectionHOLDA ((Set HOLDB) (Set HOLDB)) (Set HOLDB))",
"(assert (forall ((?X (Set HOLDB)) (?Y (Set HOLDB)) (?x HOLDB))",
" (= (inHOLDA ?x (intersectionHOLDA ?X ?Y))",
" (and (inHOLDA ?x ?X) (inHOLDA ?x ?Y))",
" (= (memberHOLDA ?x (intersectionHOLDA ?X ?Y))",
" (and (memberHOLDA ?x ?X) (memberHOLDA ?x ?Y))",
" ) ) )",
"",
"(declare-fun setminusHOLDA ((Set HOLDB) (Set HOLDB)) (Set HOLDB))",
"(assert (forall ((?X (Set HOLDB)) (?Y (Set HOLDB)) (?x HOLDB))",
" (= (inHOLDA ?x (setminusHOLDA ?X ?Y))",
" (and (inHOLDA ?x ?X) (not (inHOLDA ?x ?Y)))",
" (= (memberHOLDA ?x (setminusHOLDA ?X ?Y))",
" (and (memberHOLDA ?x ?X) (not (memberHOLDA ?x ?Y)))",
" ) ) )",
"",
"(declare-fun setenumHOLDA (HOLDB) (Set HOLDB))",
"(declare-fun singletonHOLDA (HOLDB) (Set HOLDB))",
"(assert (forall ((?x HOLDB) (?y HOLDB))",
" (= (inHOLDA ?x (setenumHOLDA ?y))",
" (= (memberHOLDA ?x (singletonHOLDA ?y))",
" (= ?x ?y)",
" ) ) )",
"",
"(declare-fun emptysetHOLDA () (Set HOLDB))",
"(assert (forall ((?x HOLDB)) (not (inHOLDA ?x emptysetHOLDA)) ) )",
"(assert (forall ((?x HOLDB)) (not (memberHOLDA ?x emptysetHOLDA)) ) )",
"",
"(define-fun subseteqHOLDA ((X (Set HOLDB)) (Y (Set HOLDB))) Bool (= (unionHOLDA X Y) Y))",
"(define-fun subsetHOLDA ((X (Set HOLDB)) (Y (Set HOLDB))) Bool (= (unionHOLDA X Y) Y))",
""
};

Expand Down Expand Up @@ -123,12 +123,12 @@ class Mapper {
t);

if(!enableAxioms)
sout << "(define-fun setenum" << elementTypeAsString << " "
sout << "(define-fun singleton" << elementTypeAsString << " "
<< " ( (x " << elementType << ") )"
<< " " << name << ""
<< " (store emptyset" << elementTypeAsString << " x true) )" << endl;
setoperators[ make_pair(t, kind::SINGLETON) ] =
em->mkVar( std::string("setenum") + elementTypeAsString,
em->mkVar( std::string("singleton") + elementTypeAsString,
em->mkFunctionType( elementType, t ) );

if(!enableAxioms)
Expand Down Expand Up @@ -164,16 +164,16 @@ class Mapper {
<< " Bool"
<< " (select s x) )" << endl;
setoperators[ make_pair(t, kind::MEMBER) ] =
em->mkVar( std::string("in") + elementTypeAsString,
em->mkVar( std::string("member") + elementTypeAsString,
em->mkPredicateType( elet_t ) );

if(!enableAxioms)
sout << "(define-fun subseteq" << elementTypeAsString << " "
sout << "(define-fun subset" << elementTypeAsString << " "
<< " ( (s1 " << name << ") (s2 " << name << ") )"
<< " Bool"
<<" (= emptyset" << elementTypeAsString << " (setminus" << elementTypeAsString << " s1 s2)) )" << endl;
setoperators[ make_pair(t, kind::SUBSET) ] =
em->mkVar( std::string("subseteq") + elementTypeAsString,
em->mkVar( std::string("subset") + elementTypeAsString,
em->mkPredicateType( t_t ) );

if(enableAxioms) {
Expand Down
2 changes: 1 addition & 1 deletion src/parser/smt2/smt2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ void Smt2::addTheory(Theory theory) {
addOperator(kind::UNION, "union");
addOperator(kind::INTERSECTION, "intersection");
addOperator(kind::SETMINUS, "setminus");
addOperator(kind::SUBSET, "subseteq");
addOperator(kind::SUBSET, "subset");
addOperator(kind::MEMBER, "member");
addOperator(kind::SINGLETON, "singleton");
break;
Expand Down
2 changes: 1 addition & 1 deletion src/printer/smt2/smt2_printer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -609,7 +609,7 @@ static string smtKindString(Kind k) throw() {
case kind::UNION: return "union";
case kind::INTERSECTION: return "intersection";
case kind::SETMINUS: return "setminus";
case kind::SUBSET: return "subseteq";
case kind::SUBSET: return "subset";
case kind::MEMBER: return "member";
case kind::SET_TYPE: return "Set";
case kind::SINGLETON: return "singleton";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
;(define-fun smt_set_com ((s mySet)) mySet ((_ map not) s))
(define-fun smt_set_dif ((s1 mySet) (s2 mySet)) mySet (setminus s1 s2))
;(define-fun smt_set_sub ((s1 mySet) (s2 mySet)) Bool (= smt_set_emp (smt_set_dif s1 s2)))
(define-fun smt_set_sub ((s1 mySet) (s2 mySet)) Bool (subseteq s1 s2))
(define-fun smt_set_sub ((s1 mySet) (s2 mySet)) Bool (subset s1 s2))
(declare-fun z3v58 () Int)
(declare-fun z3v59 () Int)
(assert (distinct z3v58 z3v59))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

(define-fun smt_set_dif ((s1 mySet) (s2 mySet)) mySet (setminus s1 s2))

(define-fun smt_set_sub ((s1 mySet) (s2 mySet)) Bool (subseteq s1 s2))
(define-fun smt_set_sub ((s1 mySet) (s2 mySet)) Bool (subset s1 s2))
(declare-fun z3v58 () Int)
(declare-fun z3v59 () Int)
(assert (distinct z3v58 z3v59))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
;(define-fun smt_set_com ((s mySet)) mySet ((_ map not) s))
(define-fun smt_set_dif ((s1 mySet) (s2 mySet)) mySet (setminus s1 s2))
;(define-fun smt_set_sub ((s1 mySet) (s2 mySet)) Bool (= smt_set_emp (smt_set_dif s1 s2)))
(define-fun smt_set_sub ((s1 mySet) (s2 mySet)) Bool (subseteq s1 s2))
(define-fun smt_set_sub ((s1 mySet) (s2 mySet)) Bool (subset s1 s2))
(declare-fun z3v54 () Int)
(declare-fun z3f55 (Int) Int)
(declare-fun z3v56 () Int)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
;(define-fun smt_set_com ((s mySet)) mySet ((_ map not) s))
(define-fun smt_set_dif ((s1 mySet) (s2 mySet)) mySet (setminus s1 s2))
;(define-fun smt_set_sub ((s1 mySet) (s2 mySet)) Bool (= smt_set_emp (smt_set_dif s1 s2)))
(define-fun smt_set_sub ((s1 mySet) (s2 mySet)) Bool (subseteq s1 s2))
(define-fun smt_set_sub ((s1 mySet) (s2 mySet)) Bool (subset s1 s2))
(declare-fun z3v56 () Int)
(declare-fun z3v57 () Int)
(assert (distinct z3v56 z3v57))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
;(define-fun smt_set_com ((s mySet)) mySet ((_ map not) s))
(define-fun smt_set_dif ((s1 mySet) (s2 mySet)) mySet (setminus s1 s2))
;(define-fun smt_set_sub ((s1 mySet) (s2 mySet)) Bool (= smt_set_emp (smt_set_dif s1 s2)))
(define-fun smt_set_sub ((s1 mySet) (s2 mySet)) Bool (subseteq s1 s2))
(define-fun smt_set_sub ((s1 mySet) (s2 mySet)) Bool (subset s1 s2))
(declare-fun z3v58 () Int)
(declare-fun z3v59 () Int)
(assert (distinct z3v58 z3v59))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
;(define-fun smt_set_com ((s mySet)) mySet ((_ map not) s))
(define-fun smt_set_dif ((s1 mySet) (s2 mySet)) mySet (setminus s1 s2))
;(define-fun smt_set_sub ((s1 mySet) (s2 mySet)) Bool (= smt_set_emp (smt_set_dif s1 s2)))
(define-fun smt_set_sub ((s1 mySet) (s2 mySet)) Bool (subseteq s1 s2))
(define-fun smt_set_sub ((s1 mySet) (s2 mySet)) Bool (subset s1 s2))
(declare-fun z3v60 () Int)
(declare-fun z3v61 () Int)
(assert (distinct z3v60 z3v61))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
(define-fun smt_set_cup ((s1 mySet) (s2 mySet)) mySet (union s1 s2))
(define-fun smt_set_cap ((s1 mySet) (s2 mySet)) mySet (intersection s1 s2))
(define-fun smt_set_dif ((s1 mySet) (s2 mySet)) mySet (setminus s1 s2))
(define-fun smt_set_sub ((s1 mySet) (s2 mySet)) Bool (subseteq s1 s2))
(define-fun smt_set_sub ((s1 mySet) (s2 mySet)) Bool (subset s1 s2))
(declare-fun z3v66 () Int)
(declare-fun z3v67 () Int)
(assert (distinct z3v66 z3v67))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
;(define-fun smt_set_com ((s mySet)) mySet ((_ map not) s))
(define-fun smt_set_dif ((s1 mySet) (s2 mySet)) mySet (setminus s1 s2))
;(define-fun smt_set_sub ((s1 mySet) (s2 mySet)) Bool (= smt_set_emp (smt_set_dif s1 s2)))
(define-fun smt_set_sub ((s1 mySet) (s2 mySet)) Bool (subseteq s1 s2))
(define-fun smt_set_sub ((s1 mySet) (s2 mySet)) Bool (subset s1 s2))
(declare-fun z3v66 () Int)
(declare-fun z3v67 () Int)
(assert (distinct z3v66 z3v67))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
(define-fun smt_set_cup ((s1 mySet) (s2 mySet)) mySet (union s1 s2))
(define-fun smt_set_cap ((s1 mySet) (s2 mySet)) mySet (intersection s1 s2))
(define-fun smt_set_dif ((s1 mySet) (s2 mySet)) mySet (setminus s1 s2))
(define-fun smt_set_sub ((s1 mySet) (s2 mySet)) Bool (subseteq s1 s2))
(define-fun smt_set_sub ((s1 mySet) (s2 mySet)) Bool (subset s1 s2))

(declare-fun z3v66 () Int)
(declare-fun z3v67 () Int)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
(define-fun smt_set_cup ((s1 mySet) (s2 mySet)) mySet (union s1 s2))
(define-fun smt_set_cap ((s1 mySet) (s2 mySet)) mySet (intersection s1 s2))
(define-fun smt_set_dif ((s1 mySet) (s2 mySet)) mySet (setminus s1 s2))
(define-fun smt_set_sub ((s1 mySet) (s2 mySet)) Bool (subseteq s1 s2))
(define-fun smt_set_sub ((s1 mySet) (s2 mySet)) Bool (subset s1 s2))

(declare-fun z3f70 (Int) mySet)
(declare-fun z3f72 (Int) mySet)
Expand Down Expand Up @@ -177,7 +177,7 @@
(z3f70 z3v270))))
(assert (= z3v242 (z3f77 z3v271 z3v270)))
(assert (= z3v242 z3v243))
(assert (subseteq (z3f70 z3v242)
(assert (subset (z3f70 z3v242)
(z3f70 z3v244)))
(assert (= (z3f72 z3v243) smt_set_emp))
(assert (= (z3f72 z3v244)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
;(define-fun smt_set_com ((s mySet)) mySet ((_ map not) s))
(define-fun smt_set_dif ((s1 mySet) (s2 mySet)) mySet (setminus s1 s2))
;(define-fun smt_set_sub ((s1 mySet) (s2 mySet)) Bool (= smt_set_emp (smt_set_dif s1 s2)))
(define-fun smt_set_sub ((s1 mySet) (s2 mySet)) Bool (subseteq s1 s2))
(define-fun smt_set_sub ((s1 mySet) (s2 mySet)) Bool (subset s1 s2))

(declare-fun z3v58 () Int)
(declare-fun z3v59 () Int)
Expand Down
2 changes: 1 addition & 1 deletion test/regress/regress0/sets/sets-sample.smt2
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
(assert (= c (union a b) ))
(assert (not (= c (intersection a b) )))
(assert (= c (setminus a b) ))
(assert (subseteq a b))
(assert (subset a b))
(assert (member e c))
(assert (member e a))
(assert (member e (intersection a b)))
Expand Down

0 comments on commit 2a734a3

Please sign in to comment.