Skip to content

Remove java dependency in string solver #1872

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/solvers/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,6 @@ elseif("${sat_impl}" STREQUAL "glucose")
target_link_libraries(solvers glucose-condensed)
endif()

target_link_libraries(solvers java_bytecode util)
target_link_libraries(solvers util)

generic_includes(solvers)
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ Author: Romain Brenguier, [email protected]

#include <limits>
#include <ansi-c/string_constant.h>
#include <java_bytecode/java_types.h>
#include <solvers/refinement/string_refinement_invariant.h>
#include <util/arith_tools.h>
#include <util/pointer_predicates.h>
Expand Down
4 changes: 2 additions & 2 deletions src/solvers/refinement/string_refinement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ Author: Alberto Griggio, [email protected]
#include <util/simplify_expr.h>
#include <solvers/sat/satcheck.h>
#include <solvers/refinement/string_constraint_instantiation.h>
#include <java_bytecode/java_types.h>
#include <unordered_set>

static bool is_valid_string_constraint(
Expand Down Expand Up @@ -1391,6 +1390,7 @@ static exprt substitute_array_access(
&symbol_generator)
{
const typet &char_type = array_expr.type().subtype();
const typet &index_type = to_array_type(array_expr.type()).size().type();
const std::vector<exprt> &operands = array_expr.operands();

exprt result = symbol_generator("out_of_bound_access", char_type);
Expand All @@ -1399,7 +1399,7 @@ static exprt substitute_array_access(
{
// Go in reverse order so that smaller indexes appear first in the result
const std::size_t pos = operands.size() - 1 - i;
const equal_exprt equals(index, from_integer(pos, java_int_type()));
const equal_exprt equals(index, from_integer(pos, index_type));
if(operands[pos].type() != char_type)
{
INVARIANT(
Expand Down