Makes it so that we parse n-ary applications of e.g. set.union in smt2.
Left associativity seems to be the case for difference operators in databases.
See
https://docs.microsoft.com/en-us/sql/t-sql/language-elements/set-operators-except-and-intersect-transact-sql?view=sql-server-ver15
if (echildren.size() > 2)
{
if (kind == INTS_DIVISION || kind == XOR || kind == SUB || kind == DIVISION
- || kind == HO_APPLY || kind == REGEXP_DIFF)
+ || kind == HO_APPLY || kind == REGEXP_DIFF || kind == SET_UNION
+ || kind == SET_INTER || kind == SET_MINUS || kind == BAG_INTER_MIN
+ || kind == BAG_UNION_MAX || kind == BAG_UNION_DISJOINT
+ || kind == BAG_DIFFERENCE_REMOVE || kind == BAG_DIFFERENCE_SUBTRACT)
{
// left-associative, but cvc5 internally only supports 2 args
res = d_nodeMgr->mkLeftAssociative(k, echildren);
regress0/parser/proj-issue370-push-pop-global.smt2
regress0/parser/quoted-define-fun.smt2
regress0/parser/real-numerals.smt2
+ regress0/parser/set-bag-left-associative.smt2
regress0/parser/shadow_fun_symbol_all.smt2
regress0/parser/shadow_fun_symbol_nirat.smt2
regress0/parser/strings20.smt2
--- /dev/null
+(set-logic ALL)
+(set-info :status sat)
+(declare-fun A () (Bag Int))
+(declare-fun B () (Bag Int))
+(declare-fun C () (Bag Int))
+(declare-fun D () (Set Int))
+(declare-fun E () (Set Int))
+(declare-fun F () (Set Int))
+
+(assert (and
+(= (bag.union_max A B C) (bag.union_max (bag.union_max A B) C))
+(= (bag.union_disjoint A B C) (bag.union_disjoint (bag.union_disjoint A B) C))
+(= (bag.difference_subtract A B C) (bag.difference_subtract (bag.difference_subtract A B) C))
+(= (set.inter D E F) (set.inter (set.inter D E) F))
+(= (set.union D E F) (set.union (set.union D E) F))
+(= (set.minus D E F) (set.minus (set.minus D E) F))
+))
+
+(check-sat)