Skip to content

Fix explorer mode for basic-1 and string-literal constraints#17

Merged
nils-loose merged 1 commit into
mainfrom
fix/explorer-string-literal-parsing
May 22, 2026
Merged

Fix explorer mode for basic-1 and string-literal constraints#17
nils-loose merged 1 commit into
mainfrom
fix/explorer-string-literal-parsing

Conversation

@nils-loose
Copy link
Copy Markdown
Contributor

TraceParser was escaping every " in branch constraints to ", which produced invalid SMT-LIB and made Z3 reject any path constraint that contained a string literal. The old SolverHandler.string_to_expr masked it with s.replace('\', ''), but the rewritten solve() path (via ConstraintCache.parse_smt_string) has no such workaround, so the underlying bug now surfaces for any String input compared to a literal. Remove the bogus escape; keep the newline strip.

Also wire basic-1's run.sh through SimpleDriver: use the explorer's .venv interpreter, pass --mode simple and --classpath ., and add -Dsolver.mode=HTTP in SimpleDriver.build_command so constraints reach the explorer over HTTP (TargetDriver already had this; SimpleDriver was missing it). Finally, derive symbolic-variable types from the input name (java/lang/String_0 -> java/lang/String) instead of inp.type, which doesn't line up with the DataTypes enum for non-primitive sorts.

TraceParser was escaping every " in branch constraints to \", which
produced invalid SMT-LIB and made Z3 reject any path constraint that
contained a string literal. The old SolverHandler.string_to_expr
masked it with s.replace('\\', ''), but the rewritten solve() path
(via ConstraintCache.parse_smt_string) has no such workaround, so the
underlying bug now surfaces for any String input compared to a literal.
Remove the bogus escape; keep the newline strip.

Also wire basic-1's run.sh through SimpleDriver: use the explorer's
.venv interpreter, pass --mode simple and --classpath ., and add
-Dsolver.mode=HTTP in SimpleDriver.build_command so constraints reach
the explorer over HTTP (TargetDriver already had this; SimpleDriver
was missing it). Finally, derive symbolic-variable types from the
input name (java/lang/String_0 -> java/lang/String) instead of
inp.type, which doesn't line up with the DataTypes enum for
non-primitive sorts.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@nils-loose nils-loose merged commit e1a6025 into main May 22, 2026
@nils-loose nils-loose deleted the fix/explorer-string-literal-parsing branch May 22, 2026 13:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant