This PR disables filtering of enumerated shapes in the pool of the Sygus reconstruction algorithm.
std::vector<Node>& vars,
std::vector<Node>& subs)
{
- for (size_t i = 0; i < vars.size(); ++i)
- {
- // We consider sygus variables as ground terms. So, if they are not equal to
- // their substitution, then s is not matchable with n and we try the next
- // term s. Example: If s = (+ z x) and n = (+ z y), then s is not matchable
- // with n and we return true
- if (d_sygusVars.find(vars[i]) != d_sygusVars.cend() && vars[i] != subs[i])
- {
- return true;
- }
- }
- // Note: false here means that we finally found an s that is matchable with n,
- // so we should not add n to the pool
- return false;
+ // If we are too aggressive in filtering enumerated shapes, we may miss some
+ // that speedup reconstruction time. So, for now, we disable filtering.
+ return true;
}
void SygusReconstruct::clear()
* TermsToRecons'' = {}
* for each subfield type T of T0
* for each t in TermsToRecons'[T]
- * TermsToRecons'[T] += t
+ * TermsToRecons[T] += t
* for each s[zs] in Pool[T]
* TermsToRecons'' += matchNewObs(t, s[zs])
* TermsToRecons' = TermsToRecons''
* Sub = {} // substitution map from zs to corresponding new vars ks
* for each (z, st) in {zs -> sts}
* // let X be the theory the solver is invoked with
- * if exists (k, ts) in Obs s.t. !=_X ts[0] = st
+ * if exists (k, ts) in Obs s.t. |=_X ts[0] = st
* ts += st
* Sub[z] = k
* else
regress2/sygus/min_IC_1.sy
regress2/sygus/mpg_guard1-dd.sy
regress2/sygus/multi-udiv.sy
+ regress2/sygus/no-bad-filter.sy
regress2/sygus/no-syntax-test-no-si.sy
regress2/sygus/pbe_bvurem.sy
regress2/sygus/process-10-vars-2fun.sy
--- /dev/null
+; COMMAND-LINE: --sygus-out=status --sygus-si=all
+; EXPECT: unsat
+
+; This regression ensures that we are not too aggressive in filtering
+; enumerated shapes in the pool.
+
+(set-logic SLIA)
+
+(synth-fun f ((x String) (y String)) String
+ ((Start String) (StartInt Int) (StartBool Bool) (ConstString String))
+ ((Start String (ConstString x y
+ (str.++ Start Start)
+ (str.substr Start StartInt StartInt)
+ (str.replace_all Start Start Start)
+ (str.from_code StartInt)
+ (str.from_int StartInt)
+ (ite StartBool Start Start)))
+ (StartInt Int (0 1 (str.len Start)
+ (str.indexof Start Start StartInt)
+ (str.to_code Start)
+ (str.to_int Start)))
+ (StartBool Bool ((and StartBool StartBool)
+ (str.<= Start Start)
+ (str.is_digit Start)
+ (not StartBool)
+ (<= StartInt StartInt)))
+ (ConstString String ("" "0" "1" "a" "b" (Constant String)))))
+
+(declare-var x String)
+(declare-var y String)
+
+(constraint (= (f x y) (str.at y (str.indexof y "a" (str.len x)))))
+
+(check-synth)