Skip to content

Collection of minor fixes and cleanup #1351

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

Merged
merged 13 commits into from
Sep 7, 2017
Merged
Show file tree
Hide file tree
Changes from all 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
4 changes: 2 additions & 2 deletions regression/Makefile
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
DIRS = ansi-c \
cbmc \
cpp \
cbmc-cover \
cbmc-java \
cbmc-java-inheritance \
cbmc-cover \
cpp \
goto-analyzer \
goto-diff \
goto-gcc \
Expand Down
2 changes: 1 addition & 1 deletion regression/cbmc/Quantifiers-assertion/test.desc
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ main.c
^\[main.assertion.5\] NotForall-Forall: successful: SUCCESS$
^\[main.assertion.6\] NotForall-NotForall: successful: SUCCESS$
^\*\* 2 of 6 failed \(2 iterations\)$
^\VERIFICATION FAILED$
^VERIFICATION FAILED$
2 changes: 1 addition & 1 deletion regression/cbmc/Quantifiers-assignment/test.desc
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ main.c
^\[main.assertion.3\] assertion z1: SUCCESS$
^\[main.assertion.4\] assertion z2: SUCCESS$
^\*\* 1 of 4 failed \(2 iterations\)$
^\VERIFICATION FAILED$
^VERIFICATION FAILED$
2 changes: 1 addition & 1 deletion regression/cbmc/Quantifiers-if/test.desc
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ main.c
^\[main.assertion.4\] failure 3: FAILURE$
^\[main.assertion.5\] success 2: SUCCESS$
^\*\* 3 of 5 failed \(2 iterations\)$
^\VERIFICATION FAILED$
^VERIFICATION FAILED$
2 changes: 1 addition & 1 deletion regression/cbmc/Quantifiers-not-exists/test.desc
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ main.c
^\[main.assertion.5\] assertion tmp_if_expr\$12: SUCCESS$
^\[main.assertion.6\] assertion tmp_if_expr\$15: SUCCESS$
^\*\* 0 of 6 failed \(1 iteration\)$
^\VERIFICATION SUCCESSFUL$
^VERIFICATION SUCCESSFUL$
2 changes: 1 addition & 1 deletion regression/cbmc/Quantifiers-not/test.desc
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ main.c
^\[main.assertion.4\] success 3: SUCCESS$
^\[main.assertion.5\] failure 2: FAILURE$
^\*\* 2 of 5 failed \(2 iterations\)$
^\VERIFICATION FAILED$
^VERIFICATION FAILED$
2 changes: 1 addition & 1 deletion regression/cbmc/Quantifiers-type/test.desc
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ main.c
^\[main.assertion.1\] assertion tmp_if_expr\$1: FAILURE$
^\[main.assertion.2\] assertion tmp_if_expr\$2: SUCCESS$
^\*\* 1 of 2 failed \(2 iterations\)$
^\VERIFICATION FAILED$
^VERIFICATION FAILED$
3 changes: 3 additions & 0 deletions src/goto-instrument/goto_instrument_parse_options.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1482,13 +1482,16 @@ void goto_instrument_parse_optionst::help()
" --show-symbol-table show symbol table\n"
" --list-symbols list symbols with type information\n"
HELP_SHOW_GOTO_FUNCTIONS
" --drop-unused-functions drop functions trivially unreachable from main function\n" // NOLINT(*)
" --print-internal-representation\n" // NOLINTNEXTLINE(*)
" show verbose internal representation of the program\n"
" --list-undefined-functions list functions without body\n"
" --show-struct-alignment show struct members that might be concurrently accessed\n" // NOLINT(*)
" --show-natural-loops show natural loop heads\n"
// NOLINTNEXTLINE(whitespace/line_length)
" --list-calls-args list all function calls with their arguments\n"
// NOLINTNEXTLINE(whitespace/line_length)
" --print-path-lengths print statistics about control-flow graph paths\n"
"\n"
"Safety checks:\n"
" --no-assertions ignore user assertions\n"
Expand Down
3 changes: 2 additions & 1 deletion src/goto-programs/convert_nondet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ static goto_programt::targett insert_nondet_init_code(
}

// Although, if the type is a ptr-to-void then we also want to bail
if(lhs.type().subtype().id()==ID_empty)
if(lhs.type().subtype().id()==ID_empty ||
lhs.type().subtype().id()==ID_code)
{
return next_instr;
}
Expand Down
7 changes: 1 addition & 6 deletions src/goto-programs/goto_convert_class.h
Original file line number Diff line number Diff line change
Expand Up @@ -530,11 +530,6 @@ class goto_convertt:public messaget
const exprt &rhs,
const exprt::operandst &arguments,
goto_programt &dest);
void do_array_set(
const exprt &lhs,
const exprt &rhs,
const exprt::operandst &arguments,
goto_programt &dest);
void do_array_equal(
const exprt &lhs,
const exprt &rhs,
Expand All @@ -543,7 +538,7 @@ class goto_convertt:public messaget
void do_array_op(
const irep_idt &id,
const exprt &lhs,
const exprt &rhs,
const exprt &function,
const exprt::operandst &arguments,
goto_programt &dest);
void do_printf(
Expand Down
1 change: 0 additions & 1 deletion src/goto-programs/replace_java_nondet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -251,4 +251,3 @@ void replace_java_nondet(goto_modelt &goto_model)
{
replace_java_nondet(goto_model.goto_functions);
}

2 changes: 2 additions & 0 deletions src/java_bytecode/java_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ Author: Daniel Kroening, [email protected]
#include <util/std_types.h>
#include <util/string_utils.h>

#include <set>

bool java_is_array_type(const typet &type)
{
if(type.id()!=ID_struct)
Expand Down
9 changes: 3 additions & 6 deletions src/java_bytecode/java_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,12 @@ Author: Daniel Kroening, [email protected]

\*******************************************************************/

#include <util/symbol_table.h>
#include <util/message.h>
#include <util/std_expr.h>

#include "java_bytecode_parse_tree.h"
#ifndef CPROVER_JAVA_BYTECODE_JAVA_UTILS_H
#define CPROVER_JAVA_BYTECODE_JAVA_UTILS_H

#include <util/type.h>
#include <util/message.h>
#include <util/std_expr.h>
#include <util/symbol_table.h>

bool java_is_array_type(const typet &type);

Expand Down
2 changes: 0 additions & 2 deletions src/solvers/flattening/pointer_logic.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ Author: Daniel Kroening, [email protected]

class namespacet;

class namespacet;

class pointer_logict
{
public:
Expand Down
2 changes: 1 addition & 1 deletion src/solvers/prop/bdd_expr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ exprt bdd_exprt::as_expr(const mini_bddt &r) const
}
else if(r.high().is_false())
{
if(r.high().is_true())
if(r.low().is_true())
return not_exprt(n_expr);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch.

else
return and_exprt(not_exprt(n_expr), as_expr(r.low()));
Expand Down