| GET_QE_DISJUNCT_TOK { PARSER_STATE->checkThatLogicIsSet(); }
term[e,e2]
{ cmd->reset(new GetQuantifierEliminationCommand(e, false)); }
+ | DECLARE_HEAP LPAREN_TOK
+ sortSymbol[t,CHECK_DECLARED]
+ sortSymbol[t, CHECK_DECLARED]
+ // We currently do nothing with the type information declared for the heap.
+ { cmd->reset(new EmptyCommand()); }
+ RPAREN_TOK
;
std::vector<Expr> patconds;
std::unordered_set<std::string> names;
std::vector< std::pair<std::string, Expr> > binders;
- Type type;
+ Type type, type2;
std::string s;
bool isBuiltinOperator = false;
bool isOverloadedFunction = false;
expr = MK_EXPR(kind, args);
}
}
-
| LPAREN_TOK
( /* An indexed function application */
indexedFunctionName[op, kind] termList[args,expr] RPAREN_TOK {
{ expr = MK_CONST(FloatingPoint::makeZero(FloatingPointSize(AntlrInput::tokenToUnsigned($eb),
AntlrInput::tokenToUnsigned($sb)),
true)); }
+ | EMP_TOK
+ sortSymbol[type,CHECK_DECLARED]
+ sortSymbol[type2,CHECK_DECLARED]
+ {
+ Expr v1 = PARSER_STATE->mkVar("_emp1", type);
+ Expr v2 = PARSER_STATE->mkVar("_emp2", type2);
+ expr = MK_EXPR(kind::SEP_EMP,v1,v2);
+ }
// NOTE: Theory parametric constants go here
)
INCLUDE_TOK : 'include';
GET_QE_TOK : 'get-qe';
GET_QE_DISJUNCT_TOK : 'get-qe-disjunct';
+DECLARE_HEAP : 'declare-heap';
+EMP_TOK : 'emp';
// SyGuS commands
SYNTH_FUN_TOK : 'synth-fun';
regress1/sep/sep-nterm-val-model.smt2 \
regress1/sep/sep-simp-unc.smt2 \
regress1/sep/simple-neg-sat.smt2 \
+ regress1/sep/sl-standard.smt2 \
regress1/sep/split-find-unsat-w-emp.smt2 \
regress1/sep/split-find-unsat.smt2 \
regress1/sep/wand-0526-sat.smt2 \
;-----------------
(assert (pto w (as sep.nil Int)))
-(assert (not (and (sep (and (emp 0 0) (= w2 (as sep.nil Int))) (pto w w1)) (sep (pto w w2) true))))
+(assert (not (and (sep (and (_ emp Int Int) (= w2 (as sep.nil Int))) (pto w w1)) (sep (pto w w2) true))))
(check-sat)
;(get-model)
(set-info :status unsat)
(declare-sort Loc 0)
(declare-const l Loc)
-(assert (sep (not (emp l l)) (not (emp l l))))
+(assert (sep (not (_ emp Loc Loc)) (not (_ emp Loc Loc))))
(assert (pto l l))
(check-sat)
; COMMAND-LINE: --no-check-models
; EXPECT: sat
(set-logic QF_ALL_SUPPORTED)
-(assert (not (emp 0 0)))
+(assert (not (_ emp Int Int)))
(check-sat)
(declare-fun a () U)
(declare-fun b () U)
-(assert (emp x x))
+(assert (_ emp U U))
(assert (sep (pto x a) (pto y b)))
(check-sat)
; COMMAND-LINE: --no-check-models --sep-pre-skolem-emp
; EXPECT: sat
(set-logic QF_ALL_SUPPORTED)
-(assert (not (emp 0 0)))
+(assert (not (_ emp Int Int)))
(check-sat)
(declare-const r Loc)
(define-fun ten-tree0 ((x Loc) (d Int)) Bool
-(or (and (emp loc0 data0) (= x (as sep.nil Loc))) (and (sep (pto x (node d l r)) (and (emp loc0 data0) (= l (as sep.nil Loc))) (and (emp loc0 data0) (= r (as sep.nil Loc)))) (= dl (- d 10)) (= dr (+ d 10)))))
+(or (and (_ emp Loc Node) (= x (as sep.nil Loc))) (and (sep (pto x (node d l r)) (and (_ emp Loc Node) (= l (as sep.nil Loc))) (and (_ emp Loc Node) (= r (as sep.nil Loc)))) (= dl (- d 10)) (= dr (+ d 10)))))
(declare-const dy Int)
(declare-const y Loc)
(declare-const z Loc)
(define-fun ord-tree0 ((x Loc) (d Int)) Bool
-(or (and (emp loc0 data0) (= x (as sep.nil Loc))) (and (sep (pto x (node d y z)) (and (emp loc0 data0) (= y (as sep.nil Loc))) (and (emp loc0 data0) (= z (as sep.nil Loc)))) (<= dy d) (<= d dz))))
+(or (and (_ emp Loc Node) (= x (as sep.nil Loc))) (and (sep (pto x (node d y z)) (and (_ emp Loc Node) (= y (as sep.nil Loc))) (and (_ emp Loc Node) (= z (as sep.nil Loc)))) (<= dy d) (<= d dz))))
;------- f -------
(assert (= y (as sep.nil Loc)))
; COMMAND-LINE: --no-check-models
; EXPECT: sat
(set-logic QF_ALL_SUPPORTED)
-(assert (wand (emp 0 0) (emp 0 0)))
+(assert (wand (_ emp Int Int) (_ emp Int Int)))
(check-sat)
(declare-sort U 0)
(declare-fun u () U)
-(assert (sep (not (emp u u)) (not (emp u u))))
+(assert (sep (not (_ emp U U)) (not (_ emp U U))))
(assert (forall ((x U) (y U)) (= x y)))
(declare-sort Loc 0)
(declare-const l Loc)
-(assert (not (emp l l)))
+(assert (not (_ emp Loc Loc)))
(assert (forall ((x Loc) (y Loc)) (not (pto x y))))
(declare-fun u1 () U)
(declare-fun u2 () U)
(assert (not (= u1 u2)))
-(assert (forall ((x U)) (=> (not (= x (as sep.nil U))) (sep (not (emp u1 0)) (pto x 0)))))
+(assert (forall ((x U)) (=> (not (= x (as sep.nil U))) (sep (not (_ emp U Int)) (pto x 0)))))
; satisfiable with heap of size 2, model of U of size 3
(check-sat)
(declare-const u Int)
-(assert (emp 0 0))
+(assert (_ emp Int Int))
(assert
(forall ((y Int))
--- /dev/null
+(set-logic QF_ALL)
+(set-info :source | CVC4 - Andrew Reynolds |)
+(set-info :smt-lib-version 2.6)
+(set-info :category "crafted")
+(set-info :status unsat)
+
+(declare-sort Loc 0)
+
+(declare-heap (Loc Loc))
+
+(declare-const loc0 Loc)
+
+(declare-const u Loc)
+(declare-const v Loc)
+(declare-const y Loc)
+(declare-const y0 Loc)
+(declare-const y00 Loc)
+(declare-const t Loc)
+(declare-const t0 Loc)
+(declare-const t00 Loc)
+
+(define-fun pos2 ((x Loc) (a Loc) (i Int)) Bool (or (and (pto x a) (= i 0)) (sep (pto x a) (or (and (pto a y) (= (- i 1) 0)) (sep (pto a y) (or (and (pto y y0) (= (- (- i 1) 1) 0)) (sep (pto y y0) (and (pto y0 y00) (= (- (- (- i 1) 1) 1) 0)))))))))
+
+(define-fun neg2 ((z Loc) (b Loc) (j Int)) Bool (or (and (not (pto z b)) (= j 0)) (sep (pto z b) (or (and (not (pto b t)) (= (- j 1) 0)) (sep (pto b t) (or (and (not (pto t t0)) (= (- (- j 1) 1) 0)) (sep (pto t t0) (and (not (pto t0 t00)) (= (- (- (- j 1) 1) 1) 0)))))))))
+
+;------- f -------
+(assert (= t y))
+(assert (= t0 y0))
+(assert (not (= t00 y00)))
+;-----------------
+
+(assert (pos2 u v 3))
+(assert (not (neg2 u v 3)))
+
+(check-sat)
(declare-const c Int)
(assert (and
- (not (sep (not (pto x a)) (not (pto y b)) (not (sep (pto x a) (pto y b))) (not (emp x x)) ))
+ (not (sep (not (pto x a)) (not (pto y b)) (not (sep (pto x a) (pto y b))) (not (_ emp Int Int)) ))
(sep (pto x a) (pto y b))
)
)
(declare-fun u () Int)
(declare-fun v () Int)
(assert (wand (pto x u) (pto y v)))
-(assert (emp 0 0))
+(assert (_ emp Int Int))
(check-sat)
; EXPECT: sat
(set-logic QF_ALL_SUPPORTED)
(declare-fun x () Int)
-(assert (wand (emp x x) (pto x 3)))
+(assert (wand (_ emp Int Int) (pto x 3)))
(check-sat)
(set-logic QF_ALL_SUPPORTED)
(set-info :status sat)
(declare-fun x () Int)
-(assert (wand (pto x 1) (emp x x)))
+(assert (wand (pto x 1) (_ emp Int Int)))
(check-sat)
(set-logic QF_ALL_SUPPORTED)
(declare-fun x () Int)
(assert (wand (pto x 1) (pto x 3)))
-(assert (emp x x))
+(assert (_ emp Int Int))
(check-sat)