Skip to content

Improve documentation of convert_java_nondet #3092

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 1 commit into from
Oct 3, 2018
Merged
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
31 changes: 23 additions & 8 deletions jbmc/src/java_bytecode/convert_java_nondet.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Author: Reuben Thomas, [email protected]
\*******************************************************************/

/// \file
/// Convert side_effect_expr_nondett expressions
/// Convert side_effect_expr_nondett expressions using java_object_factory

#ifndef CPROVER_JAVA_BYTECODE_CONVERT_NONDET_H
#define CPROVER_JAVA_BYTECODE_CONVERT_NONDET_H
Expand All @@ -22,30 +22,45 @@ class goto_model_functiont;
class message_handlert;
struct object_factory_parameterst;

/// Replace calls to nondet library functions with an internal nondet
/// representation.
/// Converts side_effect_exprt_nondett expressions using java_object_factory.
/// For example, NONDET(SomeClass *) may become a nondet choice between a null
/// pointer and a fresh instance of SomeClass, whose fields are in turn nondet
/// initialized in the same way. See \ref java_object_factory.h for details.
///
/// Note the code introduced has been freshly `goto_convert`'d without any
/// passes such as \ref remove_java_new being run. Therefore the caller may need
/// to (re-)run this and other expected GOTO transformations after this pass
/// completes.
/// \param goto_functions: The set of goto programs to modify.
/// \param symbol_table: The symbol table to query/update.
/// \param message_handler: For error logging.
/// \param object_factory_parameters: Parameters for the generation of nondet
/// objects.
void convert_nondet(
goto_functionst &,
symbol_table_baset &,
message_handlert &,
goto_functionst &goto_functions,
symbol_table_baset &symbol_table,
message_handlert &message_handler,
const object_factory_parameterst &object_factory_parameters);

void convert_nondet(
goto_modelt &,
message_handlert &,
const object_factory_parameterst &object_factory_parameters);

/// Replace calls to nondet library functions with an internal nondet
/// representation.
/// Converts side_effect_exprt_nondett expressions using java_object_factory.
/// For example, NONDET(SomeClass *) may become a nondet choice between a null
/// pointer and a fresh instance of SomeClass, whose fields are in turn nondet
/// initialized in the same way. See \ref java_object_factory.h for details.
///
/// Note the code introduced has been freshly `goto_convert`'d without any
/// passes such as \ref remove_java_new being run. Therefore the caller may need
/// to (re-)run this and other expected GOTO transformations after this pass
/// completes.
/// \param function: goto program to modify
/// \param message_handler: For error logging.
/// \param object_factory_parameters: Parameters for the generation of nondet
/// objects.
/// \param mode: Mode for newly created symbols
Copy link
Member

Choose a reason for hiding this comment

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

Surprised that this isn't always ID_java?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Me too, but that's another PR :)

void convert_nondet(
goto_model_functiont &function,
message_handlert &message_handler,
Expand Down