diff --git a/.gitignore b/.gitignore index 7ba5ba011b4..f48ca020a60 100644 --- a/.gitignore +++ b/.gitignore @@ -12,6 +12,8 @@ src/goto-analyzer/taint_driver_scripts/.idea/* /*.files /*.includes +*.pyc + # compilation files *.lo *.od @@ -68,6 +70,10 @@ src/xmllang/xml_lex.yy.cpp src/xmllang/xml_y.output src/xmllang/xml_y.tab.cpp src/xmllang/xml_y.tab.h +src/memory-models/mm_lex.yy.cpp +src/memory-models/mm_y.output +src/memory-models/mm_y.tab.cpp +src/memory-models/mm_y.tab.h # binaries src/cbmc/cbmc diff --git a/scripts/compare_postprocessor_output.py b/scripts/compare_postprocessor_output.py new file mode 100644 index 00000000000..10dcb0f2709 --- /dev/null +++ b/scripts/compare_postprocessor_output.py @@ -0,0 +1,99 @@ +import difflib, argparse, subprocess, sys, os, multiprocessing, itertools + + +def preprocess(compiler, file_contents): + """ Get output from the preprocessing pass on a file. """ + output = subprocess.Popen( + [compiler, '-E', '-'], + stdout=subprocess.PIPE, + stderr=subprocess.PIPE, + stdin=subprocess.PIPE).communicate(input=file_contents)[0] + + def should_keep(line): + return str.strip(line) and line[0] != '#' + + return filter(should_keep, output.splitlines()) + + +def preprocess_file(compiler, filename): + """ Open a file and get the preprocessor output. """ + with open(filename, 'rb') as f: + return preprocess(compiler, f.read()) + + +def file_contents_from_branch(filename, branch): + """ Get a copy of a file from another branch and return its contents. """ + return subprocess.check_output( + ['git', 'show', '%s:%s' % (branch, filename)]) + + +def equal_to_file_on_branch(filename, branch, compiler): + """ + Open a file on this branch and preprocess it. Preprocess the same file + from another branch, and return a diff. + """ + with open(filename, 'rb') as f: + def p(text): + return preprocess(compiler, text) + return difflib.unified_diff(p(f.read()), + p(file_contents_from_branch(filename, branch)), + fromfile=filename, + tofile=filename, + lineterm='') + + +def is_source(filename): + """ Return whether the file appears to be a C++ source file. """ + _, ext = os.path.splitext(filename) + return ext == '.h' or ext == '.cpp' + + +def process(tup): + """ + Check a single file, and return its name if the check fails, otherwise + return None. + """ + filename, branch, compiler = tup + failed = '\n'.join(equal_to_file_on_branch(filename, branch, compiler)) + return failed if failed else None + + +def main(): + """ + Open a file and compare its preprocessor output to the output from the same + file on a different branch. Return 0 if the outputs match, or 1 otherwise. + """ + parser = argparse.ArgumentParser() + parser.add_argument( + '--branch', type=str, default='upstream/master', + help='The branch to compare') + parser.add_argument( + '--compiler', type=str, default='g++', + help='The compiler to use') + args = parser.parse_args() + + all_files = [os.path.join(root, file) + for root, _, files in os.walk('.') for file in files] + source_files = filter(is_source, all_files) + + zipped = zip( + source_files, + itertools.cycle([args.branch]), + itertools.cycle([args.compiler])) + + pool = multiprocessing.Pool(10) + + results = filter(None, pool.map(process, zipped)) + + pool.close() + pool.join() + + if results: + print('\n\n'.join(results)) + return 1 + + return 0 + + +if __name__ == "__main__": + sys.exit(main()) diff --git a/scripts/do_doc_convert.py b/scripts/do_doc_convert.py new file mode 100644 index 00000000000..bf7f47fa953 --- /dev/null +++ b/scripts/do_doc_convert.py @@ -0,0 +1,40 @@ +from reformat_docs import convert_file +from os import walk +from os.path import join +from sys import exit +from re import match + +""" +Run this from CBMC's top-level directory. +""" + +def main(): + IGNORE_LIST = [ + r'src/big-int/.*', + r'src/miniz/.*', + r'src/ansi-c/arm_builtin_headers.h', + r'src/ansi-c/clang_builtin_headers.h', + r'src/ansi-c/cw_builtin_headers.h', + r'src/ansi-c/gcc_builtin_headers_alpha.h', + r'src/ansi-c/gcc_builtin_headers_arm.h', + r'src/ansi-c/gcc_builtin_headers_generic.h', + r'src/ansi-c/gcc_builtin_headers_ia32-2.h', + r'src/ansi-c/gcc_builtin_headers_ia32.h', + r'src/ansi-c/gcc_builtin_headers_mips.h', + r'src/ansi-c/gcc_builtin_headers_power.h', + r'src/ansi-c/library/cprover.h'] + + MATCH_EXPR = r'.*\.(h|cpp)' + + for root, dirs, files in walk('src'): + for file in files: + path = join(root, file) + if any(map(lambda x: match(x, path), IGNORE_LIST)): + print 'ignoring', path + continue + if not match(MATCH_EXPR, path): + continue + convert_file(path, True) + +if __name__ == '__main__': + exit(main()) diff --git a/scripts/reformat_docs.py b/scripts/reformat_docs.py new file mode 100644 index 00000000000..eadc5359052 --- /dev/null +++ b/scripts/reformat_docs.py @@ -0,0 +1,267 @@ +import re, collections, textwrap, sys, argparse, platform + +Field = collections.namedtuple('Field', ['name', 'contents']) + +Header = collections.namedtuple('Header', ['module']) + +Function = collections.namedtuple('Function', + ['name', 'purpose', 'inputs', 'returns']) + +Class = collections.namedtuple('Class', ['name', 'purpose']) + + +def warn(message): + """ Print a labelled message to stderr. """ + sys.stderr.write('Warning: %s\n' % message) + + +def header_from_block(block): + """ Create a Header structure from a parsed Block. """ + return Header(block.fields['Module']) + + +def function_from_block(block): + """ Create a Function structure from a parsed Block. """ + return Function(block.fields.get('Function', None), + block.fields.get('Purpose', None), block.fields.get('Inputs', None), + block.fields.get('Outputs', None)) + + +def make_field(name, contents): + return Field(name, contents if contents.strip() else None) + + +def class_from_block(block): + """ Create a Class structure from a parsed Block. """ + return Class(block.fields.get('Class', None), + block.fields.get('Purpose', None)) + + +def parse_fields(block_contents): + """ Extract the named fields of an old-style comment block. """ + + field_re = re.compile( + r'(?:\n *(Purpose):(.*))|(?:\n *([a-zA-Z0-9]+?):\n?(.*?)?^$)', + re.MULTILINE | re.DOTALL) + for m in field_re.finditer(block_contents): + # If the field is a Purpose field + if m.lastindex == 2: + yield make_field(m.group(1), textwrap.dedent(m.group(2))) + # If the field is any other field + elif m.lastindex == 3 or m.lastindex == 4: + yield make_field(m.group(3), textwrap.dedent(m.group(4))) + + +Block = collections.namedtuple('Block', ['fields']) + + +def has_field(block, field_name): + """ Return whether the block has a field with the given name. """ + return field_name in block.fields + + +def make_doxy_comment(text): + text = re.sub(r'^(?!$)', r'/// ', text, flags=re.MULTILINE) + return re.sub(r'^(?=$)', r'///' , text, flags=re.MULTILINE) + + +class GenericFormatter(object): + def __init__(self, doc_width): + self.text_wrapper = textwrap.TextWrapper(width=doc_width) + self.indented_wrapper = textwrap.TextWrapper(width=doc_width, + subsequent_indent=r' ') + self.whitespace_re = re.compile(r'\n\s*', re.MULTILINE | re.DOTALL) + + def convert(self, block): + sections = filter(None, self.convert_sections(block)) + if sections: + return make_doxy_comment('\n'.join(sections)) + '\n' + return '' + + +class HeaderFormatter(GenericFormatter): + def format_module(self, header): + if not header.module: + return None + + subbed = self.whitespace_re.sub(' ', header.module) + # The file directive must be followed by a newline in order to refer to + # the current file + return '\\file\n' + self.indented_wrapper.fill(subbed) + + def is_block_valid(self, block): + return has_field(block, 'Module') + + def convert_sections(self, block): + return [self.format_module(block)] + + def needs_new_header(self, file_contents): + return (re.search(r'^\/\/\/ \\file$', file_contents, flags=re.MULTILINE) + is None) + + +class FunctionFormatter(GenericFormatter): + def __init__(self, doc_width): + super(FunctionFormatter, self).__init__(doc_width) + self.paragraph_re = re.compile(r'(.*?)^$(.*)', re.MULTILINE | re.DOTALL) + + def format_purpose(self, function): + if not function.purpose: + return None + + match = self.paragraph_re.match(function.purpose) + first_paragraph = match.group(1) + first_paragraph = self.whitespace_re.sub(' ', + first_paragraph) if first_paragraph else '' + + tail_paragraphs = (('\n' + match.group(2)) if match.group(2) else '') + formatted_purpose = (self.text_wrapper.fill(first_paragraph) + + tail_paragraphs) + + return formatted_purpose.strip() + + def format_inputs(self, function): + if not function.inputs: + return None + + if re.match(r'^\s*\S+\s*$', function.inputs): + return None + + def param_replacement(match): + return r'\param %s:' % match.group(1) + + lines = function.inputs.split('\n') + tail = '\n'.join(lines[1:]) + + dedented = lines[0] + '\n' + textwrap.dedent(tail) + + text = re.sub(r'\n\s+', ' ', dedented, flags=re.MULTILINE) + text, num_replacements = re.subn(r'^([a-zA-Z0-9_]+)\s*[:-]', + param_replacement, text, flags=re.MULTILINE) + + if num_replacements == 0: + text = r'\par parameters: %s' % text + + text = '\n'.join( + self.indented_wrapper.fill(t) for t in text.split('\n')) + return text.strip() + + def format_returns(self, function): + if not function.returns: + return None + + subbed = self.whitespace_re.sub(' ', function.returns) + return self.indented_wrapper.fill(r'\return %s' % subbed) + + def is_block_valid(self, block): + return has_field(block, 'Function') + + def convert_sections(self, block): + return [ + self.format_purpose(block), + self.format_inputs(block), + self.format_returns(block)] + + +class ClassFormatter(GenericFormatter): + def __init__(self, doc_width): + super(ClassFormatter, self).__init__(doc_width) + self.paragraph_re = re.compile(r'(.*?)^$(.*)', re.MULTILINE | re.DOTALL) + + def format_purpose(self, klass): + if not klass.purpose: + return None + + match = self.paragraph_re.match(klass.purpose) + first_paragraph = match.group(1) + first_paragraph = self.whitespace_re.sub(' ', + first_paragraph) if first_paragraph else '' + + tail_paragraphs = (('\n' + match.group(2)) if match.group(2) else '') + formatted_purpose = (self.text_wrapper.fill(first_paragraph) + + tail_paragraphs) + + return formatted_purpose.strip() + + def is_block_valid(self, block): + return has_field(block, 'Class') + + def convert_sections(self, block): + return [self.format_purpose(block)] + + +def replace_block( + block_contents, + file_contents, + file, + header_formatter, + class_formatter, + function_formatter): + """ + Replace an old-style documentation block with the doxygen equivalent + """ + block = Block( + {f.name: f.contents for f in parse_fields(block_contents.group(1))}) + + if header_formatter.is_block_valid(block): + converted = header_formatter.convert(header_from_block(block)) + if header_formatter.needs_new_header(file_contents) and converted: + return block_contents.group(0) + converted + '\n' + return block_contents.group(0) + + if class_formatter.is_block_valid(block): + return class_formatter.convert(class_from_block(block)) + + if function_formatter.is_block_valid(block): + return function_formatter.convert(function_from_block(block)) + + warn('block in "%s" has unrecognised format:\n%s' % + (file, block_contents.group(1))) + + return '' + + +def convert_file(file, inplace): + """ Replace documentation in file with doxygen-styled comments. """ + with open(file) as f: + contents = f.read() + + doc_width = 76 + + header_formatter = HeaderFormatter(doc_width) + class_formatter = ClassFormatter(doc_width) + function_formatter = FunctionFormatter(doc_width) + + block_re = re.compile( + r'^/\*+\\$(.*?)^\\\*+/$\s*', re.MULTILINE | re.DOTALL) + new_contents = block_re.sub( + lambda match: replace_block( + match, + contents, + file, + header_formatter, + class_formatter, + function_formatter), contents) + + if inplace: + with open(file, 'w') as f: + f.write(new_contents) + else: + sys.stdout.write(new_contents) + + +def main(): + """ Run convert_file from the command-line. """ + parser = argparse.ArgumentParser() + parser.add_argument('file', type=str, help='The file to process') + parser.add_argument('-i', '--inplace', action='store_true', + help='Process in place') + args = parser.parse_args() + + convert_file(args.file, args.inplace) + + return 0 + + +if __name__ == '__main__': + sys.exit(main()) diff --git a/src/analyses/ai.cpp b/src/analyses/ai.cpp index 45d4b83c92c..47d5a060410 100644 --- a/src/analyses/ai.cpp +++ b/src/analyses/ai.cpp @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Abstract Interpretation + #include #include @@ -16,18 +19,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "ai.h" -/*******************************************************************\ - -Function: ai_baset::output - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void ai_baset::output( const namespacet &ns, const goto_functionst &goto_functions, @@ -47,18 +38,6 @@ void ai_baset::output( } } -/*******************************************************************\ - -Function: ai_baset::output - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void ai_baset::output( const namespacet &ns, const goto_programt &goto_program, @@ -79,18 +58,9 @@ void ai_baset::output( } } -/*******************************************************************\ - -Function: ai_baset::output_json - - Inputs: The namespace and goto_functions - - Outputs: The JSON object - - Purpose: Output the domains for the whole program as JSON - -\*******************************************************************/ - +/// Output the domains for the whole program as JSON +/// \par parameters: The namespace and goto_functions +/// \return The JSON object jsont ai_baset::output_json( const namespacet &ns, const goto_functionst &goto_functions) const @@ -113,18 +83,9 @@ jsont ai_baset::output_json( return result; } -/*******************************************************************\ - -Function: ai_baset::output_json - - Inputs: The namespace, goto_program and it's identifier - - Outputs: The JSON object - - Purpose: Output the domains for a single function as JSON - -\*******************************************************************/ - +/// Output the domains for a single function as JSON +/// \par parameters: The namespace, goto_program and it's identifier +/// \return The JSON object jsont ai_baset::output_json( const namespacet &ns, const goto_programt &goto_program, @@ -152,18 +113,9 @@ jsont ai_baset::output_json( return contents; } -/*******************************************************************\ - -Function: ai_baset::output_xml - - Inputs: The namespace and goto_functions - - Outputs: The XML object - - Purpose: Output the domains for the whole program as XML - -\*******************************************************************/ - +/// Output the domains for the whole program as XML +/// \par parameters: The namespace and goto_functions +/// \return The XML object xmlt ai_baset::output_xml( const namespacet &ns, const goto_functionst &goto_functions) const @@ -189,18 +141,9 @@ xmlt ai_baset::output_xml( return program; } -/*******************************************************************\ - -Function: ai_baset::output_xml - - Inputs: The namespace, goto_program and it's identifier - - Outputs: The XML object - - Purpose: Output the domains for a single function as XML - -\*******************************************************************/ - +/// Output the domains for a single function as XML +/// \par parameters: The namespace, goto_program and it's identifier +/// \return The XML object xmlt ai_baset::output_xml( const namespacet &ns, const goto_programt &goto_program, @@ -231,18 +174,6 @@ xmlt ai_baset::output_xml( return function_body; } -/*******************************************************************\ - -Function: ai_baset::entry_state - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void ai_baset::entry_state(const goto_functionst &goto_functions) { // find the 'entry function' @@ -254,53 +185,17 @@ void ai_baset::entry_state(const goto_functionst &goto_functions) entry_state(f_it->second.body); } -/*******************************************************************\ - -Function: ai_baset::entry_state - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void ai_baset::entry_state(const goto_programt &goto_program) { // The first instruction of 'goto_program' is the entry point get_state(goto_program.instructions.begin()).make_entry(); } -/*******************************************************************\ - -Function: ai_baset::initialize - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void ai_baset::initialize(const goto_functionst::goto_functiont &goto_function) { initialize(goto_function.body); } -/*******************************************************************\ - -Function: ai_baset::initialize - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void ai_baset::initialize(const goto_programt &goto_program) { // we mark everything as unreachable as starting point @@ -309,36 +204,12 @@ void ai_baset::initialize(const goto_programt &goto_program) get_state(i_it).make_bottom(); } -/*******************************************************************\ - -Function: ai_baset::initialize - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void ai_baset::initialize(const goto_functionst &goto_functions) { forall_goto_functions(it, goto_functions) initialize(it->second); } -/*******************************************************************\ - -Function: ai_baset::get_next - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - ai_baset::locationt ai_baset::get_next( working_sett &working_set) { @@ -351,18 +222,6 @@ ai_baset::locationt ai_baset::get_next( return l; } -/*******************************************************************\ - -Function: ai_baset::fixedpoint - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool ai_baset::fixedpoint( const goto_programt &goto_program, const goto_functionst &goto_functions, @@ -389,18 +248,6 @@ bool ai_baset::fixedpoint( return new_data; } -/*******************************************************************\ - -Function: ai_baset::visit - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool ai_baset::visit( locationt l, working_sett &working_set, @@ -459,18 +306,6 @@ bool ai_baset::visit( return new_data; } -/*******************************************************************\ - -Function: ai_baset::do_function_call - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool ai_baset::do_function_call( locationt l_call, locationt l_return, const goto_functionst &goto_functions, @@ -534,18 +369,6 @@ bool ai_baset::do_function_call( } } -/*******************************************************************\ - -Function: ai_baset::do_function_call_rec - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool ai_baset::do_function_call_rec( locationt l_call, locationt l_return, const exprt &function, @@ -630,18 +453,6 @@ bool ai_baset::do_function_call_rec( return new_data; } -/*******************************************************************\ - -Function: ai_baset::sequential_fixedpoint - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void ai_baset::sequential_fixedpoint( const goto_functionst &goto_functions, const namespacet &ns) @@ -653,18 +464,6 @@ void ai_baset::sequential_fixedpoint( fixedpoint(f_it->second.body, goto_functions, ns); } -/*******************************************************************\ - -Function: ai_baset::concurrent_fixedpoint - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void ai_baset::concurrent_fixedpoint( const goto_functionst &goto_functions, const namespacet &ns) diff --git a/src/analyses/ai.h b/src/analyses/ai.h index 2894cde3b10..3a7cf074340 100644 --- a/src/analyses/ai.h +++ b/src/analyses/ai.h @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Abstract Interpretation + #ifndef CPROVER_ANALYSES_AI_H #define CPROVER_ANALYSES_AI_H diff --git a/src/analyses/call_graph.cpp b/src/analyses/call_graph.cpp index c226e2c73ab..2d91e502a3f 100644 --- a/src/analyses/call_graph.cpp +++ b/src/analyses/call_graph.cpp @@ -6,39 +6,18 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Function Call Graphs + #include #include #include "call_graph.h" -/*******************************************************************\ - -Function: call_grapht::call_grapht - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - call_grapht::call_grapht() { } -/*******************************************************************\ - -Function: call_grapht::call_grapht - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - call_grapht::call_grapht(const goto_functionst &goto_functions) { forall_goto_functions(f_it, goto_functions) @@ -48,18 +27,6 @@ call_grapht::call_grapht(const goto_functionst &goto_functions) } } -/*******************************************************************\ - -Function: call_grapht::add - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void call_grapht::add( const irep_idt &function, const goto_programt &body) @@ -75,18 +42,6 @@ void call_grapht::add( } } -/*******************************************************************\ - -Function: call_grapht::add - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void call_grapht::add( const irep_idt &caller, const irep_idt &callee) @@ -94,18 +49,6 @@ void call_grapht::add( graph.insert(std::pair(caller, callee)); } -/*******************************************************************\ - -Function: call_grapht::output_dot - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void call_grapht::output_dot(std::ostream &out) const { out << "digraph call_graph {\n"; @@ -121,18 +64,6 @@ void call_grapht::output_dot(std::ostream &out) const out << "}\n"; } -/*******************************************************************\ - -Function: call_grapht::output - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void call_grapht::output(std::ostream &out) const { for(const auto &edge : graph) @@ -141,18 +72,6 @@ void call_grapht::output(std::ostream &out) const } } -/*******************************************************************\ - -Function: call_grapht::output_xml - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void call_grapht::output_xml(std::ostream &out) const { for(const auto &edge : graph) diff --git a/src/analyses/call_graph.h b/src/analyses/call_graph.h index 3410410f3d4..a93289f52bd 100644 --- a/src/analyses/call_graph.h +++ b/src/analyses/call_graph.h @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Function Call Graphs + #ifndef CPROVER_ANALYSES_CALL_GRAPH_H #define CPROVER_ANALYSES_CALL_GRAPH_H diff --git a/src/analyses/cfg_dominators.h b/src/analyses/cfg_dominators.h index 930d0ae69b9..fa7d23ccf0a 100644 --- a/src/analyses/cfg_dominators.h +++ b/src/analyses/cfg_dominators.h @@ -6,6 +6,9 @@ Author: Georg Weissenbacher, georg@weissenbacher.name \*******************************************************************/ +/// \file +/// Compute dominators for CFG of goto_function + #ifndef CPROVER_ANALYSES_CFG_DOMINATORS_H #define CPROVER_ANALYSES_CFG_DOMINATORS_H @@ -44,18 +47,7 @@ class cfg_dominators_templatet void fixedpoint(P &program); }; -/*******************************************************************\ - -Function: operator << - - Inputs: - - Outputs: - - Purpose: Print the result of the dominator computation - -\*******************************************************************/ - +/// Print the result of the dominator computation template std::ostream &operator << ( std::ostream &out, @@ -65,18 +57,7 @@ std::ostream &operator << ( return out; } -/*******************************************************************\ - -Function: operator () - - Inputs: - - Outputs: - - Purpose: Compute dominators - -\*******************************************************************/ - +/// Compute dominators template void cfg_dominators_templatet::operator()(P &program) { @@ -84,36 +65,14 @@ void cfg_dominators_templatet::operator()(P &program) fixedpoint(program); } -/*******************************************************************\ - -Function: cfg_dominators_templatet::initialise - - Inputs: - - Outputs: - - Purpose: Initialises the elements of the fixed point analysis - -\*******************************************************************/ - +/// Initialises the elements of the fixed point analysis template void cfg_dominators_templatet::initialise(P &program) { cfg(program); } -/*******************************************************************\ - -Function: cfg_dominators_templatet::fixedpoint - - Inputs: - - Outputs: - - Purpose: Computes the MOP for the dominator analysis - -\*******************************************************************/ - +/// Computes the MOP for the dominator analysis template void cfg_dominators_templatet::fixedpoint(P &program) { @@ -205,19 +164,9 @@ void cfg_dominators_templatet::fixedpoint(P &program) } } -/*******************************************************************\ - -Function: dominators_pretty_print_node - - Inputs: `node` to print and stream `out` to pretty-print it to - - Outputs: - - Purpose: Pretty-print a single node in the dominator tree. - Supply a specialisation if operator<< is not sufficient. - -\*******************************************************************/ - +/// Pretty-print a single node in the dominator tree. Supply a specialisation if +/// operator<< is not sufficient. +/// \par parameters: `node` to print and stream `out` to pretty-print it to template void dominators_pretty_print_node(const T &node, std::ostream &out) { @@ -231,18 +180,7 @@ inline void dominators_pretty_print_node( out << target->code.pretty(); } -/*******************************************************************\ - -Function: cfg_dominators_templatet::output - - Inputs: - - Outputs: - - Purpose: Print the result of the dominator computation - -\*******************************************************************/ - +/// Print the result of the dominator computation template void cfg_dominators_templatet::output(std::ostream &out) const { diff --git a/src/analyses/constant_propagator.cpp b/src/analyses/constant_propagator.cpp index 6735d558cc3..9fa552fc295 100644 --- a/src/analyses/constant_propagator.cpp +++ b/src/analyses/constant_propagator.cpp @@ -6,6 +6,9 @@ Author: Peter Schrammel \*******************************************************************/ +/// \file +/// Constant Propagation + #ifdef DEBUG #include #endif @@ -16,18 +19,6 @@ Author: Peter Schrammel #include "constant_propagator.h" -/*******************************************************************\ - -Function: concatenate_array_id - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - exprt concatenate_array_id( const exprt &array, const exprt &index, const typet &type) @@ -47,18 +38,6 @@ exprt concatenate_array_id( return new_expr; } -/*******************************************************************\ - -Function: concatenate_array_id - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - exprt concatenate_array_id( const exprt &array, const mp_integer &index, const typet &type) @@ -71,18 +50,6 @@ exprt concatenate_array_id( return new_expr; } -/*******************************************************************\ - -Function: constant_propagator_domaint::assign_rec - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void constant_propagator_domaint::assign_rec( valuest &values, const exprt &lhs, const exprt &rhs, @@ -154,18 +121,6 @@ void constant_propagator_domaint::assign_rec( #endif } -/*******************************************************************\ - -Function: constant_propagator_domaint::transform - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void constant_propagator_domaint::transform( locationt from, locationt to, @@ -255,18 +210,7 @@ void constant_propagator_domaint::transform( } -/*******************************************************************\ - -Function: constant_propagator_domaint::two_way_propagate_rec - - Inputs: - - Outputs: - - Purpose: handles equalities and conjunctions containing equalities - -\*******************************************************************/ - +/// handles equalities and conjunctions containing equalities bool constant_propagator_domaint::two_way_propagate_rec( const exprt &expr, const namespacet &ns) @@ -308,18 +252,6 @@ bool constant_propagator_domaint::two_way_propagate_rec( return change; } -/*******************************************************************\ - -Function: constant_propagator_domaint::assign - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void constant_propagator_domaint::assign( valuest &dest, const symbol_exprt &lhs, @@ -331,18 +263,6 @@ void constant_propagator_domaint::assign( dest.set_to(lhs, rhs); } -/*******************************************************************\ - -Function: constant_propagator_domaint::is_array_constant - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool constant_propagator_domaint::valuest::is_array_constant(const exprt &expr) const { exprt new_expr = concatenate_array_id(expr.op0(), @@ -355,18 +275,6 @@ bool constant_propagator_domaint::valuest::is_array_constant(const exprt &expr) return true; } -/*******************************************************************\ - -Function: constant_propagator_domaint::valuest::is_constant - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool constant_propagator_domaint::valuest::is_constant(const exprt &expr) const { if(expr.id()==ID_side_effect && @@ -395,18 +303,6 @@ bool constant_propagator_domaint::valuest::is_constant(const exprt &expr) const return true; } -/*******************************************************************\ - -Function: constant_propagator_domaint::valuest::is_constant_address_of - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool constant_propagator_domaint::valuest::is_constant_address_of( const exprt &expr) const { @@ -426,18 +322,7 @@ bool constant_propagator_domaint::valuest::is_constant_address_of( return true; } -/*******************************************************************\ - -Function: constant_propagator_domaint::valuest::set_to_top - - Inputs: - - Outputs: - - Purpose: Do not call this when iterating over replace_const.expr_map! - -\*******************************************************************/ - +/// Do not call this when iterating over replace_const.expr_map! bool constant_propagator_domaint::valuest::set_to_top(const irep_idt &id) { bool result = false; @@ -455,18 +340,6 @@ bool constant_propagator_domaint::valuest::set_to_top(const irep_idt &id) return result; } -/*******************************************************************\ - -Function: constant_propagator_domaint::valuest::output - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void constant_propagator_domaint::valuest::output( std::ostream &out, const namespacet &ns) const @@ -481,18 +354,6 @@ void constant_propagator_domaint::valuest::output( << from_expr(ns, "", replace_pair.second) << '\n'; } -/*******************************************************************\ - -Function: constant_propagator_domaint::output - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void constant_propagator_domaint::output( std::ostream &out, const ai_baset &ai, @@ -501,18 +362,8 @@ void constant_propagator_domaint::output( values.output(out, ns); } -/*******************************************************************\ - -Function: constant_propagator_domaint::valuest::merge - - Inputs: - - Outputs: Return true if "this" has changed. - - Purpose: join - -\*******************************************************************/ - +/// join +/// \return Return true if "this" has changed. bool constant_propagator_domaint::valuest::merge(const valuest &src) { // nothing to do @@ -557,18 +408,8 @@ bool constant_propagator_domaint::valuest::merge(const valuest &src) return changed; } -/*******************************************************************\ - -Function: constant_propagator_domaint::valuest::meet - - Inputs: - - Outputs: Return true if "this" has changed. - - Purpose: meet - -\*******************************************************************/ - +/// meet +/// \return Return true if "this" has changed. bool constant_propagator_domaint::valuest::meet(const valuest &src) { if(src.is_bottom || is_bottom) @@ -600,18 +441,7 @@ bool constant_propagator_domaint::valuest::meet(const valuest &src) return changed; } -/*******************************************************************\ - -Function: constant_propagator_domaint::merge - - Inputs: - - Outputs: Return true if "this" has changed. - - Purpose: - -\*******************************************************************/ - +/// \return Return true if "this" has changed. bool constant_propagator_domaint::merge( const constant_propagator_domaint &other, locationt from, @@ -620,18 +450,6 @@ bool constant_propagator_domaint::merge( return values.merge(other.values); } -/*******************************************************************\ - -Function: constant_propagator_ait::replace - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void constant_propagator_ait::replace( goto_functionst &goto_functions, const namespacet &ns) @@ -640,18 +458,6 @@ void constant_propagator_ait::replace( replace(f_it->second, ns); } -/*******************************************************************\ - -Function: constant_propagator_ait::replace_array_symbol - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void constant_propagator_ait::replace_array_symbol(exprt &expr) { if (expr.id()==ID_index) @@ -668,18 +474,6 @@ void constant_propagator_ait::replace_array_symbol(exprt &expr) } -/*******************************************************************\ - -Function: constant_propagator_ait::replace - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void constant_propagator_ait::replace( goto_functionst::goto_functiont &goto_function, const namespacet &ns) @@ -732,18 +526,6 @@ void constant_propagator_ait::replace( } } -/*******************************************************************\ - -Function: constant_propagator_ait::replace_types_rec - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void constant_propagator_ait::replace_types_rec( const replace_symbolt &replace_const, exprt &expr) diff --git a/src/analyses/constant_propagator.h b/src/analyses/constant_propagator.h index 0766b458f7d..f56b265297b 100644 --- a/src/analyses/constant_propagator.h +++ b/src/analyses/constant_propagator.h @@ -6,6 +6,9 @@ Author: Peter Schrammel \*******************************************************************/ +/// \file +/// Constant propagation + #ifndef CPROVER_ANALYSES_CONSTANT_PROPAGATOR_H #define CPROVER_ANALYSES_CONSTANT_PROPAGATOR_H diff --git a/src/analyses/custom_bitvector_analysis.cpp b/src/analyses/custom_bitvector_analysis.cpp index 0a3f0306471..face9d8ae67 100644 --- a/src/analyses/custom_bitvector_analysis.cpp +++ b/src/analyses/custom_bitvector_analysis.cpp @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Field-insensitive, location-sensitive bitvector analysis + #include #include @@ -13,18 +16,6 @@ Author: Daniel Kroening, kroening@kroening.com #include -/*******************************************************************\ - -Function: custom_bitvector_domaint::set_bit - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void custom_bitvector_domaint::set_bit( const irep_idt &identifier, unsigned bit_nr, @@ -50,18 +41,6 @@ void custom_bitvector_domaint::set_bit( } } -/*******************************************************************\ - -Function: custom_bitvector_domaint::set_bit - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void custom_bitvector_domaint::set_bit( const exprt &lhs, unsigned bit_nr, @@ -72,18 +51,6 @@ void custom_bitvector_domaint::set_bit( set_bit(id, bit_nr, mode); } -/*******************************************************************\ - -Function: custom_bitvector_domaint::object2id - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - irep_idt custom_bitvector_domaint::object2id(const exprt &src) { if(src.id()==ID_symbol) @@ -117,18 +84,6 @@ irep_idt custom_bitvector_domaint::object2id(const exprt &src) return irep_idt(); } -/*******************************************************************\ - -Function: custom_bitvector_domaint::assign_lhs - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void custom_bitvector_domaint::assign_lhs( const exprt &lhs, const vectorst &vectors) @@ -138,18 +93,6 @@ void custom_bitvector_domaint::assign_lhs( assign_lhs(id, vectors); } -/*******************************************************************\ - -Function: custom_bitvector_domaint::assign_lhs - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void custom_bitvector_domaint::assign_lhs( const irep_idt &identifier, const vectorst &vectors) @@ -167,18 +110,6 @@ void custom_bitvector_domaint::assign_lhs( may_bits[identifier]=vectors.may_bits; } -/*******************************************************************\ - -Function: custom_bitvector_domaint::get_rhs - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - custom_bitvector_domaint::vectorst custom_bitvector_domaint::get_rhs(const irep_idt &identifier) const { @@ -195,18 +126,6 @@ custom_bitvector_domaint::vectorst return vectors; } -/*******************************************************************\ - -Function: custom_bitvector_domaint::get_rhs - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - custom_bitvector_domaint::vectorst custom_bitvector_domaint::get_rhs(const exprt &rhs) const { @@ -231,18 +150,6 @@ custom_bitvector_domaint::vectorst return vectorst(); } -/*******************************************************************\ - -Function: custom_bitvector_analysist::get_bit_nr - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - unsigned custom_bitvector_analysist::get_bit_nr( const exprt &string_expr) { @@ -261,18 +168,6 @@ unsigned custom_bitvector_analysist::get_bit_nr( return bits("(unknown)"); } -/*******************************************************************\ - -Function: custom_bitvector_domaint::aliases - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::set custom_bitvector_analysist::aliases( const exprt &src, locationt loc) @@ -309,18 +204,6 @@ std::set custom_bitvector_analysist::aliases( return std::set(); } -/*******************************************************************\ - -Function: custom_bitvector_domaint::transform - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void custom_bitvector_domaint::transform( locationt from, locationt to, @@ -549,18 +432,6 @@ void custom_bitvector_domaint::transform( } } -/*******************************************************************\ - -Function: custom_bitvector_domaint::output - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void custom_bitvector_domaint::output( std::ostream &out, const ai_baset &ai, @@ -608,18 +479,6 @@ void custom_bitvector_domaint::output( } } -/*******************************************************************\ - -Function: custom_bitvector_domaint::merge - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool custom_bitvector_domaint::merge( const custom_bitvector_domaint &b, locationt from, @@ -673,18 +532,7 @@ bool custom_bitvector_domaint::merge( return changed; } -/*******************************************************************\ - -Function: custom_bitvector_domaint::erase_blank_vectors - - Inputs: - - Outputs: - - Purpose: erase blank bitvectors - -\*******************************************************************/ - +/// erase blank bitvectors void custom_bitvector_domaint::erase_blank_vectors(bitst &bits) { for(bitst::iterator a_it=bits.begin(); @@ -698,18 +546,6 @@ void custom_bitvector_domaint::erase_blank_vectors(bitst &bits) } } -/*******************************************************************\ - -Function: custom_bitvector_domaint::has_get_must_or_may - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool custom_bitvector_domaint::has_get_must_or_may(const exprt &src) { if(src.id()=="get_must" || @@ -723,18 +559,6 @@ bool custom_bitvector_domaint::has_get_must_or_may(const exprt &src) return false; } -/*******************************************************************\ - -Function: custom_bitvector_domaint::eval - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - exprt custom_bitvector_domaint::eval( const exprt &src, custom_bitvector_analysist &custom_bitvector_analysis) const @@ -797,34 +621,10 @@ exprt custom_bitvector_domaint::eval( } } -/*******************************************************************\ - -Function: custom_bitvector_analysist::instrument - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void custom_bitvector_analysist::instrument(goto_functionst &) { } -/*******************************************************************\ - -Function: custom_bitvector_analysist::check - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void custom_bitvector_analysist::check( const namespacet &ns, const goto_functionst &goto_functions, diff --git a/src/analyses/custom_bitvector_analysis.h b/src/analyses/custom_bitvector_analysis.h index e77cb6fc58b..ff2884cc2ec 100644 --- a/src/analyses/custom_bitvector_analysis.h +++ b/src/analyses/custom_bitvector_analysis.h @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Field-insensitive, location-sensitive bitvector analysis + #ifndef CPROVER_ANALYSES_CUSTOM_BITVECTOR_ANALYSIS_H #define CPROVER_ANALYSES_CUSTOM_BITVECTOR_ANALYSIS_H @@ -15,14 +18,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "ai.h" #include "local_may_alias.h" -/*******************************************************************\ - - Class: custom_bitvector_domaint - - Purpose: - -\*******************************************************************/ - class custom_bitvector_analysist; class custom_bitvector_domaint:public ai_domain_baset diff --git a/src/analyses/dependence_graph.cpp b/src/analyses/dependence_graph.cpp index 730ec0266e4..470c0911f01 100644 --- a/src/analyses/dependence_graph.cpp +++ b/src/analyses/dependence_graph.cpp @@ -9,24 +9,15 @@ Date: August 2013 \*******************************************************************/ +/// \file +/// Field-Sensitive Program Dependence Analysis, Litvak et al., FSE 2010 + #include #include "goto_rw.h" #include "dependence_graph.h" -/*******************************************************************\ - -Function: dep_graph_domaint::merge - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool dep_graph_domaint::merge( const dep_graph_domaint &src, goto_programt::const_targett from, @@ -66,18 +57,6 @@ bool dep_graph_domaint::merge( return changed; } -/*******************************************************************\ - -Function: dep_graph_domaint::control_dependencies - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void dep_graph_domaint::control_dependencies( goto_programt::const_targett from, goto_programt::const_targett to, @@ -144,18 +123,6 @@ void dep_graph_domaint::control_dependencies( dep_graph.add_dep(dep_edget::kindt::CTRL, c_dep, to); } -/*******************************************************************\ - -Function: may_be_def_use_pair - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - static bool may_be_def_use_pair( const mp_integer &w_start, const mp_integer &w_end, @@ -177,18 +144,6 @@ static bool may_be_def_use_pair( return false; } -/*******************************************************************\ - -Function: dep_graph_domaint::data_depdendencies - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void dep_graph_domaint::data_dependencies( goto_programt::const_targett from, goto_programt::const_targett to, @@ -238,18 +193,6 @@ void dep_graph_domaint::data_dependencies( } } -/*******************************************************************\ - -Function: dep_graph_domaint::transform - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void dep_graph_domaint::transform( goto_programt::const_targett from, goto_programt::const_targett to, @@ -297,18 +240,6 @@ void dep_graph_domaint::transform( data_dependencies(from, to, *dep_graph, ns); } -/*******************************************************************\ - -Function: dep_graph_domaint::output - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void dep_graph_domaint::output( std::ostream &out, const ai_baset &ai, @@ -345,18 +276,6 @@ void dep_graph_domaint::output( } } -/*******************************************************************\ - -Function: dependence_grapht::add_dep - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void dependence_grapht::add_dep( dep_edget::kindt kind, goto_programt::const_targett from, diff --git a/src/analyses/dependence_graph.h b/src/analyses/dependence_graph.h index fae7c7adbd4..fc415fe1721 100644 --- a/src/analyses/dependence_graph.h +++ b/src/analyses/dependence_graph.h @@ -9,6 +9,9 @@ Date: August 2013 \*******************************************************************/ +/// \file +/// Field-Sensitive Program Dependence Analysis, Litvak et al., FSE 2010 + #ifndef CPROVER_ANALYSES_DEPENDENCE_GRAPH_H #define CPROVER_ANALYSES_DEPENDENCE_GRAPH_H diff --git a/src/analyses/dirty.cpp b/src/analyses/dirty.cpp index a159f6ddef2..8ff99f77aa8 100644 --- a/src/analyses/dirty.cpp +++ b/src/analyses/dirty.cpp @@ -8,22 +8,13 @@ Date: March 2013 \*******************************************************************/ +/// \file +/// Local variables whose address is taken + #include #include "dirty.h" -/*******************************************************************\ - -Function: dirtyt::build - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void dirtyt::build(const goto_functiont &goto_function) { forall_goto_program_instructions(it, goto_function.body) @@ -33,18 +24,6 @@ void dirtyt::build(const goto_functiont &goto_function) } } -/*******************************************************************\ - -Function: dirtyt::find_dirty - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void dirtyt::find_dirty(const exprt &expr) { if(expr.id()==ID_address_of) @@ -58,18 +37,6 @@ void dirtyt::find_dirty(const exprt &expr) find_dirty(*it); } -/*******************************************************************\ - -Function: dirtyt::find_dirty_address_of - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void dirtyt::find_dirty_address_of(const exprt &expr) { if(expr.id()==ID_symbol) @@ -100,18 +67,6 @@ void dirtyt::find_dirty_address_of(const exprt &expr) } } -/*******************************************************************\ - -Function: dirtyt::output - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void dirtyt::output(std::ostream &out) const { for(const auto &d : dirty) diff --git a/src/analyses/dirty.h b/src/analyses/dirty.h index f60b86703c4..52801d05281 100644 --- a/src/analyses/dirty.h +++ b/src/analyses/dirty.h @@ -8,6 +8,9 @@ Date: March 2013 \*******************************************************************/ +/// \file +/// Variables whose address is taken + #ifndef CPROVER_ANALYSES_DIRTY_H #define CPROVER_ANALYSES_DIRTY_H diff --git a/src/analyses/does_remove_const.cpp b/src/analyses/does_remove_const.cpp index fcccd8219c9..90d82f99e19 100644 --- a/src/analyses/does_remove_const.cpp +++ b/src/analyses/does_remove_const.cpp @@ -6,6 +6,9 @@ \*******************************************************************/ +/// \file +/// Analyses + #include #include #include @@ -15,21 +18,10 @@ #include "does_remove_const.h" -/*******************************************************************\ - -Function: does_remove_constt::does_remove_constt - - Inputs: - goto_program - the goto program to check - ns - the namespace of the goto program (used for checking type equality) - - Outputs: - - Purpose: A naive analysis to look for casts that remove const-ness from - pointers. - -\*******************************************************************/ - +/// A naive analysis to look for casts that remove const-ness from pointers. +/// \param goto_program: the goto program to check +/// \param ns: the namespace of the goto program (used for checking type +/// equality) does_remove_constt::does_remove_constt( const goto_programt &goto_program, const namespacet &ns): @@ -37,19 +29,8 @@ does_remove_constt::does_remove_constt( ns(ns) {} -/*******************************************************************\ - -Function: does_remove_constt::operator() - - Inputs: - - Outputs: Returns true if the program contains a const-removing cast - - Purpose: A naive analysis to look for casts that remove const-ness from - pointers. - -\*******************************************************************/ - +/// A naive analysis to look for casts that remove const-ness from pointers. +/// \return Returns true if the program contains a const-removing cast bool does_remove_constt::operator()() const { for(const goto_programt::instructiont &instruction : @@ -80,22 +61,12 @@ bool does_remove_constt::operator()() const return false; } -/*******************************************************************\ - -Function: does_remove_constt::does_expr_lose_const() - - Inputs: - expr - The expression to check - - Outputs: Returns true if somewhere in the passed expression tree the const-ness - is lost. - - Purpose: Search the expression tree to look for any children that have the - same base type, but a less strict const qualification. - If one is found, we return true. - -\*******************************************************************/ - +/// Search the expression tree to look for any children that have the same base +/// type, but a less strict const qualification. If one is found, we return +/// true. +/// \param expr: The expression to check +/// \return Returns true if somewhere in the passed expression tree the const- +/// ness is lost. bool does_remove_constt::does_expr_lose_const(const exprt &expr) const { const typet &root_type=expr.type(); @@ -122,29 +93,20 @@ bool does_remove_constt::does_expr_lose_const(const exprt &expr) const return false; } -/*******************************************************************\ - -Function: does_remove_constt::is_type_at_least_as_const_as - - Inputs: - type_more_const - the type we are expecting to be at least as const qualified - type_compare - the type we are comparing against which may be less const - qualified - - Outputs: Returns true if type_more_const is at least as const as type_compare - - Purpose: A recursive check to check the type_more_const is at least as const - as type compare. - - type_more_const | type_compare || result - ---------------------------------------- - const int * | const int * -> true - int * | const int * -> false - const int * | int * -> true - int * | int * const -> false - -\*******************************************************************/ - +/// A recursive check to check the type_more_const is at least as const as type +/// compare. +/// +/// type_more_const | type_compare || result +/// ---------------------------------------- +/// const int * | const int * -> true +/// int * | const int * -> false +/// const int * | int * -> true +/// int * | int * const -> false +/// \param type_more_const: the type we are expecting to be at least as const +/// qualified +/// \param type_compare: the type we are comparing against which may be less +/// const qualified +/// \return Returns true if type_more_const is at least as const as type_compare bool does_remove_constt::is_type_at_least_as_const_as( const typet *type_more_const, const typet *type_compare) const { diff --git a/src/analyses/does_remove_const.h b/src/analyses/does_remove_const.h index 594682c7d50..f0cf2a25799 100644 --- a/src/analyses/does_remove_const.h +++ b/src/analyses/does_remove_const.h @@ -5,6 +5,9 @@ Author: DiffBlue Limited. All rights reserved. \*******************************************************************/ +/// \file +/// Analyses + #ifndef CPROVER_ANALYSES_DOES_REMOVE_CONST_H #define CPROVER_ANALYSES_DOES_REMOVE_CONST_H diff --git a/src/analyses/escape_analysis.cpp b/src/analyses/escape_analysis.cpp index 1382e9d1689..3b0e7fc3f5c 100644 --- a/src/analyses/escape_analysis.cpp +++ b/src/analyses/escape_analysis.cpp @@ -6,22 +6,13 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Field-insensitive, location-sensitive escape analysis + #include #include "escape_analysis.h" -/*******************************************************************\ - -Function: escape_domaint::is_tracked - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool escape_domaint::is_tracked(const symbol_exprt &symbol) { const irep_idt &identifier=symbol.get_identifier(); @@ -34,18 +25,6 @@ bool escape_domaint::is_tracked(const symbol_exprt &symbol) return true; } -/*******************************************************************\ - -Function: escape_domaint::get_function - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - irep_idt escape_domaint::get_function(const exprt &lhs) { if(lhs.id()==ID_address_of) @@ -61,18 +40,6 @@ irep_idt escape_domaint::get_function(const exprt &lhs) return irep_idt(); } -/*******************************************************************\ - -Function: escape_domaint::assign_lhs_cleanup - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void escape_domaint::assign_lhs_cleanup( const exprt &lhs, const std::set &cleanup_functions) @@ -92,18 +59,6 @@ void escape_domaint::assign_lhs_cleanup( } } -/*******************************************************************\ - -Function: escape_domaint::assign_lhs_aliases - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void escape_domaint::assign_lhs_aliases( const exprt &lhs, const std::set &alias_set) @@ -125,18 +80,6 @@ void escape_domaint::assign_lhs_aliases( } } -/*******************************************************************\ - -Function: escape_domaint::get_rhs_cleanup - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void escape_domaint::get_rhs_cleanup( const exprt &rhs, std::set &cleanup_functions) @@ -167,18 +110,6 @@ void escape_domaint::get_rhs_cleanup( } } -/*******************************************************************\ - -Function: escape_domaint::get_rhs_aliases - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void escape_domaint::get_rhs_aliases( const exprt &rhs, std::set &alias_set) @@ -211,18 +142,6 @@ void escape_domaint::get_rhs_aliases( } } -/*******************************************************************\ - -Function: escape_domaint::get_rhs_aliases_address_of - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void escape_domaint::get_rhs_aliases_address_of( const exprt &rhs, std::set &alias_set) @@ -242,18 +161,6 @@ void escape_domaint::get_rhs_aliases_address_of( } } -/*******************************************************************\ - -Function: escape_domaint::transform - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void escape_domaint::transform( locationt from, locationt to, @@ -346,18 +253,6 @@ void escape_domaint::transform( } } -/*******************************************************************\ - -Function: escape_domaint::output - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void escape_domaint::output( std::ostream &out, const ai_baset &ai, @@ -404,18 +299,6 @@ void escape_domaint::output( } } -/*******************************************************************\ - -Function: escape_domaint::merge - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool escape_domaint::merge( const escape_domaint &b, locationt from, @@ -480,18 +363,6 @@ bool escape_domaint::merge( return changed; } -/*******************************************************************\ - -Function: escape_domaint::check_lhs - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void escape_domaint::check_lhs( const exprt &lhs, std::set &cleanup_functions) @@ -527,18 +398,6 @@ void escape_domaint::check_lhs( } } -/*******************************************************************\ - -Function: escape_analysist::insert_cleanup - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void escape_analysist::insert_cleanup( goto_functionst::goto_functiont &goto_function, goto_programt::targett location, @@ -576,18 +435,6 @@ void escape_analysist::insert_cleanup( } } -/*******************************************************************\ - -Function: escape_analysist::instrument - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void escape_analysist::instrument( goto_functionst &goto_functions, const namespacet &ns) diff --git a/src/analyses/escape_analysis.h b/src/analyses/escape_analysis.h index 948bed3fea8..00f865b45e4 100644 --- a/src/analyses/escape_analysis.h +++ b/src/analyses/escape_analysis.h @@ -7,6 +7,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Field-insensitive, location-sensitive, over-approximative escape analysis + #ifndef CPROVER_ANALYSES_ESCAPE_ANALYSIS_H #define CPROVER_ANALYSES_ESCAPE_ANALYSIS_H @@ -16,14 +19,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "ai.h" -/*******************************************************************\ - - Class: escape_domaint - - Purpose: - -\*******************************************************************/ - class escape_analysist; class escape_domaint:public ai_domain_baset diff --git a/src/analyses/flow_insensitive_analysis.cpp b/src/analyses/flow_insensitive_analysis.cpp index bc4dd11e889..0d46d9d38c0 100644 --- a/src/analyses/flow_insensitive_analysis.cpp +++ b/src/analyses/flow_insensitive_analysis.cpp @@ -7,6 +7,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Flow Insensitive Static Analysis + #include #include @@ -14,18 +17,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "flow_insensitive_analysis.h" -/*******************************************************************\ - -Function: flow_insensitive_abstract_domain_baset::get_guard - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - exprt flow_insensitive_abstract_domain_baset::get_guard( locationt from, locationt to) const @@ -46,18 +37,6 @@ exprt flow_insensitive_abstract_domain_baset::get_guard( return from->guard; } -/*******************************************************************\ - -Function: flow_insensitive_abstract_domain_baset::get_return_lhs - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - exprt flow_insensitive_abstract_domain_baset::get_return_lhs(locationt to) const { // get predecessor of "to" @@ -76,18 +55,6 @@ exprt flow_insensitive_abstract_domain_baset::get_return_lhs(locationt to) const return code.lhs(); } -/*******************************************************************\ - -Function: flow_insensitive_analysis_baset::operator() - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void flow_insensitive_analysis_baset::operator()( const goto_functionst &goto_functions) { @@ -95,18 +62,6 @@ void flow_insensitive_analysis_baset::operator()( fixedpoint(goto_functions); } -/*******************************************************************\ - -Function: flow_insensitive_analysis_baset::operator() - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void flow_insensitive_analysis_baset::operator()( const goto_programt &goto_program) { @@ -115,18 +70,6 @@ void flow_insensitive_analysis_baset::operator()( fixedpoint(goto_program, goto_functions); } -/*******************************************************************\ - -Function: flow_insensitive_analysis_baset::output - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void flow_insensitive_analysis_baset::output( const goto_functionst &goto_functions, std::ostream &out) @@ -142,18 +85,6 @@ void flow_insensitive_analysis_baset::output( } } -/*******************************************************************\ - -Function: flow_insensitive_analysis_baset::output - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void flow_insensitive_analysis_baset::output( const goto_programt &goto_program, const irep_idt &identifier, @@ -162,18 +93,6 @@ void flow_insensitive_analysis_baset::output( get_state().output(ns, out); } -/*******************************************************************\ - -Function: flow_insensitive_analysis_baset::get_next - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - flow_insensitive_analysis_baset::locationt flow_insensitive_analysis_baset::get_next( working_sett &working_set) @@ -191,18 +110,6 @@ flow_insensitive_analysis_baset::get_next( return l; } -/*******************************************************************\ - -Function: flow_insensitive_analysis_baset::fixedpoint - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool flow_insensitive_analysis_baset::fixedpoint( const goto_programt &goto_program, const goto_functionst &goto_functions) @@ -231,18 +138,6 @@ bool flow_insensitive_analysis_baset::fixedpoint( return new_data; } -/*******************************************************************\ - -Function: flow_insensitive_analysis_baset::visit - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool flow_insensitive_analysis_baset::visit( locationt l, working_sett &working_set, @@ -310,18 +205,6 @@ bool flow_insensitive_analysis_baset::visit( return new_data; } -/*******************************************************************\ - -Function: flow_insensitive_analysis_baset::do_function_call - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool flow_insensitive_analysis_baset::do_function_call( locationt l_call, const goto_functionst &goto_functions, @@ -402,18 +285,6 @@ bool flow_insensitive_analysis_baset::do_function_call( return new_data; } -/*******************************************************************\ - -Function: flow_insensitive_analysis_baset::do_function_call_rec - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool flow_insensitive_analysis_baset::do_function_call_rec( locationt l_call, const exprt &function, @@ -523,18 +394,6 @@ bool flow_insensitive_analysis_baset::do_function_call_rec( return new_data; } -/*******************************************************************\ - -Function: flow_insensitive_analysis_baset::fixedpoint - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void flow_insensitive_analysis_baset::fixedpoint( const goto_functionst &goto_functions) { @@ -548,18 +407,6 @@ void flow_insensitive_analysis_baset::fixedpoint( } } -/*******************************************************************\ - -Function: flow_insensitive_analysis_baset::fixedpoint - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool flow_insensitive_analysis_baset::fixedpoint( const goto_functionst::function_mapt::const_iterator it, const goto_functionst &goto_functions) @@ -568,36 +415,12 @@ bool flow_insensitive_analysis_baset::fixedpoint( return fixedpoint(it->second.body, goto_functions); } -/*******************************************************************\ - -Function: flow_insensitive_analysis_baset::update - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void flow_insensitive_analysis_baset::update( const goto_functionst &goto_functions) { // no need to copy value sets around } -/*******************************************************************\ - -Function: flow_insensitive_analysis_baset::update - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void flow_insensitive_analysis_baset::update( const goto_programt &goto_program) { diff --git a/src/analyses/flow_insensitive_analysis.h b/src/analyses/flow_insensitive_analysis.h index 07d1f0f77cd..bf06cf90cdf 100644 --- a/src/analyses/flow_insensitive_analysis.h +++ b/src/analyses/flow_insensitive_analysis.h @@ -7,6 +7,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Flow Insensitive Static Analysis + #ifndef CPROVER_ANALYSES_FLOW_INSENSITIVE_ANALYSIS_H #define CPROVER_ANALYSES_FLOW_INSENSITIVE_ANALYSIS_H diff --git a/src/analyses/global_may_alias.cpp b/src/analyses/global_may_alias.cpp index 33ad0f7f186..28fabae92b4 100644 --- a/src/analyses/global_may_alias.cpp +++ b/src/analyses/global_may_alias.cpp @@ -6,19 +6,10 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ -#include "global_may_alias.h" - -/*******************************************************************\ - -Function: global_may_alias_domaint::assign_lhs_aliases - - Inputs: - - Outputs: - - Purpose: +/// \file +/// Field-insensitive, location-sensitive gobal may alias analysis -\*******************************************************************/ +#include "global_may_alias.h" void global_may_alias_domaint::assign_lhs_aliases( const exprt &lhs, @@ -37,18 +28,6 @@ void global_may_alias_domaint::assign_lhs_aliases( } } -/*******************************************************************\ - -Function: global_may_alias_domaint::get_rhs_aliases - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void global_may_alias_domaint::get_rhs_aliases( const exprt &rhs, std::set &alias_set) @@ -77,18 +56,6 @@ void global_may_alias_domaint::get_rhs_aliases( } } -/*******************************************************************\ - -Function: global_may_alias_domaint::get_rhs_aliases_address_of - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void global_may_alias_domaint::get_rhs_aliases_address_of( const exprt &rhs, std::set &alias_set) @@ -108,18 +75,6 @@ void global_may_alias_domaint::get_rhs_aliases_address_of( } } -/*******************************************************************\ - -Function: global_may_alias_domaint::transform - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void global_may_alias_domaint::transform( locationt from, locationt to, @@ -163,18 +118,6 @@ void global_may_alias_domaint::transform( } } -/*******************************************************************\ - -Function: global_may_alias_domaint::output - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void global_may_alias_domaint::output( std::ostream &out, const ai_baset &ai, @@ -213,18 +156,6 @@ void global_may_alias_domaint::output( } } -/*******************************************************************\ - -Function: global_may_alias_domaint::merge - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool global_may_alias_domaint::merge( const global_may_alias_domaint &b, locationt from, diff --git a/src/analyses/global_may_alias.h b/src/analyses/global_may_alias.h index 2f4a49b2d0a..d946b371c05 100644 --- a/src/analyses/global_may_alias.h +++ b/src/analyses/global_may_alias.h @@ -7,6 +7,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Field-insensitive, location-sensitive, over-approximative escape analysis + #ifndef CPROVER_ANALYSES_GLOBAL_MAY_ALIAS_H #define CPROVER_ANALYSES_GLOBAL_MAY_ALIAS_H @@ -16,14 +19,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "ai.h" -/*******************************************************************\ - - Class: global_may_alias_domaint - - Purpose: - -\*******************************************************************/ - class global_may_alias_analysist; class global_may_alias_domaint:public ai_domain_baset diff --git a/src/analyses/goto_check.cpp b/src/analyses/goto_check.cpp index a6871b94d23..0f668016b21 100644 --- a/src/analyses/goto_check.cpp +++ b/src/analyses/goto_check.cpp @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// GOTO Programs + #include #include @@ -136,18 +139,6 @@ class goto_checkt error_labelst error_labels; }; -/*******************************************************************\ - -Function: goto_checkt::invalidate - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_checkt::invalidate(const exprt &lhs) { if(lhs.id()==ID_index) @@ -182,18 +173,6 @@ void goto_checkt::invalidate(const exprt &lhs) } } -/*******************************************************************\ - -Function: goto_checkt::div_by_zero_check - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_checkt::div_by_zero_check( const div_exprt &expr, const guardt &guard) @@ -220,18 +199,6 @@ void goto_checkt::div_by_zero_check( guard); } -/*******************************************************************\ - -Function: goto_checkt::undefined_shift_check - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_checkt::undefined_shift_check( const shift_exprt &expr, const guardt &guard) @@ -283,18 +250,6 @@ void goto_checkt::undefined_shift_check( } } -/*******************************************************************\ - -Function: goto_checkt::mod_by_zero_check - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_checkt::mod_by_zero_check( const mod_exprt &expr, const guardt &guard) @@ -321,18 +276,6 @@ void goto_checkt::mod_by_zero_check( guard); } -/*******************************************************************\ - -Function: goto_checkt::conversion_check - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_checkt::conversion_check( const exprt &expr, const guardt &guard) @@ -512,18 +455,6 @@ void goto_checkt::conversion_check( } } -/*******************************************************************\ - -Function: goto_checkt::integer_overflow_check - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_checkt::integer_overflow_check( const exprt &expr, const guardt &guard) @@ -645,18 +576,6 @@ void goto_checkt::integer_overflow_check( } } -/*******************************************************************\ - -Function: goto_checkt::float_overflow_check - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_checkt::float_overflow_check( const exprt &expr, const guardt &guard) @@ -779,18 +698,6 @@ void goto_checkt::float_overflow_check( } } -/*******************************************************************\ - -Function: goto_checkt::nan_check - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_checkt::nan_check( const exprt &expr, const guardt &guard) @@ -900,18 +807,6 @@ void goto_checkt::nan_check( guard); } -/*******************************************************************\ - -Function: goto_checkt::pointer_rel_check - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_checkt::pointer_rel_check( const exprt &expr, const guardt &guard) @@ -942,18 +837,6 @@ void goto_checkt::pointer_rel_check( } } -/*******************************************************************\ - -Function: goto_checkt::pointer_overflow_check - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_checkt::pointer_overflow_check( const exprt &expr, const guardt &guard) @@ -980,18 +863,6 @@ void goto_checkt::pointer_overflow_check( } } -/*******************************************************************\ - -Function: goto_checkt::pointer_validity_check - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_checkt::pointer_validity_check( const dereference_exprt &expr, const guardt &guard, @@ -1120,35 +991,11 @@ void goto_checkt::pointer_validity_check( } } -/*******************************************************************\ - -Function: goto_checkt::array_name - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string goto_checkt::array_name(const exprt &expr) { return ::array_name(ns, expr); } -/*******************************************************************\ - -Function: goto_checkt::bounds_check - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_checkt::bounds_check( const index_exprt &expr, const guardt &guard) @@ -1303,18 +1150,6 @@ void goto_checkt::bounds_check( } } -/*******************************************************************\ - -Function: goto_checkt::add_guarded_claim - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_checkt::add_guarded_claim( const exprt &_expr, const std::string &comment, @@ -1362,18 +1197,6 @@ void goto_checkt::add_guarded_claim( } } -/*******************************************************************\ - -Function: goto_checkt::check_rec - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_checkt::check_rec( const exprt &expr, guardt &guard, @@ -1554,36 +1377,12 @@ void goto_checkt::check_rec( mode); } -/*******************************************************************\ - -Function: goto_checkt::check - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_checkt::check(const exprt &expr, const irep_idt &mode) { guardt guard; check_rec(expr, guard, false, mode); } -/*******************************************************************\ - -Function: goto_checkt::goto_check - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_checkt::goto_check( goto_functiont &goto_function, const irep_idt &mode) @@ -1841,18 +1640,6 @@ void goto_checkt::goto_check( } } -/*******************************************************************\ - -Function: goto_check - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_check( const namespacet &ns, const optionst &options, @@ -1862,18 +1649,6 @@ void goto_check( goto_check.goto_check(goto_function, irep_idt()); } -/*******************************************************************\ - -Function: goto_check - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_check( const namespacet &ns, const optionst &options, @@ -1888,18 +1663,6 @@ void goto_check( } } -/*******************************************************************\ - -Function: goto_check - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_check( const optionst &options, goto_modelt &goto_model) diff --git a/src/analyses/goto_check.h b/src/analyses/goto_check.h index 2089d744fd2..44d98069de9 100644 --- a/src/analyses/goto_check.h +++ b/src/analyses/goto_check.h @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Program Transformation + #ifndef CPROVER_ANALYSES_GOTO_CHECK_H #define CPROVER_ANALYSES_GOTO_CHECK_H diff --git a/src/analyses/goto_rw.cpp b/src/analyses/goto_rw.cpp index e5df484cb9c..0b86a19ef63 100644 --- a/src/analyses/goto_rw.cpp +++ b/src/analyses/goto_rw.cpp @@ -25,34 +25,10 @@ Date: April 2010 #include "goto_rw.h" -/*******************************************************************\ - -Function: range_domain_baset::~range_domain_baset - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - range_domain_baset::~range_domain_baset() { } -/*******************************************************************\ - -Function: range_domaint::output - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void range_domaint::output( const namespacet &ns, std::ostream &out) const { @@ -68,18 +44,6 @@ void range_domaint::output( out << "]"; } -/*******************************************************************\ - -Function: rw_range_sett::~rw_range_sett - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - rw_range_sett::~rw_range_sett() { for(rw_range_sett::objectst::iterator it=r_range_set.begin(); @@ -93,18 +57,6 @@ rw_range_sett::~rw_range_sett() delete it->second; } -/*******************************************************************\ - -Function: rw_range_sett::output - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void rw_range_sett::output(std::ostream &out) const { out << "READ:" << std::endl; @@ -126,18 +78,6 @@ void rw_range_sett::output(std::ostream &out) const } } -/*******************************************************************\ - -Function: rw_range_sett::get_objects_complex - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void rw_range_sett::get_objects_complex( get_modet mode, const exprt &expr, @@ -155,18 +95,6 @@ void rw_range_sett::get_objects_complex( get_objects_rec(mode, op, range_start+offset, size); } -/*******************************************************************\ - -Function: rw_range_sett::get_objects_if - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void rw_range_sett::get_objects_if( get_modet mode, const if_exprt &if_expr, @@ -186,18 +114,6 @@ void rw_range_sett::get_objects_if( } } -/*******************************************************************\ - -Function: rw_range_sett::get_objects_dereference - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void rw_range_sett::get_objects_dereference( get_modet mode, const dereference_exprt &deref, @@ -210,18 +126,6 @@ void rw_range_sett::get_objects_dereference( get_objects_rec(mode, pointer); } -/*******************************************************************\ - -Function: rw_range_sett::get_objects_byte_extract - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void rw_range_sett::get_objects_byte_extract( get_modet mode, const byte_extract_exprt &be, @@ -249,18 +153,6 @@ void rw_range_sett::get_objects_byte_extract( } } -/*******************************************************************\ - -Function: rw_range_sett::get_objects_shift - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void rw_range_sett::get_objects_shift( get_modet mode, const shift_exprt &shift, @@ -309,18 +201,6 @@ void rw_range_sett::get_objects_shift( } } -/*******************************************************************\ - -Function: rw_range_sett::get_objects_member - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void rw_range_sett::get_objects_member( get_modet mode, const member_exprt &expr, @@ -351,18 +231,6 @@ void rw_range_sett::get_objects_member( get_objects_rec(mode, expr.struct_op(), offset, size); } -/*******************************************************************\ - -Function: rw_range_sett::get_objects_index - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void rw_range_sett::get_objects_index( get_modet mode, const index_exprt &expr, @@ -411,18 +279,6 @@ void rw_range_sett::get_objects_index( size); } -/*******************************************************************\ - -Function: rw_range_sett::get_objects_array - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void rw_range_sett::get_objects_array( get_modet mode, const array_exprt &expr, @@ -463,18 +319,6 @@ void rw_range_sett::get_objects_array( } } -/*******************************************************************\ - -Function: rw_range_sett::get_objects_struct - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void rw_range_sett::get_objects_struct( get_modet mode, const struct_exprt &expr, @@ -535,18 +379,6 @@ void rw_range_sett::get_objects_struct( } } -/*******************************************************************\ - -Function: rw_range_sett::get_objects_typecast - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void rw_range_sett::get_objects_typecast( get_modet mode, const typecast_exprt &tc, @@ -572,18 +404,6 @@ void rw_range_sett::get_objects_typecast( get_objects_rec(mode, op, range_start, new_size); } -/*******************************************************************\ - -Function: rw_range_sett::get_objects_address_of - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void rw_range_sett::get_objects_address_of(const exprt &object) { if(object.id()==ID_string_constant || @@ -634,18 +454,6 @@ void rw_range_sett::get_objects_address_of(const exprt &object) throw "rw_range_sett: address_of `"+object.id_string()+"' not handled"; } -/*******************************************************************\ - -Function: rw_range_sett::add - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void rw_range_sett::add( get_modet mode, const irep_idt &identifier, @@ -663,18 +471,6 @@ void rw_range_sett::add( std::make_pair(range_start, range_end)); } -/*******************************************************************\ - -Function: rw_range_sett::get_objects_rec - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void rw_range_sett::get_objects_rec( get_modet mode, const exprt &expr, @@ -766,18 +562,6 @@ void rw_range_sett::get_objects_rec( throw "rw_range_sett: assignment to `"+expr.id_string()+"' not handled"; } -/*******************************************************************\ - -Function: rw_range_sett::get_objects_rec - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void rw_range_sett::get_objects_rec(get_modet mode, const exprt &expr) { range_spect size= @@ -785,18 +569,6 @@ void rw_range_sett::get_objects_rec(get_modet mode, const exprt &expr) get_objects_rec(mode, expr, 0, size); } -/*******************************************************************\ - -Function: rw_range_sett::get_objects_rec - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void rw_range_sett::get_objects_rec(const typet &type) { // TODO should recurse into various composite types @@ -807,18 +579,6 @@ void rw_range_sett::get_objects_rec(const typet &type) } } -/*******************************************************************\ - -Function: rw_range_set_value_sett::get_objects_dereference - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void rw_range_set_value_sett::get_objects_dereference( get_modet mode, const dereference_exprt &deref, @@ -852,18 +612,6 @@ void rw_range_set_value_sett::get_objects_dereference( get_objects_rec(mode, object, range_start, new_size); } -/*******************************************************************\ - -Function: guarded_range_domaint::output - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void guarded_range_domaint::output( const namespacet &ns, std::ostream &out) const { @@ -880,18 +628,6 @@ void guarded_range_domaint::output( out << "]"; } -/*******************************************************************\ - -Function: rw_guarded_range_set_value_sett::get_objects_if - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void rw_guarded_range_set_value_sett::get_objects_if( get_modet mode, const if_exprt &if_expr, @@ -918,18 +654,6 @@ void rw_guarded_range_set_value_sett::get_objects_if( } } -/*******************************************************************\ - -Function: rw_guarded_range_set_value_sett::add - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void rw_guarded_range_set_value_sett::add( get_modet mode, const irep_idt &identifier, @@ -948,18 +672,6 @@ void rw_guarded_range_set_value_sett::add( std::make_pair(range_end, guard.as_expr()))); } -/*******************************************************************\ - -Function: goto_rw - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_rw(goto_programt::const_targett target, const code_assignt &assign, rw_range_sett &rw_set) @@ -968,18 +680,6 @@ void goto_rw(goto_programt::const_targett target, rw_set.get_objects_rec(target, rw_range_sett::get_modet::READ, assign.rhs()); } -/*******************************************************************\ - -Function: goto_rw - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_rw(goto_programt::const_targett target, const code_function_callt &function_call, rw_range_sett &rw_set) @@ -999,18 +699,6 @@ void goto_rw(goto_programt::const_targett target, rw_set.get_objects_rec(target, rw_range_sett::get_modet::READ, *it); } -/*******************************************************************\ - -Function: goto_rw - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_rw(goto_programt::const_targett target, rw_range_sett &rw_set) { @@ -1088,36 +776,12 @@ void goto_rw(goto_programt::const_targett target, } } -/*******************************************************************\ - -Function: goto_rw - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_rw(const goto_programt &goto_program, rw_range_sett &rw_set) { forall_goto_program_instructions(i_it, goto_program) goto_rw(i_it, rw_set); } -/*******************************************************************\ - -Function: goto_rw - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_rw(const goto_functionst &goto_functions, const irep_idt &function, rw_range_sett &rw_set) diff --git a/src/analyses/interval_analysis.cpp b/src/analyses/interval_analysis.cpp index 17c3dd68562..d81d857b1f8 100644 --- a/src/analyses/interval_analysis.cpp +++ b/src/analyses/interval_analysis.cpp @@ -6,23 +6,14 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Interval Analysis + #include #include "interval_domain.h" #include "interval_analysis.h" -/*******************************************************************\ - -Function: instrument_intervals - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void instrument_intervals( const ait &interval_analysis, goto_functionst::goto_functiont &goto_function) @@ -84,18 +75,6 @@ void instrument_intervals( } } -/*******************************************************************\ - -Function: interval_analysis - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void interval_analysis( const namespacet &ns, goto_functionst &goto_functions) diff --git a/src/analyses/interval_analysis.h b/src/analyses/interval_analysis.h index be86a6c65f8..1c85fc9a193 100644 --- a/src/analyses/interval_analysis.h +++ b/src/analyses/interval_analysis.h @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Interval Analysis + #ifndef CPROVER_ANALYSES_INTERVAL_ANALYSIS_H #define CPROVER_ANALYSES_INTERVAL_ANALYSIS_H diff --git a/src/analyses/interval_domain.cpp b/src/analyses/interval_domain.cpp index 1faf8c52364..3c0e0c1a893 100644 --- a/src/analyses/interval_domain.cpp +++ b/src/analyses/interval_domain.cpp @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Interval Domain + #ifdef DEBUG #include #endif @@ -16,18 +19,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "interval_domain.h" -/*******************************************************************\ - -Function: interval_domaint::output - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void interval_domaint::output( std::ostream &out, const ai_baset &ai, @@ -64,18 +55,6 @@ void interval_domaint::output( } } -/*******************************************************************\ - -Function: interval_domaint::transform - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void interval_domaint::transform( locationt from, locationt to, @@ -127,18 +106,6 @@ void interval_domaint::transform( } } -/*******************************************************************\ - -Function: interval_domaint::merge - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool interval_domaint::merge( const interval_domaint &b, locationt from, @@ -199,36 +166,12 @@ bool interval_domaint::merge( return result; } -/*******************************************************************\ - -Function: interval_domaint::assign - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void interval_domaint::assign(const code_assignt &code_assign) { havoc_rec(code_assign.lhs()); assume_rec(code_assign.lhs(), ID_equal, code_assign.rhs()); } -/*******************************************************************\ - -Function: interval_domaint::havoc_rec - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void interval_domaint::havoc_rec(const exprt &lhs) { if(lhs.id()==ID_if) @@ -251,18 +194,6 @@ void interval_domaint::havoc_rec(const exprt &lhs) } } -/*******************************************************************\ - -Function: interval_domaint::assume_rec - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void interval_domaint::assume_rec( const exprt &lhs, irep_idt id, const exprt &rhs) { @@ -377,18 +308,6 @@ void interval_domaint::assume_rec( } } -/*******************************************************************\ - -Function: interval_domaint::assume_rec - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void interval_domaint::assume( const exprt &cond, const namespacet &ns) @@ -396,18 +315,6 @@ void interval_domaint::assume( assume_rec(simplify_expr(cond, ns), false); } -/*******************************************************************\ - -Function: interval_domaint::assume_rec - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void interval_domaint::assume_rec( const exprt &cond, bool negation) @@ -454,18 +361,6 @@ void interval_domaint::assume_rec( } } -/*******************************************************************\ - -Function: interval_domaint::make_expression - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - exprt interval_domaint::make_expression(const symbol_exprt &src) const { if(is_int(src.type())) diff --git a/src/analyses/interval_domain.h b/src/analyses/interval_domain.h index 7e95c65e9de..81be5ec7d54 100644 --- a/src/analyses/interval_domain.h +++ b/src/analyses/interval_domain.h @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Interval Domain + #ifndef CPROVER_ANALYSES_INTERVAL_DOMAIN_H #define CPROVER_ANALYSES_INTERVAL_DOMAIN_H diff --git a/src/analyses/invariant_propagation.cpp b/src/analyses/invariant_propagation.cpp index 2da2d7278f4..8e93ce4ee17 100644 --- a/src/analyses/invariant_propagation.cpp +++ b/src/analyses/invariant_propagation.cpp @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Invariant Propagation + #include #include #include @@ -13,54 +16,18 @@ Author: Daniel Kroening, kroening@kroening.com #include "invariant_propagation.h" -/*******************************************************************\ - -Function: invariant_propagationt::make_all_true - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void invariant_propagationt::make_all_true() { for(auto &state : state_map) state.second.invariant_set.make_true(); } -/*******************************************************************\ - -Function: invariant_propagationt::make_all_false - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void invariant_propagationt::make_all_false() { for(auto &state : state_map) state.second.invariant_set.make_false(); } -/*******************************************************************\ - -Function: invariant_propagationt::add_objects - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void invariant_propagationt::add_objects( const goto_programt &goto_program) { @@ -108,18 +75,6 @@ void invariant_propagationt::add_objects( } } -/*******************************************************************\ - -Function: invariant_propagationt::get_objects - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void invariant_propagationt::get_objects( const symbolt &symbol, object_listt &dest) @@ -132,18 +87,6 @@ void invariant_propagationt::get_objects( dest.push_back(object_store.add(expr)); } -/*******************************************************************\ - -Function: invariant_propagationt::get_objects_rec - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void invariant_propagationt::get_objects_rec( const exprt &src, std::list &dest) @@ -179,18 +122,6 @@ void invariant_propagationt::get_objects_rec( } } -/*******************************************************************\ - -Function: invariant_propagationt::add_vars - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void invariant_propagationt::add_objects( const goto_functionst &goto_functions) { @@ -243,18 +174,6 @@ void invariant_propagationt::add_objects( } } -/*******************************************************************\ - -Function: invariant_propagationt::get_globals - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void invariant_propagationt::get_globals( object_listt &dest) { @@ -265,18 +184,6 @@ void invariant_propagationt::get_globals( get_objects(it->second, dest); } -/*******************************************************************\ - -Function: invariant_propagationt::check_type - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool invariant_propagationt::check_type(const typet &type) const { if(type.id()==ID_pointer) @@ -297,18 +204,6 @@ bool invariant_propagationt::check_type(const typet &type) const return false; } -/*******************************************************************\ - -Function: invariant_propagationt::initialize - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void invariant_propagationt::initialize(const goto_programt &goto_program) { baset::initialize(goto_program); @@ -330,18 +225,6 @@ void invariant_propagationt::initialize(const goto_programt &goto_program) add_objects(goto_program); } -/*******************************************************************\ - -Function: invariant_propagationt::initialize - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void invariant_propagationt::initialize(const goto_functionst &goto_functions) { baset::initialize(goto_functions); @@ -350,36 +233,12 @@ void invariant_propagationt::initialize(const goto_functionst &goto_functions) initialize(f_it->second.body); } -/*******************************************************************\ - -Function: invariant_propagationt::simplify - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void invariant_propagationt::simplify(goto_functionst &goto_functions) { Forall_goto_functions(it, goto_functions) simplify(it->second.body); } -/*******************************************************************\ - -Function: invariant_propagationt::simplify - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void invariant_propagationt::simplify(goto_programt &goto_program) { Forall_goto_program_instructions(i_it, goto_program) diff --git a/src/analyses/invariant_propagation.h b/src/analyses/invariant_propagation.h index 0884ba85d07..d21f6373bcb 100644 --- a/src/analyses/invariant_propagation.h +++ b/src/analyses/invariant_propagation.h @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Invariant Propagation + #ifndef CPROVER_ANALYSES_INVARIANT_PROPAGATION_H #define CPROVER_ANALYSES_INVARIANT_PROPAGATION_H diff --git a/src/analyses/invariant_set.cpp b/src/analyses/invariant_set.cpp index 15c350f0e0f..acd7f99459a 100644 --- a/src/analyses/invariant_set.cpp +++ b/src/analyses/invariant_set.cpp @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Invariant Set + #include #include @@ -21,36 +24,12 @@ Author: Daniel Kroening, kroening@kroening.com #include "invariant_set.h" -/*******************************************************************\ - -Function: inv_object_storet::output - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void inv_object_storet::output(std::ostream &out) const { for(unsigned i=0; iget(expr, n); } -/*******************************************************************\ - -Function: inv_object_storet::is_constant_address - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool inv_object_storet::is_constant_address(const exprt &expr) { if(expr.id()==ID_address_of) @@ -250,18 +157,6 @@ bool inv_object_storet::is_constant_address(const exprt &expr) return false; } -/*******************************************************************\ - -Function: inv_object_storet::is_constant_address_rec - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool inv_object_storet::is_constant_address_rec(const exprt &expr) { if(expr.id()==ID_symbol) @@ -281,18 +176,6 @@ bool inv_object_storet::is_constant_address_rec(const exprt &expr) return false; } -/*******************************************************************\ - -Function: invariant_sett::add - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void invariant_sett::add( const std::pair &p, ineq_sett &dest) @@ -315,18 +198,6 @@ void invariant_sett::add( } } -/*******************************************************************\ - -Function: invariant_sett::add_eq - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void invariant_sett::add_eq(const std::pair &p) { eq_set.make_union(p.first, p.second); @@ -364,18 +235,6 @@ void invariant_sett::add_eq(const std::pair &p) add_eq(ne_set, p, ne); } -/*******************************************************************\ - -Function: invariant_sett::add_eq - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void invariant_sett::add_eq( ineq_sett &dest, const std::pair &eq, @@ -414,18 +273,6 @@ void invariant_sett::add_eq( } } -/*******************************************************************\ - -Function: invariant_sett::is_eq - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - tvt invariant_sett::is_eq(std::pair p) const { std::pair s=p; @@ -440,18 +287,6 @@ tvt invariant_sett::is_eq(std::pair p) const return tvt::unknown(); } -/*******************************************************************\ - -Function: invariant_sett::is_le - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - tvt invariant_sett::is_le(std::pair p) const { std::pair s=p; @@ -470,18 +305,6 @@ tvt invariant_sett::is_le(std::pair p) const return tvt::unknown(); } -/*******************************************************************\ - -Function: invariant_sett::output - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void invariant_sett::output( const irep_idt &identifier, std::ostream &out) const @@ -535,18 +358,6 @@ void invariant_sett::output( } } -/*******************************************************************\ - -Function: invariant_sett::strengthen - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void invariant_sett::add_type_bounds(const exprt &expr, const typet &type) { if(expr.type()==type) @@ -567,18 +378,6 @@ void invariant_sett::add_type_bounds(const exprt &expr, const typet &type) } } -/*******************************************************************\ - -Function: invariant_sett::strengthen - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void invariant_sett::strengthen(const exprt &expr) { exprt tmp(expr); @@ -586,18 +385,6 @@ void invariant_sett::strengthen(const exprt &expr) strengthen_rec(tmp); } -/*******************************************************************\ - -Function: invariant_sett::strengthen_rec - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void invariant_sett::strengthen_rec(const exprt &expr) { if(expr.type().id()!=ID_bool) @@ -799,18 +586,6 @@ void invariant_sett::strengthen_rec(const exprt &expr) } } -/*******************************************************************\ - -Function: invariant_sett::implies - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - tvt invariant_sett::implies(const exprt &expr) const { exprt tmp(expr); @@ -818,18 +593,6 @@ tvt invariant_sett::implies(const exprt &expr) const return implies_rec(tmp); } -/*******************************************************************\ - -Function: invariant_sett::implies - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - tvt invariant_sett::implies_rec(const exprt &expr) const { if(expr.type().id()!=ID_bool) @@ -914,18 +677,6 @@ tvt invariant_sett::implies_rec(const exprt &expr) const return tvt::unknown(); } -/*******************************************************************\ - -Function: invariant_sett::get_bounds - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void invariant_sett::get_bounds(unsigned a, boundst &bounds) const { // unbounded @@ -950,18 +701,6 @@ void invariant_sett::get_bounds(unsigned a, boundst &bounds) const bounds=it->second; } -/*******************************************************************\ - -Function: invariant_sett::nnf - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void invariant_sett::nnf(exprt &expr, bool negate) { if(expr.type().id()!=ID_bool) @@ -1075,18 +814,6 @@ void invariant_sett::nnf(exprt &expr, bool negate) } } -/*******************************************************************\ - -Function: invariant_sett::simplify - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void invariant_sett::simplify( exprt &expr) const { @@ -1105,18 +832,6 @@ void invariant_sett::simplify( } } -/*******************************************************************\ - -Function: invariant_sett::get_constant - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - exprt invariant_sett::get_constant(const exprt &expr) const { unsigned a; @@ -1172,18 +887,6 @@ exprt invariant_sett::get_constant(const exprt &expr) const return static_cast(get_nil_irep()); } -/*******************************************************************\ - -Function: inv_object_storet::to_string - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string inv_object_storet::to_string( unsigned a, const irep_idt &identifier) const @@ -1192,18 +895,6 @@ std::string inv_object_storet::to_string( return id2string(map[a]); } -/*******************************************************************\ - -Function: invariant_sett::to_string - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string invariant_sett::to_string( unsigned a, const irep_idt &identifier) const @@ -1212,18 +903,6 @@ std::string invariant_sett::to_string( return object_store->to_string(a, identifier); } -/*******************************************************************\ - -Function: invariant_sett::make_union - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool invariant_sett::make_union(const invariant_sett &other) { if(other.threaded && @@ -1275,18 +954,6 @@ bool invariant_sett::make_union(const invariant_sett &other) return false; // no change } -/*******************************************************************\ - -Function: invariant_sett::make_union_bounds_map - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool invariant_sett::make_union_bounds_map(const bounds_mapt &other) { bool changed=false; @@ -1319,18 +986,6 @@ bool invariant_sett::make_union_bounds_map(const bounds_mapt &other) return changed; } -/*******************************************************************\ - -Function: invariant_sett::modifies - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void invariant_sett::modifies(unsigned a) { eq_set.isolate(a); @@ -1339,18 +994,6 @@ void invariant_sett::modifies(unsigned a) bounds_map.erase(a); } -/*******************************************************************\ - -Function: invariant_sett::modifies - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void invariant_sett::modifies(const exprt &lhs) { if(lhs.id()==ID_symbol || @@ -1411,18 +1054,6 @@ void invariant_sett::modifies(const exprt &lhs) throw "modifies: unexpected lhs: "+lhs.id_string(); } -/*******************************************************************\ - -Function: invariant_sett::assignment - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void invariant_sett::assignment( const exprt &lhs, const exprt &rhs) @@ -1442,18 +1073,6 @@ void invariant_sett::assignment( strengthen(equality); } -/*******************************************************************\ - -Function: invariant_sett::apply_code - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void invariant_sett::apply_code(const codet &code) { const irep_idt &statement=code.get(ID_statement); diff --git a/src/analyses/invariant_set.h b/src/analyses/invariant_set.h index d5f0a31003c..6def40f54a8 100644 --- a/src/analyses/invariant_set.h +++ b/src/analyses/invariant_set.h @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Value Set + #ifndef CPROVER_ANALYSES_INVARIANT_SET_H #define CPROVER_ANALYSES_INVARIANT_SET_H diff --git a/src/analyses/invariant_set_domain.cpp b/src/analyses/invariant_set_domain.cpp index 5f8512c55b5..6dec2f9ff70 100644 --- a/src/analyses/invariant_set_domain.cpp +++ b/src/analyses/invariant_set_domain.cpp @@ -6,22 +6,13 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Invariant Set Domain + #include #include "invariant_set_domain.h" -/*******************************************************************\ - -Function: invariant_set_domaint::transform - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void invariant_set_domaint::transform( locationt from_l, locationt to_l, diff --git a/src/analyses/invariant_set_domain.h b/src/analyses/invariant_set_domain.h index 2e231524cbb..4d38b6b2657 100644 --- a/src/analyses/invariant_set_domain.h +++ b/src/analyses/invariant_set_domain.h @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Value Set + #ifndef CPROVER_ANALYSES_INVARIANT_SET_DOMAIN_H #define CPROVER_ANALYSES_INVARIANT_SET_DOMAIN_H diff --git a/src/analyses/is_threaded.cpp b/src/analyses/is_threaded.cpp index 905cd6b91ac..64b1e48f959 100644 --- a/src/analyses/is_threaded.cpp +++ b/src/analyses/is_threaded.cpp @@ -8,6 +8,9 @@ Date: October 2012 \*******************************************************************/ +/// \file +/// Over-approximate Concurrency for Threaded Goto Programs + #include "ai.h" #include "is_threaded.h" @@ -78,18 +81,6 @@ class is_threaded_domaint:public ai_domain_baset } }; -/*******************************************************************\ - -Function: is_threadedt::compute - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void is_threadedt::compute(const goto_functionst &goto_functions) { // the analysis doesn't actually use the namespace, fake one diff --git a/src/analyses/is_threaded.h b/src/analyses/is_threaded.h index 738857b8b8a..5a3823b867e 100644 --- a/src/analyses/is_threaded.h +++ b/src/analyses/is_threaded.h @@ -8,6 +8,9 @@ Date: October 2012 \*******************************************************************/ +/// \file +/// Over-approximate Concurrency for Threaded Goto Programs + #ifndef CPROVER_ANALYSES_IS_THREADED_H #define CPROVER_ANALYSES_IS_THREADED_H diff --git a/src/analyses/local_bitvector_analysis.cpp b/src/analyses/local_bitvector_analysis.cpp index 3fc0d10bb09..c213885efd7 100644 --- a/src/analyses/local_bitvector_analysis.cpp +++ b/src/analyses/local_bitvector_analysis.cpp @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Field-insensitive, location-sensitive may-alias analysis + #include #include @@ -18,18 +21,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "local_bitvector_analysis.h" -/*******************************************************************\ - -Function: local_bitvector_analysist::flagst::print - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void local_bitvector_analysist::flagst::print(std::ostream &out) const { if(is_unknown()) @@ -50,18 +41,6 @@ void local_bitvector_analysist::flagst::print(std::ostream &out) const out << "+integer_address"; } -/*******************************************************************\ - -Function: local_bitvector_analysist::loc_infot::merge - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool local_bitvector_analysist::loc_infot::merge(const loc_infot &src) { bool result=false; @@ -78,19 +57,7 @@ bool local_bitvector_analysist::loc_infot::merge(const loc_infot &src) return result; } -/*******************************************************************\ - -Function: local_bitvector_analysist::is_tracked - - Inputs: - - Outputs: return 'true' iff we track the object with given - identifier - - Purpose: - -\*******************************************************************/ - +/// \return return 'true' iff we track the object with given identifier bool local_bitvector_analysist::is_tracked(const irep_idt &identifier) { localst::locals_mapt::const_iterator it=locals.locals_map.find(identifier); @@ -102,18 +69,6 @@ bool local_bitvector_analysist::is_tracked(const irep_idt &identifier) return true; } -/*******************************************************************\ - -Function: local_bitvector_analysist::assign_lhs - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void local_bitvector_analysist::assign_lhs( const exprt &lhs, const exprt &rhs, @@ -154,18 +109,6 @@ void local_bitvector_analysist::assign_lhs( } } -/*******************************************************************\ - -Function: local_bitvector_analysist::get - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - local_bitvector_analysist::flagst local_bitvector_analysist::get( const goto_programt::const_targett t, const exprt &rhs) @@ -179,18 +122,6 @@ local_bitvector_analysist::flagst local_bitvector_analysist::get( return get_rec(rhs, loc_info_src); } -/*******************************************************************\ - -Function: local_bitvector_analysist::get_rec - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - local_bitvector_analysist::flagst local_bitvector_analysist::get_rec( const exprt &rhs, const loc_infot &loc_info_src) @@ -312,18 +243,6 @@ local_bitvector_analysist::flagst local_bitvector_analysist::get_rec( return flagst::mk_unknown(); } -/*******************************************************************\ - -Function: local_bitvector_analysist::build - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void local_bitvector_analysist::build(const goto_functiont &goto_function) { if(cfg.nodes.empty()) @@ -406,18 +325,6 @@ void local_bitvector_analysist::build(const goto_functiont &goto_function) } } -/*******************************************************************\ - -Function: local_bitvector_analysist::output - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void local_bitvector_analysist::output( std::ostream &out, const goto_functiont &goto_function, diff --git a/src/analyses/local_bitvector_analysis.h b/src/analyses/local_bitvector_analysis.h index 4284ec99475..a88b38fb1c6 100644 --- a/src/analyses/local_bitvector_analysis.h +++ b/src/analyses/local_bitvector_analysis.h @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Field-insensitive, location-sensitive bitvector analysis + #ifndef CPROVER_ANALYSES_LOCAL_BITVECTOR_ANALYSIS_H #define CPROVER_ANALYSES_LOCAL_BITVECTOR_ANALYSIS_H @@ -17,14 +20,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "dirty.h" #include "local_cfg.h" -/*******************************************************************\ - - Class: local_bitvector_analysist - - Purpose: - -\*******************************************************************/ - class local_bitvector_analysist { public: diff --git a/src/analyses/local_cfg.cpp b/src/analyses/local_cfg.cpp index 52f5c6831a4..b65dbafd97e 100644 --- a/src/analyses/local_cfg.cpp +++ b/src/analyses/local_cfg.cpp @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// CFG for One Function + #if 0 #include #include @@ -21,18 +24,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "local_cfg.h" -/*******************************************************************\ - -Function: local_cfgt::build - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void local_cfgt::build(const goto_programt &goto_program) { nodes.resize(goto_program.instructions.size()); diff --git a/src/analyses/local_cfg.h b/src/analyses/local_cfg.h index a0187be8177..d2e53cfdab0 100644 --- a/src/analyses/local_cfg.h +++ b/src/analyses/local_cfg.h @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// CFG for One Function + #ifndef CPROVER_ANALYSES_LOCAL_CFG_H #define CPROVER_ANALYSES_LOCAL_CFG_H @@ -13,14 +16,6 @@ Author: Daniel Kroening, kroening@kroening.com #include -/*******************************************************************\ - - Class: local_cfgt - - Purpose: - -\*******************************************************************/ - class local_cfgt { public: diff --git a/src/analyses/local_may_alias.cpp b/src/analyses/local_may_alias.cpp index ffaefe73667..aa50af1487d 100644 --- a/src/analyses/local_may_alias.cpp +++ b/src/analyses/local_may_alias.cpp @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Field-insensitive, location-sensitive may-alias analysis + #include #include @@ -18,18 +21,7 @@ Author: Daniel Kroening, kroening@kroening.com #include "local_may_alias.h" -/*******************************************************************\ - -Function: local_may_aliast::loc_infot::merge - - Inputs: - - Outputs: return 'true' iff changed - - Purpose: - -\*******************************************************************/ - +/// \return return 'true' iff changed bool local_may_aliast::loc_infot::merge(const loc_infot &src) { bool changed=false; @@ -49,18 +41,6 @@ bool local_may_aliast::loc_infot::merge(const loc_infot &src) return changed; } -/*******************************************************************\ - -Function: local_may_aliast::assign_lhs - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void local_may_aliast::assign_lhs( const exprt &lhs, const exprt &rhs, @@ -132,18 +112,6 @@ void local_may_aliast::assign_lhs( } } -/*******************************************************************\ - -Function: local_may_aliast::get - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::set local_may_aliast::get( const goto_programt::const_targett t, const exprt &rhs) const @@ -170,18 +138,6 @@ std::set local_may_aliast::get( return result; } -/*******************************************************************\ - -Function: local_may_aliast::aliases - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool local_may_aliast::aliases( const goto_programt::const_targett t, const exprt &src1, const exprt &src2) const @@ -210,18 +166,6 @@ bool local_may_aliast::aliases( return !result.empty(); } -/*******************************************************************\ - -Function: local_may_aliast::get_rec - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void local_may_aliast::get_rec( object_sett &dest, const exprt &rhs, @@ -369,18 +313,6 @@ void local_may_aliast::get_rec( dest.insert(unknown_object); } -/*******************************************************************\ - -Function: local_may_aliast::build - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void local_may_aliast::build(const goto_functiont &goto_function) { if(cfg.nodes.empty()) @@ -502,18 +434,6 @@ void local_may_aliast::build(const goto_functiont &goto_function) } } -/*******************************************************************\ - -Function: local_may_aliast::output - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void local_may_aliast::output( std::ostream &out, const goto_functiont &goto_function, diff --git a/src/analyses/local_may_alias.h b/src/analyses/local_may_alias.h index 109ca2b5e19..b54cf4e9e88 100644 --- a/src/analyses/local_may_alias.h +++ b/src/analyses/local_may_alias.h @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Field-insensitive, location-sensitive may-alias analysis + #ifndef CPROVER_ANALYSES_LOCAL_MAY_ALIAS_H #define CPROVER_ANALYSES_LOCAL_MAY_ALIAS_H @@ -18,14 +21,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "dirty.h" #include "local_cfg.h" -/*******************************************************************\ - - Class: local_may_aliast - - Purpose: - -\*******************************************************************/ - class local_may_aliast { public: diff --git a/src/analyses/locals.cpp b/src/analyses/locals.cpp index 7f30c1c008b..09d7ebfe7c3 100644 --- a/src/analyses/locals.cpp +++ b/src/analyses/locals.cpp @@ -8,22 +8,13 @@ Date: March 2013 \*******************************************************************/ +/// \file +/// Local variables + #include #include "locals.h" -/*******************************************************************\ - -Function: localst::build - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void localst::build(const goto_functiont &goto_function) { forall_goto_program_instructions(it, goto_function.body) @@ -39,18 +30,6 @@ void localst::build(const goto_functiont &goto_function) symbol_exprt(param.get_identifier(), param.type()); } -/*******************************************************************\ - -Function: localst::output - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void localst::output(std::ostream &out) const { for(const auto &local : locals_map) diff --git a/src/analyses/locals.h b/src/analyses/locals.h index 3cd52254c41..c9c59aaf340 100644 --- a/src/analyses/locals.h +++ b/src/analyses/locals.h @@ -8,6 +8,9 @@ Date: March 2013 \*******************************************************************/ +/// \file +/// Local variables whose address is taken + #ifndef CPROVER_ANALYSES_LOCALS_H #define CPROVER_ANALYSES_LOCALS_H diff --git a/src/analyses/natural_loops.cpp b/src/analyses/natural_loops.cpp index 593fc78006d..3832ae6b1ad 100644 --- a/src/analyses/natural_loops.cpp +++ b/src/analyses/natural_loops.cpp @@ -6,22 +6,13 @@ Author: Georg Weissenbacher, georg@weissenbacher.name \*******************************************************************/ +/// \file +/// Dominators + #include #include "natural_loops.h" -/*******************************************************************\ - -Function: show_natural_loops - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void show_natural_loops(const goto_functionst &goto_functions) { forall_goto_functions(it, goto_functions) diff --git a/src/analyses/natural_loops.h b/src/analyses/natural_loops.h index ff56c687c93..ce27a306882 100644 --- a/src/analyses/natural_loops.h +++ b/src/analyses/natural_loops.h @@ -6,6 +6,9 @@ Author: Georg Weissenbacher, georg@weissenbacher.name \*******************************************************************/ +/// \file +/// Compute natural loops in a goto_function + #ifndef CPROVER_ANALYSES_NATURAL_LOOPS_H #define CPROVER_ANALYSES_NATURAL_LOOPS_H @@ -69,18 +72,7 @@ typedef natural_loops_templatet void show_natural_loops(const goto_functionst &goto_functions); -/*******************************************************************\ - -Function: natural_loops_templatet::compute - - Inputs: - - Outputs: - - Purpose: Finds all back-edges and computes the natural loops - -\*******************************************************************/ - +/// Finds all back-edges and computes the natural loops #ifdef DEBUG #include #endif @@ -123,19 +115,7 @@ void natural_loops_templatet::compute(P &program) } } -/*******************************************************************\ - -Function: natural_loops_templatet::compute_natural_loop - - Inputs: - - Outputs: - - Purpose: Computes the natural loop for a given back-edge - (see Muchnick section 7.4) - -\*******************************************************************/ - +/// Computes the natural loop for a given back-edge (see Muchnick section 7.4) template void natural_loops_templatet::compute_natural_loop(T m, T n) { @@ -170,18 +150,7 @@ void natural_loops_templatet::compute_natural_loop(T m, T n) } } -/*******************************************************************\ - -Function: natural_loops_templatet::output - - Inputs: - - Outputs: - - Purpose: Print all natural loops that were found - -\*******************************************************************/ - +/// Print all natural loops that were found template void natural_loops_templatet::output(std::ostream &out) const { diff --git a/src/analyses/reaching_definitions.cpp b/src/analyses/reaching_definitions.cpp index 81c3c1c5069..de78ef99981 100644 --- a/src/analyses/reaching_definitions.cpp +++ b/src/analyses/reaching_definitions.cpp @@ -9,6 +9,10 @@ Date: February 2013 \*******************************************************************/ +/// \file +/// Range-based reaching definitions analysis (following Field- Sensitive +/// Program Dependence Analysis, Litvak et al., FSE 2010) + #include #include @@ -19,18 +23,6 @@ Date: February 2013 #include "reaching_definitions.h" -/*******************************************************************\ - -Function: rd_range_domaint::populate_cache - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void rd_range_domaint::populate_cache(const irep_idt &identifier) const { assert(bv_container); @@ -51,18 +43,6 @@ void rd_range_domaint::populate_cache(const irep_idt &identifier) const } } -/*******************************************************************\ - -Function: rd_range_domaint::transform - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void rd_range_domaint::transform( locationt from, locationt to, @@ -129,18 +109,6 @@ void rd_range_domaint::transform( #endif } -/*******************************************************************\ - -Function: rd_range_domaint::transform_dead - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void rd_range_domaint::transform_dead( const namespacet &ns, locationt from) @@ -157,18 +125,6 @@ void rd_range_domaint::transform_dead( } } -/*******************************************************************\ - -Function: rd_range_domaint::transform_start_thread - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void rd_range_domaint::transform_start_thread( const namespacet &ns, reaching_definitions_analysist &rd) @@ -194,18 +150,6 @@ void rd_range_domaint::transform_start_thread( } } -/*******************************************************************\ - -Function: rd_range_domaint::transform_function_call - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void rd_range_domaint::transform_function_call( const namespacet &ns, locationt from, @@ -269,18 +213,6 @@ void rd_range_domaint::transform_function_call( } } -/*******************************************************************\ - -Function: rd_range_domaint::transform_end_function - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void rd_range_domaint::transform_end_function( const namespacet &ns, locationt from, @@ -349,18 +281,6 @@ void rd_range_domaint::transform_end_function( } } -/*******************************************************************\ - -Function: rd_range_domaint::transform_assign - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void rd_range_domaint::transform_assign( const namespacet &ns, locationt from, @@ -394,18 +314,6 @@ void rd_range_domaint::transform_assign( } } -/*******************************************************************\ - -Function: rd_range_domaint::kill - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void rd_range_domaint::kill( const irep_idt &identifier, const range_spect &range_start, @@ -506,18 +414,6 @@ void rd_range_domaint::kill( } } -/*******************************************************************\ - -Function: rd_range_domaint::kill_inf - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void rd_range_domaint::kill_inf( const irep_idt &identifier, const range_spect &range_start) @@ -552,18 +448,6 @@ void rd_range_domaint::kill_inf( #endif } -/*******************************************************************\ - -Function: rd_range_domaint::gen - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool rd_range_domaint::gen( locationt from, const irep_idt &identifier, @@ -636,18 +520,6 @@ bool rd_range_domaint::gen( return true; } -/*******************************************************************\ - -Function: rd_range_domaint::output - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void rd_range_domaint::output(std::ostream &out) const { out << "Reaching definitions:" << std::endl; @@ -687,18 +559,7 @@ void rd_range_domaint::output(std::ostream &out) const } } -/*******************************************************************\ - -Function: rd_range_domaint::merge_inner - - Inputs: - - Outputs: returns true iff there is s.th. new - - Purpose: - -\*******************************************************************/ - +/// \return returns true iff there is s.th. new bool rd_range_domaint::merge_inner( values_innert &dest, const values_innert &other) @@ -749,18 +610,7 @@ bool rd_range_domaint::merge_inner( return more; } -/*******************************************************************\ - -Function: rd_range_domaint::merge - - Inputs: - - Outputs: returns true iff there is s.th. new - - Purpose: - -\*******************************************************************/ - +/// \return returns true iff there is s.th. new bool rd_range_domaint::merge( const rd_range_domaint &other, locationt from, @@ -796,18 +646,7 @@ bool rd_range_domaint::merge( return changed; } -/*******************************************************************\ - -Function: rd_range_domaint::merge_shared - - Inputs: - - Outputs: returns true iff there is s.th. new - - Purpose: - -\*******************************************************************/ - +/// \return returns true iff there is s.th. new bool rd_range_domaint::merge_shared( const rd_range_domaint &other, goto_programt::const_targett from, @@ -857,18 +696,6 @@ bool rd_range_domaint::merge_shared( return changed; } -/*******************************************************************\ - -Function: rd_range_domaint::get - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - const rd_range_domaint::ranges_at_loct &rd_range_domaint::get( const irep_idt &identifier) const { @@ -884,18 +711,6 @@ const rd_range_domaint::ranges_at_loct &rd_range_domaint::get( return entry->second; } -/*******************************************************************\ - -Function: reaching_definitions_analysist::~reaching_definitions_analysist - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - reaching_definitions_analysist::~reaching_definitions_analysist() { if(is_dirty) @@ -906,18 +721,6 @@ reaching_definitions_analysist::~reaching_definitions_analysist() delete value_sets; } -/*******************************************************************\ - -Function: reaching_definitions_analysist::initialize - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void reaching_definitions_analysist::initialize( const goto_functionst &goto_functions) { diff --git a/src/analyses/reaching_definitions.h b/src/analyses/reaching_definitions.h index a48a271a9a6..2cc7d815fa3 100644 --- a/src/analyses/reaching_definitions.h +++ b/src/analyses/reaching_definitions.h @@ -9,6 +9,10 @@ Date: February 2013 \*******************************************************************/ +/// \file +/// Range-based reaching definitions analysis (following Field- Sensitive +/// Program Dependence Analysis, Litvak et al., FSE 2010) + #ifndef CPROVER_ANALYSES_REACHING_DEFINITIONS_H #define CPROVER_ANALYSES_REACHING_DEFINITIONS_H diff --git a/src/analyses/replace_symbol_ext.cpp b/src/analyses/replace_symbol_ext.cpp index 568ea45e090..75c697030b7 100644 --- a/src/analyses/replace_symbol_ext.cpp +++ b/src/analyses/replace_symbol_ext.cpp @@ -6,23 +6,15 @@ Author: Peter Schrammel \*******************************************************************/ +/// \file +/// Modified expression replacement for constant propagator + #include #include #include "replace_symbol_ext.h" -/*******************************************************************\ - -Function: replace_symbol_extt::replace - - Inputs: - - Outputs: - - Purpose: does not replace object in address_of expressions - -\*******************************************************************/ - +/// does not replace object in address_of expressions bool replace_symbol_extt::replace(exprt &dest) const { bool result=true; diff --git a/src/analyses/replace_symbol_ext.h b/src/analyses/replace_symbol_ext.h index 5a2152db17f..05d7226be40 100644 --- a/src/analyses/replace_symbol_ext.h +++ b/src/analyses/replace_symbol_ext.h @@ -6,6 +6,9 @@ Author: Peter Schrammel \*******************************************************************/ +/// \file +/// Modified expression replacement for constant propagator + #ifndef CPROVER_ANALYSES_REPLACE_SYMBOL_EXT_H #define CPROVER_ANALYSES_REPLACE_SYMBOL_EXT_H diff --git a/src/analyses/static_analysis.cpp b/src/analyses/static_analysis.cpp index 8309566f27d..dd6b8ac0f54 100644 --- a/src/analyses/static_analysis.cpp +++ b/src/analyses/static_analysis.cpp @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Value Set Propagation + #include #include @@ -17,18 +20,6 @@ Author: Daniel Kroening, kroening@kroening.com #define USE_DEPRECATED_STATIC_ANALYSIS_H #include "static_analysis.h" -/*******************************************************************\ - -Function: static_analysis_baset::get_guard - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - exprt static_analysis_baset::get_guard( locationt from, locationt to) @@ -49,18 +40,6 @@ exprt static_analysis_baset::get_guard( return from->guard; } -/*******************************************************************\ - -Function: static_analysis_baset::get_return_lhs - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - exprt static_analysis_baset::get_return_lhs(locationt to) { // get predecessor of "to" @@ -79,18 +58,6 @@ exprt static_analysis_baset::get_return_lhs(locationt to) return code.lhs(); } -/*******************************************************************\ - -Function: static_analysis_baset::operator() - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void static_analysis_baset::operator()( const goto_functionst &goto_functions) { @@ -98,18 +65,6 @@ void static_analysis_baset::operator()( fixedpoint(goto_functions); } -/*******************************************************************\ - -Function: static_analysis_baset::operator() - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void static_analysis_baset::operator()( const goto_programt &goto_program) { @@ -118,18 +73,6 @@ void static_analysis_baset::operator()( fixedpoint(goto_program, goto_functions); } -/*******************************************************************\ - -Function: static_analysis_baset::output - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void static_analysis_baset::output( const goto_functionst &goto_functions, std::ostream &out) const @@ -148,18 +91,6 @@ void static_analysis_baset::output( } } -/*******************************************************************\ - -Function: static_analysis_baset::output - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void static_analysis_baset::output( const goto_programt &goto_program, const irep_idt &identifier, @@ -179,18 +110,6 @@ void static_analysis_baset::output( } } -/*******************************************************************\ - -Function: static_analysis_baset::generate_states - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void static_analysis_baset::generate_states( const goto_functionst &goto_functions) { @@ -198,18 +117,6 @@ void static_analysis_baset::generate_states( generate_states(f_it->second.body); } -/*******************************************************************\ - -Function: static_analysis_baset::generate_states - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void static_analysis_baset::generate_states( const goto_programt &goto_program) { @@ -217,18 +124,6 @@ void static_analysis_baset::generate_states( generate_state(i_it); } -/*******************************************************************\ - -Function: static_analysis_baset::update - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void static_analysis_baset::update( const goto_functionst &goto_functions) { @@ -236,18 +131,6 @@ void static_analysis_baset::update( update(f_it->second.body); } -/*******************************************************************\ - -Function: static_analysis_baset::generate_states - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void static_analysis_baset::update( const goto_programt &goto_program) { @@ -270,18 +153,6 @@ void static_analysis_baset::update( } } -/*******************************************************************\ - -Function: static_analysis_baset::get_next - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - static_analysis_baset::locationt static_analysis_baset::get_next( working_sett &working_set) { @@ -294,18 +165,6 @@ static_analysis_baset::locationt static_analysis_baset::get_next( return l; } -/*******************************************************************\ - -Function: static_analysis_baset::fixedpoint - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool static_analysis_baset::fixedpoint( const goto_programt &goto_program, const goto_functionst &goto_functions) @@ -332,18 +191,6 @@ bool static_analysis_baset::fixedpoint( return new_data; } -/*******************************************************************\ - -Function: static_analysis_baset::visit - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool static_analysis_baset::visit( locationt l, working_sett &working_set, @@ -397,18 +244,6 @@ bool static_analysis_baset::visit( return new_data; } -/*******************************************************************\ - -Function: static_analysis_baset::do_function_call - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void static_analysis_baset::do_function_call( locationt l_call, locationt l_return, const goto_functionst &goto_functions, @@ -480,18 +315,6 @@ void static_analysis_baset::do_function_call( } } -/*******************************************************************\ - -Function: static_analysis_baset::do_function_call_rec - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void static_analysis_baset::do_function_call_rec( locationt l_call, locationt l_return, const exprt &function, @@ -594,18 +417,6 @@ void static_analysis_baset::do_function_call_rec( } } -/*******************************************************************\ - -Function: static_analysis_baset::sequential_fixedpoint - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void static_analysis_baset::sequential_fixedpoint( const goto_functionst &goto_functions) { @@ -616,18 +427,6 @@ void static_analysis_baset::sequential_fixedpoint( fixedpoint(it->second.body, goto_functions); } -/*******************************************************************\ - -Function: static_analysis_baset::concurrent_fixedpoint - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void static_analysis_baset::concurrent_fixedpoint( const goto_functionst &goto_functions) { diff --git a/src/analyses/static_analysis.h b/src/analyses/static_analysis.h index 2a390fb7e61..17d8dced473 100644 --- a/src/analyses/static_analysis.h +++ b/src/analyses/static_analysis.h @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Static Analysis + #ifndef CPROVER_ANALYSES_STATIC_ANALYSIS_H #define CPROVER_ANALYSES_STATIC_ANALYSIS_H diff --git a/src/analyses/uncaught_exceptions_analysis.cpp b/src/analyses/uncaught_exceptions_analysis.cpp index 814fcaf3730..dfc012238ab 100644 --- a/src/analyses/uncaught_exceptions_analysis.cpp +++ b/src/analyses/uncaught_exceptions_analysis.cpp @@ -6,23 +6,15 @@ Author: Cristina David \*******************************************************************/ +/// \file +/// Over-approximating uncaught exceptions analysis + #ifdef DEBUG #include #endif #include "uncaught_exceptions_analysis.h" -/*******************************************************************\ - -Function: get_exception_type - - Inputs: - - Outputs: - - Purpose: Returns the compile type of an exception - -\*******************************************************************/ - +/// Returns the compile type of an exception irep_idt uncaught_exceptions_domaint::get_exception_type(const typet &type) { assert(type.id()==ID_pointer); @@ -34,18 +26,7 @@ irep_idt uncaught_exceptions_domaint::get_exception_type(const typet &type) return ID_empty; } -/*******************************************************************\ - -Function: get_exception_symbol - - Inputs: - - Outputs: - - Purpose: Returns the symbol corresponding to an exception - -\*******************************************************************/ - +/// Returns the symbol corresponding to an exception exprt uncaught_exceptions_domaint::get_exception_symbol(const exprt &expr) { if(expr.id()!=ID_symbol && expr.has_operands()) @@ -54,18 +35,7 @@ exprt uncaught_exceptions_domaint::get_exception_symbol(const exprt &expr) return expr; } -/*******************************************************************\ - -Function: uncaught_exceptions_domaint::join - - Inputs: - - Outputs: - - Purpose: The join operator for the uncaught exceptions domain - -\*******************************************************************/ - +/// The join operator for the uncaught exceptions domain void uncaught_exceptions_domaint::join( const irep_idt &element) { @@ -85,18 +55,7 @@ void uncaught_exceptions_domaint::join( } -/*******************************************************************\ - -Function: uncaught_exceptions_domaint::transform - - Inputs: - - Outputs: - - Purpose: The transformer for the uncaught exceptions domain - -\*******************************************************************/ - +/// The transformer for the uncaught exceptions domain void uncaught_exceptions_domaint::transform( const goto_programt::const_targett from, uncaught_exceptions_analysist &uea, @@ -175,54 +134,20 @@ void uncaught_exceptions_domaint::transform( } } -/*******************************************************************\ - -Function: uncaught_exceptions_domaint::get_elements - - Inputs: - - Outputs: - - Purpose: Returns the value of the private member thrown - -\*******************************************************************/ - +/// Returns the value of the private member thrown const std::set &uncaught_exceptions_domaint::get_elements() const { return thrown; } -/*******************************************************************\ - -Function: uncaught_exceptions_domaint::operator() - - Inputs: - - Outputs: - - Purpose: Constructs the class hierarchy - -\*******************************************************************/ - +/// Constructs the class hierarchy void uncaught_exceptions_domaint::operator()( const namespacet &ns) { class_hierarchy(ns.get_symbol_table()); } -/*******************************************************************\ - -Function: uncaught_exceptions_analysist::collect_uncaught_exceptions - - Inputs: - - Outputs: - - Purpose: Runs the uncaught exceptions analysis, which - populates the exceptions map - -\*******************************************************************/ - +/// Runs the uncaught exceptions analysis, which populates the exceptions map void uncaught_exceptions_analysist::collect_uncaught_exceptions( const goto_functionst &goto_functions, const namespacet &ns) @@ -256,19 +181,8 @@ void uncaught_exceptions_analysist::collect_uncaught_exceptions( } } -/*******************************************************************\ - -Function: uncaught_exceptions_analysist::output - - Inputs: - - Outputs: - - Purpose: Prints the exceptions map that maps each method to the - set of exceptions that may escape it - -\*******************************************************************/ - +/// Prints the exceptions map that maps each method to the set of exceptions +/// that may escape it void uncaught_exceptions_analysist::output( const goto_functionst &goto_functions) { @@ -288,19 +202,7 @@ void uncaught_exceptions_analysist::output( #endif } -/*******************************************************************\ - -Function: uncaught_exceptions_analysist::operator() - - Inputs: - - Outputs: - - Purpose: Applies the uncaught exceptions analysis and - outputs the result - -\*******************************************************************/ - +/// Applies the uncaught exceptions analysis and outputs the result void uncaught_exceptions_analysist::operator()( const goto_functionst &goto_functions, const namespacet &ns, @@ -312,19 +214,7 @@ void uncaught_exceptions_analysist::operator()( output(goto_functions); } -/*******************************************************************\ - -Function: uncaught_exceptions - - Inputs: - - Outputs: - - Purpose: Applies the uncaught exceptions analysis and - outputs the result - -\*******************************************************************/ - +/// Applies the uncaught exceptions analysis and outputs the result void uncaught_exceptions( const goto_functionst &goto_functions, const namespacet &ns, diff --git a/src/analyses/uncaught_exceptions_analysis.h b/src/analyses/uncaught_exceptions_analysis.h index 50ed75b202c..a53998b4bd2 100644 --- a/src/analyses/uncaught_exceptions_analysis.h +++ b/src/analyses/uncaught_exceptions_analysis.h @@ -6,6 +6,9 @@ Author: Cristina David \*******************************************************************/ +/// \file +/// Over-approximative uncaught exceptions analysis + #ifndef CPROVER_ANALYSES_UNCAUGHT_EXCEPTIONS_ANALYSIS_H #define CPROVER_ANALYSES_UNCAUGHT_EXCEPTIONS_ANALYSIS_H @@ -15,15 +18,7 @@ Author: Cristina David #include #include -/*******************************************************************\ - - Class: uncaught_exceptions_domaint - - Purpose: defines the domain used by the uncaught - exceptions analysis - -\*******************************************************************/ - +/// defines the domain used by the uncaught exceptions analysis class uncaught_exceptions_analysist; class uncaught_exceptions_domaint @@ -58,15 +53,8 @@ class uncaught_exceptions_domaint class_hierarchyt class_hierarchy; }; -/*******************************************************************\ - - Class: uncaught_exceptions_analysist - - Purpose: computes in exceptions_map an overapproximation of the - exceptions thrown by each method - -\*******************************************************************/ - +/// computes in exceptions_map an overapproximation of the exceptions thrown by +/// each method class uncaught_exceptions_analysist { public: diff --git a/src/analyses/uninitialized_domain.cpp b/src/analyses/uninitialized_domain.cpp index 8a6e8dd52a5..60f8c45c1bb 100644 --- a/src/analyses/uninitialized_domain.cpp +++ b/src/analyses/uninitialized_domain.cpp @@ -8,23 +8,14 @@ Date: January 2010 \*******************************************************************/ +/// \file +/// Detection for Uninitialized Local Variables + #include #include #include "uninitialized_domain.h" -/*******************************************************************\ - -Function: uninitialized_domaint::transform - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void uninitialized_domaint::transform( locationt from, locationt to, @@ -60,18 +51,6 @@ void uninitialized_domaint::transform( } } -/*******************************************************************\ - -Function: uninitialized_domaint::assign - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void uninitialized_domaint::assign(const exprt &lhs) { if(lhs.id()==ID_index) @@ -82,18 +61,6 @@ void uninitialized_domaint::assign(const exprt &lhs) uninitialized.erase(to_symbol_expr(lhs).get_identifier()); } -/*******************************************************************\ - -Function: uninitialized_domaint::output - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void uninitialized_domaint::output( std::ostream &out, const ai_baset &ai, @@ -108,18 +75,7 @@ void uninitialized_domaint::output( } } -/*******************************************************************\ - -Function: uninitialized_domaint::merge - - Inputs: - - Outputs: returns true iff there is s.th. new - - Purpose: - -\*******************************************************************/ - +/// \return returns true iff there is s.th. new bool uninitialized_domaint::merge( const uninitialized_domaint &other, locationt from, diff --git a/src/analyses/uninitialized_domain.h b/src/analyses/uninitialized_domain.h index 6ca27f341b0..a48f9954388 100644 --- a/src/analyses/uninitialized_domain.h +++ b/src/analyses/uninitialized_domain.h @@ -8,6 +8,9 @@ Date: January 2010 \*******************************************************************/ +/// \file +/// Detection for Uninitialized Local Variables + #ifndef CPROVER_ANALYSES_UNINITIALIZED_DOMAIN_H #define CPROVER_ANALYSES_UNINITIALIZED_DOMAIN_H diff --git a/src/ansi-c/anonymous_member.cpp b/src/ansi-c/anonymous_member.cpp index adaff8d4680..197739f5941 100644 --- a/src/ansi-c/anonymous_member.cpp +++ b/src/ansi-c/anonymous_member.cpp @@ -6,23 +6,14 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// ANSI-C Language Type Checking + #include #include #include "anonymous_member.h" -/*******************************************************************\ - -Function: make_member_expr - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - static exprt make_member_expr( const exprt &struct_union, const struct_union_typet::componentt &component, @@ -46,18 +37,6 @@ static exprt make_member_expr( return result; } -/*******************************************************************\ - -Function: get_component_rec - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - exprt get_component_rec( const exprt &struct_union, const irep_idt &component_name, @@ -90,18 +69,6 @@ exprt get_component_rec( return nil_exprt(); } -/*******************************************************************\ - -Function: has_component_rec - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool has_component_rec( const typet &type, const irep_idt &component_name, diff --git a/src/ansi-c/anonymous_member.h b/src/ansi-c/anonymous_member.h index d9b00394b6f..3c58ad70efb 100644 --- a/src/ansi-c/anonymous_member.h +++ b/src/ansi-c/anonymous_member.h @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// C Language Type Checking + #ifndef CPROVER_ANSI_C_ANONYMOUS_MEMBER_H #define CPROVER_ANSI_C_ANONYMOUS_MEMBER_H diff --git a/src/ansi-c/ansi_c_convert_type.cpp b/src/ansi-c/ansi_c_convert_type.cpp index 7dc6f2165cf..56c2a42cac8 100644 --- a/src/ansi-c/ansi_c_convert_type.cpp +++ b/src/ansi-c/ansi_c_convert_type.cpp @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// SpecC Language Conversion + #include #include @@ -16,18 +19,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "ansi_c_convert_type.h" -/*******************************************************************\ - -Function: ansi_c_convert_typet::convert - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void ansi_c_convert_typet::read(const typet &type) { clear(); @@ -35,18 +26,6 @@ void ansi_c_convert_typet::read(const typet &type) read_rec(type); } -/*******************************************************************\ - -Function: ansi_c_convert_typet::read_rec - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void ansi_c_convert_typet::read_rec(const typet &type) { if(type.id()==ID_merged_type) @@ -240,18 +219,6 @@ void ansi_c_convert_typet::read_rec(const typet &type) other.push_back(type); } -/*******************************************************************\ - -Function: ansi_c_convert_typet::write - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void ansi_c_convert_typet::write(typet &type) { type.clear(); diff --git a/src/ansi-c/ansi_c_convert_type.h b/src/ansi-c/ansi_c_convert_type.h index 0fef20b4928..6b2de66c5ee 100644 --- a/src/ansi-c/ansi_c_convert_type.h +++ b/src/ansi-c/ansi_c_convert_type.h @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// ANSI-C Language Conversion + #ifndef CPROVER_ANSI_C_ANSI_C_CONVERT_TYPE_H #define CPROVER_ANSI_C_ANSI_C_CONVERT_TYPE_H diff --git a/src/ansi-c/ansi_c_declaration.cpp b/src/ansi-c/ansi_c_declaration.cpp index 7f9d0980583..75726b7471e 100644 --- a/src/ansi-c/ansi_c_declaration.cpp +++ b/src/ansi-c/ansi_c_declaration.cpp @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// ANSI-C Language Type Checking + #include #include @@ -14,18 +17,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "ansi_c_declaration.h" -/*******************************************************************\ - -Function: ansi_c_declaratort::build - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void ansi_c_declaratort::build(irept &src) { typet *p=static_cast(&src); @@ -66,18 +57,6 @@ void ansi_c_declaratort::build(irept &src) value().make_nil(); } -/*******************************************************************\ - -Function: ansi_c_declarationt::output - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void ansi_c_declarationt::output(std::ostream &out) const { out << "Flags:"; @@ -109,18 +88,6 @@ void ansi_c_declarationt::output(std::ostream &out) const out << "Declarator: " << declarator.pretty() << "\n"; } -/*******************************************************************\ - -Function: ansi_c_declarationt::full_type - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - typet ansi_c_declarationt::full_type( const ansi_c_declaratort &declarator) const { @@ -153,18 +120,6 @@ typet ansi_c_declarationt::full_type( return result; } -/*******************************************************************\ - -Function: ansi_c_declarationt::to_symbol - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void ansi_c_declarationt::to_symbol( const ansi_c_declaratort &declarator, symbolt &symbol) const diff --git a/src/ansi-c/ansi_c_declaration.h b/src/ansi-c/ansi_c_declaration.h index 3143c2090a5..af5db98e32e 100644 --- a/src/ansi-c/ansi_c_declaration.h +++ b/src/ansi-c/ansi_c_declaration.h @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// ANSI-CC Language Type Checking + #ifndef CPROVER_ANSI_C_ANSI_C_DECLARATION_H #define CPROVER_ANSI_C_ANSI_C_DECLARATION_H diff --git a/src/ansi-c/ansi_c_entry_point.cpp b/src/ansi-c/ansi_c_entry_point.cpp index ecb2dcc73cd..59c9674718a 100644 --- a/src/ansi-c/ansi_c_entry_point.cpp +++ b/src/ansi-c/ansi_c_entry_point.cpp @@ -26,18 +26,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "ansi_c_entry_point.h" #include "c_nondet_symbol_factory.h" -/*******************************************************************\ - -Function: build_function_environment - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - exprt::operandst build_function_environment( const code_typet::parameterst ¶meters, code_blockt &init_code, @@ -68,18 +56,6 @@ exprt::operandst build_function_environment( return main_arguments; } -/*******************************************************************\ - -Function: record_function_outputs - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void record_function_outputs( const symbolt &function, code_blockt &init_code, @@ -141,18 +117,6 @@ void record_function_outputs( #endif } -/*******************************************************************\ - -Function: ansi_c_entry_point - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool ansi_c_entry_point( symbol_tablet &symbol_table, const std::string &standard_main, diff --git a/src/ansi-c/ansi_c_internal_additions.cpp b/src/ansi-c/ansi_c_internal_additions.cpp index eb564038e2e..152f1ef8a8e 100644 --- a/src/ansi-c/ansi_c_internal_additions.cpp +++ b/src/ansi-c/ansi_c_internal_additions.cpp @@ -58,18 +58,6 @@ const char clang_builtin_headers[]= #include "clang_builtin_headers.inc" ; // NOLINT(whitespace/semicolon) -/*******************************************************************\ - -Function: architecture_string - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - static std::string architecture_string(const std::string &value, const char *s) { return std::string("const char *__CPROVER_architecture_")+ @@ -77,18 +65,6 @@ static std::string architecture_string(const std::string &value, const char *s) "=\""+value+"\";\n"; } -/*******************************************************************\ - -Function: architecture_string - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - static std::string architecture_string(int value, const char *s) { return std::string("const int __CPROVER_architecture_")+ @@ -96,18 +72,6 @@ static std::string architecture_string(int value, const char *s) "="+std::to_string(value)+";\n"; } -/*******************************************************************\ - -Function: ansi_c_internal_additions - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void ansi_c_internal_additions(std::string &code) { code+= @@ -310,18 +274,6 @@ void ansi_c_internal_additions(std::string &code) ansi_c_architecture_strings(code); } -/*******************************************************************\ - -Function: architecture_strings - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void ansi_c_architecture_strings(std::string &code) { // The following are CPROVER-specific. diff --git a/src/ansi-c/ansi_c_language.cpp b/src/ansi-c/ansi_c_language.cpp index 159b0d6df40..5a46bbccc1a 100644 --- a/src/ansi-c/ansi_c_language.cpp +++ b/src/ansi-c/ansi_c_language.cpp @@ -25,52 +25,17 @@ Author: Daniel Kroening, kroening@kroening.com #include "ansi_c_internal_additions.h" #include "type2name.h" -/*******************************************************************\ - -Function: ansi_c_languaget::extensions - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::set ansi_c_languaget::extensions() const { return { "c", "i" }; } -/*******************************************************************\ - -Function: ansi_c_languaget::modules_provided - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void ansi_c_languaget::modules_provided(std::set &modules) { modules.insert(get_base_name(parse_path, true)); } -/*******************************************************************\ - -Function: ansi_c_languaget::preprocess - - Inputs: - - Outputs: - - Purpose: ANSI-C preprocessing - -\*******************************************************************/ - +/// ANSI-C preprocessing bool ansi_c_languaget::preprocess( std::istream &instream, const std::string &path, @@ -83,18 +48,6 @@ bool ansi_c_languaget::preprocess( return c_preprocess(path, outstream, get_message_handler()); } -/*******************************************************************\ - -Function: ansi_c_languaget::parse - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool ansi_c_languaget::parse( std::istream &instream, const std::string &path) @@ -147,18 +100,6 @@ bool ansi_c_languaget::parse( return result; } -/*******************************************************************\ - -Function: ansi_c_languaget::typecheck - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool ansi_c_languaget::typecheck( symbol_tablet &symbol_table, const std::string &module) @@ -182,18 +123,6 @@ bool ansi_c_languaget::typecheck( return false; } -/*******************************************************************\ - -Function: ansi_c_languaget::final - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool ansi_c_languaget::final(symbol_tablet &symbol_table) { generate_opaque_method_stubs(symbol_table); @@ -204,52 +133,16 @@ bool ansi_c_languaget::final(symbol_tablet &symbol_table) return false; } -/*******************************************************************\ - -Function: ansi_c_languaget::show_parse - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void ansi_c_languaget::show_parse(std::ostream &out) { parse_tree.output(out); } -/*******************************************************************\ - -Function: new_ansi_c_language - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - languaget *new_ansi_c_language() { return new ansi_c_languaget; } -/*******************************************************************\ - -Function: ansi_c_languaget::from_expr - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool ansi_c_languaget::from_expr( const exprt &expr, std::string &code, @@ -259,18 +152,6 @@ bool ansi_c_languaget::from_expr( return false; } -/*******************************************************************\ - -Function: ansi_c_languaget::from_type - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool ansi_c_languaget::from_type( const typet &type, std::string &code, @@ -280,18 +161,6 @@ bool ansi_c_languaget::from_type( return false; } -/*******************************************************************\ - -Function: ansi_c_languaget::type_to_name - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool ansi_c_languaget::type_to_name( const typet &type, std::string &name, @@ -301,18 +170,6 @@ bool ansi_c_languaget::type_to_name( return false; } -/*******************************************************************\ - -Function: ansi_c_languaget::to_expr - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool ansi_c_languaget::to_expr( const std::string &code, const std::string &module, @@ -359,18 +216,6 @@ bool ansi_c_languaget::to_expr( return result; } -/*******************************************************************\ - -Function: ansi_c_languaget::~ansi_c_languaget - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - ansi_c_languaget::~ansi_c_languaget() { } diff --git a/src/ansi-c/ansi_c_parse_tree.cpp b/src/ansi-c/ansi_c_parse_tree.cpp index 4f58d094563..c2efad964c4 100644 --- a/src/ansi-c/ansi_c_parse_tree.cpp +++ b/src/ansi-c/ansi_c_parse_tree.cpp @@ -10,52 +10,16 @@ Author: Daniel Kroening, kroening@kroening.com #include "ansi_c_parse_tree.h" -/*******************************************************************\ - -Function: ansi_c_parse_treet::swap - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void ansi_c_parse_treet::swap(ansi_c_parse_treet &ansi_c_parse_tree) { ansi_c_parse_tree.items.swap(items); } -/*******************************************************************\ - -Function: ansi_c_parse_treet::clear - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void ansi_c_parse_treet::clear() { items.clear(); } -/*******************************************************************\ - -Function: ansi_c_parse_treet::output - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void ansi_c_parse_treet::output(std::ostream &out) const { for(const auto &item : items) diff --git a/src/ansi-c/ansi_c_parser.cpp b/src/ansi-c/ansi_c_parser.cpp index 77a71b62dc2..2464751cdb3 100644 --- a/src/ansi-c/ansi_c_parser.cpp +++ b/src/ansi-c/ansi_c_parser.cpp @@ -13,18 +13,6 @@ Author: Daniel Kroening, kroening@kroening.com ansi_c_parsert ansi_c_parser; -/*******************************************************************\ - -Function: ansi_c_parsert::lookup - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - ansi_c_id_classt ansi_c_parsert::lookup( const irep_idt &base_name, irep_idt &identifier, // output @@ -70,18 +58,6 @@ ansi_c_id_classt ansi_c_parsert::lookup( return ansi_c_id_classt::ANSI_C_UNKNOWN; } -/*******************************************************************\ - -Function: ansi_c_parsert::add_tag_with_body - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void ansi_c_parsert::add_tag_with_body(irept &tag) { const std::string scope_name= @@ -100,18 +76,6 @@ void ansi_c_parsert::add_tag_with_body(irept &tag) } } -/*******************************************************************\ - -Function: yyansi_cerror - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - extern char *yyansi_ctext; int yyansi_cerror(const std::string &error) @@ -120,18 +84,6 @@ int yyansi_cerror(const std::string &error) return 0; } -/*******************************************************************\ - -Function: ansi_c_parsert::add_declarator - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void ansi_c_parsert::add_declarator( exprt &declaration, irept &declarator) @@ -202,18 +154,6 @@ void ansi_c_parsert::add_declarator( ansi_c_declaration.declarators().push_back(new_declarator); } -/*******************************************************************\ - -Function: ansi_c_parsert::get_class - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - ansi_c_id_classt ansi_c_parsert::get_class(const typet &type) { if(type.id()==ID_typedef) diff --git a/src/ansi-c/ansi_c_scope.cpp b/src/ansi-c/ansi_c_scope.cpp index ffd3663e1fa..f23995a6b28 100644 --- a/src/ansi-c/ansi_c_scope.cpp +++ b/src/ansi-c/ansi_c_scope.cpp @@ -10,18 +10,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "ansi_c_scope.h" -/*******************************************************************\ - -Function: ansi_c_scopet::print - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void ansi_c_scopet::print(std::ostream &out) const { out << "Prefix: " << prefix << "\n"; diff --git a/src/ansi-c/ansi_c_typecheck.cpp b/src/ansi-c/ansi_c_typecheck.cpp index 08da6bbae01..98971527711 100644 --- a/src/ansi-c/ansi_c_typecheck.cpp +++ b/src/ansi-c/ansi_c_typecheck.cpp @@ -6,19 +6,10 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ -#include "ansi_c_typecheck.h" - -/*******************************************************************\ - -Function: ansi_c_typecheckt::typecheck - - Inputs: - - Outputs: - - Purpose: +/// \file +/// ANSI-C Language Type Checking -\*******************************************************************/ +#include "ansi_c_typecheck.h" void ansi_c_typecheckt::typecheck() { @@ -32,18 +23,6 @@ void ansi_c_typecheckt::typecheck() } } -/*******************************************************************\ - -Function: ansi_c_typecheck - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool ansi_c_typecheck( ansi_c_parse_treet &ansi_c_parse_tree, symbol_tablet &symbol_table, @@ -55,18 +34,6 @@ bool ansi_c_typecheck( return ansi_c_typecheck.typecheck_main(); } -/*******************************************************************\ - -Function: ansi_c_typecheck - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool ansi_c_typecheck( exprt &expr, message_handlert &message_handler, diff --git a/src/ansi-c/ansi_c_typecheck.h b/src/ansi-c/ansi_c_typecheck.h index aa6672d0d01..fdb9a32f2fe 100644 --- a/src/ansi-c/ansi_c_typecheck.h +++ b/src/ansi-c/ansi_c_typecheck.h @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// ANSI-C Language Type Checking + #ifndef CPROVER_ANSI_C_ANSI_C_TYPECHECK_H #define CPROVER_ANSI_C_ANSI_C_TYPECHECK_H diff --git a/src/ansi-c/c_misc.cpp b/src/ansi-c/c_misc.cpp index 94baea10fa2..6af272c86a0 100644 --- a/src/ansi-c/c_misc.cpp +++ b/src/ansi-c/c_misc.cpp @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// ANSI-C Misc Utilities + #include #ifdef _WIN32 @@ -16,18 +19,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "c_misc.h" -/*******************************************************************\ - -Function: MetaChar - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - static void MetaChar(std::string &out, char c, bool inString) { switch(c) @@ -102,18 +93,6 @@ static void MetaChar(std::string &out, char c, bool inString) } #if 0 -/*******************************************************************\ - -Function: MetaChar - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - static std::string MetaChar(char c) { std::string result; @@ -122,18 +101,6 @@ static std::string MetaChar(char c) } #endif -/*******************************************************************\ - -Function: MetaString - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string MetaString(const std::string &in) { std::string result; diff --git a/src/ansi-c/c_misc.h b/src/ansi-c/c_misc.h index 40f9d0db5b8..5af7eb4754c 100644 --- a/src/ansi-c/c_misc.h +++ b/src/ansi-c/c_misc.h @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// ANSI-C Misc Utilities + #ifndef CPROVER_ANSI_C_C_MISC_H #define CPROVER_ANSI_C_C_MISC_H diff --git a/src/ansi-c/c_nondet_symbol_factory.cpp b/src/ansi-c/c_nondet_symbol_factory.cpp index 9149d6f8786..99e804bf311 100644 --- a/src/ansi-c/c_nondet_symbol_factory.cpp +++ b/src/ansi-c/c_nondet_symbol_factory.cpp @@ -6,6 +6,9 @@ Author: DiffBlue Limited. All rights reserved. \*******************************************************************/ +/// \file +/// C Nondet Symbol Factory + #include #include @@ -27,23 +30,13 @@ Author: DiffBlue Limited. All rights reserved. #include "c_nondet_symbol_factory.h" -/*******************************************************************\ - -Function: declare_new_tmp_symbol - - Inputs: - symbol_table - The symbol table to create the symbol in - loc - The location to assign to the symbol - type - The type of symbol to create - static_lifetime - Whether the symbol should have a static lifetime - prefix - The prefix to use for the symbol's basename - - Outputs: Returns a reference to the new symbol - - Purpose: Create a new temporary static symbol - -\*******************************************************************/ - +/// Create a new temporary static symbol +/// \param symbol_table: The symbol table to create the symbol in +/// \param loc: The location to assign to the symbol +/// \param type: The type of symbol to create +/// \param static_lifetime: Whether the symbol should have a static lifetime +/// \param prefix: The prefix to use for the symbol's basename +/// \return Returns a reference to the new symbol static const symbolt &c_new_tmp_symbol( symbol_tablet &symbol_table, const source_locationt &loc, @@ -58,19 +51,8 @@ static const symbolt &c_new_tmp_symbol( return tmp_symbol; } -/*******************************************************************\ - -Function: c_get_nondet_bool - - Inputs: - type - Desired type (C_bool or plain bool) - - Outputs: nondet expr of that type - - Purpose: - -\*******************************************************************/ - +/// \param type: Desired type (C_bool or plain bool) +/// \return nondet expr of that type static exprt c_get_nondet_bool(const typet &type) { // We force this to 0 and 1 and won't consider other values @@ -107,23 +89,14 @@ class symbol_factoryt void gen_nondet_init(code_blockt &assignments, const exprt &expr); }; -/*******************************************************************\ - -Function: symbol_factoryt::allocate_object - - Inputs: - assignments - The code block to add code to - target_expr - The expression which we are allocating a symbol for - allocate_type - The type to use for the symbol. If this doesn't match - target_expr then a cast will be used for the assignment - static_lifetime - Whether the symbol created should have static lifetime - - Outputs: Returns the address of the allocated symbol - - Purpose: Create a symbol for a pointer to point to - -\*******************************************************************/ - +/// Create a symbol for a pointer to point to +/// \param assignments: The code block to add code to +/// \param target_expr: The expression which we are allocating a symbol for +/// \param allocate_type: The type to use for the symbol. If this doesn't match +/// target_expr then a cast will be used for the assignment +/// \param static_lifetime: Whether the symbol created should have static +/// lifetime +/// \return Returns the address of the allocated symbol exprt symbol_factoryt::allocate_object( code_blockt &assignments, const exprt &target_expr, @@ -157,21 +130,11 @@ exprt symbol_factoryt::allocate_object( return aoe; } -/*******************************************************************\ - -Function: symbol_factoryt::gen_nondet_init - - Inputs: - assignments - The code block to add code to - expr - The expression which we are generating a non-determinate value for - - Outputs: - - Purpose: Creates a nondet for expr, including calling itself recursively to - make appropriate symbols to point to if expr is a pointer. - -\*******************************************************************/ - +/// Creates a nondet for expr, including calling itself recursively to make +/// appropriate symbols to point to if expr is a pointer. +/// \param assignments: The code block to add code to +/// \param expr: The expression which we are generating a non-determinate value +/// for void symbol_factoryt::gen_nondet_init( code_blockt &assignments, const exprt &expr) @@ -243,26 +206,16 @@ void symbol_factoryt::gen_nondet_init( } } -/*******************************************************************\ - -Function: c_nondet_symbol_factory - - Inputs: - init_code - The code block to add generated code to - symbol_table - The symbol table - base_name - The name to use for the symbol created - type - The type for the symbol created - loc - The location to assign to generated code - allow_null - Whether to allow a null value when type is a pointer - - Outputs: Returns the symbol_exprt for the symbol created - - Purpose: Creates a symbol and generates code so that it can vary - over all possible values for its type. For pointers this - involves allocating symbols which it can point to. - -\*******************************************************************/ - +/// Creates a symbol and generates code so that it can vary over all possible +/// values for its type. For pointers this involves allocating symbols which it +/// can point to. +/// \param init_code: The code block to add generated code to +/// \param symbol_table: The symbol table +/// \param base_name: The name to use for the symbol created +/// \param type: The type for the symbol created +/// \param loc: The location to assign to generated code +/// \param allow_null: Whether to allow a null value when type is a pointer +/// \return Returns the symbol_exprt for the symbol created exprt c_nondet_symbol_factory( code_blockt &init_code, symbol_tablet &symbol_table, diff --git a/src/ansi-c/c_nondet_symbol_factory.h b/src/ansi-c/c_nondet_symbol_factory.h index 8760de6ac55..8d375663e73 100644 --- a/src/ansi-c/c_nondet_symbol_factory.h +++ b/src/ansi-c/c_nondet_symbol_factory.h @@ -6,6 +6,9 @@ Author: DiffBlue Limited. All rights reserved. \*******************************************************************/ +/// \file +/// C Nondet Symbol Factory + #ifndef CPROVER_ANSI_C_C_NONDET_SYMBOL_FACTORY_H #define CPROVER_ANSI_C_C_NONDET_SYMBOL_FACTORY_H diff --git a/src/ansi-c/c_preprocess.cpp b/src/ansi-c/c_preprocess.cpp index 9582d6f3b00..0eae03ea2ff 100644 --- a/src/ansi-c/c_preprocess.cpp +++ b/src/ansi-c/c_preprocess.cpp @@ -96,18 +96,7 @@ Author: Daniel Kroening, kroening@kroening.com " -D__INTPTR_TYPE__=\"long long int\""\ " -D__UINTPTR_TYPE__=\"long long unsigned int\"" -/*******************************************************************\ - -Function: type_max - - Inputs: - - Outputs: - - Purpose: produce a string with the maximum value of a given type - -\*******************************************************************/ - +/// produce a string with the maximum value of a given type static std::string type_max(const typet &src) { if(src.id()==ID_signedbv) @@ -120,18 +109,7 @@ static std::string type_max(const typet &src) assert(false); } -/*******************************************************************\ - -Function: shell_quote - - Inputs: - - Outputs: - - Purpose: quote a string for bash and CMD - -\*******************************************************************/ - +/// quote a string for bash and CMD static std::string shell_quote(const std::string &src) { #ifdef _WIN32 @@ -205,18 +183,6 @@ static std::string shell_quote(const std::string &src) #endif } -/*******************************************************************\ - -Function: error_parse_line - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - static void error_parse_line( const std::string &line, bool warning_only, @@ -337,18 +303,6 @@ static void error_parse_line( m << error_msg << messaget::eom; } -/*******************************************************************\ - -Function: error_parse - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - static void error_parse( std::istream &errors, bool warning_only, @@ -360,18 +314,7 @@ static void error_parse( error_parse_line(line, warning_only, message); } -/*******************************************************************\ - -Function: c_preprocess - - Inputs: - - Outputs: - - Purpose: ANSI-C preprocessing - -\*******************************************************************/ - +/// ANSI-C preprocessing bool c_preprocess( std::istream &instream, std::ostream &outstream, @@ -397,18 +340,7 @@ bool c_preprocess( return result; } -/*******************************************************************\ - -Function: is_dot_i_file - - Inputs: - - Outputs: - - Purpose: ANSI-C preprocessing - -\*******************************************************************/ - +/// ANSI-C preprocessing static bool is_dot_i_file(const std::string &path) { const char *ext=strrchr(path.c_str(), '.'); @@ -420,18 +352,7 @@ static bool is_dot_i_file(const std::string &path) return false; } -/*******************************************************************\ - -Function: c_preprocess - - Inputs: - - Outputs: - - Purpose: ANSI-C preprocessing - -\*******************************************************************/ - +/// ANSI-C preprocessing bool c_preprocess_codewarrior( const std::string &, std::ostream &, message_handlert &); bool c_preprocess_arm( @@ -480,18 +401,7 @@ bool c_preprocess( return true; } -/*******************************************************************\ - -Function: c_preprocess_visual_studio - - Inputs: - - Outputs: - - Purpose: ANSI-C preprocessing - -\*******************************************************************/ - +/// ANSI-C preprocessing bool c_preprocess_visual_studio( const std::string &file, std::ostream &outstream, @@ -598,18 +508,7 @@ bool c_preprocess_visual_studio( return false; } -/*******************************************************************\ - -Function: postprocess_codewarrior - - Inputs: - - Outputs: - - Purpose: post-processing specifically for CodeWarrior - -\*******************************************************************/ - +/// post-processing specifically for CodeWarrior void postprocess_codewarrior( std::istream &instream, std::ostream &outstream) @@ -645,18 +544,7 @@ void postprocess_codewarrior( } } -/*******************************************************************\ - -Function: c_preprocess_codewarrior - - Inputs: - - Outputs: - - Purpose: ANSI-C preprocessing - -\*******************************************************************/ - +/// ANSI-C preprocessing bool c_preprocess_codewarrior( const std::string &file, std::ostream &outstream, @@ -729,18 +617,7 @@ bool c_preprocess_codewarrior( return false; } -/*******************************************************************\ - -Function: c_preprocess_gcc_clang - - Inputs: - - Outputs: - - Purpose: ANSI-C preprocessing - -\*******************************************************************/ - +/// ANSI-C preprocessing bool c_preprocess_gcc_clang( const std::string &file, std::ostream &outstream, @@ -1044,18 +921,7 @@ bool c_preprocess_gcc_clang( return false; } -/*******************************************************************\ - -Function: c_preprocess_arm - - Inputs: - - Outputs: - - Purpose: ANSI-C preprocessing - -\*******************************************************************/ - +/// ANSI-C preprocessing bool c_preprocess_arm( const std::string &file, std::ostream &outstream, @@ -1177,18 +1043,7 @@ bool c_preprocess_arm( return false; } -/*******************************************************************\ - -Function: c_preprocess_none - - Inputs: - - Outputs: - - Purpose: ANSI-C preprocessing - -\*******************************************************************/ - +/// ANSI-C preprocessing bool c_preprocess_none( const std::string &file, std::ostream &outstream, @@ -1223,18 +1078,7 @@ bool c_preprocess_none( return false; } -/*******************************************************************\ - -Function: test_c_preprocessor - - Inputs: - - Outputs: - - Purpose: tests ANSI-C preprocessing - -\*******************************************************************/ - +/// tests ANSI-C preprocessing const char c_test_program[]= "#include \n" "\n" diff --git a/src/ansi-c/c_qualifiers.cpp b/src/ansi-c/c_qualifiers.cpp index 75ca8bf9c05..47a99a63f65 100644 --- a/src/ansi-c/c_qualifiers.cpp +++ b/src/ansi-c/c_qualifiers.cpp @@ -10,18 +10,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "c_qualifiers.h" -/*******************************************************************\ - -Function: c_qualifierst::as_string - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string c_qualifierst::as_string() const { std::string qualifiers; @@ -50,18 +38,6 @@ std::string c_qualifierst::as_string() const return qualifiers; } -/*******************************************************************\ - -Function: c_qualifierst::read - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void c_qualifierst::read(const typet &src) { if(src.get_bool(ID_C_constant)) @@ -89,18 +65,6 @@ void c_qualifierst::read(const typet &src) is_noreturn=true; } -/*******************************************************************\ - -Function: c_qualifierst::write - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void c_qualifierst::write(typet &dest) const { if(is_constant) @@ -144,18 +108,6 @@ void c_qualifierst::write(typet &dest) const dest.remove(ID_C_noreturn); } -/*******************************************************************\ - -Function: c_qualifierst::clear - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void c_qualifierst::clear(typet &dest) { dest.remove(ID_C_constant); @@ -167,18 +119,7 @@ void c_qualifierst::clear(typet &dest) dest.remove(ID_C_noreturn); } -/*******************************************************************\ - -Function: operator << - - Inputs: - - Outputs: - - Purpose: pretty-print the qualifiers - -\*******************************************************************/ - +/// pretty-print the qualifiers std::ostream &operator << ( std::ostream &out, const c_qualifierst &c_qualifiers) diff --git a/src/ansi-c/c_sizeof.cpp b/src/ansi-c/c_sizeof.cpp index 85c91870208..7d4dd390759 100644 --- a/src/ansi-c/c_sizeof.cpp +++ b/src/ansi-c/c_sizeof.cpp @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Conversion of sizeof Expressions + #include #include #include @@ -15,18 +18,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "c_typecast.h" #include "c_types.h" -/*******************************************************************\ - -Function: c_sizeoft::sizeof_rec - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - exprt c_sizeoft::sizeof_rec(const typet &type) { // this implementation will eventually be replaced @@ -258,18 +249,6 @@ exprt c_sizeoft::sizeof_rec(const typet &type) return dest; } -/*******************************************************************\ - -Function: c_sizeoft::c_offsetof - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - exprt c_sizeoft::c_offsetof( const struct_typet &type, const irep_idt &component_name) @@ -320,18 +299,6 @@ exprt c_sizeoft::c_offsetof( return nil_exprt(); } -/*******************************************************************\ - -Function: c_sizeof - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - exprt c_sizeof(const typet &src, const namespacet &ns) { c_sizeoft c_sizeof_inst(ns); @@ -340,18 +307,6 @@ exprt c_sizeof(const typet &src, const namespacet &ns) return tmp; } -/*******************************************************************\ - -Function: c_offsetof - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - exprt c_offsetof( const struct_typet &src, const irep_idt &component_name, diff --git a/src/ansi-c/c_storage_spec.cpp b/src/ansi-c/c_storage_spec.cpp index df4cdb2381c..6a74d092599 100644 --- a/src/ansi-c/c_storage_spec.cpp +++ b/src/ansi-c/c_storage_spec.cpp @@ -10,18 +10,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "c_storage_spec.h" -/*******************************************************************\ - -Function: c_storage_spect::read - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void c_storage_spect::read(const typet &type) { if(type.id()==ID_merged_type || diff --git a/src/ansi-c/c_typecast.cpp b/src/ansi-c/c_typecast.cpp index 52070e29257..b8be3a66b50 100644 --- a/src/ansi-c/c_typecast.cpp +++ b/src/ansi-c/c_typecast.cpp @@ -22,18 +22,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "c_types.h" #include "c_qualifiers.h" -/*******************************************************************\ - -Function: c_implicit_typecast - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool c_implicit_typecast( exprt &expr, const typet &dest_type, @@ -44,18 +32,6 @@ bool c_implicit_typecast( return !c_typecast.errors.empty(); } -/*******************************************************************\ - -Function: check_c_implicit_typecast - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool check_c_implicit_typecast( const typet &src_type, const typet &dest_type, @@ -68,18 +44,7 @@ bool check_c_implicit_typecast( return !c_typecast.errors.empty(); } -/*******************************************************************\ - -Function: c_implicit_typecast_arithmetic - - Inputs: - - Outputs: - - Purpose: perform arithmetic prompotions and conversions - -\*******************************************************************/ - +/// perform arithmetic prompotions and conversions bool c_implicit_typecast_arithmetic( exprt &expr1, exprt &expr2, const namespacet &ns) @@ -89,18 +54,6 @@ bool c_implicit_typecast_arithmetic( return !c_typecast.errors.empty(); } -/*******************************************************************\ - -Function: is_void_pointer - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool is_void_pointer(const typet &type) { if(type.id()==ID_pointer) @@ -114,18 +67,6 @@ bool is_void_pointer(const typet &type) return false; } -/*******************************************************************\ - -Function: check_c_implicit_typecast - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool check_c_implicit_typecast( const typet &src_type, const typet &dest_type) @@ -308,18 +249,6 @@ bool check_c_implicit_typecast( return true; } -/*******************************************************************\ - -Function: c_typecastt::follow_with_qualifiers - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - typet c_typecastt::follow_with_qualifiers(const typet &src_type) { if(src_type.id()!=ID_symbol) @@ -344,18 +273,6 @@ typet c_typecastt::follow_with_qualifiers(const typet &src_type) return result_type; } -/*******************************************************************\ - -Function: c_typecastt::get_c_type - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - c_typecastt::c_typet c_typecastt::get_c_type( const typet &type) const { @@ -441,18 +358,6 @@ c_typecastt::c_typet c_typecastt::get_c_type( return OTHER; } -/*******************************************************************\ - -Function: c_typecastt::implicit_typecast_arithmetic - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void c_typecastt::implicit_typecast_arithmetic( exprt &expr, c_typet c_type) @@ -499,18 +404,6 @@ void c_typecastt::implicit_typecast_arithmetic( do_typecast(expr, new_type); } -/*******************************************************************\ - -Function: c_typecastt::implicit_typecast_arithmetic - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - c_typecastt::c_typet c_typecastt::minimum_promotion( const typet &type) const { @@ -544,36 +437,12 @@ c_typecastt::c_typet c_typecastt::minimum_promotion( return max_type; } -/*******************************************************************\ - -Function: c_typecastt::implicit_typecast_arithmetic - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void c_typecastt::implicit_typecast_arithmetic(exprt &expr) { c_typet c_type=minimum_promotion(expr.type()); implicit_typecast_arithmetic(expr, c_type); } -/*******************************************************************\ - -Function: c_typecastt::implicit_typecast - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void c_typecastt::implicit_typecast( exprt &expr, const typet &type) @@ -588,18 +457,6 @@ void c_typecastt::implicit_typecast( implicit_typecast_followed(expr, src_type, type_qual, dest_type); } -/*******************************************************************\ - -Function: c_typecastt::implicit_typecast_followed - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void c_typecastt::implicit_typecast_followed( exprt &expr, const typet &src_type, @@ -721,18 +578,6 @@ void c_typecastt::implicit_typecast_followed( do_typecast(expr, orig_dest_type); } -/*******************************************************************\ - -Function: c_typecastt::implicit_typecast_arithmetic - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void c_typecastt::implicit_typecast_arithmetic( exprt &expr1, exprt &expr2) @@ -847,18 +692,6 @@ void c_typecastt::implicit_typecast_arithmetic( #endif } -/*******************************************************************\ - -Function: c_typecastt::do_typecast - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void c_typecastt::do_typecast(exprt &expr, const typet &dest_type) { // special case: array -> pointer is actually diff --git a/src/ansi-c/c_typecheck_argc_argv.cpp b/src/ansi-c/c_typecheck_argc_argv.cpp index a528a630042..5b6b11c8c1f 100644 --- a/src/ansi-c/c_typecheck_argc_argv.cpp +++ b/src/ansi-c/c_typecheck_argc_argv.cpp @@ -6,22 +6,13 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// ANSI-C Conversion / Type Checking + #include #include "c_typecheck_base.h" -/*******************************************************************\ - -Function: c_typecheck_baset::add_argc_argv - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void c_typecheck_baset::add_argc_argv(const symbolt &main_symbol) { const code_typet::parameterst ¶meters= diff --git a/src/ansi-c/c_typecheck_base.cpp b/src/ansi-c/c_typecheck_base.cpp index 8597eef3852..2b40d71796f 100644 --- a/src/ansi-c/c_typecheck_base.cpp +++ b/src/ansi-c/c_typecheck_base.cpp @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// ANSI-C Conversion / Type Checking + #include #include #include @@ -15,52 +18,16 @@ Author: Daniel Kroening, kroening@kroening.com #include "type2name.h" #include "c_storage_spec.h" -/*******************************************************************\ - -Function: c_typecheck_baset::to_string - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string c_typecheck_baset::to_string(const exprt &expr) { return expr2c(expr, *this); } -/*******************************************************************\ - -Function: c_typecheck_baset::to_string - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string c_typecheck_baset::to_string(const typet &type) { return type2c(type, *this); } -/*******************************************************************\ - -Function: c_typecheck_baset::move_symbol - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void c_typecheck_baset::move_symbol(symbolt &symbol, symbolt *&new_symbol) { symbol.mode=mode; @@ -75,18 +42,6 @@ void c_typecheck_baset::move_symbol(symbolt &symbol, symbolt *&new_symbol) } } -/*******************************************************************\ - -Function: c_typecheck_baset::typecheck_symbol - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void c_typecheck_baset::typecheck_symbol(symbolt &symbol) { current_symbol_id=symbol.name; @@ -173,18 +128,6 @@ void c_typecheck_baset::typecheck_symbol(symbolt &symbol) } } -/*******************************************************************\ - -Function: c_typecheck_baset::typecheck_new_symbol - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void c_typecheck_baset::typecheck_new_symbol(symbolt &symbol) { if(symbol.is_parameter) @@ -236,18 +179,6 @@ void c_typecheck_baset::typecheck_new_symbol(symbolt &symbol) } } -/*******************************************************************\ - -Function: c_typecheck_baset::typecheck_redefinition_type - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void c_typecheck_baset::typecheck_redefinition_type( symbolt &old_symbol, symbolt &new_symbol) @@ -331,18 +262,6 @@ void c_typecheck_baset::typecheck_redefinition_type( } } -/*******************************************************************\ - -Function: c_typecheck_baset::typecheck_redefinition_non_type - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void c_typecheck_baset::typecheck_redefinition_non_type( symbolt &old_symbol, symbolt &new_symbol) @@ -615,18 +534,6 @@ void c_typecheck_baset::typecheck_redefinition_non_type( // mismatch. } -/*******************************************************************\ - -Function: c_typecheck_baset::typecheck_function_body - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void c_typecheck_baset::typecheck_function_body(symbolt &symbol) { code_typet &code_type=to_code_type(symbol.type); @@ -697,18 +604,6 @@ void c_typecheck_baset::typecheck_function_body(symbolt &symbol) } } -/*******************************************************************\ - -Function: c_typecheck_baset::apply_asm_label - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void c_typecheck_baset::apply_asm_label( const irep_idt &asm_label, symbolt &symbol) @@ -777,18 +672,6 @@ void c_typecheck_baset::apply_asm_label( } } -/*******************************************************************\ - -Function: c_typecheck_baset::typecheck_declaration - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void c_typecheck_baset::typecheck_declaration( ansi_c_declarationt &declaration) { diff --git a/src/ansi-c/c_typecheck_base.h b/src/ansi-c/c_typecheck_base.h index 68191f54fe9..684b0b64edc 100644 --- a/src/ansi-c/c_typecheck_base.h +++ b/src/ansi-c/c_typecheck_base.h @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// ANSI-C Language Type Checking + #ifndef CPROVER_ANSI_C_C_TYPECHECK_BASE_H #define CPROVER_ANSI_C_C_TYPECHECK_BASE_H diff --git a/src/ansi-c/c_typecheck_code.cpp b/src/ansi-c/c_typecheck_code.cpp index dfbac98940c..c13564b9ab2 100644 --- a/src/ansi-c/c_typecheck_code.cpp +++ b/src/ansi-c/c_typecheck_code.cpp @@ -6,41 +6,20 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// C Language Type Checking + #include #include #include "ansi_c_declaration.h" #include "c_typecheck_base.h" -/*******************************************************************\ - -Function: c_typecheck_baset::start_typecheck_code - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void c_typecheck_baset::start_typecheck_code() { case_is_allowed=break_is_allowed=continue_is_allowed=false; } -/*******************************************************************\ - -Function: c_typecheck_baset::typecheck_code - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void c_typecheck_baset::typecheck_code(codet &code) { if(code.id()!=ID_code) @@ -152,18 +131,6 @@ void c_typecheck_baset::typecheck_code(codet &code) } } -/*******************************************************************\ - -Function: c_typecheck_baset::typecheck_asm - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void c_typecheck_baset::typecheck_asm(codet &code) { const irep_idt flavor=to_code_asm(code).get_flavor(); @@ -197,18 +164,6 @@ void c_typecheck_baset::typecheck_asm(codet &code) } } -/*******************************************************************\ - -Function: c_typecheck_baset::typecheck_assign - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void c_typecheck_baset::typecheck_assign(codet &code) { if(code.operands().size()!=2) @@ -225,18 +180,6 @@ void c_typecheck_baset::typecheck_assign(codet &code) implicit_typecast(code.op1(), code.op0().type()); } -/*******************************************************************\ - -Function: c_typecheck_baset::typecheck_block - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void c_typecheck_baset::typecheck_block(codet &code) { Forall_operands(it, code) @@ -276,18 +219,6 @@ void c_typecheck_baset::typecheck_block(codet &code) code.operands().swap(new_ops.operands()); } -/*******************************************************************\ - -Function: c_typecheck_baset::typecheck_break - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void c_typecheck_baset::typecheck_break(codet &code) { if(!break_is_allowed) @@ -298,18 +229,6 @@ void c_typecheck_baset::typecheck_break(codet &code) } } -/*******************************************************************\ - -Function: c_typecheck_baset::typecheck_continue - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void c_typecheck_baset::typecheck_continue(codet &code) { if(!continue_is_allowed) @@ -320,18 +239,6 @@ void c_typecheck_baset::typecheck_continue(codet &code) } } -/*******************************************************************\ - -Function: c_typecheck_baset::typecheck_decl - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void c_typecheck_baset::typecheck_decl(codet &code) { // this comes with 1 operand, which is a declaration @@ -452,18 +359,6 @@ void c_typecheck_baset::typecheck_decl(codet &code) } } -/*******************************************************************\ - -Function: c_typecheck_baset::is_complete_type - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool c_typecheck_baset::is_complete_type(const typet &type) const { if(type.id()==ID_incomplete_struct || @@ -494,18 +389,6 @@ bool c_typecheck_baset::is_complete_type(const typet &type) const return true; } -/*******************************************************************\ - -Function: c_typecheck_baset::typecheck_expression - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void c_typecheck_baset::typecheck_expression(codet &code) { if(code.operands().size()!=1) @@ -520,18 +403,6 @@ void c_typecheck_baset::typecheck_expression(codet &code) typecheck_expr(op); } -/*******************************************************************\ - -Function: c_typecheck_baset::typecheck_for - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void c_typecheck_baset::typecheck_for(codet &code) { if(code.operands().size()!=4) @@ -623,18 +494,6 @@ void c_typecheck_baset::typecheck_for(codet &code) typecheck_spec_expr(code, ID_C_spec_loop_invariant); } -/*******************************************************************\ - -Function: c_typecheck_baset::typecheck_label - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void c_typecheck_baset::typecheck_label(code_labelt &code) { // record the label @@ -643,18 +502,6 @@ void c_typecheck_baset::typecheck_label(code_labelt &code) typecheck_code(code.code()); } -/*******************************************************************\ - -Function: c_typecheck_baset::typecheck_switch_case - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void c_typecheck_baset::typecheck_switch_case(code_switch_caset &code) { if(code.operands().size()!=2) @@ -690,18 +537,6 @@ void c_typecheck_baset::typecheck_switch_case(code_switch_caset &code) } } -/*******************************************************************\ - -Function: c_typecheck_baset::typecheck_gcc_switch_case_range - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void c_typecheck_baset::typecheck_gcc_switch_case_range(codet &code) { if(code.operands().size()!=3) @@ -727,54 +562,18 @@ void c_typecheck_baset::typecheck_gcc_switch_case_range(codet &code) implicit_typecast(code.op1(), switch_op_type); } -/*******************************************************************\ - -Function: c_typecheck_baset::typecheck_gcc_local_label - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void c_typecheck_baset::typecheck_gcc_local_label(codet &code) { // these are just declarations, e.g., // __label__ here, there; } -/*******************************************************************\ - -Function: c_typecheck_baset::typecheck_goto - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void c_typecheck_baset::typecheck_goto(code_gotot &code) { // we record the label used labels_used[code.get_destination()]=code.source_location(); } -/*******************************************************************\ - -Function: c_typecheck_baset::typecheck_gcc_computed_goto - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void c_typecheck_baset::typecheck_gcc_computed_goto(codet &code) { if(code.operands().size()!=1) @@ -800,18 +599,6 @@ void c_typecheck_baset::typecheck_gcc_computed_goto(codet &code) dest.type()=empty_typet(); } -/*******************************************************************\ - -Function: c_typecheck_baset::typecheck_ifthenelse - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void c_typecheck_baset::typecheck_ifthenelse(code_ifthenelset &code) { if(code.operands().size()!=3) @@ -861,18 +648,6 @@ void c_typecheck_baset::typecheck_ifthenelse(code_ifthenelset &code) } } -/*******************************************************************\ - -Function: c_typecheck_baset::typecheck_start_thread - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void c_typecheck_baset::typecheck_start_thread(codet &code) { if(code.operands().size()!=1) @@ -885,18 +660,6 @@ void c_typecheck_baset::typecheck_start_thread(codet &code) typecheck_code(to_code(code.op0())); } -/*******************************************************************\ - -Function: c_typecheck_baset::typecheck_return - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void c_typecheck_baset::typecheck_return(codet &code) { if(code.operands().empty()) @@ -941,18 +704,6 @@ void c_typecheck_baset::typecheck_return(codet &code) } } -/*******************************************************************\ - -Function: c_typecheck_baset::typecheck_switch - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void c_typecheck_baset::typecheck_switch(code_switcht &code) { if(code.operands().size()!=2) @@ -984,18 +735,6 @@ void c_typecheck_baset::typecheck_switch(code_switcht &code) switch_op_type=old_switch_op_type; } -/*******************************************************************\ - -Function: c_typecheck_baset::typecheck_while - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void c_typecheck_baset::typecheck_while(code_whilet &code) { if(code.operands().size()!=2) @@ -1031,18 +770,6 @@ void c_typecheck_baset::typecheck_while(code_whilet &code) typecheck_spec_expr(code, ID_C_spec_loop_invariant); } -/*******************************************************************\ - -Function: c_typecheck_baset::typecheck_dowhile - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void c_typecheck_baset::typecheck_dowhile(code_dowhilet &code) { if(code.operands().size()!=2) @@ -1078,18 +805,6 @@ void c_typecheck_baset::typecheck_dowhile(code_dowhilet &code) typecheck_spec_expr(code, ID_C_spec_loop_invariant); } -/*******************************************************************\ - -Function: c_typecheck_baset::typecheck_spec_expr - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void c_typecheck_baset::typecheck_spec_expr( codet &code, const irep_idt &spec) diff --git a/src/ansi-c/c_typecheck_expr.cpp b/src/ansi-c/c_typecheck_expr.cpp index 5d4788e5145..6f845653102 100644 --- a/src/ansi-c/c_typecheck_expr.cpp +++ b/src/ansi-c/c_typecheck_expr.cpp @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// ANSI-C Language Type Checking + #include #include @@ -28,18 +31,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "anonymous_member.h" #include "padding.h" -/*******************************************************************\ - -Function: c_typecheck_baset::typecheck_expr - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void c_typecheck_baset::typecheck_expr(exprt &expr) { if(expr.id()==ID_already_typechecked) @@ -58,18 +49,6 @@ void c_typecheck_baset::typecheck_expr(exprt &expr) typecheck_expr_main(expr); } -/*******************************************************************\ - -Function: c_typecheck_baset::add_rounding_mode - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void c_typecheck_baset::add_rounding_mode(exprt &expr) { for(auto &op : expr.operands()) @@ -104,18 +83,6 @@ void c_typecheck_baset::add_rounding_mode(exprt &expr) } } -/*******************************************************************\ - -Function: c_typecheck_baset::gcc_types_compatible_p - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool c_typecheck_baset::gcc_types_compatible_p( const typet &type1, const typet &type2) @@ -198,18 +165,6 @@ bool c_typecheck_baset::gcc_types_compatible_p( return false; } -/*******************************************************************\ - -Function: c_typecheck_baset::typecheck_expr_main - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void c_typecheck_baset::typecheck_expr_main(exprt &expr) { if(expr.id()==ID_side_effect) @@ -467,18 +422,6 @@ void c_typecheck_baset::typecheck_expr_main(exprt &expr) } } -/*******************************************************************\ - -Function: c_typecheck_baset::typecheck_expr_comma - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void c_typecheck_baset::typecheck_expr_comma(exprt &expr) { if(expr.operands().size()!=2) @@ -495,18 +438,6 @@ void c_typecheck_baset::typecheck_expr_comma(exprt &expr) expr.set(ID_C_lvalue, true); } -/*******************************************************************\ - -Function: c_typecheck_baset::typecheck_expr_builtin_va_arg - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void c_typecheck_baset::typecheck_expr_builtin_va_arg(exprt &expr) { // The first parameter is the va_list, and the second @@ -552,18 +483,6 @@ void c_typecheck_baset::typecheck_expr_builtin_va_arg(exprt &expr) symbol_table.move(symbol); } -/*******************************************************************\ - -Function: c_typecheck_baset::typecheck_expr_cw_va_arg_typeof - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void c_typecheck_baset::typecheck_expr_cw_va_arg_typeof(exprt &expr) { // used in Code Warrior via @@ -581,18 +500,6 @@ void c_typecheck_baset::typecheck_expr_cw_va_arg_typeof(exprt &expr) expr.type()=signed_int_type(); } -/*******************************************************************\ - -Function: c_typecheck_baset::typecheck_expr_builtin_offsetof - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void c_typecheck_baset::typecheck_expr_builtin_offsetof(exprt &expr) { // these need not be constant, due to array indices! @@ -754,18 +661,6 @@ void c_typecheck_baset::typecheck_expr_builtin_offsetof(exprt &expr) expr.swap(result); } -/*******************************************************************\ - -Function: c_typecheck_baset::typecheck_expr_operands - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void c_typecheck_baset::typecheck_expr_operands(exprt &expr) { if(expr.id()==ID_side_effect && @@ -837,18 +732,6 @@ void c_typecheck_baset::typecheck_expr_operands(exprt &expr) } } -/*******************************************************************\ - -Function: c_typecheck_baset::typecheck_expr_symbol - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void c_typecheck_baset::typecheck_expr_symbol(exprt &expr) { irep_idt identifier=to_symbol_expr(expr).get_identifier(); @@ -954,18 +837,6 @@ void c_typecheck_baset::typecheck_expr_symbol(exprt &expr) } } -/*******************************************************************\ - -Function: c_typecheck_baset::typecheck_side_effect_statement_expression - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void c_typecheck_baset::typecheck_side_effect_statement_expression( side_effect_exprt &expr) { @@ -1042,18 +913,6 @@ void c_typecheck_baset::typecheck_side_effect_statement_expression( expr.type()=typet(ID_empty); } -/*******************************************************************\ - -Function: c_typecheck_baset::typecheck_expr_sizeof - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void c_typecheck_baset::typecheck_expr_sizeof(exprt &expr) { typet type; @@ -1116,18 +975,6 @@ void c_typecheck_baset::typecheck_expr_sizeof(exprt &expr) } } -/*******************************************************************\ - -Function: c_typecheck_baset::typecheck_expr_alignof - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void c_typecheck_baset::typecheck_expr_alignof(exprt &expr) { typet argument_type; @@ -1150,18 +997,6 @@ void c_typecheck_baset::typecheck_expr_alignof(exprt &expr) expr.swap(tmp); } -/*******************************************************************\ - -Function: c_typecheck_baset::typecheck_expr_typecast - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void c_typecheck_baset::typecheck_expr_typecast(exprt &expr) { if(expr.operands().size()!=1) @@ -1354,35 +1189,11 @@ void c_typecheck_baset::typecheck_expr_typecast(exprt &expr) } } -/*******************************************************************\ - -Function: c_typecheck_baset::make_index_type - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void c_typecheck_baset::make_index_type(exprt &expr) { implicit_typecast(expr, index_type()); } -/*******************************************************************\ - -Function: c_typecheck_baset::typecheck_expr_index - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void c_typecheck_baset::typecheck_expr_index(exprt &expr) { if(expr.operands().size()!=2) @@ -1443,18 +1254,6 @@ void c_typecheck_baset::typecheck_expr_index(exprt &expr) expr.type()=final_array_type.subtype(); } -/*******************************************************************\ - -Function: c_typecheck_baset::adjust_float_rel - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void c_typecheck_baset::adjust_float_rel(exprt &expr) { // equality and disequality on float is not mathematical equality! @@ -1469,18 +1268,6 @@ void c_typecheck_baset::adjust_float_rel(exprt &expr) } } -/*******************************************************************\ - -Function: c_typecheck_baset::typecheck_expr_rel - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void c_typecheck_baset::typecheck_expr_rel( binary_relation_exprt &expr) { @@ -1587,18 +1374,6 @@ void c_typecheck_baset::typecheck_expr_rel( throw 0; } -/*******************************************************************\ - -Function: c_typecheck_baset::typecheck_expr_rel_vector - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void c_typecheck_baset::typecheck_expr_rel_vector( binary_relation_exprt &expr) { @@ -1625,18 +1400,6 @@ void c_typecheck_baset::typecheck_expr_rel_vector( expr.type()=vector_typet(signed_int_type(), to_vector_type(o_type0).size()); } -/*******************************************************************\ - -Function: c_typecheck_baset::typecheck_expr_ptrmember - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void c_typecheck_baset::typecheck_expr_ptrmember(exprt &expr) { if(expr.operands().size()!=1) @@ -1672,18 +1435,6 @@ void c_typecheck_baset::typecheck_expr_ptrmember(exprt &expr) typecheck_expr_member(expr); } -/*******************************************************************\ - -Function: c_typecheck_baset::typecheck_expr_member - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void c_typecheck_baset::typecheck_expr_member(exprt &expr) { if(expr.operands().size()!=1) @@ -1780,18 +1531,6 @@ void c_typecheck_baset::typecheck_expr_member(exprt &expr) } } -/*******************************************************************\ - -Function: c_typecheck_baset::typecheck_expr_trinary - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void c_typecheck_baset::typecheck_expr_trinary(if_exprt &expr) { exprt::operandst &operands=expr.operands(); @@ -1885,18 +1624,6 @@ void c_typecheck_baset::typecheck_expr_trinary(if_exprt &expr) throw 0; } -/*******************************************************************\ - -Function: c_typecheck_baset::typecheck_side_effect_gcc_conditional_expresssion - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void c_typecheck_baset::typecheck_side_effect_gcc_conditional_expression( side_effect_exprt &expr) { @@ -1928,18 +1655,6 @@ void c_typecheck_baset::typecheck_side_effect_gcc_conditional_expression( expr.type()=if_expr.type(); } -/*******************************************************************\ - -Function: c_typecheck_baset::typecheck_expr_address_of - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void c_typecheck_baset::typecheck_expr_address_of(exprt &expr) { if(expr.operands().size()!=1) @@ -2010,18 +1725,6 @@ void c_typecheck_baset::typecheck_expr_address_of(exprt &expr) expr.type()=pointer_type(op.type()); } -/*******************************************************************\ - -Function: c_typecheck_baset::typecheck_expr_dereference - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void c_typecheck_baset::typecheck_expr_dereference(exprt &expr) { if(expr.operands().size()!=1) @@ -2065,18 +1768,6 @@ void c_typecheck_baset::typecheck_expr_dereference(exprt &expr) typecheck_expr_function_identifier(expr); } -/*******************************************************************\ - -Function: c_typecheck_baset::typecheck_expr_function_identifier - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void c_typecheck_baset::typecheck_expr_function_identifier(exprt &expr) { if(expr.type().id()==ID_code) @@ -2089,18 +1780,6 @@ void c_typecheck_baset::typecheck_expr_function_identifier(exprt &expr) } } -/*******************************************************************\ - -Function: c_typecheck_baset::typecheck_expr_side_effect - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void c_typecheck_baset::typecheck_expr_side_effect(side_effect_exprt &expr) { const irep_idt &statement=expr.get_statement(); @@ -2192,18 +1871,6 @@ void c_typecheck_baset::typecheck_expr_side_effect(side_effect_exprt &expr) } } -/*******************************************************************\ - -Function: c_typecheck_baset::typecheck_side_effect_function_call - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void c_typecheck_baset::typecheck_side_effect_function_call( side_effect_expr_function_callt &expr) { @@ -2312,18 +1979,6 @@ void c_typecheck_baset::typecheck_side_effect_function_call( typecheck_function_call_arguments(expr); } -/*******************************************************************\ - -Function: c_typecheck_baset::do_special_functions - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - exprt c_typecheck_baset::do_special_functions( side_effect_expr_function_callt &expr) { @@ -2928,18 +2583,8 @@ exprt c_typecheck_baset::do_special_functions( return nil_exprt(); } -/*******************************************************************\ - -Function: c_typecheck_baset::typecheck_function_call_arguments - - Inputs: type-checked arguments, type-checked function - - Outputs: type-adjusted function arguments - - Purpose: - -\*******************************************************************/ - +/// \param type:checked arguments, type-checked function +/// \return type-adjusted function arguments void c_typecheck_baset::typecheck_function_call_arguments( side_effect_expr_function_callt &expr) { @@ -3022,35 +2667,11 @@ void c_typecheck_baset::typecheck_function_call_arguments( } } -/*******************************************************************\ - -Function: c_typecheck_baset::typecheck_expr_constant - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void c_typecheck_baset::typecheck_expr_constant(exprt &expr) { // nothing to do } -/*******************************************************************\ - -Function: c_typecheck_baset::typecheck_expr_unary_arithmetic - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void c_typecheck_baset::typecheck_expr_unary_arithmetic(exprt &expr) { if(expr.operands().size()!=1) @@ -3090,18 +2711,6 @@ void c_typecheck_baset::typecheck_expr_unary_arithmetic(exprt &expr) throw 0; } -/*******************************************************************\ - -Function: c_typecheck_baset::typecheck_expr_unary_boolean - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void c_typecheck_baset::typecheck_expr_unary_boolean(exprt &expr) { if(expr.operands().size()!=1) @@ -3124,18 +2733,6 @@ void c_typecheck_baset::typecheck_expr_unary_boolean(exprt &expr) expr.type()=bool_typet(); } -/*******************************************************************\ - -Function: c_typecheck_baset::gcc_vector_types_compatible - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool c_typecheck_baset::gcc_vector_types_compatible( const vector_typet &type0, const vector_typet &type1) @@ -3163,18 +2760,6 @@ bool c_typecheck_baset::gcc_vector_types_compatible( return type0.subtype()==type1.subtype(); } -/*******************************************************************\ - -Function: c_typecheck_baset::typecheck_expr_binary_arithmetic - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void c_typecheck_baset::typecheck_expr_binary_arithmetic(exprt &expr) { if(expr.operands().size()!=2) @@ -3276,18 +2861,6 @@ void c_typecheck_baset::typecheck_expr_binary_arithmetic(exprt &expr) throw 0; } -/*******************************************************************\ - -Function: c_typecheck_baset::typecheck_expr_shifts - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void c_typecheck_baset::typecheck_expr_shifts(shift_exprt &expr) { assert(expr.id()==ID_shl || expr.id()==ID_shr); @@ -3357,18 +2930,6 @@ void c_typecheck_baset::typecheck_expr_shifts(shift_exprt &expr) throw 0; } -/*******************************************************************\ - -Function: c_typecheck_baset::typecheck_arithmetic_pointer - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void c_typecheck_baset::typecheck_arithmetic_pointer(const exprt &expr) { const typet &type=expr.type(); @@ -3387,18 +2948,6 @@ void c_typecheck_baset::typecheck_arithmetic_pointer(const exprt &expr) } } -/*******************************************************************\ - -Function: c_typecheck_baset::typecheck_expr_pointer_arithmetic - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void c_typecheck_baset::typecheck_expr_pointer_arithmetic(exprt &expr) { assert(expr.operands().size()==2); @@ -3489,18 +3038,6 @@ void c_typecheck_baset::typecheck_expr_pointer_arithmetic(exprt &expr) throw 0; } -/*******************************************************************\ - -Function: c_typecheck_baset::typecheck_expr_binary_boolean - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void c_typecheck_baset::typecheck_expr_binary_boolean(exprt &expr) { if(expr.operands().size()!=2) @@ -3522,18 +3059,6 @@ void c_typecheck_baset::typecheck_expr_binary_boolean(exprt &expr) expr.type()=bool_typet(); } -/*******************************************************************\ - -Function: c_typecheck_baset::typecheck_side_effect_assignment - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void c_typecheck_baset::typecheck_side_effect_assignment( side_effect_exprt &expr) { @@ -3728,18 +3253,6 @@ void c_typecheck_baset::typecheck_side_effect_assignment( throw 0; } -/*******************************************************************\ - -Function: c_typecheck_baset::make_constant - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void c_typecheck_baset::make_constant(exprt &expr) { make_constant_rec(expr); @@ -3755,18 +3268,6 @@ void c_typecheck_baset::make_constant(exprt &expr) } } -/*******************************************************************\ - -Function: c_typecheck_baset::make_constant_index - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void c_typecheck_baset::make_constant_index(exprt &expr) { make_constant(expr); @@ -3782,18 +3283,6 @@ void c_typecheck_baset::make_constant_index(exprt &expr) } } -/*******************************************************************\ - -Function: c_typecheck_baset::make_constant_rec - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void c_typecheck_baset::make_constant_rec(exprt &expr) { } diff --git a/src/ansi-c/c_typecheck_initializer.cpp b/src/ansi-c/c_typecheck_initializer.cpp index 79dabc9f0e9..0c9e7c5ccac 100644 --- a/src/ansi-c/c_typecheck_initializer.cpp +++ b/src/ansi-c/c_typecheck_initializer.cpp @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// ANSI-C Conversion / Type Checking + #include #include #include @@ -21,18 +24,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "string_constant.h" #include "anonymous_member.h" -/*******************************************************************\ - -Function: c_typecheck_baset::do_initializer - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void c_typecheck_baset::do_initializer( exprt &initializer, const typet &type, @@ -60,19 +51,7 @@ void c_typecheck_baset::do_initializer( initializer=result; } -/*******************************************************************\ - -Function: c_typecheck_baset::do_initializer_rec - - Inputs: - - Outputs: - - Purpose: initialize something of type `type' with given - value `value' - -\*******************************************************************/ - +/// initialize something of type `type' with given value `value' exprt c_typecheck_baset::do_initializer_rec( const exprt &value, const typet &type, @@ -230,18 +209,6 @@ exprt c_typecheck_baset::do_initializer_rec( return result; } -/*******************************************************************\ - -Function: c_typecheck_baset::do_initializer - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void c_typecheck_baset::do_initializer(symbolt &symbol) { // this one doesn't need initialization @@ -285,18 +252,6 @@ void c_typecheck_baset::do_initializer(symbolt &symbol) } } -/*******************************************************************\ - -Function: c_typecheck_baset::designator_enter - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void c_typecheck_baset::designator_enter( const typet &type, designatort &designator) @@ -394,18 +349,8 @@ void c_typecheck_baset::designator_enter( designator.push_entry(entry); } -/*******************************************************************\ - -Function: c_typecheck_baset::do_designated_initializer - - Inputs: pre-initialized result, designator - - Outputs: sets result - - Purpose: - -\*******************************************************************/ - +/// \param pre:initialized result, designator +/// \return sets result void c_typecheck_baset::do_designated_initializer( exprt &result, designatort &designator, @@ -646,18 +591,6 @@ void c_typecheck_baset::do_designated_initializer( } } -/*******************************************************************\ - -Function: c_typecheck_baset::increment_designator - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void c_typecheck_baset::increment_designator(designatort &designator) { assert(!designator.empty()); @@ -706,18 +639,6 @@ void c_typecheck_baset::increment_designator(designatort &designator) } } -/*******************************************************************\ - -Function: c_typecheck_baset::make_designator - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - designatort c_typecheck_baset::make_designator( const typet &src_type, const exprt &src) @@ -865,18 +786,6 @@ designatort c_typecheck_baset::make_designator( return designator; } -/*******************************************************************\ - -Function: c_typecheck_baset::do_initializer_list - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - exprt c_typecheck_baset::do_initializer_list( const exprt &value, const typet &type, diff --git a/src/ansi-c/c_typecheck_type.cpp b/src/ansi-c/c_typecheck_type.cpp index ac3fe7f2928..df3ea27a605 100644 --- a/src/ansi-c/c_typecheck_type.cpp +++ b/src/ansi-c/c_typecheck_type.cpp @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// C++ Language Type Checking + #include #include @@ -23,18 +26,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "type2name.h" #include "ansi_c_convert_type.h" -/*******************************************************************\ - -Function: c_typecheck_baset::typecheck_type - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void c_typecheck_baset::typecheck_type(typet &type) { // we first convert, and then check @@ -255,18 +246,6 @@ void c_typecheck_baset::typecheck_type(typet &type) } } -/*******************************************************************\ - -Function: c_typecheck_baset::typecheck_custom_type - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void c_typecheck_baset::typecheck_custom_type(typet &type) { // they all have a width @@ -367,18 +346,6 @@ void c_typecheck_baset::typecheck_custom_type(typet &type) assert(false); } -/*******************************************************************\ - -Function: c_typecheck_baset::typecheck_code_type - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void c_typecheck_baset::typecheck_code_type(code_typet &type) { // the return type is still 'subtype()' @@ -478,18 +445,6 @@ void c_typecheck_baset::typecheck_code_type(code_typet &type) } } -/*******************************************************************\ - -Function: c_typecheck_baset::typecheck_array_type - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void c_typecheck_baset::typecheck_array_type(array_typet &type) { exprt &size=type.size(); @@ -616,18 +571,6 @@ void c_typecheck_baset::typecheck_array_type(array_typet &type) } } -/*******************************************************************\ - -Function: c_typecheck_baset::typecheck_vector_type - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void c_typecheck_baset::typecheck_vector_type(vector_typet &type) { exprt &size=type.size(); @@ -709,18 +652,6 @@ void c_typecheck_baset::typecheck_vector_type(vector_typet &type) type.size()=from_integer(s, signed_size_type()); } -/*******************************************************************\ - -Function: c_typecheck_baset::typecheck_compound_type - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void c_typecheck_baset::typecheck_compound_type(struct_union_typet &type) { // These get replaced by symbol types later. @@ -833,18 +764,6 @@ void c_typecheck_baset::typecheck_compound_type(struct_union_typet &type) original_qualifiers.write(type); } -/*******************************************************************\ - -Function: c_typecheck_baset::typecheck_compound_type - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void c_typecheck_baset::typecheck_compound_body( struct_union_typet &type) { @@ -1021,18 +940,6 @@ void c_typecheck_baset::typecheck_compound_body( } } -/*******************************************************************\ - -Function: c_typecheck_baset::enum_constant_type - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - typet c_typecheck_baset::enum_constant_type( const mp_integer &min_value, const mp_integer &max_value) const @@ -1065,18 +972,6 @@ typet c_typecheck_baset::enum_constant_type( } } -/*******************************************************************\ - -Function: c_typecheck_baset::enum_underlying_type - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - typet c_typecheck_baset::enum_underlying_type( const mp_integer &min_value, const mp_integer &max_value, @@ -1135,18 +1030,6 @@ typet c_typecheck_baset::enum_underlying_type( } } -/*******************************************************************\ - -Function: c_typecheck_baset::typecheck_c_enum_type - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void c_typecheck_baset::typecheck_c_enum_type(typet &type) { // These come with the declarations @@ -1330,18 +1213,6 @@ void c_typecheck_baset::typecheck_c_enum_type(typet &type) type.set(ID_identifier, identifier); } -/*******************************************************************\ - -Function: c_typecheck_baset::typecheck_c_enum_tag_type - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void c_typecheck_baset::typecheck_c_enum_tag_type(c_enum_tag_typet &type) { // It's just a tag. @@ -1401,18 +1272,6 @@ void c_typecheck_baset::typecheck_c_enum_tag_type(c_enum_tag_typet &type) type.set_identifier(identifier); } -/*******************************************************************\ - -Function: c_typecheck_baset::typecheck_c_bit_field_type - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void c_typecheck_baset::typecheck_c_bit_field_type(c_bit_field_typet &type) { typecheck_type(type.subtype()); @@ -1493,18 +1352,6 @@ void c_typecheck_baset::typecheck_c_bit_field_type(c_bit_field_typet &type) } } -/*******************************************************************\ - -Function: c_typecheck_baset::typecheck_typeof_type - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void c_typecheck_baset::typecheck_typeof_type(typet &type) { // save location @@ -1542,18 +1389,6 @@ void c_typecheck_baset::typecheck_typeof_type(typet &type) c_qualifiers.write(type); } -/*******************************************************************\ - -Function: c_typecheck_baset::typecheck_symbol_type - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void c_typecheck_baset::typecheck_symbol_type(typet &type) { const irep_idt &identifier= @@ -1608,18 +1443,6 @@ void c_typecheck_baset::typecheck_symbol_type(typet &type) } } -/*******************************************************************\ - -Function: c_typecheck_baset::adjust_function_parameter - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void c_typecheck_baset::adjust_function_parameter(typet &type) const { if(type.id()==ID_array) diff --git a/src/ansi-c/c_typecheck_typecast.cpp b/src/ansi-c/c_typecheck_typecast.cpp index 5d1cfad1332..e026ac7044d 100644 --- a/src/ansi-c/c_typecheck_typecast.cpp +++ b/src/ansi-c/c_typecheck_typecast.cpp @@ -10,18 +10,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "c_typecheck_base.h" #include "c_types.h" -/*******************************************************************\ - -Function: c_typecheck_baset::implicit_typecast - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void c_typecheck_baset::implicit_typecast( exprt &expr, const typet &dest_type) @@ -62,18 +50,6 @@ void c_typecheck_baset::implicit_typecast( } } -/*******************************************************************\ - -Function: c_typecheck_baset::implicit_typecast_arithmetic - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void c_typecheck_baset::implicit_typecast_arithmetic( exprt &expr1, exprt &expr2) @@ -82,18 +58,6 @@ void c_typecheck_baset::implicit_typecast_arithmetic( c_typecast.implicit_typecast_arithmetic(expr1, expr2); } -/*******************************************************************\ - -Function: c_typecheck_baset::implicit_typecast_arithmetic - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void c_typecheck_baset::implicit_typecast_arithmetic(exprt &expr) { c_typecastt c_typecast(*this); diff --git a/src/ansi-c/c_types.cpp b/src/ansi-c/c_types.cpp index 6ba5ddaefb3..5a4504c890c 100644 --- a/src/ansi-c/c_types.cpp +++ b/src/ansi-c/c_types.cpp @@ -11,36 +11,13 @@ Author: Daniel Kroening, kroening@kroening.com #include "c_types.h" -/*******************************************************************\ - -Function: index_type - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - typet index_type() { // same as signed size type return signed_size_type(); } -/*******************************************************************\ - -Function: enum_constant_type - - Inputs: - - Outputs: - - Purpose: return type of enum constants - -\*******************************************************************/ - +/// return type of enum constants typet enum_constant_type() { // usually same as 'int', @@ -48,18 +25,6 @@ typet enum_constant_type() return signed_int_type(); } -/*******************************************************************\ - -Function: signed_int_type - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - typet signed_int_type() { typet result=signedbv_typet(config.ansi_c.int_width); @@ -67,18 +32,6 @@ typet signed_int_type() return result; } -/*******************************************************************\ - -Function: signed_short_int_type - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - typet signed_short_int_type() { typet result=signedbv_typet(config.ansi_c.short_int_width); @@ -86,18 +39,6 @@ typet signed_short_int_type() return result; } -/*******************************************************************\ - -Function: unsigned_int_type - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - typet unsigned_int_type() { typet result=unsignedbv_typet(config.ansi_c.int_width); @@ -105,18 +46,6 @@ typet unsigned_int_type() return result; } -/*******************************************************************\ - -Function: unsigned_short_int_type - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - typet unsigned_short_int_type() { typet result=unsignedbv_typet(config.ansi_c.short_int_width); @@ -124,18 +53,6 @@ typet unsigned_short_int_type() return result; } -/*******************************************************************\ - -Function: size_type - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - typet size_type() { // The size type varies. This is unsigned int on some systems, @@ -152,36 +69,12 @@ typet size_type() assert(false); // aaah! } -/*******************************************************************\ - -Function: signed_size_type - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - typet signed_size_type() { // we presume this is the same as pointer difference return pointer_diff_type(); } -/*******************************************************************\ - -Function: signed_long_int_type - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - typet signed_long_int_type() { typet result=signedbv_typet(config.ansi_c.long_int_width); @@ -189,18 +82,6 @@ typet signed_long_int_type() return result; } -/*******************************************************************\ - -Function: signed_long_long_int_type - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - typet signed_long_long_int_type() { typet result=signedbv_typet(config.ansi_c.long_long_int_width); @@ -208,18 +89,6 @@ typet signed_long_long_int_type() return result; } -/*******************************************************************\ - -Function: unsigned_long_int_type - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - typet unsigned_long_int_type() { typet result=unsignedbv_typet(config.ansi_c.long_int_width); @@ -227,18 +96,6 @@ typet unsigned_long_int_type() return result; } -/*******************************************************************\ - -Function: unsigned_long_long_int_type - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - typet unsigned_long_long_int_type() { typet result=unsignedbv_typet(config.ansi_c.long_long_int_width); @@ -246,36 +103,12 @@ typet unsigned_long_long_int_type() return result; } -/*******************************************************************\ - -Function: c_bool_type - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - typet c_bool_type() { typet result=c_bool_typet(config.ansi_c.bool_width); return result; } -/*******************************************************************\ - -Function: char_type - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - typet char_type() { typet result; @@ -295,18 +128,6 @@ typet char_type() return result; } -/*******************************************************************\ - -Function: unsigned_char_type - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - typet unsigned_char_type() { typet result=unsignedbv_typet(config.ansi_c.char_width); @@ -316,18 +137,6 @@ typet unsigned_char_type() return result; } -/*******************************************************************\ - -Function: signed_char_type - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - typet signed_char_type() { typet result=signedbv_typet(config.ansi_c.char_width); @@ -337,18 +146,6 @@ typet signed_char_type() return result; } -/*******************************************************************\ - -Function: wchar_t_type - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - typet wchar_t_type() { typet result; @@ -363,18 +160,6 @@ typet wchar_t_type() return result; } -/*******************************************************************\ - -Function: char16_t_type - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - typet char16_t_type() { typet result; @@ -389,18 +174,6 @@ typet char16_t_type() return result; } -/*******************************************************************\ - -Function: char32_t_type - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - typet char32_t_type() { typet result; @@ -415,18 +188,6 @@ typet char32_t_type() return result; } -/*******************************************************************\ - -Function: float_type - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - typet float_type() { typet result; @@ -446,18 +207,6 @@ typet float_type() return result; } -/*******************************************************************\ - -Function: double_type - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - typet double_type() { typet result; @@ -477,18 +226,6 @@ typet double_type() return result; } -/*******************************************************************\ - -Function: long_double_type - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - typet long_double_type() { typet result; @@ -527,18 +264,6 @@ typet long_double_type() return result; } -/*******************************************************************\ - -Function: gcc_float128_type - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - typet gcc_float128_type() { typet result; @@ -561,18 +286,6 @@ typet gcc_float128_type() return result; } -/*******************************************************************\ - -Function: pointer_diff_type - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - typet pointer_diff_type() { // The pointer-diff type varies. This is signed int on some systems, @@ -588,52 +301,16 @@ typet pointer_diff_type() assert(false); // aaah! } -/*******************************************************************\ - -Function: pointer_type - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - typet pointer_type(const typet &subtype) { return pointer_typet(subtype); } -/*******************************************************************\ - -Function: void_type - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - typet void_type() { return empty_typet(); } -/*******************************************************************\ - -Function: gcc_unsigned_int128_type - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - typet gcc_unsigned_int128_type() { typet result=unsignedbv_typet(128); @@ -641,18 +318,6 @@ typet gcc_unsigned_int128_type() return result; } -/*******************************************************************\ - -Function: gcc_signed_int128_type - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - typet gcc_signed_int128_type() { typet result=signedbv_typet(128); @@ -660,18 +325,6 @@ typet gcc_signed_int128_type() return result; } -/*******************************************************************\ - -Function: c_type_as_string - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string c_type_as_string(const irep_idt &c_type) { if(c_type==ID_signed_int) diff --git a/src/ansi-c/cprover_library.cpp b/src/ansi-c/cprover_library.cpp index 382ec324636..4cc00ec28a9 100644 --- a/src/ansi-c/cprover_library.cpp +++ b/src/ansi-c/cprover_library.cpp @@ -21,18 +21,6 @@ struct cprover_library_entryt #include "cprover_library.inc" ; // NOLINT(whitespace/semicolon) -/*******************************************************************\ - -Function: get_cprover_library_text - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string get_cprover_library_text( const std::set &functions, const symbol_tablet &symbol_table) @@ -74,18 +62,6 @@ std::string get_cprover_library_text( return library_text.str(); } -/*******************************************************************\ - -Function: add_cprover_library - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void add_cprover_library( const std::set &functions, symbol_tablet &symbol_table, @@ -101,18 +77,6 @@ void add_cprover_library( add_library(library_text, symbol_table, message_handler); } -/*******************************************************************\ - -Function: add_library - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void add_library( const std::string &src, symbol_tablet &symbol_table, diff --git a/src/ansi-c/designator.cpp b/src/ansi-c/designator.cpp index 88657e71407..1d54f11d5f1 100644 --- a/src/ansi-c/designator.cpp +++ b/src/ansi-c/designator.cpp @@ -6,22 +6,13 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// ANSI-C Language Type Checking + #include #include "designator.h" -/*******************************************************************\ - -Function: designatort::print - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void designatort::print(std::ostream &out) const { for(index_listt::const_iterator it=index_list.begin(); diff --git a/src/ansi-c/designator.h b/src/ansi-c/designator.h index 019f622ef63..d31d3bb3e66 100644 --- a/src/ansi-c/designator.h +++ b/src/ansi-c/designator.h @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// ANSI-C Language Type Checking + #ifndef CPROVER_ANSI_C_DESIGNATOR_H #define CPROVER_ANSI_C_DESIGNATOR_H diff --git a/src/ansi-c/expr2c.cpp b/src/ansi-c/expr2c.cpp index e8ccb805a76..9d7b654cae5 100644 --- a/src/ansi-c/expr2c.cpp +++ b/src/ansi-c/expr2c.cpp @@ -51,18 +51,6 @@ Precedences are as follows. Higher values mean higher precedence. */ -/*******************************************************************\ - -Function: expr2ct::id_shorthand - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - irep_idt expr2ct::id_shorthand(const irep_idt &identifier) const { const symbolt *symbol; @@ -81,18 +69,6 @@ irep_idt expr2ct::id_shorthand(const irep_idt &identifier) const return sh; } -/*******************************************************************\ - -Function: clean_identifier - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - static std::string clean_identifier(const irep_idt &id) { std::string dest=id2string(id); @@ -115,18 +91,6 @@ static std::string clean_identifier(const irep_idt &id) return dest; } -/*******************************************************************\ - -Function: expr2ct::get_shorthands - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void expr2ct::get_shorthands(const exprt &expr) { find_symbols_sett symbols; @@ -190,35 +154,11 @@ void expr2ct::get_shorthands(const exprt &expr) } } -/*******************************************************************\ - -Function: expr2ct::convert - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string expr2ct::convert(const typet &src) { return convert_rec(src, c_qualifierst(), ""); } -/*******************************************************************\ - -Function: expr2ct::convert_rec - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string expr2ct::convert_rec( const typet &src, const c_qualifierst &qualifiers, @@ -706,21 +646,12 @@ std::string expr2ct::convert_rec( } } -/*******************************************************************\ - -Function: expr2ct::convert_struct_type - - Inputs: - src - the struct type being converted - qualifiers - any qualifiers on the type - declarator - the declarator on the type - - Outputs: Returns a type declaration for a struct, containing the - body of the struct and in that body the padding parameters. - - Purpose: To generate C-like string for defining the given struct - -\*******************************************************************/ +/// To generate C-like string for defining the given struct +/// \param src: the struct type being converted +/// \param qualifiers: any qualifiers on the type +/// \param declarator: the declarator on the type +/// \return Returns a type declaration for a struct, containing the body of the +/// struct and in that body the padding parameters. std::string expr2ct::convert_struct_type( const typet &src, const std::string &qualifiers_str, @@ -729,26 +660,16 @@ std::string expr2ct::convert_struct_type( return convert_struct_type(src, qualifiers_str, declarator_str, true, true); } -/*******************************************************************\ - -Function: expr2ct::convert_struct_type - - Inputs: - src - the struct type being converted - qualifiers - any qualifiers on the type - declarator - the declarator on the type - inc_struct_body - when generating the code, should we include - a complete definition of the struct - inc_padding_components - should the padding parameters be included - Note this only makes sense if inc_struct_body - - Outputs: Returns a type declaration for a struct, optionally containing the - body of the struct (and in that body, optionally the padding - parameters). - - Purpose: To generate C-like string for declaring (or defining) the given struct - -\*******************************************************************/ +/// To generate C-like string for declaring (or defining) the given struct +/// \param src: the struct type being converted +/// \param qualifiers: any qualifiers on the type +/// \param declarator: the declarator on the type +/// \param inc_struct_body: when generating the code, should we include a +/// complete definition of the struct +/// \param inc_padding_components: should the padding parameters be included +/// Note this only makes sense if inc_struct_body +/// \return Returns a type declaration for a struct, optionally containing the +/// body of the struct (and in that body, optionally the padding parameters). std::string expr2ct::convert_struct_type( const typet &src, const std::string &qualifiers, @@ -798,22 +719,12 @@ std::string expr2ct::convert_struct_type( return dest; } -/*******************************************************************\ - -Function: expr2ct::convert_array_type - - Inputs: - src - The array type to convert - qualifier - declarator_str - - Outputs: A C-like type declaration of an array - - Purpose: To generate a C-like type declaration of an array. Includes - the size of the array in the [] - -\*******************************************************************/ - +/// To generate a C-like type declaration of an array. Includes the size of the +/// array in the [] +/// \param src: The array type to convert +/// qualifier +/// declarator_str +/// \return A C-like type declaration of an array std::string expr2ct::convert_array_type( const typet &src, const c_qualifierst &qualifiers, @@ -822,24 +733,14 @@ std::string expr2ct::convert_array_type( return convert_array_type(src, qualifiers, declarator_str, true); } -/*******************************************************************\ - -Function: expr2ct::convert_array_type - - Inputs: - src - The array type to convert - qualifier - declarator_str - inc_size_if_possible - Should the generated string include - the size of the array (if it is known). - - Outputs: A C-like type declaration of an array - - Purpose: To generate a C-like type declaration of an array. Optionally - can include or exclude the size of the array in the [] - -\*******************************************************************/ - +/// To generate a C-like type declaration of an array. Optionally can include or +/// exclude the size of the array in the [] +/// \param src: The array type to convert +/// qualifier +/// declarator_str +/// \param inc_size_if_possible: Should the generated string include the size of +/// the array (if it is known). +/// \return A C-like type declaration of an array std::string expr2ct::convert_array_type( const typet &src, const c_qualifierst &qualifiers, @@ -860,18 +761,6 @@ std::string expr2ct::convert_array_type( src.subtype(), qualifiers, declarator_str+array_suffix); } -/*******************************************************************\ - -Function: expr2ct::convert_typecast - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string expr2ct::convert_typecast( const typecast_exprt &src, unsigned &precedence) @@ -906,18 +795,6 @@ std::string expr2ct::convert_typecast( return dest; } -/*******************************************************************\ - -Function: expr2ct::convert_trinary - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string expr2ct::convert_trinary( const exprt &src, const std::string &symbol1, @@ -969,18 +846,6 @@ std::string expr2ct::convert_trinary( return dest; } -/*******************************************************************\ - -Function: expr2ct::convert_quantifier - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string expr2ct::convert_quantifier( const exprt &src, const std::string &symbol, @@ -1003,18 +868,6 @@ std::string expr2ct::convert_quantifier( return dest; } -/*******************************************************************\ - -Function: expr2ct::convert_with - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string expr2ct::convert_with( const exprt &src, unsigned precedence) @@ -1083,18 +936,6 @@ std::string expr2ct::convert_with( return dest; } -/*******************************************************************\ - -Function: expr2ct::convert_update - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string expr2ct::convert_update( const exprt &src, unsigned precedence) @@ -1139,18 +980,6 @@ std::string expr2ct::convert_update( return dest; } -/*******************************************************************\ - -Function: expr2ct::convert_cond - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string expr2ct::convert_cond( const exprt &src, unsigned precedence) @@ -1185,18 +1014,6 @@ std::string expr2ct::convert_cond( return dest; } -/*******************************************************************\ - -Function: expr2ct::convert_binary - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string expr2ct::convert_binary( const exprt &src, const std::string &symbol, @@ -1246,18 +1063,6 @@ std::string expr2ct::convert_binary( return dest; } -/*******************************************************************\ - -Function: expr2ct::convert_unary - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string expr2ct::convert_unary( const exprt &src, const std::string &symbol, @@ -1281,18 +1086,6 @@ std::string expr2ct::convert_unary( return dest; } -/*******************************************************************\ - -Function: expr2ct::convert_pointer_object_has_type - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string expr2ct::convert_pointer_object_has_type( const exprt &src, unsigned precedence) @@ -1313,18 +1106,6 @@ std::string expr2ct::convert_pointer_object_has_type( return dest; } -/*******************************************************************\ - -Function: expr2ct::convert_malloc - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string expr2ct::convert_malloc( const exprt &src, unsigned &precedence) @@ -1351,18 +1132,6 @@ std::string expr2ct::convert_malloc( return dest; } -/*******************************************************************\ - -Function: expr2ct::convert_nondet - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string expr2ct::convert_nondet( const exprt &src, unsigned &precedence) @@ -1373,18 +1142,6 @@ std::string expr2ct::convert_nondet( return "NONDET("+convert(src.type())+")"; } -/*******************************************************************\ - -Function: expr2ct::convert_statement_expression - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string expr2ct::convert_statement_expression( const exprt &src, unsigned &precedence) @@ -1396,18 +1153,6 @@ std::string expr2ct::convert_statement_expression( return "("+convert_code(to_code_block(to_code(src.op0())), 0)+")"; } -/*******************************************************************\ - -Function: expr2ct::convert_prob_coin - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string expr2ct::convert_prob_coin( const exprt &src, unsigned &precedence) @@ -1418,18 +1163,6 @@ std::string expr2ct::convert_prob_coin( return convert_norep(src, precedence); } -/*******************************************************************\ - -Function: expr2ct::convert_literal - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string expr2ct::convert_literal( const exprt &src, unsigned &precedence) @@ -1437,18 +1170,6 @@ std::string expr2ct::convert_literal( return "L("+src.get_string(ID_literal)+")"; } -/*******************************************************************\ - -Function: expr2ct::convert_prob_uniform - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string expr2ct::convert_prob_uniform( const exprt &src, unsigned &precedence) @@ -1459,18 +1180,6 @@ std::string expr2ct::convert_prob_uniform( return convert_norep(src, precedence); } -/*******************************************************************\ - -Function: expr2ct::convert_function - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string expr2ct::convert_function( const exprt &src, const std::string &name, @@ -1495,18 +1204,6 @@ std::string expr2ct::convert_function( return dest; } -/*******************************************************************\ - -Function: expr2ct::convert_comma - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string expr2ct::convert_comma( const exprt &src, unsigned precedence) @@ -1531,18 +1228,6 @@ std::string expr2ct::convert_comma( return dest; } -/*******************************************************************\ - -Function: expr2ct::convert_complex - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string expr2ct::convert_complex( const exprt &src, unsigned precedence) @@ -1594,18 +1279,6 @@ std::string expr2ct::convert_complex( return dest; } -/*******************************************************************\ - -Function: expr2ct::convert_array_of - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string expr2ct::convert_array_of( const exprt &src, unsigned precedence) @@ -1616,18 +1289,6 @@ std::string expr2ct::convert_array_of( return "ARRAY_OF("+convert(src.op0())+')'; } -/*******************************************************************\ - -Function: expr2ct::convert_byte_extract - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string expr2ct::convert_byte_extract( const exprt &src, unsigned precedence) @@ -1653,18 +1314,6 @@ std::string expr2ct::convert_byte_extract( return dest; } -/*******************************************************************\ - -Function: expr2ct::convert_byte_update - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string expr2ct::convert_byte_update( const exprt &src, unsigned precedence) @@ -1695,18 +1344,6 @@ std::string expr2ct::convert_byte_update( return dest; } -/*******************************************************************\ - -Function: expr2ct::convert_unary_post - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string expr2ct::convert_unary_post( const exprt &src, const std::string &symbol, @@ -1729,18 +1366,6 @@ std::string expr2ct::convert_unary_post( return dest; } -/*******************************************************************\ - -Function: expr2ct::convert_index - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string expr2ct::convert_index( const exprt &src, unsigned precedence) @@ -1765,18 +1390,6 @@ std::string expr2ct::convert_index( return dest; } -/*******************************************************************\ - -Function: expr2ct::convert_pointer_arithmetic - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string expr2ct::convert_pointer_arithmetic( const exprt &src, unsigned &precedence) { @@ -1814,18 +1427,6 @@ std::string expr2ct::convert_pointer_arithmetic( return dest; } -/*******************************************************************\ - -Function: expr2ct::convert_pointer_difference - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string expr2ct::convert_pointer_difference( const exprt &src, unsigned &precedence) { @@ -1863,18 +1464,6 @@ std::string expr2ct::convert_pointer_difference( return dest; } -/*******************************************************************\ - -Function: expr2ct::convert_member_designator - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string expr2ct::convert_member_designator(const exprt &src) { unsigned precedence; @@ -1885,18 +1474,6 @@ std::string expr2ct::convert_member_designator(const exprt &src) return "."+src.get_string(ID_component_name); } -/*******************************************************************\ - -Function: expr2ct::convert_index_designator - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string expr2ct::convert_index_designator(const exprt &src) { unsigned precedence; @@ -1907,18 +1484,6 @@ std::string expr2ct::convert_index_designator(const exprt &src) return "["+convert(src.op0())+"]"; } -/*******************************************************************\ - -Function: expr2ct::convert_member - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string expr2ct::convert_member( const member_exprt &src, unsigned precedence) @@ -1995,18 +1560,6 @@ std::string expr2ct::convert_member( return dest; } -/*******************************************************************\ - -Function: expr2ct::convert_array_member_value - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string expr2ct::convert_array_member_value( const exprt &src, unsigned precedence) @@ -2017,18 +1570,6 @@ std::string expr2ct::convert_array_member_value( return "[]="+convert(src.op0()); } -/*******************************************************************\ - -Function: expr2ct::convert_struct_member_value - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string expr2ct::convert_struct_member_value( const exprt &src, unsigned precedence) @@ -2039,18 +1580,6 @@ std::string expr2ct::convert_struct_member_value( return "."+src.get_string(ID_name)+"="+convert(src.op0()); } -/*******************************************************************\ - -Function: expr2ct::convert_norep - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string expr2ct::convert_norep( const exprt &src, unsigned &precedence) @@ -2062,18 +1591,6 @@ std::string expr2ct::convert_norep( return dest; } -/*******************************************************************\ - -Function: expr2ct::convert_symbol - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string expr2ct::convert_symbol( const exprt &src, unsigned &precedence) @@ -2116,18 +1633,6 @@ std::string expr2ct::convert_symbol( return dest; } -/*******************************************************************\ - -Function: expr2ct::convert_nondet_symbol - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string expr2ct::convert_nondet_symbol( const exprt &src, unsigned &precedence) @@ -2136,18 +1641,6 @@ std::string expr2ct::convert_nondet_symbol( return "nondet_symbol("+id+")"; } -/*******************************************************************\ - -Function: expr2ct::convert_predicate_symbol - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string expr2ct::convert_predicate_symbol( const exprt &src, unsigned &precedence) @@ -2156,18 +1649,6 @@ std::string expr2ct::convert_predicate_symbol( return "ps("+id+")"; } -/*******************************************************************\ - -Function: expr2ct::convert_predicate_next_symbol - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string expr2ct::convert_predicate_next_symbol( const exprt &src, unsigned &precedence) @@ -2176,18 +1657,6 @@ std::string expr2ct::convert_predicate_next_symbol( return "pns("+id+")"; } -/*******************************************************************\ - -Function: expr2ct::convert_predicate_passive_symbol - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string expr2ct::convert_predicate_passive_symbol( const exprt &src, unsigned &precedence) @@ -2196,18 +1665,6 @@ std::string expr2ct::convert_predicate_passive_symbol( return "pps("+id+")"; } -/*******************************************************************\ - -Function: expr2ct::convert_quantified_symbol - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string expr2ct::convert_quantified_symbol( const exprt &src, unsigned &precedence) @@ -2216,18 +1673,6 @@ std::string expr2ct::convert_quantified_symbol( return id; } -/*******************************************************************\ - -Function: expr2ct::convert_nondet_bool - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string expr2ct::convert_nondet_bool( const exprt &src, unsigned &precedence) @@ -2235,18 +1680,6 @@ std::string expr2ct::convert_nondet_bool( return "nondet_bool()"; } -/*******************************************************************\ - -Function: expr2ct::convert_object_descriptor - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string expr2ct::convert_object_descriptor( const exprt &src, unsigned &precedence) @@ -2271,18 +1704,6 @@ std::string expr2ct::convert_object_descriptor( return result; } -/*******************************************************************\ - -Function: expr2ct::convert_constant - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string expr2ct::convert_constant( const constant_exprt &src, unsigned &precedence) @@ -2508,19 +1929,10 @@ std::string expr2ct::convert_constant( return dest; } -/*******************************************************************\ - -Function: expr2ct::convert_constant_bool - - Inputs: - boolean_value - The value of the constant bool expression - - Outputs: Returns a C-like representation of the boolean value, - e.g. TRUE or FALSE. - - Purpose: To get the C-like representation of a given boolean value. - -\*******************************************************************/ +/// To get the C-like representation of a given boolean value. +/// \param boolean_value: The value of the constant bool expression +/// \return Returns a C-like representation of the boolean value, e.g. TRUE or +/// FALSE. std::string expr2ct::convert_constant_bool(bool boolean_value) { // C doesn't really have these @@ -2530,18 +1942,6 @@ std::string expr2ct::convert_constant_bool(bool boolean_value) return "FALSE"; } -/*******************************************************************\ - -Function: expr2ct::convert_struct - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string expr2ct::convert_struct( const exprt &src, unsigned &precedence) @@ -2549,23 +1949,13 @@ std::string expr2ct::convert_struct( return convert_struct(src, precedence, true); } -/*******************************************************************\ - -Function: expr2ct::convert_struct - - Inputs: - src - The struct declaration expression - precedence - include_padding_components - Should the generated C code - include the padding members added - to structs for GOTOs benifit - - Outputs: A string representation of the struct expression - - Purpose: To generate a C-like string representing a struct. Can optionally - include the padding parameters. - -\*******************************************************************/ +/// To generate a C-like string representing a struct. Can optionally include +/// the padding parameters. +/// \param src: The struct declaration expression +/// precedence +/// \param include_padding_components: Should the generated C code include the +/// padding members added to structs for GOTOs benifit +/// \return A string representation of the struct expression std::string expr2ct::convert_struct( const exprt &src, unsigned &precedence, @@ -2640,18 +2030,6 @@ std::string expr2ct::convert_struct( return dest; } -/*******************************************************************\ - -Function: expr2ct::convert_vector - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string expr2ct::convert_vector( const exprt &src, unsigned &precedence) @@ -2699,18 +2077,6 @@ std::string expr2ct::convert_vector( return dest; } -/*******************************************************************\ - -Function: expr2ct::convert_union - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string expr2ct::convert_union( const exprt &src, unsigned &precedence) @@ -2732,18 +2098,6 @@ std::string expr2ct::convert_union( return dest; } -/*******************************************************************\ - -Function: expr2ct::convert_array - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string expr2ct::convert_array( const exprt &src, unsigned &precedence) @@ -2850,18 +2204,6 @@ std::string expr2ct::convert_array( return dest; } -/*******************************************************************\ - -Function: expr2ct::convert_array_list - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string expr2ct::convert_array_list( const exprt &src, unsigned &precedence) @@ -2896,18 +2238,6 @@ std::string expr2ct::convert_array_list( return dest; } -/*******************************************************************\ - -Function: expr2ct::convert_initializer_list - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string expr2ct::convert_initializer_list( const exprt &src, unsigned &precedence) @@ -2936,18 +2266,6 @@ std::string expr2ct::convert_initializer_list( return dest; } -/*******************************************************************\ - -Function: expr2ct::convert_designated_initializer - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string expr2ct::convert_designated_initializer( const exprt &src, unsigned &precedence) @@ -2966,18 +2284,6 @@ std::string expr2ct::convert_designated_initializer( return dest; } -/*******************************************************************\ - -Function: expr2ct::convert_function_application - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string expr2ct::convert_function_application( const function_application_exprt &src, unsigned &precedence) @@ -3008,18 +2314,6 @@ std::string expr2ct::convert_function_application( return dest; } -/*******************************************************************\ - -Function: expr2ct::convert_side_effect_expr_function_call - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string expr2ct::convert_side_effect_expr_function_call( const side_effect_expr_function_callt &src, unsigned &precedence) @@ -3050,18 +2344,6 @@ std::string expr2ct::convert_side_effect_expr_function_call( return dest; } -/*******************************************************************\ - -Function: expr2ct::convert_overflow - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string expr2ct::convert_overflow( const exprt &src, unsigned &precedence) @@ -3093,35 +2375,11 @@ std::string expr2ct::convert_overflow( return dest; } -/*******************************************************************\ - -Function: expr2ct::indent_str - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string expr2ct::indent_str(unsigned indent) { return std::string(indent, ' '); } -/*******************************************************************\ - -Function: expr2ct::convert_code_asm - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string expr2ct::convert_code_asm( const code_asmt &src, unsigned indent) @@ -3200,18 +2458,6 @@ std::string expr2ct::convert_code_asm( return dest; } -/*******************************************************************\ - -Function: expr2ct::convert_code_while - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string expr2ct::convert_code_while( const code_whilet &src, unsigned indent) @@ -3238,18 +2484,6 @@ std::string expr2ct::convert_code_while( return dest; } -/*******************************************************************\ - -Function: expr2ct::convert_code_dowhile - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string expr2ct::convert_code_dowhile( const code_dowhilet &src, unsigned indent) @@ -3279,18 +2513,6 @@ std::string expr2ct::convert_code_dowhile( return dest; } -/*******************************************************************\ - -Function: expr2ct::convert_code_ifthenelse - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string expr2ct::convert_code_ifthenelse( const code_ifthenelset &src, unsigned indent) @@ -3328,18 +2550,6 @@ std::string expr2ct::convert_code_ifthenelse( return dest; } -/*******************************************************************\ - -Function: expr2ct::convert_code_return - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string expr2ct::convert_code_return( const codet &src, unsigned indent) @@ -3362,18 +2572,6 @@ std::string expr2ct::convert_code_return( return dest; } -/*******************************************************************\ - -Function: expr2ct::convert_code_goto - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string expr2ct::convert_code_goto( const codet &src, unsigned indent) @@ -3386,18 +2584,6 @@ std::string expr2ct::convert_code_goto( return dest; } -/*******************************************************************\ - -Function: expr2ct::convert_code_break - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string expr2ct::convert_code_break( const codet &src, unsigned indent) @@ -3409,18 +2595,6 @@ std::string expr2ct::convert_code_break( return dest; } -/*******************************************************************\ - -Function: expr2ct::convert_code_switch - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string expr2ct::convert_code_switch( const codet &src, unsigned indent) @@ -3464,18 +2638,6 @@ std::string expr2ct::convert_code_switch( return dest; } -/*******************************************************************\ - -Function: expr2ct::convert_code_continue - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string expr2ct::convert_code_continue( const codet &src, unsigned indent) @@ -3487,18 +2649,6 @@ std::string expr2ct::convert_code_continue( return dest; } -/*******************************************************************\ - -Function: expr2ct::convert_code_decl - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string expr2ct::convert_code_decl( const codet &src, unsigned indent) @@ -3539,18 +2689,6 @@ std::string expr2ct::convert_code_decl( return dest; } -/*******************************************************************\ - -Function: expr2ct::convert_code_dead - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string expr2ct::convert_code_dead( const codet &src, unsigned indent) @@ -3565,18 +2703,6 @@ std::string expr2ct::convert_code_dead( return "dead "+convert(src.op0())+";"; } -/*******************************************************************\ - -Function: expr2ct::convert_code_for - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string expr2ct::convert_code_for( const code_fort &src, unsigned indent) @@ -3614,18 +2740,6 @@ std::string expr2ct::convert_code_for( return dest; } -/*******************************************************************\ - -Function: expr2ct::convert_code_block - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string expr2ct::convert_code_block( const code_blockt &src, unsigned indent) @@ -3649,18 +2763,6 @@ std::string expr2ct::convert_code_block( return dest; } -/*******************************************************************\ - -Function: expr2ct::convert_code_decl_block - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string expr2ct::convert_code_decl_block( const codet &src, unsigned indent) @@ -3676,18 +2778,6 @@ std::string expr2ct::convert_code_decl_block( return dest; } -/*******************************************************************\ - -Function: expr2ct::convert_code_expression - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string expr2ct::convert_code_expression( const codet &src, unsigned indent) @@ -3710,18 +2800,6 @@ std::string expr2ct::convert_code_expression( return dest; } -/*******************************************************************\ - -Function: expr2ct::convert_code - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string expr2ct::convert_code( const codet &src, unsigned indent) @@ -3845,18 +2923,6 @@ std::string expr2ct::convert_code( return convert_norep(src, precedence); } -/*******************************************************************\ - -Function: expr2ct::convert_code_assign - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string expr2ct::convert_code_assign( const code_assignt &src, unsigned indent) @@ -3868,18 +2934,6 @@ std::string expr2ct::convert_code_assign( return dest; } -/*******************************************************************\ - -Function: expr2ct::convert_code_free - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string expr2ct::convert_code_free( const codet &src, unsigned indent) @@ -3893,18 +2947,6 @@ std::string expr2ct::convert_code_free( return indent_str(indent)+"FREE("+convert(src.op0())+");"; } -/*******************************************************************\ - -Function: expr2ct::convert_code_init - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string expr2ct::convert_code_init( const codet &src, unsigned indent) @@ -3914,18 +2956,6 @@ std::string expr2ct::convert_code_init( return indent_str(indent)+"INIT "+tmp+";"; } -/*******************************************************************\ - -Function: expr2ct::convert_code_lock - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string expr2ct::convert_code_lock( const codet &src, unsigned indent) @@ -3939,18 +2969,6 @@ std::string expr2ct::convert_code_lock( return indent_str(indent)+"LOCK("+convert(src.op0())+");"; } -/*******************************************************************\ - -Function: expr2ct::convert_code_unlock - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string expr2ct::convert_code_unlock( const codet &src, unsigned indent) @@ -3964,18 +2982,6 @@ std::string expr2ct::convert_code_unlock( return indent_str(indent)+"UNLOCK("+convert(src.op0())+");"; } -/*******************************************************************\ - -Function: expr2ct::convert_code_function_call - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string expr2ct::convert_code_function_call( const code_function_callt &src, unsigned indent) @@ -4024,18 +3030,6 @@ std::string expr2ct::convert_code_function_call( return dest; } -/*******************************************************************\ - -Function: expr2ct::convert_code_printf - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string expr2ct::convert_code_printf( const codet &src, unsigned indent) @@ -4058,18 +3052,6 @@ std::string expr2ct::convert_code_printf( return dest; } -/*******************************************************************\ - -Function: expr2ct::convert_code_fence - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string expr2ct::convert_code_fence( const codet &src, unsigned indent) @@ -4100,18 +3082,6 @@ std::string expr2ct::convert_code_fence( return dest; } -/*******************************************************************\ - -Function: expr2ct::convert_code_input - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string expr2ct::convert_code_input( const codet &src, unsigned indent) @@ -4134,18 +3104,6 @@ std::string expr2ct::convert_code_input( return dest; } -/*******************************************************************\ - -Function: expr2ct::convert_code_output - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string expr2ct::convert_code_output( const codet &src, unsigned indent) @@ -4167,18 +3125,6 @@ std::string expr2ct::convert_code_output( return dest; } -/*******************************************************************\ - -Function: expr2ct::convert_code_array_set - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string expr2ct::convert_code_array_set( const codet &src, unsigned indent) @@ -4201,18 +3147,6 @@ std::string expr2ct::convert_code_array_set( return dest; } -/*******************************************************************\ - -Function: expr2ct::convert_code_array_copy - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string expr2ct::convert_code_array_copy( const codet &src, unsigned indent) @@ -4235,18 +3169,6 @@ std::string expr2ct::convert_code_array_copy( return dest; } -/*******************************************************************\ - -Function: expr2ct::convert_code_assert - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string expr2ct::convert_code_assert( const codet &src, unsigned indent) @@ -4260,18 +3182,6 @@ std::string expr2ct::convert_code_assert( return indent_str(indent)+"assert("+convert(src.op0())+");"; } -/*******************************************************************\ - -Function: expr2ct::convert_code_assume - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string expr2ct::convert_code_assume( const codet &src, unsigned indent) @@ -4285,18 +3195,6 @@ std::string expr2ct::convert_code_assume( return indent_str(indent)+"__CPROVER_assume("+convert(src.op0())+");"; } -/*******************************************************************\ - -Function: expr2ct::convert_code_label - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string expr2ct::convert_code_label( const code_labelt &src, unsigned indent) @@ -4315,18 +3213,6 @@ std::string expr2ct::convert_code_label( return labels_string+tmp; } -/*******************************************************************\ - -Function: expr2ct::convert_code_switch_case - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string expr2ct::convert_code_switch_case( const code_switch_caset &src, unsigned indent) @@ -4357,35 +3243,11 @@ std::string expr2ct::convert_code_switch_case( return labels_string+tmp; } -/*******************************************************************\ - -Function: expr2ct::convert_code - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string expr2ct::convert_code(const codet &src) { return convert_code(src, 0); } -/*******************************************************************\ - -Function: expr2ct::convert_Hoare - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string expr2ct::convert_Hoare(const exprt &src) { unsigned precedence; @@ -4429,18 +3291,6 @@ std::string expr2ct::convert_Hoare(const exprt &src) return dest; } -/*******************************************************************\ - -Function: expr2ct::convert_extractbit - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string expr2ct::convert_extractbit( const exprt &src, unsigned precedence) @@ -4456,18 +3306,6 @@ std::string expr2ct::convert_extractbit( return dest; } -/*******************************************************************\ - -Function: expr2ct::convert_extractbits - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string expr2ct::convert_extractbits( const exprt &src, unsigned precedence) @@ -4485,18 +3323,6 @@ std::string expr2ct::convert_extractbits( return dest; } -/*******************************************************************\ - -Function: expr2ct::convert_sizeof - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string expr2ct::convert_sizeof( const exprt &src, unsigned &precedence) @@ -4511,18 +3337,6 @@ std::string expr2ct::convert_sizeof( return dest; } -/*******************************************************************\ - -Function: expr2ct::convert - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string expr2ct::convert_with_precedence( const exprt &src, unsigned &precedence) @@ -5027,36 +3841,12 @@ std::string expr2ct::convert_with_precedence( return convert_norep(src, precedence); } -/*******************************************************************\ - -Function: expr2ct::convert - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string expr2ct::convert(const exprt &src) { unsigned precedence; return convert_with_precedence(src, precedence); } -/*******************************************************************\ - -Function: expr2c - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string expr2c(const exprt &expr, const namespacet &ns) { std::string code; @@ -5065,18 +3855,6 @@ std::string expr2c(const exprt &expr, const namespacet &ns) return expr2c.convert(expr); } -/*******************************************************************\ - -Function: type2c - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string type2c(const typet &type, const namespacet &ns) { expr2ct expr2c(ns); diff --git a/src/ansi-c/file_converter.cpp b/src/ansi-c/file_converter.cpp index 1a3aecab1a3..f45dec56984 100644 --- a/src/ansi-c/file_converter.cpp +++ b/src/ansi-c/file_converter.cpp @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Convert file contents to C strings + #include #include diff --git a/src/ansi-c/library/jsa.h b/src/ansi-c/library/jsa.h index 20f68ad371d..4859e34a927 100644 --- a/src/ansi-c/library/jsa.h +++ b/src/ansi-c/library/jsa.h @@ -7,6 +7,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Counterexample-Guided Inductive Synthesis + /* FUNCTION: __CPROVER_jsa_synthesise */ #ifndef CPROVER_ANSI_C_LIBRARY_JSA_H diff --git a/src/ansi-c/literals/convert_character_literal.cpp b/src/ansi-c/literals/convert_character_literal.cpp index f76af2eefa6..f494634b7a0 100644 --- a/src/ansi-c/literals/convert_character_literal.cpp +++ b/src/ansi-c/literals/convert_character_literal.cpp @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// C Language Conversion + #include #include @@ -16,18 +19,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "unescape_string.h" #include "convert_character_literal.h" -/*******************************************************************\ - -Function: convert_character_literal - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - exprt convert_character_literal( const std::string &src, bool force_integer_type) diff --git a/src/ansi-c/literals/convert_character_literal.h b/src/ansi-c/literals/convert_character_literal.h index 4c497db73cd..797457a3970 100644 --- a/src/ansi-c/literals/convert_character_literal.h +++ b/src/ansi-c/literals/convert_character_literal.h @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// C++ Language Conversion + #ifndef CPROVER_ANSI_C_LITERALS_CONVERT_CHARACTER_LITERAL_H #define CPROVER_ANSI_C_LITERALS_CONVERT_CHARACTER_LITERAL_H diff --git a/src/ansi-c/literals/convert_float_literal.cpp b/src/ansi-c/literals/convert_float_literal.cpp index 7e72f6e6f53..87094fb5e0b 100644 --- a/src/ansi-c/literals/convert_float_literal.cpp +++ b/src/ansi-c/literals/convert_float_literal.cpp @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// C++ Language Conversion + #include #include @@ -19,18 +22,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "parse_float.h" #include "convert_float_literal.h" -/*******************************************************************\ - -Function: convert_float_literal - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - exprt convert_float_literal(const std::string &src) { mp_integer significand; diff --git a/src/ansi-c/literals/convert_float_literal.h b/src/ansi-c/literals/convert_float_literal.h index 4c76abbd312..5aa627ace8c 100644 --- a/src/ansi-c/literals/convert_float_literal.h +++ b/src/ansi-c/literals/convert_float_literal.h @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// C Language Conversion + #ifndef CPROVER_ANSI_C_LITERALS_CONVERT_FLOAT_LITERAL_H #define CPROVER_ANSI_C_LITERALS_CONVERT_FLOAT_LITERAL_H diff --git a/src/ansi-c/literals/convert_integer_literal.cpp b/src/ansi-c/literals/convert_integer_literal.cpp index d7c832dee31..d14c5c92b24 100644 --- a/src/ansi-c/literals/convert_integer_literal.cpp +++ b/src/ansi-c/literals/convert_integer_literal.cpp @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// C++ Language Conversion + #include #include @@ -17,18 +20,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "convert_integer_literal.h" -/*******************************************************************\ - -Function: convert_integer_literal - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - exprt convert_integer_literal(const std::string &src) { bool is_unsigned=false, is_imaginary=false; diff --git a/src/ansi-c/literals/convert_integer_literal.h b/src/ansi-c/literals/convert_integer_literal.h index 5ce3847fdb6..27c231d3790 100644 --- a/src/ansi-c/literals/convert_integer_literal.h +++ b/src/ansi-c/literals/convert_integer_literal.h @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// C++ Language Conversion + #ifndef CPROVER_ANSI_C_LITERALS_CONVERT_INTEGER_LITERAL_H #define CPROVER_ANSI_C_LITERALS_CONVERT_INTEGER_LITERAL_H diff --git a/src/ansi-c/literals/convert_string_literal.cpp b/src/ansi-c/literals/convert_string_literal.cpp index 4176581afe2..2589cdf122a 100644 --- a/src/ansi-c/literals/convert_string_literal.cpp +++ b/src/ansi-c/literals/convert_string_literal.cpp @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// C/C++ Language Conversion + #include #include @@ -17,18 +20,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "unescape_string.h" #include "convert_string_literal.h" -/*******************************************************************\ - -Function: convert_one_string_literal - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::basic_string convert_one_string_literal( const std::string &src) { @@ -79,18 +70,6 @@ std::basic_string convert_one_string_literal( } } -/*******************************************************************\ - -Function: convert_string_literal - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - exprt convert_string_literal(const std::string &src) { // note that 'src' could be a concatenation of string literals, diff --git a/src/ansi-c/literals/convert_string_literal.h b/src/ansi-c/literals/convert_string_literal.h index f634a1dfb1f..16b7e5e5929 100644 --- a/src/ansi-c/literals/convert_string_literal.h +++ b/src/ansi-c/literals/convert_string_literal.h @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// C/C++ Language Conversion + #ifndef CPROVER_ANSI_C_LITERALS_CONVERT_STRING_LITERAL_H #define CPROVER_ANSI_C_LITERALS_CONVERT_STRING_LITERAL_H diff --git a/src/ansi-c/literals/parse_float.cpp b/src/ansi-c/literals/parse_float.cpp index 674e986e35a..e5c67ea4d70 100644 --- a/src/ansi-c/literals/parse_float.cpp +++ b/src/ansi-c/literals/parse_float.cpp @@ -6,22 +6,13 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Conversion of Expressions + #include #include "parse_float.h" -/*******************************************************************\ - -Function: convert_ct::parse_float - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void parse_float( const std::string &src, mp_integer &significand, diff --git a/src/ansi-c/literals/parse_float.h b/src/ansi-c/literals/parse_float.h index 7edb55a08b7..b750c0cd77b 100644 --- a/src/ansi-c/literals/parse_float.h +++ b/src/ansi-c/literals/parse_float.h @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// ANSI-C Conversion / Type Checking + #ifndef CPROVER_ANSI_C_LITERALS_PARSE_FLOAT_H #define CPROVER_ANSI_C_LITERALS_PARSE_FLOAT_H diff --git a/src/ansi-c/literals/unescape_string.cpp b/src/ansi-c/literals/unescape_string.cpp index 6ecfadc703d..c5177be1ad5 100644 --- a/src/ansi-c/literals/unescape_string.cpp +++ b/src/ansi-c/literals/unescape_string.cpp @@ -6,24 +6,15 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// ANSI-C Language Conversion + #include #include #include #include "unescape_string.h" -/*******************************************************************\ - -Function: unescape_string - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string unescape_string(const std::string &src) { std::string dest; @@ -134,18 +125,6 @@ std::string unescape_string(const std::string &src) return dest; } -/*******************************************************************\ - -Function: unescape_wide_string - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::basic_string unescape_wide_string( const std::string &src) { @@ -256,18 +235,6 @@ std::basic_string unescape_wide_string( return dest; } -/*******************************************************************\ - -Function: hex_to_unsigned - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - unsigned hex_to_unsigned(const char *hex, std::size_t digits) { unsigned value=0; @@ -290,18 +257,6 @@ unsigned hex_to_unsigned(const char *hex, std::size_t digits) return value; } -/*******************************************************************\ - -Function: octal_to_unsigned - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - unsigned octal_to_unsigned(const char *octal, std::size_t digits) { unsigned value=0; diff --git a/src/ansi-c/literals/unescape_string.h b/src/ansi-c/literals/unescape_string.h index 9d672cde19c..be6f1a18093 100644 --- a/src/ansi-c/literals/unescape_string.h +++ b/src/ansi-c/literals/unescape_string.h @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// ANSI-C Language Conversion + #ifndef CPROVER_ANSI_C_LITERALS_UNESCAPE_STRING_H #define CPROVER_ANSI_C_LITERALS_UNESCAPE_STRING_H diff --git a/src/ansi-c/padding.cpp b/src/ansi-c/padding.cpp index 16391ee33a7..24b40649ca2 100644 --- a/src/ansi-c/padding.cpp +++ b/src/ansi-c/padding.cpp @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// C++ Language Type Checking + #include #include @@ -15,18 +18,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "padding.h" -/*******************************************************************\ - -Function: alignment - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - mp_integer alignment(const typet &type, const namespacet &ns) { // we need to consider a number of different cases: @@ -114,18 +105,6 @@ mp_integer alignment(const typet &type, const namespacet &ns) return result; } -/*******************************************************************\ - -Function: add_padding - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void add_padding(struct_typet &type, const namespacet &ns) { struct_typet::componentst &components=type.components(); @@ -322,18 +301,6 @@ void add_padding(struct_typet &type, const namespacet &ns) } } -/*******************************************************************\ - -Function: add_padding - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void add_padding(union_typet &type, const namespacet &ns) { mp_integer max_alignment=alignment(type, ns)*8; diff --git a/src/ansi-c/padding.h b/src/ansi-c/padding.h index 18634a61559..27fb6fda099 100644 --- a/src/ansi-c/padding.h +++ b/src/ansi-c/padding.h @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// ANSI-C Language Type Checking + #ifndef CPROVER_ANSI_C_PADDING_H #define CPROVER_ANSI_C_PADDING_H diff --git a/src/ansi-c/preprocessor_line.cpp b/src/ansi-c/preprocessor_line.cpp index a9b651fc3f7..b3b2ea1e2c5 100644 --- a/src/ansi-c/preprocessor_line.cpp +++ b/src/ansi-c/preprocessor_line.cpp @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// ANSI-C Language Conversion + #include #include @@ -14,18 +17,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "literals/unescape_string.h" #include "preprocessor_line.h" -/*******************************************************************\ - -Function: preprocessor_line - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void preprocessor_line( const char *text, parsert &parser) diff --git a/src/ansi-c/preprocessor_line.h b/src/ansi-c/preprocessor_line.h index 5222fdd83d9..bd18aa636fe 100644 --- a/src/ansi-c/preprocessor_line.h +++ b/src/ansi-c/preprocessor_line.h @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// ANSI-C Language Conversion + #ifndef CPROVER_ANSI_C_PREPROCESSOR_LINE_H #define CPROVER_ANSI_C_PREPROCESSOR_LINE_H diff --git a/src/ansi-c/printf_formatter.cpp b/src/ansi-c/printf_formatter.cpp index 31ddfa735f2..e1431798e2a 100644 --- a/src/ansi-c/printf_formatter.cpp +++ b/src/ansi-c/printf_formatter.cpp @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// printf Formatting + #include #include @@ -15,18 +18,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "c_types.h" #include "printf_formatter.h" -/*******************************************************************\ - -Function: printf_formattert::make_type - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - const exprt printf_formattert::make_type( const exprt &src, const typet &dest) { @@ -38,18 +29,6 @@ const exprt printf_formattert::make_type( return tmp; } -/*******************************************************************\ - -Function: printf_formattert::operator() - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void printf_formattert::operator()( const std::string &_format, const std::list &_operands) @@ -58,18 +37,6 @@ void printf_formattert::operator()( operands=_operands; } -/*******************************************************************\ - -Function: printf_formattert::print() - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void printf_formattert::print(std::ostream &out) { format_pos=0; @@ -85,18 +52,6 @@ void printf_formattert::print(std::ostream &out) } } -/*******************************************************************\ - -Function: printf_formattert::as_string() - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string printf_formattert::as_string() { std::ostringstream stream; @@ -104,18 +59,6 @@ std::string printf_formattert::as_string() return stream.str(); } -/*******************************************************************\ - -Function: printf_formattert::process_format - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void printf_formattert::process_format(std::ostream &out) { exprt tmp; @@ -236,18 +179,6 @@ void printf_formattert::process_format(std::ostream &out) } } -/*******************************************************************\ - -Function: printf_formattert::process_char - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void printf_formattert::process_char(std::ostream &out) { char ch=next(); diff --git a/src/ansi-c/printf_formatter.h b/src/ansi-c/printf_formatter.h index 4048af9a6a4..2cc36b87d1e 100644 --- a/src/ansi-c/printf_formatter.h +++ b/src/ansi-c/printf_formatter.h @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// printf Formatting + #ifndef CPROVER_ANSI_C_PRINTF_FORMATTER_H #define CPROVER_ANSI_C_PRINTF_FORMATTER_H diff --git a/src/ansi-c/string_constant.cpp b/src/ansi-c/string_constant.cpp index 6576a99ea5b..9f09a2abed0 100644 --- a/src/ansi-c/string_constant.cpp +++ b/src/ansi-c/string_constant.cpp @@ -12,54 +12,18 @@ Author: Daniel Kroening, kroening@kroening.com #include "string_constant.h" #include "c_types.h" -/*******************************************************************\ - -Function: string_constantt::string_constantt - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - string_constantt::string_constantt(): exprt(ID_string_constant) { set_value(irep_idt()); } -/*******************************************************************\ - -Function: string_constantt::string_constantt - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - string_constantt::string_constantt(const irep_idt &_value): exprt(ID_string_constant) { set_value(_value); } -/*******************************************************************\ - -Function: string_constantt::set_value - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void string_constantt::set_value(const irep_idt &value) { exprt size_expr=from_integer(value.size()+1, index_type()); @@ -67,18 +31,7 @@ void string_constantt::set_value(const irep_idt &value) set(ID_value, value); } -/*******************************************************************\ - -Function: string_constantt:to_array_expr - - Inputs: - - Outputs: - - Purpose: convert string into array constant - -\*******************************************************************/ - +/// convert string into array constant array_exprt string_constantt::to_array_expr() const { const std::string &str=get_string(ID_value); @@ -119,18 +72,8 @@ array_exprt string_constantt::to_array_expr() const return dest; } -/*******************************************************************\ - -Function: string_constantt:from_array_expr - - Inputs: - - Outputs: true on error - - Purpose: convert array constant into string - -\*******************************************************************/ - +/// convert array constant into string +/// \return true on error bool string_constantt::from_array_expr(const array_exprt &src) { id(ID_string_constant); diff --git a/src/ansi-c/type2name.cpp b/src/ansi-c/type2name.cpp index fdcf6b0a276..6e3ce05b757 100644 --- a/src/ansi-c/type2name.cpp +++ b/src/ansi-c/type2name.cpp @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@cs.cmu.edu \*******************************************************************/ +/// \file +/// Type Naming for C + #include #include #include @@ -22,18 +25,6 @@ static std::string type2name( const namespacet &ns, symbol_numbert &symbol_number); -/*******************************************************************\ - -Function: type2name_symbol - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - static std::string type2name_symbol( const typet &type, const namespacet &ns, @@ -90,18 +81,6 @@ static std::string type2name_symbol( return result; } -/*******************************************************************\ - -Function: type2name - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - static bool parent_is_sym_check=false; static std::string type2name( const typet &type, @@ -278,18 +257,6 @@ static std::string type2name( return result; } -/*******************************************************************\ - -Function: type2name - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string type2name(const typet &type, const namespacet &ns) { parent_is_sym_check=true; @@ -297,18 +264,6 @@ std::string type2name(const typet &type, const namespacet &ns) return type2name(type, ns, symbol_number); } -/*******************************************************************\ - -Function: type2name - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string type2name(const typet &type) { symbol_tablet symbol_table; diff --git a/src/ansi-c/type2name.h b/src/ansi-c/type2name.h index b7299617e7f..b8d2d5c0e05 100644 --- a/src/ansi-c/type2name.h +++ b/src/ansi-c/type2name.h @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@cs.cmu.edu \*******************************************************************/ +/// \file +/// Type Naming for C + #ifndef CPROVER_ANSI_C_TYPE2NAME_H #define CPROVER_ANSI_C_TYPE2NAME_H diff --git a/src/assembler/assembler_parser.cpp b/src/assembler/assembler_parser.cpp index 59367857340..045572b7d1f 100644 --- a/src/assembler/assembler_parser.cpp +++ b/src/assembler/assembler_parser.cpp @@ -12,18 +12,6 @@ Author: Daniel Kroening, kroening@kroening.com assembler_parsert assembler_parser; -/*******************************************************************\ - -Function: yyassemblererror - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - extern char *yyassemblertext; int yyassemblererror(const std::string &error) diff --git a/src/cbmc/all_properties.cpp b/src/cbmc/all_properties.cpp index 2534ba7827a..bd9c5242dd4 100644 --- a/src/cbmc/all_properties.cpp +++ b/src/cbmc/all_properties.cpp @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Symbolic Execution of ANSI-C + #include #include @@ -23,18 +26,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "all_properties_class.h" -/*******************************************************************\ - -Function: bmc_all_propertiest::goal_covered - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void bmc_all_propertiest::goal_covered(const cover_goalst::goalt &) { for(auto &g : goal_map) @@ -61,18 +52,6 @@ void bmc_all_propertiest::goal_covered(const cover_goalst::goalt &) } } -/*******************************************************************\ - -Function: bmc_all_propertiest::operator() - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - safety_checkert::resultt bmc_all_propertiest::operator()() { status() << "Passing problem to " << solver.decision_procedure_text() << eom; @@ -178,18 +157,6 @@ safety_checkert::resultt bmc_all_propertiest::operator()() return safe?safety_checkert::resultt::SAFE:safety_checkert::resultt::UNSAFE; } -/*******************************************************************\ - -Function: bmc_all_propertiest::report() - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void bmc_all_propertiest::report(const cover_goalst &cover_goals) { switch(bmc.ui) @@ -263,18 +230,6 @@ void bmc_all_propertiest::report(const cover_goalst &cover_goals) } } -/*******************************************************************\ - -Function: bmct::all_properties - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - safety_checkert::resultt bmct::all_properties( const goto_functionst &goto_functions, prop_convt &solver) diff --git a/src/cbmc/all_properties_class.h b/src/cbmc/all_properties_class.h index 1f3fc27960a..89c4614cc12 100644 --- a/src/cbmc/all_properties_class.h +++ b/src/cbmc/all_properties_class.h @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Symbolic Execution of ANSI-C + #ifndef CPROVER_CBMC_ALL_PROPERTIES_CLASS_H #define CPROVER_CBMC_ALL_PROPERTIES_CLASS_H @@ -13,18 +16,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "bmc.h" -/*******************************************************************\ - - Class: bmc_all_propertiest - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - class bmc_all_propertiest: public cover_goalst::observert, public messaget diff --git a/src/cbmc/bmc.cpp b/src/cbmc/bmc.cpp index 0a8fd5053c8..f92483d2441 100644 --- a/src/cbmc/bmc.cpp +++ b/src/cbmc/bmc.cpp @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Symbolic Execution of ANSI-C + #include #include #include @@ -39,35 +42,11 @@ Author: Daniel Kroening, kroening@kroening.com #include "fault_localization.h" #include "bmc.h" -/*******************************************************************\ - -Function: bmct::do_unwind_module - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void bmct::do_unwind_module() { // this is a hook for hw-cbmc } -/*******************************************************************\ - -Function: bmct::error_trace - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void bmct::error_trace() { status() << "Building error trace" << eom; @@ -109,18 +88,7 @@ void bmct::error_trace() } } -/*******************************************************************\ - -Function: bmct::output_graphml - - Inputs: - - Outputs: - - Purpose: outputs witnesses in graphml format - -\*******************************************************************/ - +/// outputs witnesses in graphml format void bmct::output_graphml( resultt result, const goto_functionst &goto_functions) @@ -146,18 +114,6 @@ void bmct::output_graphml( } } -/*******************************************************************\ - -Function: bmct::do_conversion - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void bmct::do_conversion() { // convert HDL (hook for hw-cbmc) @@ -178,18 +134,6 @@ void bmct::do_conversion() } } -/*******************************************************************\ - -Function: bmct::run_decision_procedure - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - decision_proceduret::resultt bmct::run_decision_procedure(prop_convt &prop_conv) { @@ -217,18 +161,6 @@ bmct::run_decision_procedure(prop_convt &prop_conv) return dec_result; } -/*******************************************************************\ - -Function: bmct::report_success - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void bmct::report_success() { result() << "VERIFICATION SUCCESSFUL" << eom; @@ -257,18 +189,6 @@ void bmct::report_success() } } -/*******************************************************************\ - -Function: bmct::report_failure - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void bmct::report_failure() { result() << "VERIFICATION FAILED" << eom; @@ -297,18 +217,6 @@ void bmct::report_failure() } } -/*******************************************************************\ - -Function: bmct::show_program - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void bmct::show_program() { unsigned count=1; @@ -398,18 +306,6 @@ void bmct::show_program() } } -/*******************************************************************\ - -Function: bmct::run - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - safety_checkert::resultt bmct::run( const goto_functionst &goto_functions) { @@ -595,18 +491,6 @@ safety_checkert::resultt bmct::run( } } -/*******************************************************************\ - -Function: bmct::decide - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - safety_checkert::resultt bmct::decide( const goto_functionst &goto_functions, prop_convt &prop_conv) @@ -619,18 +503,6 @@ safety_checkert::resultt bmct::decide( return all_properties(goto_functions, prop_conv); } -/*******************************************************************\ - -Function: bmct::stop_on_fail - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - safety_checkert::resultt bmct::stop_on_fail( const goto_functionst &goto_functions, prop_convt &prop_conv) @@ -667,18 +539,6 @@ safety_checkert::resultt bmct::stop_on_fail( } } -/*******************************************************************\ - -Function: bmct::setup_unwind - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void bmct::setup_unwind() { const std::string &set=options.get_option("unwindset"); diff --git a/src/cbmc/bmc.h b/src/cbmc/bmc.h index 33d73005c1a..4c69fab527c 100644 --- a/src/cbmc/bmc.h +++ b/src/cbmc/bmc.h @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Bounded Model Checking for ANSI-C + HDL + #ifndef CPROVER_CBMC_BMC_H #define CPROVER_CBMC_BMC_H diff --git a/src/cbmc/bmc_cover.cpp b/src/cbmc/bmc_cover.cpp index fd900dda14d..4c101cc2159 100644 --- a/src/cbmc/bmc_cover.cpp +++ b/src/cbmc/bmc_cover.cpp @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Test-Suite Generation with BMC + #include #include @@ -24,18 +27,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "bmc.h" #include "bv_cbmc.h" -/*******************************************************************\ - - Class: bmc_covert - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - class bmc_covert: public cover_goalst::observert, public messaget @@ -149,18 +140,6 @@ class bmc_covert: bmct &bmc; }; -/*******************************************************************\ - -Function: bmc_covert::satisfying_assignment - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void bmc_covert::satisfying_assignment() { tests.push_back(testt()); @@ -210,18 +189,6 @@ void bmc_covert::satisfying_assignment() #endif } -/*******************************************************************\ - -Function: bmc_covert::operator() - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool bmc_covert::operator()() { status() << "Passing problem to " << solver.decision_procedure_text() << eom; @@ -463,18 +430,7 @@ bool bmc_covert::operator()() return false; } -/*******************************************************************\ - -Function: bmct::cover - - Inputs: - - Outputs: - - Purpose: Try to cover all goals - -\*******************************************************************/ - +/// Try to cover all goals bool bmct::cover( const goto_functionst &goto_functions, const optionst::value_listt &criteria) diff --git a/src/cbmc/bv_cbmc.cpp b/src/cbmc/bv_cbmc.cpp index 830507c0099..6445c6e0295 100644 --- a/src/cbmc/bv_cbmc.cpp +++ b/src/cbmc/bv_cbmc.cpp @@ -11,18 +11,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "bv_cbmc.h" -/*******************************************************************\ - -Function: bv_cbmct::convert_waitfor - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bvt bv_cbmct::convert_waitfor(const exprt &expr) { if(expr.operands().size()!=4) @@ -144,18 +132,6 @@ bvt bv_cbmct::convert_waitfor(const exprt &expr) return convert_bitvector(new_cycle); } -/*******************************************************************\ - -Function: bv_cbmct::convert_waitfor_symbol - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bvt bv_cbmct::convert_waitfor_symbol(const exprt &expr) { if(expr.operands().size()!=1) @@ -179,18 +155,6 @@ bvt bv_cbmct::convert_waitfor_symbol(const exprt &expr) return convert_bitvector(result); } -/*******************************************************************\ - -Function: bv_cbmct::convert_bitvector - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bvt bv_cbmct::convert_bitvector(const exprt &expr) { if(expr.id()=="waitfor") diff --git a/src/cbmc/cbmc_dimacs.cpp b/src/cbmc/cbmc_dimacs.cpp index 4df2dfbbed9..8584c8fac4b 100644 --- a/src/cbmc/cbmc_dimacs.cpp +++ b/src/cbmc/cbmc_dimacs.cpp @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Writing DIMACS Files + #include #include @@ -13,18 +16,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "cbmc_dimacs.h" -/*******************************************************************\ - -Function: cbmc_dimacst::write_dimacs - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool cbmc_dimacst::write_dimacs(const std::string &filename) { if(filename.empty() || filename=="-") @@ -41,18 +32,6 @@ bool cbmc_dimacst::write_dimacs(const std::string &filename) return write_dimacs(out); } -/*******************************************************************\ - -Function: cbmc_dimacst::write_dimacs - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool cbmc_dimacst::write_dimacs(std::ostream &out) { dynamic_cast(prop).write_dimacs_cnf(out); diff --git a/src/cbmc/cbmc_dimacs.h b/src/cbmc/cbmc_dimacs.h index e8ccda5155a..444a99e73f4 100644 --- a/src/cbmc/cbmc_dimacs.h +++ b/src/cbmc/cbmc_dimacs.h @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Writing DIMACS Files + #ifndef CPROVER_CBMC_CBMC_DIMACS_H #define CPROVER_CBMC_CBMC_DIMACS_H diff --git a/src/cbmc/cbmc_languages.cpp b/src/cbmc/cbmc_languages.cpp index a18d0344833..b9ece275261 100644 --- a/src/cbmc/cbmc_languages.cpp +++ b/src/cbmc/cbmc_languages.cpp @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Language Registration + #include #include @@ -25,18 +28,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "cbmc_parse_options.h" -/*******************************************************************\ - -Function: cbmc_parse_optionst::register_languages - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void cbmc_parse_optionst::register_languages() { register_language(new_ansi_c_language); diff --git a/src/cbmc/cbmc_main.cpp b/src/cbmc/cbmc_main.cpp index d09ecc4772e..81bf25a7b83 100644 --- a/src/cbmc/cbmc_main.cpp +++ b/src/cbmc/cbmc_main.cpp @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// CBMC Main Module + /* CBMC @@ -22,18 +25,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "cbmc_parse_options.h" -/*******************************************************************\ - -Function: main / wmain - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - #ifdef IREP_HASH_STATS extern unsigned long long irep_hash_cnt; extern unsigned long long irep_cmp_cnt; diff --git a/src/cbmc/cbmc_parse_options.cpp b/src/cbmc/cbmc_parse_options.cpp index b9230c6b4e6..1ad81dd1d1e 100644 --- a/src/cbmc/cbmc_parse_options.cpp +++ b/src/cbmc/cbmc_parse_options.cpp @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// CBMC Command Line Option Processing + #include #include // exit() #include @@ -62,18 +65,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "version.h" #include "xml_interface.h" -/*******************************************************************\ - -Function: cbmc_parse_optionst::cbmc_parse_optionst - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - cbmc_parse_optionst::cbmc_parse_optionst(int argc, const char **argv): parse_options_baset(CBMC_OPTIONS, argc, argv), xml_interfacet(cmdline), @@ -82,18 +73,6 @@ cbmc_parse_optionst::cbmc_parse_optionst(int argc, const char **argv): { } -/*******************************************************************\ - -Function: cbmc_parse_optionst::cbmc_parse_optionst - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - ::cbmc_parse_optionst::cbmc_parse_optionst( int argc, const char **argv, @@ -105,18 +84,6 @@ ::cbmc_parse_optionst::cbmc_parse_optionst( { } -/*******************************************************************\ - -Function: cbmc_parse_optionst::eval_verbosity - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void cbmc_parse_optionst::eval_verbosity() { // this is our default verbosity @@ -132,18 +99,6 @@ void cbmc_parse_optionst::eval_verbosity() ui_message_handler.set_verbosity(v); } -/*******************************************************************\ - -Function: cbmc_parse_optionst::get_command_line_options - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void cbmc_parse_optionst::get_command_line_options(optionst &options) { if(config.set(cmdline)) @@ -456,18 +411,7 @@ void cbmc_parse_optionst::get_command_line_options(optionst &options) cmdline.get_value("symex-coverage-report")); } -/*******************************************************************\ - -Function: cbmc_parse_optionst::doit - - Inputs: - - Outputs: - - Purpose: invoke main modules - -\*******************************************************************/ - +/// invoke main modules int cbmc_parse_optionst::doit() { if(cmdline.isset("version")) @@ -566,18 +510,6 @@ int cbmc_parse_optionst::doit() return do_bmc(bmc, goto_functions); } -/*******************************************************************\ - -Function: cbmc_parse_optionst::set_properties - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool cbmc_parse_optionst::set_properties(goto_functionst &goto_functions) { try @@ -609,18 +541,6 @@ bool cbmc_parse_optionst::set_properties(goto_functionst &goto_functions) return false; } -/*******************************************************************\ - -Function: cbmc_parse_optionst::get_goto_program - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - int cbmc_parse_optionst::get_goto_program( const optionst &options, bmct &bmc, // for get_modules @@ -787,18 +707,6 @@ int cbmc_parse_optionst::get_goto_program( return -1; // no error, continue } -/*******************************************************************\ - -Function: cbmc_parse_optionst::preprocessing - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void cbmc_parse_optionst::preprocessing() { try @@ -855,18 +763,6 @@ void cbmc_parse_optionst::preprocessing() } } -/*******************************************************************\ - -Function: cbmc_parse_optionst::process_goto_program - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool cbmc_parse_optionst::process_goto_program( const optionst &options, goto_functionst &goto_functions) @@ -1015,18 +911,7 @@ bool cbmc_parse_optionst::process_goto_program( return false; } -/*******************************************************************\ - -Function: cbmc_parse_optionst::do_bmc - - Inputs: - - Outputs: - - Purpose: invoke main modules - -\*******************************************************************/ - +/// invoke main modules int cbmc_parse_optionst::do_bmc( bmct &bmc, const goto_functionst &goto_functions) @@ -1057,18 +942,7 @@ int cbmc_parse_optionst::do_bmc( return result; } -/*******************************************************************\ - -Function: cbmc_parse_optionst::help - - Inputs: - - Outputs: - - Purpose: display command line help - -\*******************************************************************/ - +/// display command line help void cbmc_parse_optionst::help() { std::cout << diff --git a/src/cbmc/cbmc_parse_options.h b/src/cbmc/cbmc_parse_options.h index 2c54dfc7353..8c68eb57f1b 100644 --- a/src/cbmc/cbmc_parse_options.h +++ b/src/cbmc/cbmc_parse_options.h @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// CBMC Command Line Option Processing + #ifndef CPROVER_CBMC_CBMC_PARSE_OPTIONS_H #define CPROVER_CBMC_CBMC_PARSE_OPTIONS_H diff --git a/src/cbmc/cbmc_solvers.cpp b/src/cbmc/cbmc_solvers.cpp index a9395f476bb..1825a1cd3ab 100644 --- a/src/cbmc/cbmc_solvers.cpp +++ b/src/cbmc/cbmc_solvers.cpp @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Solvers for VCs Generated by Symbolic Execution of ANSI-C + #include #include #include @@ -27,18 +30,8 @@ Author: Daniel Kroening, kroening@kroening.com #include "counterexample_beautification.h" #include "version.h" -/*******************************************************************\ - -Function: cbmc_solverst::get_smt1_solver_type - - Inputs: None - - Outputs: An smt1_dect::solvert giving the solver to use. - - Purpose: Uses the options to pick an SMT 1.2 solver - -\*******************************************************************/ - +/// Uses the options to pick an SMT 1.2 solver +/// \return An smt1_dect::solvert giving the solver to use. smt1_dect::solvert cbmc_solverst::get_smt1_solver_type() const { assert(options.get_bool_option("smt1")); @@ -65,18 +58,8 @@ smt1_dect::solvert cbmc_solverst::get_smt1_solver_type() const return s; } -/*******************************************************************\ - -Function: cbmc_solverst::get_smt2_solver_type - - Inputs: None - - Outputs: An smt2_dect::solvert giving the solver to use. - - Purpose: Uses the options to pick an SMT 2.0 solver - -\*******************************************************************/ - +/// Uses the options to pick an SMT 2.0 solver +/// \return An smt2_dect::solvert giving the solver to use. smt2_dect::solvert cbmc_solverst::get_smt2_solver_type() const { assert(options.get_bool_option("smt2")); @@ -103,18 +86,7 @@ smt2_dect::solvert cbmc_solverst::get_smt2_solver_type() const return s; } -/*******************************************************************\ - -Function: cbmc_solverst::get_default - - Inputs: - - Outputs: - - Purpose: Get the default decision procedure - -\*******************************************************************/ - +/// Get the default decision procedure cbmc_solverst::solvert* cbmc_solverst::get_default() { solvert *solver=new solvert; @@ -144,18 +116,6 @@ cbmc_solverst::solvert* cbmc_solverst::get_default() return solver; } -/*******************************************************************\ - -Function: cbmc_solverst::get_dimacs - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - cbmc_solverst::solvert* cbmc_solverst::get_dimacs() { no_beautification(); @@ -169,18 +129,6 @@ cbmc_solverst::solvert* cbmc_solverst::get_dimacs() return new solvert(new cbmc_dimacst(ns, *prop, filename), prop); } -/*******************************************************************\ - -Function: cbmc_solverst::get_bv_refinement - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - cbmc_solverst::solvert* cbmc_solverst::get_bv_refinement() { propt *prop; @@ -212,17 +160,9 @@ cbmc_solverst::solvert* cbmc_solverst::get_bv_refinement() return new solvert(bv_refinement, prop); } -/*******************************************************************\ - -Function: cbmc_solverst::get_string_refinement - - Outputs: a solver for cbmc - - Purpose: the string refinement adds to the bit vector refinement - specifications for functions from the Java string library - -\*******************************************************************/ - +/// the string refinement adds to the bit vector refinement specifications for +/// functions from the Java string library +/// \return a solver for cbmc cbmc_solverst::solvert* cbmc_solverst::get_string_refinement() { propt *prop; @@ -254,18 +194,6 @@ cbmc_solverst::solvert* cbmc_solverst::get_string_refinement() return new solvert(string_refinement, prop); } -/*******************************************************************\ - -Function: cbmc_solverst::get_smt1 - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - cbmc_solverst::solvert* cbmc_solverst::get_smt1(smt1_dect::solvert solver) { no_beautification(); @@ -335,18 +263,6 @@ cbmc_solverst::solvert* cbmc_solverst::get_smt1(smt1_dect::solvert solver) } } -/*******************************************************************\ - -Function: cbmc_solverst::get_smt2 - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - cbmc_solverst::solvert* cbmc_solverst::get_smt2(smt2_dect::solvert solver) { no_beautification(); @@ -424,18 +340,6 @@ cbmc_solverst::solvert* cbmc_solverst::get_smt2(smt2_dect::solvert solver) } } -/*******************************************************************\ - -Function: cbmc_solverst::no_beautification - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void cbmc_solverst::no_beautification() { if(options.get_bool_option("beautify")) @@ -445,18 +349,6 @@ void cbmc_solverst::no_beautification() } } -/*******************************************************************\ - -Function: cbmc_solverst::no_incremental_check - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void cbmc_solverst::no_incremental_check() { if(options.get_bool_option("all-properties") || diff --git a/src/cbmc/cbmc_solvers.h b/src/cbmc/cbmc_solvers.h index c837bd55806..f17f9b663bf 100644 --- a/src/cbmc/cbmc_solvers.h +++ b/src/cbmc/cbmc_solvers.h @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Bounded Model Checking for ANSI-C + HDL + #ifndef CPROVER_CBMC_CBMC_SOLVERS_H #define CPROVER_CBMC_CBMC_SOLVERS_H @@ -27,12 +30,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "bv_cbmc.h" -/*******************************************************************\ - -Solver factory - -\*******************************************************************/ - class cbmc_solverst:public messaget { public: diff --git a/src/cbmc/counterexample_beautification.cpp b/src/cbmc/counterexample_beautification.cpp index a65069618df..334366ca8f2 100644 --- a/src/cbmc/counterexample_beautification.cpp +++ b/src/cbmc/counterexample_beautification.cpp @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Counterexample Beautification using Incremental SAT + #include #include #include @@ -16,18 +19,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "counterexample_beautification.h" -/*******************************************************************\ - -Function: counterexample_beautificationt::get_minimization_list - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void counterexample_beautificationt::get_minimization_list( prop_convt &prop_conv, const symex_target_equationt &equation, @@ -68,18 +59,6 @@ void counterexample_beautificationt::get_minimization_list( } } -/*******************************************************************\ - -Function: counterexample_beautificationt::get_failed_property - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - symex_target_equationt::SSA_stepst::const_iterator counterexample_beautificationt::get_failed_property( const prop_convt &prop_conv, @@ -99,18 +78,6 @@ counterexample_beautificationt::get_failed_property( return equation.SSA_steps.end(); } -/*******************************************************************\ - -Function: counterexample_beautificationt::operator() - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void counterexample_beautificationt::operator()( bv_cbmct &bv_cbmc, const symex_target_equationt &equation, diff --git a/src/cbmc/counterexample_beautification.h b/src/cbmc/counterexample_beautification.h index d4f9c35bc88..10bb96f4597 100644 --- a/src/cbmc/counterexample_beautification.h +++ b/src/cbmc/counterexample_beautification.h @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Counterexample Beautification + #ifndef CPROVER_CBMC_COUNTEREXAMPLE_BEAUTIFICATION_H #define CPROVER_CBMC_COUNTEREXAMPLE_BEAUTIFICATION_H diff --git a/src/cbmc/fault_localization.cpp b/src/cbmc/fault_localization.cpp index f248428c5be..2beae26ff79 100644 --- a/src/cbmc/fault_localization.cpp +++ b/src/cbmc/fault_localization.cpp @@ -6,6 +6,9 @@ Author: Peter Schrammel \*******************************************************************/ +/// \file +/// Fault Localization + #include #include #include @@ -21,18 +24,6 @@ Author: Peter Schrammel #include "fault_localization.h" #include "counterexample_beautification.h" -/*******************************************************************\ - -Function: fault_localizationt::freeze_guards - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void fault_localizationt::freeze_guards() { for(const auto &step : bmc.equation.SSA_steps) @@ -45,18 +36,6 @@ void fault_localizationt::freeze_guards() } } -/*******************************************************************\ - -Function: fault_localizationt::collect_guards - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void fault_localizationt::collect_guards(lpointst &lpoints) { for(symex_target_equationt::SSA_stepst::const_iterator @@ -80,18 +59,6 @@ void fault_localizationt::collect_guards(lpointst &lpoints) } } -/*******************************************************************\ - -Function: fault_localizationt::get_failed_property - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - symex_target_equationt::SSA_stepst::const_iterator fault_localizationt::get_failed_property() { @@ -107,18 +74,6 @@ fault_localizationt::get_failed_property() return bmc.equation.SSA_steps.end(); } -/*******************************************************************\ - -Function: fault_localizationt::check - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool fault_localizationt::check(const lpointst &lpoints, const lpoints_valuet &value) { @@ -145,18 +100,6 @@ bool fault_localizationt::check(const lpointst &lpoints, return true; } -/*******************************************************************\ - -Function: fault_localizationt::update_scores - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void fault_localizationt::update_scores(lpointst &lpoints, const lpoints_valuet &value) { @@ -174,18 +117,6 @@ void fault_localizationt::update_scores(lpointst &lpoints, } } -/*******************************************************************\ - -Function: fault_localizationt::localize_linear - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void fault_localizationt::localize_linear(lpointst &lpoints) { lpoints_valuet v; @@ -204,18 +135,6 @@ void fault_localizationt::localize_linear(lpointst &lpoints) } } -/*******************************************************************\ - -Function: fault_localizationt::run - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void fault_localizationt::run(irep_idt goal_id) { // find failed property @@ -243,18 +162,6 @@ void fault_localizationt::run(irep_idt goal_id) bmc.prop_conv.set_assumptions(assumptions); } -/*******************************************************************\ - -Function: fault_localizationt::report() - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void fault_localizationt::report(irep_idt goal_id) { if(goal_id==ID_nil) @@ -284,18 +191,6 @@ void fault_localizationt::report(irep_idt goal_id) << eom; } -/*******************************************************************\ - -Function: fault_localizationt::operator() - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - safety_checkert::resultt fault_localizationt::operator()() { if(options.get_bool_option("stop-on-fail")) @@ -304,18 +199,6 @@ safety_checkert::resultt fault_localizationt::operator()() return bmc_all_propertiest::operator()(); } -/*******************************************************************\ - -Function: fault_localizationt::run_decision_procedure - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - decision_proceduret::resultt fault_localizationt::run_decision_procedure(prop_convt &prop_conv) { @@ -346,18 +229,6 @@ fault_localizationt::run_decision_procedure(prop_convt &prop_conv) return dec_result; } -/*******************************************************************\ - -Function: fault_localizationt::stop_on_fail - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - safety_checkert::resultt fault_localizationt::stop_on_fail() { switch(run_decision_procedure(bmc.prop_conv)) @@ -391,18 +262,6 @@ safety_checkert::resultt fault_localizationt::stop_on_fail() } } -/*******************************************************************\ - -Function: fault_localizationt::goal_covered - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void fault_localizationt::goal_covered( const cover_goalst::goalt &) { @@ -434,18 +293,6 @@ void fault_localizationt::goal_covered( } } -/*******************************************************************\ - -Function: fault_localizationt::report - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void fault_localizationt::report( const cover_goalst &cover_goals) { diff --git a/src/cbmc/fault_localization.h b/src/cbmc/fault_localization.h index 552095b7cd3..0c3ec090153 100644 --- a/src/cbmc/fault_localization.h +++ b/src/cbmc/fault_localization.h @@ -6,6 +6,9 @@ Author: Peter Schrammel \*******************************************************************/ +/// \file +/// Fault Localization + #ifndef CPROVER_CBMC_FAULT_LOCALIZATION_H #define CPROVER_CBMC_FAULT_LOCALIZATION_H diff --git a/src/cbmc/show_vcc.cpp b/src/cbmc/show_vcc.cpp index 1ae0de6900a..f7a777173ce 100644 --- a/src/cbmc/show_vcc.cpp +++ b/src/cbmc/show_vcc.cpp @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Symbolic Execution of ANSI-C + #include #include @@ -20,18 +23,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "bmc.h" -/*******************************************************************\ - -Function: bmct::show_vcc_plain - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void bmct::show_vcc_plain(std::ostream &out) { out << "\n" << "VERIFICATION CONDITIONS:" << "\n" << "\n"; @@ -90,18 +81,6 @@ void bmct::show_vcc_plain(std::ostream &out) } } -/*******************************************************************\ - -Function: bmct::show_vcc_json - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void bmct::show_vcc_json(std::ostream &out) { json_objectt json_result; @@ -160,18 +139,6 @@ void bmct::show_vcc_json(std::ostream &out) out << ",\n" << json_result; } -/*******************************************************************\ - -Function: bmct::show_vcc - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void bmct::show_vcc() { const std::string &filename=options.get_option("outfile"); diff --git a/src/cbmc/symex_bmc.cpp b/src/cbmc/symex_bmc.cpp index 5ae65275ef6..beb014d6db5 100644 --- a/src/cbmc/symex_bmc.cpp +++ b/src/cbmc/symex_bmc.cpp @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Bounded Model Checking for ANSI-C + #include #include @@ -13,18 +16,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "symex_bmc.h" -/*******************************************************************\ - -Function: symex_bmct::symex_bmct - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - symex_bmct::symex_bmct( const namespacet &_ns, symbol_tablet &_new_symbol_table, @@ -36,18 +27,7 @@ symex_bmct::symex_bmct( { } -/*******************************************************************\ - -Function: symex_bmct::symex_step - - Inputs: - - Outputs: - - Purpose: show progress - -\*******************************************************************/ - +/// show progress void symex_bmct::symex_step( const goto_functionst &goto_functions, statet &state) @@ -96,18 +76,6 @@ void symex_bmct::symex_step( symex_coverage.covered(cur_pc, state.source.pc); } -/*******************************************************************\ - -Function: symex_bmct::merge_goto - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void symex_bmct::merge_goto( const statet::goto_statet &goto_state, statet &state) @@ -127,18 +95,6 @@ void symex_bmct::merge_goto( symex_coverage.covered(prev_pc, state.source.pc); } -/*******************************************************************\ - -Function: symex_bmct::get_unwind - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool symex_bmct::get_unwind( const symex_targett::sourcet &source, unsigned unwind) @@ -180,18 +136,6 @@ bool symex_bmct::get_unwind( return abort; } -/*******************************************************************\ - -Function: symex_bmct::get_unwind_recursion - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool symex_bmct::get_unwind_recursion( const irep_idt &id, const unsigned thread_nr, @@ -237,18 +181,6 @@ bool symex_bmct::get_unwind_recursion( return abort; } -/*******************************************************************\ - -Function: symex_bmct::no_body - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void symex_bmct::no_body(const irep_idt &identifier) { if(body_warnings.insert(identifier).second) diff --git a/src/cbmc/symex_bmc.h b/src/cbmc/symex_bmc.h index 8b2df348f3b..b8d23a52719 100644 --- a/src/cbmc/symex_bmc.h +++ b/src/cbmc/symex_bmc.h @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Bounded Model Checking for ANSI-C + #ifndef CPROVER_CBMC_SYMEX_BMC_H #define CPROVER_CBMC_SYMEX_BMC_H diff --git a/src/cbmc/symex_coverage.cpp b/src/cbmc/symex_coverage.cpp index 812df4de062..c36490f67f5 100644 --- a/src/cbmc/symex_coverage.cpp +++ b/src/cbmc/symex_coverage.cpp @@ -8,6 +8,9 @@ Date: March 2016 \*******************************************************************/ +/// \file +/// Record and print code coverage of symbolic execution + #include #include #include @@ -91,18 +94,6 @@ class goto_program_coverage_recordt:public coverage_recordt coverage_lines_mapt &dest); }; -/*******************************************************************\ - -Function: rate - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - static std::string rate( std::size_t covered, std::size_t total, @@ -129,18 +120,6 @@ static std::string rate( return oss.str(); } -/*******************************************************************\ - -Function: goto_program_coverage_recordt::goto_program_coverage_recordt - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - goto_program_coverage_recordt::goto_program_coverage_recordt( const namespacet &ns, goto_functionst::function_mapt::const_iterator gf_it, @@ -227,18 +206,6 @@ goto_program_coverage_recordt::goto_program_coverage_recordt( } } -/*******************************************************************\ - -Function: goto_program_coverage_recordt::compute_coverage_lines - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_program_coverage_recordt::compute_coverage_lines( const goto_programt &goto_program, const irep_idt &file_name, @@ -321,18 +288,6 @@ void goto_program_coverage_recordt::compute_coverage_lines( } } -/*******************************************************************\ - -Function: symex_coveraget::compute_overall_coverage - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void symex_coveraget::compute_overall_coverage( const goto_functionst &goto_functions, coverage_recordt &dest) const @@ -409,18 +364,6 @@ void symex_coveraget::compute_overall_coverage( } } -/*******************************************************************\ - -Function: symex_coveraget::build_cobertura - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void symex_coveraget::build_cobertura( const goto_functionst &goto_functions, xmlt &xml_coverage) const @@ -462,18 +405,6 @@ void symex_coveraget::build_cobertura( package.set_attribute("complexity", "0.0"); } -/*******************************************************************\ - -Function: symex_coveraget::output_report - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool symex_coveraget::output_report( const goto_functionst &goto_functions, std::ostream &os) const @@ -489,18 +420,6 @@ bool symex_coveraget::output_report( return !os.good(); } -/*******************************************************************\ - -Function: symex_coveraget::output_report - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool symex_coveraget::generate_report( const goto_functionst &goto_functions, const std::string &path) const diff --git a/src/cbmc/symex_coverage.h b/src/cbmc/symex_coverage.h index c173bc65ad7..b7556b1087b 100644 --- a/src/cbmc/symex_coverage.h +++ b/src/cbmc/symex_coverage.h @@ -8,6 +8,9 @@ Date: March 2016 \*******************************************************************/ +/// \file +/// Record and print code coverage of symbolic execution + #ifndef CPROVER_CBMC_SYMEX_COVERAGE_H #define CPROVER_CBMC_SYMEX_COVERAGE_H diff --git a/src/cbmc/xml_interface.cpp b/src/cbmc/xml_interface.cpp index d94fa7bf034..da58cfe12c5 100644 --- a/src/cbmc/xml_interface.cpp +++ b/src/cbmc/xml_interface.cpp @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// XML Interface + #include #include @@ -14,18 +17,7 @@ Author: Daniel Kroening, kroening@kroening.com #include "xml_interface.h" -/*******************************************************************\ - -Function: xml_interfacet::get_xml_options - - Inputs: - - Outputs: - - Purpose: XML User Interface - -\*******************************************************************/ - +/// XML User Interface void xml_interfacet::get_xml_options(cmdlinet &cmdline) { if(cmdline.isset("xml-interface")) @@ -41,18 +33,7 @@ void xml_interfacet::get_xml_options(cmdlinet &cmdline) } } -/*******************************************************************\ - -Function: xml_interfacet::get_xml_options - - Inputs: - - Outputs: - - Purpose: XML User Interface - -\*******************************************************************/ - +/// XML User Interface void xml_interfacet::get_xml_options( const xmlt &xml, cmdlinet &cmdline) diff --git a/src/cbmc/xml_interface.h b/src/cbmc/xml_interface.h index 0cf038083db..945be7624bb 100644 --- a/src/cbmc/xml_interface.h +++ b/src/cbmc/xml_interface.h @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// XML Interface + #ifndef CPROVER_CBMC_XML_INTERFACE_H #define CPROVER_CBMC_XML_INTERFACE_H diff --git a/src/clobber/clobber_main.cpp b/src/clobber/clobber_main.cpp index 8255f068c92..16e2a286900 100644 --- a/src/clobber/clobber_main.cpp +++ b/src/clobber/clobber_main.cpp @@ -6,22 +6,13 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Symex Main Module + #include #include "clobber_parse_options.h" -/*******************************************************************\ - -Function: main - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - #ifdef _MSC_VER int wmain(int argc, const wchar_t **argv_wide) { diff --git a/src/clobber/clobber_parse_options.cpp b/src/clobber/clobber_parse_options.cpp index a8fd471ecb6..dfc4a08faf5 100644 --- a/src/clobber/clobber_parse_options.cpp +++ b/src/clobber/clobber_parse_options.cpp @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Symex Command Line Options Processing + #include #include #include @@ -37,18 +40,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "clobber_parse_options.h" // #include "clobber_instrumenter.h" -/*******************************************************************\ - -Function: clobber_parse_optionst::clobber_parse_optionst - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - clobber_parse_optionst::clobber_parse_optionst(int argc, const char **argv): parse_options_baset(CLOBBER_OPTIONS, argc, argv), language_uit(cmdline, ui_message_handler), @@ -56,18 +47,6 @@ clobber_parse_optionst::clobber_parse_optionst(int argc, const char **argv): { } -/*******************************************************************\ - -Function: clobber_parse_optionst::eval_verbosity - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void clobber_parse_optionst::eval_verbosity() { // this is our default verbosity @@ -85,18 +64,6 @@ void clobber_parse_optionst::eval_verbosity() ui_message_handler.set_verbosity(v); } -/*******************************************************************\ - -Function: clobber_parse_optionst::get_command_line_options - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void clobber_parse_optionst::get_command_line_options(optionst &options) { if(config.set(cmdline)) @@ -131,18 +98,7 @@ void clobber_parse_optionst::get_command_line_options(optionst &options) options.set_option("error-label", cmdline.get_value("error-label")); } -/*******************************************************************\ - -Function: clobber_parse_optionst::doit - - Inputs: - - Outputs: - - Purpose: invoke main modules - -\*******************************************************************/ - +/// invoke main modules int clobber_parse_optionst::doit() { if(cmdline.isset("version")) @@ -224,18 +180,6 @@ int clobber_parse_optionst::doit() #endif } -/*******************************************************************\ - -Function: clobber_parse_optionst::set_properties - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool clobber_parse_optionst::set_properties(goto_functionst &goto_functions) { if(cmdline.isset("property")) @@ -244,18 +188,6 @@ bool clobber_parse_optionst::set_properties(goto_functionst &goto_functions) return false; } -/*******************************************************************\ - -Function: clobber_parse_optionst::get_goto_program - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool clobber_parse_optionst::get_goto_program( const optionst &options, goto_functionst &goto_functions) @@ -378,18 +310,6 @@ bool clobber_parse_optionst::get_goto_program( return false; } -/*******************************************************************\ - -Function: clobber_parse_optionst::process_goto_program - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool clobber_parse_optionst::process_goto_program( const optionst &options, goto_functionst &goto_functions) @@ -435,18 +355,6 @@ bool clobber_parse_optionst::process_goto_program( return false; } -/*******************************************************************\ - -Function: clobber_parse_optionst::report_properties - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - #if 0 void clobber_parse_optionst::report_properties( const path_searcht::property_mapt &property_map) @@ -506,18 +414,6 @@ void clobber_parse_optionst::report_properties( } #endif -/*******************************************************************\ - -Function: clobber_parse_optionst::report_success - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void clobber_parse_optionst::report_success() { result() << "VERIFICATION SUCCESSFUL" << eom; @@ -541,18 +437,6 @@ void clobber_parse_optionst::report_success() } } -/*******************************************************************\ - -Function: clobber_parse_optionst::show_counterexample - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void clobber_parse_optionst::show_counterexample( const goto_tracet &error_trace) { @@ -578,18 +462,6 @@ void clobber_parse_optionst::show_counterexample( } } -/*******************************************************************\ - -Function: clobber_parse_optionst::report_failure - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void clobber_parse_optionst::report_failure() { result() << "VERIFICATION FAILED" << eom; @@ -613,18 +485,7 @@ void clobber_parse_optionst::report_failure() } } -/*******************************************************************\ - -Function: clobber_parse_optionst::help - - Inputs: - - Outputs: - - Purpose: display command line help - -\*******************************************************************/ - +/// display command line help void clobber_parse_optionst::help() { std::cout << diff --git a/src/clobber/clobber_parse_options.h b/src/clobber/clobber_parse_options.h index ffd897c9155..89faff353f0 100644 --- a/src/clobber/clobber_parse_options.h +++ b/src/clobber/clobber_parse_options.h @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Command Line Parsing + #ifndef CPROVER_CLOBBER_CLOBBER_PARSE_OPTIONS_H #define CPROVER_CLOBBER_CLOBBER_PARSE_OPTIONS_H diff --git a/src/cpp/cpp_constructor.cpp b/src/cpp/cpp_constructor.cpp index 3c5b34762dd..53655ea75df 100644 --- a/src/cpp/cpp_constructor.cpp +++ b/src/cpp/cpp_constructor.cpp @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@cs.cmu.edu \*******************************************************************/ +/// \file +/// C++ Language Type Checking + #include #include @@ -14,18 +17,8 @@ Author: Daniel Kroening, kroening@cs.cmu.edu #include "cpp_typecheck.h" #include "cpp_util.h" -/*******************************************************************\ - -Function: cpp_typecheckt::cpp_constructor - - Inputs: non-typchecked object, non-typechecked operands - - Outputs: typechecked code - - Purpose: - -\*******************************************************************/ - +/// \param non:typchecked object, non-typechecked operands +/// \return typechecked code codet cpp_typecheckt::cpp_constructor( const source_locationt &source_location, const exprt &object, @@ -315,18 +308,6 @@ codet cpp_typecheckt::cpp_constructor( return nil; } -/*******************************************************************\ - -Function: cpp_typecheckt::new_temporary - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void cpp_typecheckt::new_temporary( const source_locationt &source_location, const typet &type, @@ -359,18 +340,6 @@ void cpp_typecheckt::new_temporary( temporary.swap(tmp_object_expr); } -/*******************************************************************\ - -Function: cpp_typecheckt::new_temporary - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void cpp_typecheckt::new_temporary( const source_locationt &source_location, const typet &type, diff --git a/src/cpp/cpp_convert_type.cpp b/src/cpp/cpp_convert_type.cpp index 0f106b19575..d2c5e3989f9 100644 --- a/src/cpp/cpp_convert_type.cpp +++ b/src/cpp/cpp_convert_type.cpp @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@cs.cmu.edu \*******************************************************************/ +/// \file +/// C++ Language Type Conversion + #include #include @@ -42,18 +45,6 @@ class cpp_convert_typet void read_template(const typet &type); }; -/*******************************************************************\ - -Function: cpp_convert_typet::read - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void cpp_convert_typet::read(const typet &type) { unsigned_cnt=signed_cnt=char_cnt=int_cnt=short_cnt= @@ -72,18 +63,6 @@ void cpp_convert_typet::read(const typet &type) read_rec(type); } -/*******************************************************************\ - -Function: cpp_convert_typet::read_rec - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void cpp_convert_typet::read_rec(const typet &type) { #if 0 @@ -185,18 +164,6 @@ void cpp_convert_typet::read_rec(const typet &type) } } -/*******************************************************************\ - -Function: cpp_covnert_typet::read_template - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void cpp_convert_typet::read_template(const typet &type) { other.push_back(type); @@ -225,18 +192,6 @@ void cpp_convert_typet::read_template(const typet &type) } } -/*******************************************************************\ - -Function: cpp_convert_typet::read_function_type - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void cpp_convert_typet::read_function_type(const typet &type) { other.push_back(type); @@ -338,18 +293,6 @@ void cpp_convert_typet::read_function_type(const typet &type) parameters.get_sub().clear(); } -/*******************************************************************\ - -Function: cpp_convert_typet::write - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void cpp_convert_typet::write(typet &type) { type.clear(); @@ -600,18 +543,6 @@ void cpp_convert_typet::write(typet &type) type.set(ID_C_volatile, true); } -/*******************************************************************\ - -Function: cpp_convert_plain_type - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void cpp_convert_plain_type(typet &type) { if(type.id()==ID_cpp_name || diff --git a/src/cpp/cpp_convert_type.h b/src/cpp/cpp_convert_type.h index 9c690287fae..590ce6e98a6 100644 --- a/src/cpp/cpp_convert_type.h +++ b/src/cpp/cpp_convert_type.h @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@cs.cmu.edu \*******************************************************************/ +/// \file +/// C++ Language Conversion + #ifndef CPROVER_CPP_CPP_CONVERT_TYPE_H #define CPROVER_CPP_CPP_CONVERT_TYPE_H diff --git a/src/cpp/cpp_declaration.cpp b/src/cpp/cpp_declaration.cpp index 1a06fbaa36d..432390c79bc 100644 --- a/src/cpp/cpp_declaration.cpp +++ b/src/cpp/cpp_declaration.cpp @@ -6,22 +6,13 @@ Author: Daniel Kroening, kroening@cs.cmu.edu \*******************************************************************/ +/// \file +/// C++ Language Type Checking + #include #include "cpp_declaration.h" -/*******************************************************************\ - -Function: cpp_declarationt::output - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void cpp_declarationt::output(std::ostream &out) const { out << "is_template: " << is_template() << "\n"; @@ -38,18 +29,6 @@ void cpp_declarationt::output(std::ostream &out) const } } -/*******************************************************************\ - -Function: cpp_declarationt::name_anon_struct_union - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void cpp_declarationt::name_anon_struct_union(typet &dest) { // We name any anon struct/unions according to the first diff --git a/src/cpp/cpp_declaration.h b/src/cpp/cpp_declaration.h index 271f7c5ee44..17cf872d226 100644 --- a/src/cpp/cpp_declaration.h +++ b/src/cpp/cpp_declaration.h @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@cs.cmu.edu \*******************************************************************/ +/// \file +/// C++ Language Type Checking + #ifndef CPROVER_CPP_CPP_DECLARATION_H #define CPROVER_CPP_CPP_DECLARATION_H diff --git a/src/cpp/cpp_declarator.cpp b/src/cpp/cpp_declarator.cpp index 063003b696c..aa671c45a5f 100644 --- a/src/cpp/cpp_declarator.cpp +++ b/src/cpp/cpp_declarator.cpp @@ -6,23 +6,14 @@ Author: Daniel Kroening, kroening@cs.cmu.edu \*******************************************************************/ +/// \file +/// C++ Language Type Checking + #include #include #include "cpp_declarator.h" -/*******************************************************************\ - -Function: cpp_declaratort::output - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void cpp_declaratort::output(std::ostream &out) const { out << " name: " << name().pretty() << "\n"; @@ -32,18 +23,6 @@ void cpp_declaratort::output(std::ostream &out) const out << " method_qualifier: " << method_qualifier().pretty() << "\n"; } -/*******************************************************************\ - -Function: cpp_declaratort::merge_type - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - typet cpp_declaratort::merge_type(const typet &declaration_type) const { typet dest_type=type(); diff --git a/src/cpp/cpp_declarator.h b/src/cpp/cpp_declarator.h index 3a08f17180a..7f316506f56 100644 --- a/src/cpp/cpp_declarator.h +++ b/src/cpp/cpp_declarator.h @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@cs.cmu.edu \*******************************************************************/ +/// \file +/// C++ Language Type Checking + #ifndef CPROVER_CPP_CPP_DECLARATOR_H #define CPROVER_CPP_CPP_DECLARATOR_H diff --git a/src/cpp/cpp_declarator_converter.cpp b/src/cpp/cpp_declarator_converter.cpp index 24a295a03f7..c3b8739616f 100644 --- a/src/cpp/cpp_declarator_converter.cpp +++ b/src/cpp/cpp_declarator_converter.cpp @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@cs.cmu.edu \*******************************************************************/ +/// \file +/// C++ Language Type Checking + #include #include @@ -15,18 +18,6 @@ Author: Daniel Kroening, kroening@cs.cmu.edu #include "cpp_declarator_converter.h" #include "cpp_typecheck.h" -/*******************************************************************\ - -Function: cpp_declarator_convertert::cpp_declarator_convertert - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - cpp_declarator_convertert::cpp_declarator_convertert( class cpp_typecheckt &_cpp_typecheck): is_typedef(false), @@ -38,18 +29,6 @@ cpp_declarator_convertert::cpp_declarator_convertert( { } -/*******************************************************************\ - -Function: cpp_declarator_convertert::convert - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - symbolt &cpp_declarator_convertert::convert( const typet &declaration_type, const cpp_storage_spect &storage_spec, @@ -252,18 +231,6 @@ symbolt &cpp_declarator_convertert::convert( } } -/*******************************************************************\ - -Function: cpp_declarator_convertert::combine_types - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void cpp_declarator_convertert::combine_types( const source_locationt &source_location, const typet &decl_type, @@ -346,18 +313,6 @@ void cpp_declarator_convertert::combine_types( throw 0; } -/*******************************************************************\ - -Function: cpp_declarator_convertert::enforce_rules - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void cpp_declarator_convertert::enforce_rules(const symbolt &symbol) { // enforce rules for operator overloading @@ -367,18 +322,6 @@ void cpp_declarator_convertert::enforce_rules(const symbolt &symbol) main_function_rules(symbol); } -/*******************************************************************\ - -Function: cpp_declarator_convertert::handle_initializer - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void cpp_declarator_convertert::handle_initializer( symbolt &symbol, cpp_declaratort &declarator) @@ -431,18 +374,6 @@ void cpp_declarator_convertert::handle_initializer( } } -/*******************************************************************\ - -Function: cpp_declarator_convertert::get_final_identifier - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void cpp_declarator_convertert::get_final_identifier() { std::string identifier=id2string(base_name); @@ -489,18 +420,6 @@ void cpp_declarator_convertert::get_final_identifier() identifier; } -/*******************************************************************\ - -Function: cpp_declarator_convertert::convert_new_symbol - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - symbolt &cpp_declarator_convertert::convert_new_symbol( const cpp_storage_spect &storage_spec, const cpp_member_spect &member_spec, @@ -641,18 +560,6 @@ symbolt &cpp_declarator_convertert::convert_new_symbol( return *new_symbol; } -/*******************************************************************\ - -Function: cpp_declarator_convertert::get_pretty_name - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - irep_idt cpp_declarator_convertert::get_pretty_name() { if(is_code) @@ -680,35 +587,11 @@ irep_idt cpp_declarator_convertert::get_pretty_name() return scope->prefix+id2string(base_name); } -/*******************************************************************\ - -Function: cpp_declarator_convertert::operator_overloading_rules - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void cpp_declarator_convertert::operator_overloading_rules( const symbolt &symbol) { } -/*******************************************************************\ - -Function: cpp_declarator_convertert::main_function_rules - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void cpp_declarator_convertert::main_function_rules( const symbolt &symbol) { diff --git a/src/cpp/cpp_declarator_converter.h b/src/cpp/cpp_declarator_converter.h index 850549a69d5..54399c6b62e 100644 --- a/src/cpp/cpp_declarator_converter.h +++ b/src/cpp/cpp_declarator_converter.h @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@cs.cmu.edu \*******************************************************************/ +/// \file +/// C++ Language Type Checking + #ifndef CPROVER_CPP_CPP_DECLARATOR_CONVERTER_H #define CPROVER_CPP_CPP_DECLARATOR_CONVERTER_H diff --git a/src/cpp/cpp_destructor.cpp b/src/cpp/cpp_destructor.cpp index 75479a0ee85..bd1f2ffeb2b 100644 --- a/src/cpp/cpp_destructor.cpp +++ b/src/cpp/cpp_destructor.cpp @@ -6,24 +6,16 @@ Author: Daniel Kroening, kroening@cs.cmu.edu \*******************************************************************/ +/// \file +/// C++ Language Type Checking + #include #include #include "cpp_typecheck.h" -/*******************************************************************\ - -Function: cpp_typecheckt::cpp_destructor - - Inputs: - - Outputs: typechecked code - - Purpose: - -\*******************************************************************/ - +/// \return typechecked code codet cpp_typecheckt::cpp_destructor( const source_locationt &source_location, const typet &type, diff --git a/src/cpp/cpp_enum_type.cpp b/src/cpp/cpp_enum_type.cpp index ba4bc6ecbae..98125a4fb8d 100644 --- a/src/cpp/cpp_enum_type.cpp +++ b/src/cpp/cpp_enum_type.cpp @@ -6,38 +6,17 @@ Author: Daniel Kroening, kroening@cs.cmu.edu \*******************************************************************/ +/// \file +/// C++ Language Type Checking + #include #include "cpp_enum_type.h" -/*******************************************************************\ - -Function: cpp_enum_typet::cpp_enum_typet - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - cpp_enum_typet::cpp_enum_typet():typet(ID_c_enum) { } -/*******************************************************************\ - -Function: cpp_enum_typet::generate_anon_tag - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - irep_idt cpp_enum_typet::generate_anon_tag() const { // This will only clash with anon enums that would have diff --git a/src/cpp/cpp_enum_type.h b/src/cpp/cpp_enum_type.h index 23edd61900e..97dc50df769 100644 --- a/src/cpp/cpp_enum_type.h +++ b/src/cpp/cpp_enum_type.h @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@cs.cmu.edu \*******************************************************************/ +/// \file +/// C++ Language Type Checking + #ifndef CPROVER_CPP_CPP_ENUM_TYPE_H #define CPROVER_CPP_CPP_ENUM_TYPE_H diff --git a/src/cpp/cpp_exception_id.cpp b/src/cpp/cpp_exception_id.cpp index e64fa67e0df..d3a4b8f7081 100644 --- a/src/cpp/cpp_exception_id.cpp +++ b/src/cpp/cpp_exception_id.cpp @@ -6,20 +6,12 @@ Author: Daniel Kroening, kroening@cs.cmu.edu \*******************************************************************/ -#include "cpp_exception_id.h" - -/*******************************************************************\ - -Function: cpp_exception_list_rec - - Inputs: - - Outputs: - - Purpose: turns a type into a list of relevant exception IDs +/// \file +/// C++ Language Type Checking -\*******************************************************************/ +#include "cpp_exception_id.h" +/// turns a type into a list of relevant exception IDs void cpp_exception_list_rec( const typet &src, const namespacet &ns, @@ -75,18 +67,7 @@ void cpp_exception_list_rec( } } -/*******************************************************************\ - -Function: cpp_exception_list - - Inputs: - - Outputs: - - Purpose: turns a type into a list of relevant exception IDs - -\*******************************************************************/ - +/// turns a type into a list of relevant exception IDs irept cpp_exception_list( const typet &src, const namespacet &ns) @@ -103,18 +84,7 @@ irept cpp_exception_list( return result; } -/*******************************************************************\ - -Function: cpp_exception_id - - Inputs: - - Outputs: - - Purpose: turns a type into an exception ID - -\*******************************************************************/ - +/// turns a type into an exception ID irep_idt cpp_exception_id( const typet &src, const namespacet &ns) diff --git a/src/cpp/cpp_exception_id.h b/src/cpp/cpp_exception_id.h index 38b675c76fb..c652169aa50 100644 --- a/src/cpp/cpp_exception_id.h +++ b/src/cpp/cpp_exception_id.h @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@cs.cmu.edu \*******************************************************************/ +/// \file +/// C++ Language Type Checking + #ifndef CPROVER_CPP_CPP_EXCEPTION_ID_H #define CPROVER_CPP_CPP_EXCEPTION_ID_H diff --git a/src/cpp/cpp_id.cpp b/src/cpp/cpp_id.cpp index 4ccb1a095d1..dae74bd1f4d 100644 --- a/src/cpp/cpp_id.cpp +++ b/src/cpp/cpp_id.cpp @@ -6,23 +6,14 @@ Author: Daniel Kroening, kroening@cs.cmu.edu \*******************************************************************/ +/// \file +/// C++ Language Type Checking + #include #include "cpp_id.h" #include "cpp_scope.h" -/*******************************************************************\ - -Function: cpp_idt::cpp_idt - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - cpp_idt::cpp_idt(): is_member(false), is_method(false), @@ -36,18 +27,6 @@ cpp_idt::cpp_idt(): { } -/*******************************************************************\ - -Function: cpp_idt::print - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void cpp_idt::print(std::ostream &out, unsigned indent) const { print_fields(out, indent); @@ -63,18 +42,6 @@ void cpp_idt::print(std::ostream &out, unsigned indent) const } } -/*******************************************************************\ - -Function: cpp_idt::print_fields - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void cpp_idt::print_fields(std::ostream &out, unsigned indent) const { for(unsigned i=0; i\"" << '\n'; diff --git a/src/cpp/cpp_is_pod.cpp b/src/cpp/cpp_is_pod.cpp index 2b5c895611e..5cd698fd718 100644 --- a/src/cpp/cpp_is_pod.cpp +++ b/src/cpp/cpp_is_pod.cpp @@ -6,40 +6,10 @@ Author: Daniel Kroening, kroening@cs.cmu.edu \*******************************************************************/ -#include "cpp_typecheck.h" - -/*******************************************************************\ - -Function: cpp_typecheckt::cpp_is_pod - - Inputs: - - Outputs: +/// \file +/// C++ Language Type Checking - Standard: - "Arithmetic types (3.9.1), enumeration types, pointer types, and - pointer to member types (3.9.2), and cvqualified versions of - these types (3.9.3) are collectively called scalar types. Scalar - types, POD-struct types, POD-union types (clause 9), arrays of - such types and cv-qualified versions of these types (3.9.3) are - collectively called POD types." - - "A POD-struct is an aggregate class that has no non-static data - members of type non-POD-struct, non-POD-union (or array of such - types) or reference, and has no user-defined copy assignment - operator and no user-defined destructor. Similarly, a POD-union - is an aggregate union that has no non-static data members of type - non-POD-struct, non-POD-union (or array of such types) or reference, - and has no userdefined copy assignment operator and no user-defined - destructor. A POD class is a class that is either a POD-struct or - a POD-union." - - "An aggregate is an array or a class (clause 9) with no - user-declared constructors (12.1), no private or protected - non-static data members (clause 11), no base classes (clause 10), - and no virtual functions (10.3)." - -\*******************************************************************/ +#include "cpp_typecheck.h" bool cpp_typecheckt::cpp_is_pod(const typet &type) const { diff --git a/src/cpp/cpp_item.h b/src/cpp/cpp_item.h index f3f32674278..75b7c3e120c 100644 --- a/src/cpp/cpp_item.h +++ b/src/cpp/cpp_item.h @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@cs.cmu.edu \*******************************************************************/ +/// \file +/// C++ Language Type Checking + #ifndef CPROVER_CPP_CPP_ITEM_H #define CPROVER_CPP_CPP_ITEM_H diff --git a/src/cpp/cpp_language.cpp b/src/cpp/cpp_language.cpp index f1b4b97018d..1f10dc2c4ae 100644 --- a/src/cpp/cpp_language.cpp +++ b/src/cpp/cpp_language.cpp @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@cs.cmu.edu \*******************************************************************/ +/// \file +/// C++ Language Module + #include #include #include @@ -26,18 +29,6 @@ Author: Daniel Kroening, kroening@cs.cmu.edu #include "cpp_typecheck.h" #include "cpp_type2name.h" -/*******************************************************************\ - -Function: cpp_languaget::extensions - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::set cpp_languaget::extensions() const { std::set s; @@ -56,35 +47,12 @@ std::set cpp_languaget::extensions() const return s; } -/*******************************************************************\ - -Function: cpp_languaget::modules_provided - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void cpp_languaget::modules_provided(std::set &modules) { modules.insert(get_base_name(parse_path, true)); } -/*******************************************************************\ - -Function: cpp_languaget::preprocess - - Inputs: - - Outputs: - - Purpose: ANSI-C preprocessing - -\*******************************************************************/ - +/// ANSI-C preprocessing bool cpp_languaget::preprocess( std::istream &instream, const std::string &path, @@ -111,18 +79,6 @@ bool cpp_languaget::preprocess( return c_preprocess(path, outstream, get_message_handler()); } -/*******************************************************************\ - -Function: cpp_languaget::parse - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool cpp_languaget::parse( std::istream &instream, const std::string &path) @@ -161,18 +117,6 @@ bool cpp_languaget::parse( return result; } -/*******************************************************************\ - -Function: cpp_languaget::typecheck - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool cpp_languaget::typecheck( symbol_tablet &symbol_table, const std::string &module) @@ -189,18 +133,6 @@ bool cpp_languaget::typecheck( return linking(symbol_table, new_symbol_table, get_message_handler()); } -/*******************************************************************\ - -Function: cpp_languaget::final - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool cpp_languaget::final(symbol_tablet &symbol_table) { if(ansi_c_entry_point(symbol_table, "main", get_message_handler())) @@ -209,18 +141,6 @@ bool cpp_languaget::final(symbol_tablet &symbol_table) return false; } -/*******************************************************************\ - -Function: cpp_languaget::show_parse - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void cpp_languaget::show_parse(std::ostream &out) { for(cpp_parse_treet::itemst::const_iterator it= @@ -230,18 +150,6 @@ void cpp_languaget::show_parse(std::ostream &out) show_parse(out, *it); } -/*******************************************************************\ - -Function: cpp_languaget::show_parse - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void cpp_languaget::show_parse( std::ostream &out, const cpp_itemt &item) @@ -296,35 +204,11 @@ void cpp_languaget::show_parse( out << "UNKNOWN: " << item.pretty() << std::endl; } -/*******************************************************************\ - -Function: new_cpp_language - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - languaget *new_cpp_language() { return new cpp_languaget; } -/*******************************************************************\ - -Function: cpp_languaget::from_expr - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool cpp_languaget::from_expr( const exprt &expr, std::string &code, @@ -334,18 +218,6 @@ bool cpp_languaget::from_expr( return false; } -/*******************************************************************\ - -Function: cpp_languaget::from_type - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool cpp_languaget::from_type( const typet &type, std::string &code, @@ -355,18 +227,6 @@ bool cpp_languaget::from_type( return false; } -/*******************************************************************\ - -Function: cpp_languaget::type_to_name - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool cpp_languaget::type_to_name( const typet &type, std::string &name, @@ -376,18 +236,6 @@ bool cpp_languaget::type_to_name( return false; } -/*******************************************************************\ - -Function: cpp_languaget::to_expr - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool cpp_languaget::to_expr( const std::string &code, const std::string &module, @@ -426,18 +274,6 @@ bool cpp_languaget::to_expr( return result; } -/*******************************************************************\ - -Function: cpp_languaget::~cpp_languaget - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - cpp_languaget::~cpp_languaget() { } diff --git a/src/cpp/cpp_language.h b/src/cpp/cpp_language.h index 329adbaa1a5..982e2e180c1 100644 --- a/src/cpp/cpp_language.h +++ b/src/cpp/cpp_language.h @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@cs.cmu.edu \*******************************************************************/ +/// \file +/// C++ Language Module + #ifndef CPROVER_CPP_CPP_LANGUAGE_H #define CPROVER_CPP_CPP_LANGUAGE_H diff --git a/src/cpp/cpp_linkage_spec.h b/src/cpp/cpp_linkage_spec.h index 67cf2c93b63..d7b6002ea60 100644 --- a/src/cpp/cpp_linkage_spec.h +++ b/src/cpp/cpp_linkage_spec.h @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@cs.cmu.edu \*******************************************************************/ +/// \file +/// C++ Language Type Checking + #ifndef CPROVER_CPP_CPP_LINKAGE_SPEC_H #define CPROVER_CPP_CPP_LINKAGE_SPEC_H diff --git a/src/cpp/cpp_name.cpp b/src/cpp/cpp_name.cpp index ae73ba3cbca..7fd959d91eb 100644 --- a/src/cpp/cpp_name.cpp +++ b/src/cpp/cpp_name.cpp @@ -6,23 +6,14 @@ Author: Daniel Kroening, kroening@cs.cmu.edu \*******************************************************************/ +/// \file +/// C++ Language Type Checking + #include #include #include "cpp_name.h" -/*******************************************************************\ - -Function: cpp_namet::get_base_name - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - irep_idt cpp_namet::get_base_name() const { const subt &sub=get_sub(); @@ -49,18 +40,6 @@ irep_idt cpp_namet::get_base_name() const return irep_idt(); } -/*******************************************************************\ - -Function: cpp_namet::convert - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - #if 0 void cpp_namet::convert( std::string &identifier, @@ -94,18 +73,6 @@ void cpp_namet::convert( } #endif -/*******************************************************************\ - -Function: cpp_namet::convert - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string cpp_namet::to_string() const { std::string str; diff --git a/src/cpp/cpp_namespace_spec.cpp b/src/cpp/cpp_namespace_spec.cpp index d7e8adb5eda..c4b60e3eb24 100644 --- a/src/cpp/cpp_namespace_spec.cpp +++ b/src/cpp/cpp_namespace_spec.cpp @@ -6,23 +6,14 @@ Author: Daniel Kroening, kroening@cs.cmu.edu \*******************************************************************/ +/// \file +/// C++ Language Type Checking + #include #include "cpp_namespace_spec.h" #include "cpp_item.h" -/*******************************************************************\ - -Function: cpp_namespace_spect::output - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void cpp_namespace_spect::output(std::ostream &out) const { out << " namespace: " << get_namespace() << "\n"; diff --git a/src/cpp/cpp_namespace_spec.h b/src/cpp/cpp_namespace_spec.h index 84aa6314086..ed96d1dd338 100644 --- a/src/cpp/cpp_namespace_spec.h +++ b/src/cpp/cpp_namespace_spec.h @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@cs.cmu.edu \*******************************************************************/ +/// \file +/// C++ Language Type Checking + #ifndef CPROVER_CPP_CPP_NAMESPACE_SPEC_H #define CPROVER_CPP_CPP_NAMESPACE_SPEC_H diff --git a/src/cpp/cpp_parse_tree.cpp b/src/cpp/cpp_parse_tree.cpp index 33614a83f53..9027c9ed3b0 100644 --- a/src/cpp/cpp_parse_tree.cpp +++ b/src/cpp/cpp_parse_tree.cpp @@ -6,37 +6,16 @@ Author: Daniel Kroening, kroening@cs.cmu.edu \*******************************************************************/ -#include "cpp_parse_tree.h" - -/*******************************************************************\ - -Function: cpp_parse_treet::swap - - Inputs: +/// \file +/// C++ Parser - Outputs: - - Purpose: - -\*******************************************************************/ +#include "cpp_parse_tree.h" void cpp_parse_treet::swap(cpp_parse_treet &cpp_parse_tree) { cpp_parse_tree.items.swap(items); } -/*******************************************************************\ - -Function: cpp_parse_treet::clear - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void cpp_parse_treet::clear() { items.clear(); diff --git a/src/cpp/cpp_parse_tree.h b/src/cpp/cpp_parse_tree.h index 9d620864247..afcd706fcef 100644 --- a/src/cpp/cpp_parse_tree.h +++ b/src/cpp/cpp_parse_tree.h @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@cs.cmu.edu \*******************************************************************/ +/// \file +/// C++ Parser + #ifndef CPROVER_CPP_CPP_PARSE_TREE_H #define CPROVER_CPP_CPP_PARSE_TREE_H diff --git a/src/cpp/cpp_parser.cpp b/src/cpp/cpp_parser.cpp index b72c6be6d5e..fd0135bb259 100644 --- a/src/cpp/cpp_parser.cpp +++ b/src/cpp/cpp_parser.cpp @@ -6,24 +6,15 @@ Author: Daniel Kroening, kroening@cs.cmu.edu \*******************************************************************/ +/// \file +/// C++ Parser + #include #include "cpp_parser.h" cpp_parsert cpp_parser; -/*******************************************************************\ - -Function: cpp_parsert::parse - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool cpp_parse(); bool cpp_parsert::parse() diff --git a/src/cpp/cpp_parser.h b/src/cpp/cpp_parser.h index f2db8e6c2f7..1a167f71f24 100644 --- a/src/cpp/cpp_parser.h +++ b/src/cpp/cpp_parser.h @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@cs.cmu.edu \*******************************************************************/ +/// \file +/// C++ Parser + #ifndef CPROVER_CPP_CPP_PARSER_H #define CPROVER_CPP_CPP_PARSER_H diff --git a/src/cpp/cpp_scope.cpp b/src/cpp/cpp_scope.cpp index 6254cc70af3..84ce1874ee6 100644 --- a/src/cpp/cpp_scope.cpp +++ b/src/cpp/cpp_scope.cpp @@ -6,21 +6,12 @@ Author: Daniel Kroening, kroening@cs.cmu.edu \*******************************************************************/ +/// \file +/// C++ Language Type Checking + #include "cpp_typecheck.h" #include "cpp_scope.h" -/*******************************************************************\ - -Function: cpp_scopet::operator << - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::ostream &operator << (std::ostream &out, cpp_scopet::lookup_kindt kind) { switch(kind) @@ -34,18 +25,6 @@ std::ostream &operator << (std::ostream &out, cpp_scopet::lookup_kindt kind) return out; } -/*******************************************************************\ - -Function: cpp_scopet::lookup - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void cpp_scopet::lookup( const irep_idt &base_name, lookup_kindt kind, @@ -109,18 +88,6 @@ void cpp_scopet::lookup( get_parent().lookup(base_name, kind, id_set); } -/*******************************************************************\ - -Function: cpp_scopet::lookup - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void cpp_scopet::lookup( const irep_idt &base_name, lookup_kindt kind, @@ -201,18 +168,6 @@ void cpp_scopet::lookup( get_parent().lookup(base_name, kind, id_class, id_set); } -/*******************************************************************\ - -Function: cpp_scopet::lookup_identifier - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void cpp_scopet::lookup_identifier( const irep_idt &identifier, cpp_idt::id_classt id_class, @@ -241,18 +196,6 @@ void cpp_scopet::lookup_identifier( #endif } -/*******************************************************************\ - -Function: cpp_scopet::new_scope - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - cpp_scopet &cpp_scopet::new_scope(const irep_idt &new_scope_name) { cpp_idt &id=insert(new_scope_name); @@ -265,18 +208,6 @@ cpp_scopet &cpp_scopet::new_scope(const irep_idt &new_scope_name) } -/*******************************************************************\ - -Function: cpp_scopet::contains - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool cpp_scopet::contains(const irep_idt &base_name) { id_sett id_set; diff --git a/src/cpp/cpp_scope.h b/src/cpp/cpp_scope.h index 0c806f427b8..690318edb43 100644 --- a/src/cpp/cpp_scope.h +++ b/src/cpp/cpp_scope.h @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@cs.cmu.edu \*******************************************************************/ +/// \file +/// C++ Language Type Checking + #ifndef CPROVER_CPP_CPP_SCOPE_H #define CPROVER_CPP_CPP_SCOPE_H diff --git a/src/cpp/cpp_scopes.cpp b/src/cpp/cpp_scopes.cpp index bdd78980e9b..2a9496fe7cd 100644 --- a/src/cpp/cpp_scopes.cpp +++ b/src/cpp/cpp_scopes.cpp @@ -6,41 +6,20 @@ Author: Daniel Kroening, kroening@cs.cmu.edu \*******************************************************************/ +/// \file +/// C++ Language Type Checking + #include #include "cpp_scopes.h" -/*******************************************************************\ - -Function: cpp_scopest::new_block_scope - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - cpp_scopet &cpp_scopest::new_block_scope() { unsigned prefix=++current_scope().compound_counter; return new_scope(std::to_string(prefix), cpp_idt::id_classt::BLOCK_SCOPE); } -/*******************************************************************\ - -Function: cpp_scopest::put_into_scope - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - cpp_idt &cpp_scopest::put_into_scope( const symbolt &symbol, cpp_scopet &scope, @@ -90,17 +69,7 @@ cpp_idt &cpp_scopest::put_into_scope( } } -/*******************************************************************\ - -Function: cpp_scopest::print_current - - Inputs: - - Outputs: - Purpose: - -\*******************************************************************/ - +/// \return Purpose: void cpp_scopest::print_current(std::ostream &out) const { const cpp_scopet *scope=current_scope_ptr; diff --git a/src/cpp/cpp_scopes.h b/src/cpp/cpp_scopes.h index 92d9ebdb6e2..ca392497c7d 100644 --- a/src/cpp/cpp_scopes.h +++ b/src/cpp/cpp_scopes.h @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@cs.cmu.edu \*******************************************************************/ +/// \file +/// C++ Language Type Checking + #ifndef CPROVER_CPP_CPP_SCOPES_H #define CPROVER_CPP_CPP_SCOPES_H diff --git a/src/cpp/cpp_static_assert.h b/src/cpp/cpp_static_assert.h index 64b3d5bcf6a..be784ca51f1 100644 --- a/src/cpp/cpp_static_assert.h +++ b/src/cpp/cpp_static_assert.h @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@cs.cmu.edu \*******************************************************************/ +/// \file +/// C++ Language Type Checking + #ifndef CPROVER_CPP_CPP_STATIC_ASSERT_H #define CPROVER_CPP_CPP_STATIC_ASSERT_H diff --git a/src/cpp/cpp_template_args.h b/src/cpp/cpp_template_args.h index 5fa708879a8..47ceca5f003 100644 --- a/src/cpp/cpp_template_args.h +++ b/src/cpp/cpp_template_args.h @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@cs.cmu.edu \*******************************************************************/ +/// \file +/// C++ Language Type Checking + #ifndef CPROVER_CPP_CPP_TEMPLATE_ARGS_H #define CPROVER_CPP_CPP_TEMPLATE_ARGS_H diff --git a/src/cpp/cpp_token.h b/src/cpp/cpp_token.h index a022cf92df2..800ac372353 100644 --- a/src/cpp/cpp_token.h +++ b/src/cpp/cpp_token.h @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@cs.cmu.edu \*******************************************************************/ +/// \file +/// C++ Parser: Token + #ifndef CPROVER_CPP_CPP_TOKEN_H #define CPROVER_CPP_CPP_TOKEN_H diff --git a/src/cpp/cpp_token_buffer.cpp b/src/cpp/cpp_token_buffer.cpp index 9dcd75526e6..a59b0b199ff 100644 --- a/src/cpp/cpp_token_buffer.cpp +++ b/src/cpp/cpp_token_buffer.cpp @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@cs.cmu.edu \*******************************************************************/ +/// \file +/// C++ Parser: Token Buffer + #include #include @@ -13,18 +16,6 @@ Author: Daniel Kroening, kroening@cs.cmu.edu #include "cpp_token_buffer.h" -/*******************************************************************\ - -Function: cpp_token_buffert::LookAhead - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - int cpp_token_buffert::LookAhead(unsigned offset) { assert(current_pos<=token_vector.size()); @@ -37,18 +28,6 @@ int cpp_token_buffert::LookAhead(unsigned offset) return token_vector[offset]->kind; } -/*******************************************************************\ - -Function: cpp_token_buffert::get_token - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - int cpp_token_buffert::get_token(cpp_tokent &token) { assert(current_pos<=token_vector.size()); @@ -63,18 +42,6 @@ int cpp_token_buffert::get_token(cpp_tokent &token) return token.kind; } -/*******************************************************************\ - -Function: cpp_token_buffert::get_token - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - int cpp_token_buffert::get_token() { assert(current_pos<=token_vector.size()); @@ -89,18 +56,6 @@ int cpp_token_buffert::get_token() return kind; } -/*******************************************************************\ - -Function: cpp_token_buffert::LookAhead - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - int cpp_token_buffert::LookAhead(unsigned offset, cpp_tokent &token) { assert(current_pos<=token_vector.size()); @@ -115,18 +70,6 @@ int cpp_token_buffert::LookAhead(unsigned offset, cpp_tokent &token) return token.kind; } -/*******************************************************************\ - -Function: cpp_token_buffert::read_token - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - int yyansi_clex(); extern char *yyansi_ctext; @@ -155,52 +98,16 @@ void cpp_token_buffert::read_token() // std::cout << "I2: " << token_vector.size() << std::endl; } -/*******************************************************************\ - -Function: cpp_token_buffert::Save - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - cpp_token_buffert::post cpp_token_buffert::Save() { return current_pos; } -/*******************************************************************\ - -Function: cpp_token_buffert::Restore - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void cpp_token_buffert::Restore(post pos) { current_pos=pos; } -/*******************************************************************\ - -Function: cpp_token_buffert::Replace - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void cpp_token_buffert::Replace(const cpp_tokent &token) { assert(current_pos<=token_vector.size()); @@ -211,18 +118,6 @@ void cpp_token_buffert::Replace(const cpp_tokent &token) *token_vector[current_pos]=token; } -/*******************************************************************\ - -Function: cpp_token_buffert::Replace - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void cpp_token_buffert::Insert(const cpp_tokent &token) { assert(current_pos<=token_vector.size()); diff --git a/src/cpp/cpp_token_buffer.h b/src/cpp/cpp_token_buffer.h index e4e90422853..859945787bd 100644 --- a/src/cpp/cpp_token_buffer.h +++ b/src/cpp/cpp_token_buffer.h @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@cs.cmu.edu \*******************************************************************/ +/// \file +/// C++ Parser: Token Buffer + #ifndef CPROVER_CPP_CPP_TOKEN_BUFFER_H #define CPROVER_CPP_CPP_TOKEN_BUFFER_H diff --git a/src/cpp/cpp_type2name.cpp b/src/cpp/cpp_type2name.cpp index 98842b8b41a..6a938a9a4f0 100644 --- a/src/cpp/cpp_type2name.cpp +++ b/src/cpp/cpp_type2name.cpp @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@cs.cmu.edu \*******************************************************************/ +/// \file +/// C++ Language Module + #include #include @@ -13,18 +16,6 @@ Author: Daniel Kroening, kroening@cs.cmu.edu #include "cpp_type2name.h" -/*******************************************************************\ - -Function: do_prefix - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - static std::string do_prefix(const std::string &s) { if(s.find(',')!=std::string::npos || @@ -34,18 +25,6 @@ static std::string do_prefix(const std::string &s) return s; } -/*******************************************************************\ - -Function: irep2name - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - static void irep2name(const irept &irep, std::string &result) { result=""; @@ -109,18 +88,6 @@ static void irep2name(const irept &irep, std::string &result) result+=')'; } -/*******************************************************************\ - -Function: cpp_type2name - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string cpp_type2name(const typet &type) { std::string result; @@ -203,18 +170,6 @@ std::string cpp_type2name(const typet &type) return result; } -/*******************************************************************\ - -Function: cpp_expr2name - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string cpp_expr2name(const exprt &expr) { std::string tmp; diff --git a/src/cpp/cpp_type2name.h b/src/cpp/cpp_type2name.h index ffb2a99eef6..96aa6b58d8c 100644 --- a/src/cpp/cpp_type2name.h +++ b/src/cpp/cpp_type2name.h @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@cs.cmu.edu \*******************************************************************/ +/// \file +/// C++ Language Module + #ifndef CPROVER_CPP_CPP_TYPE2NAME_H #define CPROVER_CPP_CPP_TYPE2NAME_H diff --git a/src/cpp/cpp_typecheck.cpp b/src/cpp/cpp_typecheck.cpp index fe8a9f063d7..0b15d9538f9 100644 --- a/src/cpp/cpp_typecheck.cpp +++ b/src/cpp/cpp_typecheck.cpp @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@cs.cmu.edu \*******************************************************************/ +/// \file +/// C++ Language Type Checking + #include #include @@ -20,18 +23,6 @@ Author: Daniel Kroening, kroening@cs.cmu.edu #include "cpp_convert_type.h" #include "cpp_declarator.h" -/*******************************************************************\ - -Function: cpp_typecheckt::convert - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void cpp_typecheckt::convert(cpp_itemt &item) { if(item.is_declaration()) @@ -52,18 +43,7 @@ void cpp_typecheckt::convert(cpp_itemt &item) } } -/*******************************************************************\ - -Function: cpp_typecheckt::typecheck - - Inputs: - - Outputs: - - Purpose: typechecking main method - -\*******************************************************************/ - +/// typechecking main method void cpp_typecheckt::typecheck() { // default linkage is "automatic" @@ -79,18 +59,6 @@ void cpp_typecheckt::typecheck() clean_up(); } -/*******************************************************************\ - -Function: cpp_typecheckt::this_struct_type - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - const struct_typet &cpp_typecheckt::this_struct_type() { const exprt &this_expr= @@ -104,52 +72,16 @@ const struct_typet &cpp_typecheckt::this_struct_type() return to_struct_type(t); } -/*******************************************************************\ - -Function: cpp_typecheckt::to_string - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string cpp_typecheckt::to_string(const exprt &expr) { return expr2cpp(expr, *this); } -/*******************************************************************\ - -Function: cpp_typecheckt::to_string - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string cpp_typecheckt::to_string(const typet &type) { return type2cpp(type, *this); } -/*******************************************************************\ - -Function: cpp_typecheck - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool cpp_typecheck( cpp_parse_treet &cpp_parse_tree, symbol_tablet &symbol_table, @@ -161,18 +93,6 @@ bool cpp_typecheck( return cpp_typecheck.typecheck_main(); } -/*******************************************************************\ - -Function: cpp_typecheck - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool cpp_typecheck( exprt &expr, message_handlert &message_handler, @@ -207,31 +127,20 @@ bool cpp_typecheck( return cpp_typecheck.get_error_found(); } -/*******************************************************************\ - -Function: cpp_typecheckt::static_and_dynamic_initialization - - Inputs: - - Outputs: - - Purpose: Initialization of static objects: - - "Objects with static storage duration (3.7.1) shall be zero-initialized - (8.5) before any other initialization takes place. Zero-initialization - and initialization with a constant expression are collectively called - static initialization; all other initialization is dynamic - initialization. Objects of POD types (3.9) with static storage duration - initialized with constant expressions (5.19) shall be initialized before - any dynamic initialization takes place. Objects with static storage - duration defined in namespace scope in the same translation unit and - dynamically initialized shall be initialized in the order in which their - definition appears in the translation unit. [Note: 8.5.1 describes the - order in which aggregate members are initialized. The initialization - of local static objects is described in 6.7. ]" - -\*******************************************************************/ - +/// Initialization of static objects: +/// +/// "Objects with static storage duration (3.7.1) shall be zero-initialized +/// (8.5) before any other initialization takes place. Zero-initialization +/// and initialization with a constant expression are collectively called +/// static initialization; all other initialization is dynamic +/// initialization. Objects of POD types (3.9) with static storage duration +/// initialized with constant expressions (5.19) shall be initialized before +/// any dynamic initialization takes place. Objects with static storage +/// duration defined in namespace scope in the same translation unit and +/// dynamically initialized shall be initialized in the order in which their +/// definition appears in the translation unit. [Note: 8.5.1 describes the +/// order in which aggregate members are initialized. The initialization +/// of local static objects is described in 6.7. ]" void cpp_typecheckt::static_and_dynamic_initialization() { code_blockt init_block; // Dynamic Initialization Block @@ -302,18 +211,6 @@ void cpp_typecheckt::static_and_dynamic_initialization() disable_access_control=false; } -/*******************************************************************\ - -Function: cpp_typecheckt::do_not_typechecked - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void cpp_typecheckt::do_not_typechecked() { bool cont; @@ -363,18 +260,6 @@ void cpp_typecheckt::do_not_typechecked() } } -/*******************************************************************\ - -Function: cpp_typecheckt::clean_up - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void cpp_typecheckt::clean_up() { symbol_tablet::symbolst::iterator it=symbol_table.symbols.begin(); diff --git a/src/cpp/cpp_typecheck.h b/src/cpp/cpp_typecheck.h index 55955cd0334..5c0a6afe285 100644 --- a/src/cpp/cpp_typecheck.h +++ b/src/cpp/cpp_typecheck.h @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@cs.cmu.edu \*******************************************************************/ +/// \file +/// C++ Language Type Checking + #ifndef CPROVER_CPP_CPP_TYPECHECK_H #define CPROVER_CPP_CPP_TYPECHECK_H diff --git a/src/cpp/cpp_typecheck_bases.cpp b/src/cpp/cpp_typecheck_bases.cpp index 1c768d63153..7432b7a382b 100644 --- a/src/cpp/cpp_typecheck_bases.cpp +++ b/src/cpp/cpp_typecheck_bases.cpp @@ -6,22 +6,13 @@ Author: Daniel Kroening, kroening@cs.cmu.edu \*******************************************************************/ +/// \file +/// C++ Language Type Checking + #include #include "cpp_typecheck.h" -/*******************************************************************\ - -Function: cpp_typecheckt::typcheck_compound_bases - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void cpp_typecheckt::typecheck_compound_bases(struct_typet &type) { std::set bases; @@ -126,18 +117,6 @@ void cpp_typecheckt::typecheck_compound_bases(struct_typet &type) } } -/*******************************************************************\ - -Function: cpp_typecheckt::add_base_components - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void cpp_typecheckt::add_base_components( const struct_typet &from, const irep_idt &access, diff --git a/src/cpp/cpp_typecheck_code.cpp b/src/cpp/cpp_typecheck_code.cpp index f375cd4dbf6..a85b1a5c92f 100644 --- a/src/cpp/cpp_typecheck_code.cpp +++ b/src/cpp/cpp_typecheck_code.cpp @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@cs.cmu.edu \*******************************************************************/ +/// \file +/// C++ Language Type Checking + #include #include "cpp_typecheck.h" @@ -15,18 +18,6 @@ Author: Daniel Kroening, kroening@cs.cmu.edu #include "cpp_util.h" #include "cpp_exception_id.h" -/*******************************************************************\ - -Function: cpp_typecheckt::typecheck_code - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void cpp_typecheckt::typecheck_code(codet &code) { const irep_idt &statement=code.get_statement(); @@ -49,18 +40,6 @@ void cpp_typecheckt::typecheck_code(codet &code) c_typecheck_baset::typecheck_code(code); } -/*******************************************************************\ - -Function: cpp_typecheckt::typecheck_try_catch - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void cpp_typecheckt::typecheck_try_catch(codet &code) { codet::operandst &operands=code.operands(); @@ -127,18 +106,6 @@ void cpp_typecheckt::typecheck_try_catch(codet &code) } } -/*******************************************************************\ - -Function: cpp_typecheckt::typecheck_ifthenelse - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void cpp_typecheckt::typecheck_ifthenelse(code_ifthenelset &code) { // In addition to the C syntax, C++ also allows a declaration @@ -153,18 +120,6 @@ void cpp_typecheckt::typecheck_ifthenelse(code_ifthenelset &code) c_typecheck_baset::typecheck_ifthenelse(code); } -/*******************************************************************\ - -Function: cpp_typecheckt::typecheck_while - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void cpp_typecheckt::typecheck_while(code_whilet &code) { // In addition to the C syntax, C++ also allows a declaration @@ -179,18 +134,6 @@ void cpp_typecheckt::typecheck_while(code_whilet &code) c_typecheck_baset::typecheck_while(code); } -/*******************************************************************\ - -Function: cpp_typecheckt::typecheck_switch - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void cpp_typecheckt::typecheck_switch(code_switcht &code) { // In addition to the C syntax, C++ also allows a declaration @@ -222,18 +165,6 @@ void cpp_typecheckt::typecheck_switch(code_switcht &code) c_typecheck_baset::typecheck_switch(code); } -/*******************************************************************\ - -Function: cpp_typecheckt::typecheck_member_initializer - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void cpp_typecheckt::typecheck_member_initializer(codet &code) { const cpp_namet &member= @@ -413,18 +344,6 @@ void cpp_typecheckt::typecheck_member_initializer(codet &code) } } -/*******************************************************************\ - -Function: cpp_typecheckt::typecheck_decl - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void cpp_typecheckt::typecheck_decl(codet &code) { if(code.operands().size()!=1) @@ -518,18 +437,6 @@ void cpp_typecheckt::typecheck_decl(codet &code) code.swap(new_code); } -/*******************************************************************\ - -Function: cpp_typecheck_codet::typecheck_block - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void cpp_typecheckt::typecheck_block(codet &code) { cpp_save_scopet saved_scope(cpp_scopes); @@ -538,18 +445,6 @@ void cpp_typecheckt::typecheck_block(codet &code) c_typecheck_baset::typecheck_block(code); } -/*******************************************************************\ - -Function: cpp_typecheckt::typecheck_assign - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void cpp_typecheckt::typecheck_assign(codet &code) { if(code.operands().size()!=2) diff --git a/src/cpp/cpp_typecheck_compound_type.cpp b/src/cpp/cpp_typecheck_compound_type.cpp index 56db1bbba6c..2a9a9368f90 100644 --- a/src/cpp/cpp_typecheck_compound_type.cpp +++ b/src/cpp/cpp_typecheck_compound_type.cpp @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@cs.cmu.edu \*******************************************************************/ +/// \file +/// C++ Language Type Checking + #include #include @@ -20,18 +23,6 @@ Author: Daniel Kroening, kroening@cs.cmu.edu #include "cpp_convert_type.h" #include "cpp_name.h" -/*******************************************************************\ - -Function: cpp_typecheckt::has_const - -Inputs: - -Outputs: - -Purpose: - -\*******************************************************************/ - bool cpp_typecheckt::has_const(const typet &type) { if(type.id()==ID_const) @@ -48,18 +39,6 @@ bool cpp_typecheckt::has_const(const typet &type) return false; } -/*******************************************************************\ - -Function: cpp_typecheckt::has_volatile - -Inputs: - -Outputs: - -Purpose: - -\*******************************************************************/ - bool cpp_typecheckt::has_volatile(const typet &type) { if(type.id()==ID_volatile) @@ -76,18 +55,6 @@ bool cpp_typecheckt::has_volatile(const typet &type) return false; } -/*******************************************************************\ - -Function: cpp_typecheckt::tag_scope - -Inputs: - -Outputs: - -Purpose: - -\*******************************************************************/ - cpp_scopet &cpp_typecheckt::tag_scope( const irep_idt &base_name, bool has_body, @@ -127,18 +94,6 @@ cpp_scopet &cpp_typecheckt::tag_scope( return cpp_scopes.get_global_scope(); } -/*******************************************************************\ - -Function: cpp_typecheckt::typecheck_compound_type - -Inputs: - -Outputs: - -Purpose: - -\*******************************************************************/ - void cpp_typecheckt::typecheck_compound_type( struct_union_typet &type) { @@ -294,18 +249,6 @@ void cpp_typecheckt::typecheck_compound_type( type.swap(symbol_type); } -/*******************************************************************\ - -Function: cpp_typecheckt::typecheck_compound_declarator - -Inputs: - -Outputs: - -Purpose: - -\*******************************************************************/ - void cpp_typecheckt::typecheck_compound_declarator( const symbolt &symbol, const cpp_declarationt &declaration, @@ -804,18 +747,7 @@ void cpp_typecheckt::typecheck_compound_declarator( components.push_back(component); } -/*******************************************************************\ - -Function: cpp_typecheckt::check_fixed_size_array - -Inputs: - -Outputs: - -Purpose: check that an array has fixed size - -\*******************************************************************/ - +/// check that an array has fixed size void cpp_typecheckt::check_fixed_size_array(typet &type) { if(type.id()==ID_array) @@ -830,18 +762,6 @@ void cpp_typecheckt::check_fixed_size_array(typet &type) } } -/*******************************************************************\ - -Function: cpp_typecheckt::put_compound_into_scope - -Inputs: - -Outputs: - -Purpose: - -\*******************************************************************/ - void cpp_typecheckt::put_compound_into_scope( const struct_union_typet::componentt &compound) { @@ -918,18 +838,6 @@ void cpp_typecheckt::put_compound_into_scope( } } -/*******************************************************************\ - -Function: cpp_typecheckt::typecheck_friend_declaration - -Inputs: - -Outputs: - -Purpose: - -\*******************************************************************/ - void cpp_typecheckt::typecheck_friend_declaration( symbolt &symbol, cpp_declarationt &declaration) @@ -1014,18 +922,6 @@ void cpp_typecheckt::typecheck_friend_declaration( } } -/*******************************************************************\ - -Function: cpp_typecheckt::typecheck_compound_body - -Inputs: - -Outputs: - -Purpose: - -\*******************************************************************/ - void cpp_typecheckt::typecheck_compound_body(symbolt &symbol) { cpp_save_scopet saved_scope(cpp_scopes); @@ -1308,18 +1204,6 @@ void cpp_typecheckt::typecheck_compound_body(symbolt &symbol) symbol.type.remove(ID_body); } -/*******************************************************************\ - -Function: cpp_typecheckt::move_member_initializers - -Inputs: - -Outputs: - -Purpose: - -\*******************************************************************/ - void cpp_typecheckt::move_member_initializers( irept &initializers, const typet &type, @@ -1362,18 +1246,6 @@ void cpp_typecheckt::move_member_initializers( } } -/*******************************************************************\ - -Function: cpp_typecheckt::typecheck_member_function - -Inputs: - -Outputs: - -Purpose: - -\*******************************************************************/ - void cpp_typecheckt::typecheck_member_function( const irep_idt &compound_identifier, struct_typet::componentt &component, @@ -1456,18 +1328,6 @@ void cpp_typecheckt::typecheck_member_function( add_method_body(new_symbol); } -/*******************************************************************\ - -Function: cpp_typecheckt::add_this_to_method_type - -Inputs: - -Outputs: - -Purpose: - -\*******************************************************************/ - void cpp_typecheckt::add_this_to_method_type( const irep_idt &compound_symbol, typet &type, @@ -1495,18 +1355,6 @@ void cpp_typecheckt::add_this_to_method_type( parameter.type()=pointer_typet(subtype); } -/*******************************************************************\ - -Function: cpp_typecheckt::add_anonymous_members_to_scope - -Inputs: - -Outputs: - -Purpose: - -\*******************************************************************/ - void cpp_typecheckt::add_anonymous_members_to_scope( const symbolt &struct_union_symbol) { @@ -1557,18 +1405,6 @@ void cpp_typecheckt::add_anonymous_members_to_scope( } } -/*******************************************************************\ - -Function: cpp_typecheckt::convert_anon_struct_union_member - -Inputs: - -Outputs: - -Purpose: - -\*******************************************************************/ - void cpp_typecheckt::convert_anon_struct_union_member( const cpp_declarationt &declaration, const irep_idt &access, @@ -1620,18 +1456,6 @@ void cpp_typecheckt::convert_anon_struct_union_member( struct_union_symbol.type.set("#unnamed_object", base_name); } -/*******************************************************************\ - -Function: cpp_typecheckt::get_component - -Inputs: - -Outputs: - -Purpose: - -\*******************************************************************/ - bool cpp_typecheckt::get_component( const source_locationt &source_location, const exprt &object, @@ -1732,18 +1556,6 @@ bool cpp_typecheckt::get_component( return false; // component not found } -/*******************************************************************\ - -Function: cpp_typecheckt::check_component_access - -Inputs: - -Outputs: - -Purpose: - -\*******************************************************************/ - bool cpp_typecheckt::check_component_access( const struct_union_typet::componentt &component, const struct_union_typet &struct_union_type) @@ -1810,18 +1622,6 @@ bool cpp_typecheckt::check_component_access( return true; // not ok } -/*******************************************************************\ - -Function: cpp_typecheckt::get_bases - -Inputs: - -Outputs: - -Purpose: - -\*******************************************************************/ - void cpp_typecheckt::get_bases( const struct_typet &type, std::set &set_bases) const @@ -1841,18 +1641,6 @@ void cpp_typecheckt::get_bases( } } -/*******************************************************************\ - -Function: cpp_typecheckt::get_virtual_bases - -Inputs: - -Outputs: - -Purpose: - -\*******************************************************************/ - void cpp_typecheckt::get_virtual_bases( const struct_typet &type, std::list &vbases) const @@ -1877,18 +1665,6 @@ void cpp_typecheckt::get_virtual_bases( } } -/*******************************************************************\ - -Function: cpp_typecheckt::subtype_typecast - -Inputs: - -Outputs: - -Purpose: - -\*******************************************************************/ - bool cpp_typecheckt::subtype_typecast( const struct_typet &from, const struct_typet &to) const @@ -1903,18 +1679,6 @@ bool cpp_typecheckt::subtype_typecast( return bases.find(to.get(ID_name))!=bases.end(); } -/*******************************************************************\ - -Function: cpp_typecheckt::make_ptr_subtypecast - -Inputs: - -Outputs: - -Purpose: - -\*******************************************************************/ - void cpp_typecheckt::make_ptr_typecast( exprt &expr, const typet &dest_type) diff --git a/src/cpp/cpp_typecheck_constructor.cpp b/src/cpp/cpp_typecheck_constructor.cpp index 01cc9ca7123..61e52f3e5c9 100644 --- a/src/cpp/cpp_typecheck_constructor.cpp +++ b/src/cpp/cpp_typecheck_constructor.cpp @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@cs.cmu.edu \*******************************************************************/ +/// \file +/// C++ Language Type Checking + #include #include #include @@ -15,19 +18,9 @@ Author: Daniel Kroening, kroening@cs.cmu.edu #include "cpp_typecheck.h" #include "cpp_util.h" -/*******************************************************************\ - -Function: copy_parent - - Inputs: parent_base_name: base name of typechecked parent - block: non-typechecked block - - Outputs: generate code to copy the parent - - Purpose: - -\*******************************************************************/ - +/// \param parent_base_name: base name of typechecked parent +/// \param block: non-typechecked block +/// \return generate code to copy the parent static void copy_parent( const source_locationt &source_location, const irep_idt &parent_base_name, @@ -66,19 +59,9 @@ static void copy_parent( op1.add_source_location()=source_location; } -/*******************************************************************\ - -Function: copy_member - - Inputs: member_base_name: name of a member - block: non-typechecked block - - Outputs: generate code to copy the member - - Purpose: - -\*******************************************************************/ - +/// \param member_base_name: name of a member +/// \param block: non-typechecked block +/// \return generate code to copy the member static void copy_member( const source_locationt &source_location, const irep_idt &member_base_name, @@ -120,20 +103,10 @@ static void copy_member( op1.add_source_location()=source_location; } -/*******************************************************************\ - -Function: copy_array - - Inputs: member_base_name: name of array member - index: index to copy - block: non-typechecked block - - Outputs: generate code to copy the member - - Purpose: - -\*******************************************************************/ - +/// \param member_base_name: name of array member +/// \param index: index to copy +/// \param block: non-typechecked block +/// \return generate code to copy the member static void copy_array( const source_locationt &source_location, const irep_idt &member_base_name, @@ -182,18 +155,7 @@ static void copy_array( op1.add_source_location()=source_location; } -/*******************************************************************\ - -Function: cpp_typecheckt::default_ctor - - Inputs: - - Outputs: - - Purpose: Generate code for implicit default constructors - -\*******************************************************************/ - +/// Generate code for implicit default constructors void cpp_typecheckt::default_ctor( const source_locationt &source_location, const irep_idt &base_name, @@ -222,18 +184,7 @@ void cpp_typecheckt::default_ctor( ctor.add_source_location()=source_location; } -/*******************************************************************\ - -Function: cpp_typecheckt::default_cpctor - - Inputs: - - Outputs: - - Purpose: Generate code for implicit default copy constructor - -\*******************************************************************/ - +/// Generate code for implicit default copy constructor void cpp_typecheckt::default_cpctor( const symbolt &symbol, cpp_declarationt &cpctor) const @@ -402,19 +353,7 @@ void cpp_typecheckt::default_cpctor( } } -/*******************************************************************\ - -Function: cpp_typecheckt::default_assignop - - Inputs: - - Outputs: - - Purpose: Generate declarartion of the implicit default assignment - operator - -\*******************************************************************/ - +/// Generate declarartion of the implicit default assignment operator void cpp_typecheckt::default_assignop( const symbolt &symbol, cpp_declarationt &cpctor) @@ -488,18 +427,7 @@ void cpp_typecheckt::default_assignop( args_decl_declor.value().make_nil(); } -/*******************************************************************\ - -Function: cpp_typecheckt::default_assignop_value - - Inputs: - - Outputs: - - Purpose: Generate code for the implicit default assignment operator - -\*******************************************************************/ - +/// Generate code for the implicit default assignment operator void cpp_typecheckt::default_assignop_value( const symbolt &symbol, cpp_declaratort &declarator) @@ -580,24 +508,13 @@ void cpp_typecheckt::default_assignop_value( ret_code.type()=code_typet(); } -/*******************************************************************\ - -Function: check_member_initializers - - Inputs: bases: the parents of the class - components: the components of the class - initializers: the constructor initializers - - Outputs: If an invalid initializer is found, then - the method outputs an error message and - throws a 0 exception. - - Purpose: Check a constructor initialization-list. - An initalizer has to be a data member declared - in this class or a direct-parent constructor. - -\*******************************************************************/ - +/// Check a constructor initialization-list. An initalizer has to be a data +/// member declared in this class or a direct-parent constructor. +/// \param bases: the parents of the class +/// \param components: the components of the class +/// \param initializers: the constructor initializers +/// \return If an invalid initializer is found, then the method outputs an error +/// message and throws a 0 exception. void cpp_typecheckt::check_member_initializers( const irept &bases, const struct_typet::componentst &components, @@ -726,23 +643,14 @@ void cpp_typecheckt::check_member_initializers( } } -/*******************************************************************\ - -Function: full_member_initialization - - Inputs: struct_union_type: the class/struct/union - initializers: the constructor initializers - - Outputs: initializers is updated. - - Purpose: Build the full initialization list of the constructor. - First, all the direct-parent constructors are called. - Second, all the non-pod data members are initialized. - - Note: The initialization order follows the decalration order. - -\*******************************************************************/ - +/// Build the full initialization list of the constructor. First, all the +/// direct-parent constructors are called. Second, all the non-pod data members +/// are initialized. +/// +/// Note: The initialization order follows the decalration order. +/// \param struct_union_type: the class/struct/union +/// \param initializers: the constructor initializers +/// \return initializers is updated. void cpp_typecheckt::full_member_initialization( const struct_union_typet &struct_union_type, irept &initializers) @@ -1006,23 +914,8 @@ void cpp_typecheckt::full_member_initialization( initializers.swap(final_initializers); } -/*******************************************************************\ - -Function: find_cpctor - - Inputs: typechecked compound symbol - - Outputs: return true if a copy constructor is found - - Note: - "A non-template constructor for class X is a copy constructor - if its first parameter is of type X&, const X&, volatile X& - or const volatile X&, and either there are no other parameters - or else all other parameters have default arguments (8.3.6).106) - [Example: X::X(const X&) and X::X(X&, int=1) are copy constructors." - -\*******************************************************************/ - +/// \par parameters: typechecked compound symbol +/// \return return true if a copy constructor is found bool cpp_typecheckt::find_cpctor(const symbolt &symbol) const { const struct_typet &struct_type=to_struct_type(symbol.type); @@ -1080,18 +973,6 @@ bool cpp_typecheckt::find_cpctor(const symbolt &symbol) const return false; } -/*******************************************************************\ - -Function: cpp_typecheckt::find_assignop - - Inputs: - - Outputs: - - Note: - -\*******************************************************************/ - bool cpp_typecheckt::find_assignop(const symbolt &symbol) const { const struct_typet &struct_type=to_struct_type(symbol.type); diff --git a/src/cpp/cpp_typecheck_conversions.cpp b/src/cpp/cpp_typecheck_conversions.cpp index 16d8e519741..186d7479ac5 100644 --- a/src/cpp/cpp_typecheck_conversions.cpp +++ b/src/cpp/cpp_typecheck_conversions.cpp @@ -6,6 +6,9 @@ Module: C++ Language Type Checking \*******************************************************************/ +/// \file +/// C++ Language Type Checking + #include #include @@ -19,35 +22,26 @@ Module: C++ Language Type Checking #include "cpp_typecheck.h" -/*******************************************************************\ - -Function: standard_conversion_lvalue_to_rvalue - - Inputs: A typechecked lvalue expression - - Outputs: True iff the lvalue-to-rvalue conversion is possible. - 'new_type' contains the result of the conversion. - - Purpose: Lvalue-to-rvalue conversion - - An lvalue (3.10) of a non-function, non-array type T can be - converted to an rvalue. If T is an incomplete type, a program - that necessitates this conversion is ill-formed. If the object - to which the lvalue refers is not an object of type T and is - not an object of a type derived from T, or if the object is - uninitialized, a program that necessitates this conversion has - undefined behavior. If T is a non-class type, the type of the - rvalue is the cv-unqualified version of T. Otherwise, the type of - the rvalue is T. - - The value contained in the object indicated by the lvalue - is the rvalue result. When an lvalue-to-rvalue conversion - occurs within the operand of sizeof (5.3.3) the value contained - in the referenced object is not accessed, since that operator - does not evaluate its operand. - -\*******************************************************************/ - +/// Lvalue-to-rvalue conversion +/// +/// An lvalue (3.10) of a non-function, non-array type T can be +/// converted to an rvalue. If T is an incomplete type, a program +/// that necessitates this conversion is ill-formed. If the object +/// to which the lvalue refers is not an object of type T and is +/// not an object of a type derived from T, or if the object is +/// uninitialized, a program that necessitates this conversion has +/// undefined behavior. If T is a non-class type, the type of the +/// rvalue is the cv-unqualified version of T. Otherwise, the type of +/// the rvalue is T. +/// +/// The value contained in the object indicated by the lvalue +/// is the rvalue result. When an lvalue-to-rvalue conversion +/// occurs within the operand of sizeof (5.3.3) the value contained +/// in the referenced object is not accessed, since that operator +/// does not evaluate its operand. +/// \par parameters: A typechecked lvalue expression +/// \return True iff the lvalue-to-rvalue conversion is possible. 'new_type' +/// contains the result of the conversion. bool cpp_typecheckt::standard_conversion_lvalue_to_rvalue( const exprt &expr, exprt &new_expr) const @@ -65,23 +59,14 @@ bool cpp_typecheckt::standard_conversion_lvalue_to_rvalue( return true; } -/*******************************************************************\ - -Function: standard_conversion_array_to_pointer - - Inputs: An array expression - - Outputs: True iff the array-to-pointer conversion is possible. - The result of the conversion is stored in 'new_expr'. - - Purpose: Array-to-pointer conversion - - An lvalue or rvalue of type "array of N T" or "array of unknown - bound of T" can be converted to an rvalue of type "pointer to T." - The result is a pointer to the first element of the array. - -\*******************************************************************/ - +/// Array-to-pointer conversion +/// +/// An lvalue or rvalue of type "array of N T" or "array of unknown +/// bound of T" can be converted to an rvalue of type "pointer to T." +/// The result is a pointer to the first element of the array. +/// \par parameters: An array expression +/// \return True iff the array-to-pointer conversion is possible. The result of +/// the conversion is stored in 'new_expr'. bool cpp_typecheckt::standard_conversion_array_to_pointer( const exprt &expr, exprt &new_expr) const @@ -101,23 +86,13 @@ bool cpp_typecheckt::standard_conversion_array_to_pointer( return true; } -/*******************************************************************\ - -Function: standard_conversion_function_to_pointer - - Inputs: A function expression - - Outputs: True iff the array-to-pointer conversion is possible. - The result of the conversion is stored in 'new_expr'. - - - Purpose: Function-to-pointer conversion - - An lvalue of function type T can be converted to an rvalue of type - "pointer to T." The result is a pointer to the function.50) - -\*******************************************************************/ - +/// Function-to-pointer conversion +/// +/// An lvalue of function type T can be converted to an rvalue of type +/// "pointer to T." The result is a pointer to the function.50) +/// \par parameters: A function expression +/// \return True iff the array-to-pointer conversion is possible. The result of +/// the conversion is stored in 'new_expr'. bool cpp_typecheckt::standard_conversion_function_to_pointer( const exprt &expr, exprt &new_expr) const { @@ -136,20 +111,11 @@ bool cpp_typecheckt::standard_conversion_function_to_pointer( return true; } -/*******************************************************************\ - -Function: standard_conversion_qualification - - Inputs: A typechecked expression 'expr', a destination - type 'type' - - Outputs: True iff the qualification conversion is possible. - The result of the conversion is stored in 'new_expr'. - - Purpose: Qualification conversion - -\*******************************************************************/ - +/// Qualification conversion +/// \par parameters: A typechecked expression 'expr', a destination +/// type 'type' +/// \return True iff the qualification conversion is possible. The result of the +/// conversion is stored in 'new_expr'. bool cpp_typecheckt::standard_conversion_qualification( const exprt &expr, const typet &type, @@ -203,40 +169,31 @@ bool cpp_typecheckt::standard_conversion_qualification( return false; } -/*******************************************************************\ - -Function: standard_conversion_integral_promotion - - Inputs: A typechecked expression 'expr' - - Outputs: True iff the integral pormotion is possible. - The result of the conversion is stored in 'new_expr'. - - Purpose: Integral-promotion conversion - - An rvalue of type char, signed char, unsigned char, short int, - or unsigned short int can be converted to an rvalue of type int - if int can represent all the values of the source type; otherwise, - the source rvalue can be converted to an rvalue of type unsigned int. - - An rvalue of type wchar_t (3.9.1) or an enumeration type (7.2) can - be converted to an rvalue of the first of the following types that - can represent all the values of its underlying type: int, unsigned int, - long, or unsigned long. - - An rvalue for an integral bit-field (9.6) can be converted - to an rvalue of type int if int can represent all the values of the - bit-field; otherwise, it can be converted to unsigned int if - unsigned int can represent all the values of the bit-field. - If the bit-field is larger yet, no integral promotion applies to - it. If the bit-field has an enumerated type, it is treated as - any other value of that type for promotion purposes. - - An rvalue of type bool can be converted to an rvalue of type int, - with false becoming zero and true becoming one. - -\*******************************************************************/ - +/// Integral-promotion conversion +/// +/// An rvalue of type char, signed char, unsigned char, short int, +/// or unsigned short int can be converted to an rvalue of type int +/// if int can represent all the values of the source type; otherwise, +/// the source rvalue can be converted to an rvalue of type unsigned int. +/// +/// An rvalue of type wchar_t (3.9.1) or an enumeration type (7.2) can +/// be converted to an rvalue of the first of the following types that +/// can represent all the values of its underlying type: int, unsigned int, +/// long, or unsigned long. +/// +/// An rvalue for an integral bit-field (9.6) can be converted +/// to an rvalue of type int if int can represent all the values of the +/// bit-field; otherwise, it can be converted to unsigned int if +/// unsigned int can represent all the values of the bit-field. +/// If the bit-field is larger yet, no integral promotion applies to +/// it. If the bit-field has an enumerated type, it is treated as +/// any other value of that type for promotion purposes. +/// +/// An rvalue of type bool can be converted to an rvalue of type int, +/// with false becoming zero and true becoming one. +/// \par parameters: A typechecked expression 'expr' +/// \return True iff the integral pormotion is possible. The result of the +/// conversion is stored in 'new_expr'. bool cpp_typecheckt::standard_conversion_integral_promotion( const exprt &expr, exprt &new_expr) const @@ -282,22 +239,13 @@ bool cpp_typecheckt::standard_conversion_integral_promotion( return false; } -/*******************************************************************\ - -Function: standard_conversion_floating_point_promotion - - Inputs: A typechecked expression 'expr' - - Outputs: True iff the integral promotion is possible. - The result of the conversion is stored in 'new_expr'. - - Purpose: Floating-point-promotion conversion - - An rvalue of type float can be converted to an rvalue of type - double. The value is unchanged. - -\*******************************************************************/ - +/// Floating-point-promotion conversion +/// +/// An rvalue of type float can be converted to an rvalue of type +/// double. The value is unchanged. +/// \par parameters: A typechecked expression 'expr' +/// \return True iff the integral promotion is possible. The result of the +/// conversion is stored in 'new_expr'. bool cpp_typecheckt::standard_conversion_floating_point_promotion( const exprt &expr, exprt &new_expr) const @@ -325,43 +273,34 @@ bool cpp_typecheckt::standard_conversion_floating_point_promotion( return true; } -/*******************************************************************\ - -Function: standard_conversion_integral_conversion - - Inputs: A typechecked expression 'expr', a destination - type 'type' - - Outputs: True iff the integral pormotion is possible. - The result of the conversion is stored in 'new_expr'. - - Purpose: Integral conversion - - An rvalue of type char, signed char, unsigned char, short int, - An rvalue of an integer type can be converted to an rvalue of - another integer type. An rvalue of an enumeration type can be - converted to an rvalue of an integer type. - - If the destination type is unsigned, the resulting value is the - least unsigned integer congruent to the source integer (modulo - 2n where n is the number of bits used to represent the unsigned - type). [Note: In a two's complement representation, this - conversion is conceptual and there is no change in the bit - pattern (if there is no truncation). ] - - If the destination type is signed, the value is unchanged if it - can be represented in the destination type (and bit-field width); - otherwise, the value is implementation-defined. - - If the destination type is bool, see 4.12. If the source type is - bool, the value false is converted to zero and the value true is - converted to one. - - The conversions allowed as integral promotions are excluded from - the set of integral conversions. - -\*******************************************************************/ - +/// Integral conversion +/// +/// An rvalue of type char, signed char, unsigned char, short int, +/// An rvalue of an integer type can be converted to an rvalue of +/// another integer type. An rvalue of an enumeration type can be +/// converted to an rvalue of an integer type. +/// +/// If the destination type is unsigned, the resulting value is the +/// least unsigned integer congruent to the source integer (modulo +/// 2n where n is the number of bits used to represent the unsigned +/// type). [Note: In a two's complement representation, this +/// conversion is conceptual and there is no change in the bit +/// pattern (if there is no truncation). ] +/// +/// If the destination type is signed, the value is unchanged if it +/// can be represented in the destination type (and bit-field width); +/// otherwise, the value is implementation-defined. +/// +/// If the destination type is bool, see 4.12. If the source type is +/// bool, the value false is converted to zero and the value true is +/// converted to one. +/// +/// The conversions allowed as integral promotions are excluded from +/// the set of integral conversions. +/// \par parameters: A typechecked expression 'expr', a destination +/// type 'type' +/// \return True iff the integral pormotion is possible. The result of the +/// conversion is stored in 'new_expr'. bool cpp_typecheckt::standard_conversion_integral_conversion( const exprt &expr, const typet &type, @@ -389,34 +328,25 @@ bool cpp_typecheckt::standard_conversion_integral_conversion( return true; } -/*******************************************************************\ - -Function: standard_conversion_floating_integral_conversion - - Inputs: A typechecked expression 'expr' - - Outputs: True iff the conversion is possible. - The result of the conversion is stored in 'new_expr'. - - Purpose: Floating-integral conversion - - An rvalue of a floating point type can be converted to an rvalue - of an integer type. The conversion truncates; that is, the - fractional part is discarded. The behavior is undefined if the - truncated value cannot be represented in the destination type. - [Note: If the destination type is bool, see 4.12. ] - - An rvalue of an integer type or of an enumeration type can be - converted to an rvalue of a floating point type. The result is - exact if possible. Otherwise, it is an implementation-defined - choice of either the next lower or higher representable value. - [Note: loss of precision occurs if the integral value cannot be - represented exactly as a value of the floating type. ] If the - source type is bool, the value false is converted to zero and the - value true is converted to one. - -\*******************************************************************/ - +/// Floating-integral conversion +/// +/// An rvalue of a floating point type can be converted to an rvalue +/// of an integer type. The conversion truncates; that is, the +/// fractional part is discarded. The behavior is undefined if the +/// truncated value cannot be represented in the destination type. +/// [Note: If the destination type is bool, see 4.12. ] +/// +/// An rvalue of an integer type or of an enumeration type can be +/// converted to an rvalue of a floating point type. The result is +/// exact if possible. Otherwise, it is an implementation-defined +/// choice of either the next lower or higher representable value. +/// [Note: loss of precision occurs if the integral value cannot be +/// represented exactly as a value of the floating type. ] If the +/// source type is bool, the value false is converted to zero and the +/// value true is converted to one. +/// \par parameters: A typechecked expression 'expr' +/// \return True iff the conversion is possible. The result of the conversion is +/// stored in 'new_expr'. bool cpp_typecheckt::standard_conversion_floating_integral_conversion( const exprt &expr, const typet &type, @@ -453,31 +383,22 @@ bool cpp_typecheckt::standard_conversion_floating_integral_conversion( } -/*******************************************************************\ - -Function: standard_conversion_floating_point_conversion - - Inputs: A typechecked expression 'expr', a destination - type 'type' - - Outputs: True iff the floating-point conversion is possible. - The result of the conversion is stored in 'new_expr'. - - Purpose: Floating-point conversion - - An rvalue of floating point type can be converted to an rvalue - of another floating point type. If the source value can be exactly - represented in the destination type, the result of the conversion - is that exact representation. If the source value is between two - adjacent destination values, the result of the conversion is an - implementation-defined choice of either of those values. Otherwise, - the behavior is undefined. - - The conversions allowed as floating point promotions are excluded - from the set of floating point conversions. - -\*******************************************************************/ - +/// Floating-point conversion +/// +/// An rvalue of floating point type can be converted to an rvalue +/// of another floating point type. If the source value can be exactly +/// represented in the destination type, the result of the conversion +/// is that exact representation. If the source value is between two +/// adjacent destination values, the result of the conversion is an +/// implementation-defined choice of either of those values. Otherwise, +/// the behavior is undefined. +/// +/// The conversions allowed as floating point promotions are excluded +/// from the set of floating point conversions. +/// \par parameters: A typechecked expression 'expr', a destination +/// type 'type' +/// \return True iff the floating-point conversion is possible. The result of +/// the conversion is stored in 'new_expr'. bool cpp_typecheckt::standard_conversion_floating_point_conversion( const exprt &expr, const typet &type, @@ -504,47 +425,38 @@ bool cpp_typecheckt::standard_conversion_floating_point_conversion( return true; } -/*******************************************************************\ - -Function: standard_conversion_pointer - - Inputs: A typechecked expression 'expr', a destination - type 'type' - - Outputs: True iff the pointer conversion is possible. - The result of the conversion is stored in 'new_expr'. - - Purpose: Pointer conversion - - A null pointer constant is an integral constant expression - (5.19) rvalue of integer type that evaluates to zero. A null - pointer constant can be converted to a pointer type; the result - is the null pointer value of that type and is distinguishable - from every other value of pointer to object or pointer to - function type. Two null pointer values of the same type shall - compare equal. The conversion of a null pointer constant to a - pointer to cv-qualified type is a single conversion, and not the - sequence of a pointer conversion followed by a qualification - conversion (4.4). - - An rvalue of type "pointer to cv T," where T is an object type, - can be converted to an rvalue of type "pointer to cv void." The - result of converting a "pointer to cv T" to a "pointer to cv - void" points to the start of the storage location where the - object of type T resides, as if the object is a most derived - object (1.8) of type T (that is, not a base class subobject). - - An rvalue of type "pointer to cv D," where D is a class type, - can be converted to an rvalue of type "pointer to cv B," where - B is a base class (clause 10) of D. If B is an inaccessible - (clause 11) or ambiguous (10.2) base class of D, a program that - necessitates this conversion is ill-formed. The result of the - conversion is a pointer to the base class sub-object of the - derived class object. The null pointer value is converted to - the null pointer value of the destination type. - -\*******************************************************************/ - +/// Pointer conversion +/// +/// A null pointer constant is an integral constant expression +/// (5.19) rvalue of integer type that evaluates to zero. A null +/// pointer constant can be converted to a pointer type; the result +/// is the null pointer value of that type and is distinguishable +/// from every other value of pointer to object or pointer to +/// function type. Two null pointer values of the same type shall +/// compare equal. The conversion of a null pointer constant to a +/// pointer to cv-qualified type is a single conversion, and not the +/// sequence of a pointer conversion followed by a qualification +/// conversion (4.4). +/// +/// An rvalue of type "pointer to cv T," where T is an object type, +/// can be converted to an rvalue of type "pointer to cv void." The +/// result of converting a "pointer to cv T" to a "pointer to cv +/// void" points to the start of the storage location where the +/// object of type T resides, as if the object is a most derived +/// object (1.8) of type T (that is, not a base class subobject). +/// +/// An rvalue of type "pointer to cv D," where D is a class type, +/// can be converted to an rvalue of type "pointer to cv B," where +/// B is a base class (clause 10) of D. If B is an inaccessible +/// (clause 11) or ambiguous (10.2) base class of D, a program that +/// necessitates this conversion is ill-formed. The result of the +/// conversion is a pointer to the base class sub-object of the +/// derived class object. The null pointer value is converted to +/// the null pointer value of the destination type. +/// \par parameters: A typechecked expression 'expr', a destination +/// type 'type' +/// \return True iff the pointer conversion is possible. The result of the +/// conversion is stored in 'new_expr'. bool cpp_typecheckt::standard_conversion_pointer( const exprt &expr, const typet &type, @@ -611,46 +523,36 @@ bool cpp_typecheckt::standard_conversion_pointer( return false; } -/*******************************************************************\ - -Function: standard_conversion_pointer_to_member - - Inputs: A typechecked expression 'expr', a destination - type 'type' - - Outputs: True iff the pointer-to-member conversion is possible. - The result of the conversion is stored in 'new_expr'. - - - Purpose: Pointer-to-member conversion - - A null pointer constant (4.10) can be converted to a pointer to - member type; the result is the null member pointer value of that - type and is distinguishable from any pointer to member not created - from a null pointer constant. Two null member pointer values of - the same type shall compare equal. The conversion of a null pointer - constant to a pointer to member of cv-qualified type is a single - conversion, and not the sequence of a pointer to member conversion - followed by a qualification conversion (4.4). - - An rvalue of type "pointer to member of B of type cv T," where B - is a class type, can be converted to an rvalue of type "pointer - to member of D of type cv T," where D is a derived class - (clause 10) of B. If B is an inaccessible (clause 11), ambiguous - (10.2) or virtual (10.1) base class of D, a program that - necessitates this conversion is ill-formed. The result of the - conversion refers to the same member as the pointer to member - before the conversion took place, but it refers to the base class - member as if it were a member of the derived class. The result - refers to the member in D"s instance of B. Since the result has - type "pointer to member of D of type cv T," it can be dereferenced - with a D object. The result is the same as if the pointer to - member of B were dereferenced with the B sub-object of D. The null - member pointer value is converted to the null member pointer value - of the destination type.52) - -\*******************************************************************/ - +/// Pointer-to-member conversion +/// +/// A null pointer constant (4.10) can be converted to a pointer to +/// member type; the result is the null member pointer value of that +/// type and is distinguishable from any pointer to member not created +/// from a null pointer constant. Two null member pointer values of +/// the same type shall compare equal. The conversion of a null pointer +/// constant to a pointer to member of cv-qualified type is a single +/// conversion, and not the sequence of a pointer to member conversion +/// followed by a qualification conversion (4.4). +/// +/// An rvalue of type "pointer to member of B of type cv T," where B +/// is a class type, can be converted to an rvalue of type "pointer +/// to member of D of type cv T," where D is a derived class +/// (clause 10) of B. If B is an inaccessible (clause 11), ambiguous +/// (10.2) or virtual (10.1) base class of D, a program that +/// necessitates this conversion is ill-formed. The result of the +/// conversion refers to the same member as the pointer to member +/// before the conversion took place, but it refers to the base class +/// member as if it were a member of the derived class. The result +/// refers to the member in D"s instance of B. Since the result has +/// type "pointer to member of D of type cv T," it can be dereferenced +/// with a D object. The result is the same as if the pointer to +/// member of B were dereferenced with the B sub-object of D. The null +/// member pointer value is converted to the null member pointer value +/// of the destination type.52) +/// \par parameters: A typechecked expression 'expr', a destination +/// type 'type' +/// \return True iff the pointer-to-member conversion is possible. The result of +/// the conversion is stored in 'new_expr'. bool cpp_typecheckt::standard_conversion_pointer_to_member( const exprt &expr, const typet &type, @@ -724,25 +626,15 @@ bool cpp_typecheckt::standard_conversion_pointer_to_member( return false; } -/*******************************************************************\ - -Function: standard_conversion_boolean - - Inputs: A typechecked expression 'expr' - - Outputs: True iff the boolean conversion is possible. - The result of the conversion is stored in 'new_expr'. - - - Purpose: Boolean conversion - - An rvalue of arithmetic, enumeration, pointer, or pointer to - member type can be converted to an rvalue of type bool. - A zero value, null pointer value, or null member pointer value is - converted to false; any other value is converted to true. - -\*******************************************************************/ - +/// Boolean conversion +/// +/// An rvalue of arithmetic, enumeration, pointer, or pointer to +/// member type can be converted to an rvalue of type bool. +/// A zero value, null pointer value, or null member pointer value is +/// converted to false; any other value is converted to true. +/// \par parameters: A typechecked expression 'expr' +/// \return True iff the boolean conversion is possible. The result of the +/// conversion is stored in 'new_expr'. bool cpp_typecheckt::standard_conversion_boolean( const exprt &expr, exprt &new_expr) const { @@ -766,37 +658,26 @@ bool cpp_typecheckt::standard_conversion_boolean( return true; } -/*******************************************************************\ - -Function: standard_conversion_sequence - - Inputs: A typechecked expression 'expr', a destination - type 'type'. - - Outputs: True iff a standard conversion sequence exists. - The result of the conversion is stored in 'new_expr'. - The reference 'rank' is incremented. - - - Purpose: Standard Conversion Sequence - - A standard conversion sequence is a sequence of standard conversions - in the following order: - - * Zero or one conversion from the following set: lvalue-to-rvalue - conversion, array-to-pointer conversion, and function-to-pointer - conversion. - - * Zero or one conversion from the following set: integral - promotions, floating point promotion, integral conversions, - floating point conversions, floating-integral conversions, - pointer conversions, pointer to member conversions, and boolean - conversions. - - * Zero or one qualification conversion. - -\*******************************************************************/ - +/// Standard Conversion Sequence +/// +/// A standard conversion sequence is a sequence of standard conversions +/// in the following order: +/// +/// * Zero or one conversion from the following set: lvalue-to-rvalue +/// conversion, array-to-pointer conversion, and function-to-pointer +/// conversion. +/// +/// * Zero or one conversion from the following set: integral +/// promotions, floating point promotion, integral conversions, +/// floating point conversions, floating-integral conversions, +/// pointer conversions, pointer to member conversions, and boolean +/// conversions. +/// +/// * Zero or one qualification conversion. +/// \par parameters: A typechecked expression 'expr', a destination +/// type 'type'. +/// \return True iff a standard conversion sequence exists. The result of the +/// conversion is stored in 'new_expr'. The reference 'rank' is incremented. bool cpp_typecheckt::standard_conversion_sequence( const exprt &expr, const typet &type, @@ -962,20 +843,11 @@ bool cpp_typecheckt::standard_conversion_sequence( return true; } -/*******************************************************************\ - -Function: user_defined_conversion_sequence - - Inputs: A typechecked expression 'expr', a destination - type 'type'. - - Outputs: True iff a user-defined conversion sequence exists. - The result of the conversion is stored in 'new_expr'. - - Purpose: User-defined conversion sequence - -\*******************************************************************/ - +/// User-defined conversion sequence +/// \par parameters: A typechecked expression 'expr', a destination +/// type 'type'. +/// \return True iff a user-defined conversion sequence exists. The result of +/// the conversion is stored in 'new_expr'. bool cpp_typecheckt::user_defined_conversion_sequence( const exprt &expr, const typet &type, @@ -1282,20 +1154,10 @@ bool cpp_typecheckt::user_defined_conversion_sequence( return new_expr.is_not_nil(); } -/*******************************************************************\ - -Function: reference_related - - Inputs: A typechecked expression 'expr', - a reference 'type'. - - Outputs: True iff an the reference 'type' is reference-related - to 'expr'. - - Purpose: Reference-related - -\*******************************************************************/ - +/// Reference-related +/// \par parameters: A typechecked expression 'expr', +/// a reference 'type'. +/// \return True iff an the reference 'type' is reference-related to 'expr'. bool cpp_typecheckt::reference_related( const exprt &expr, const typet &type) const @@ -1329,20 +1191,10 @@ bool cpp_typecheckt::reference_related( return false; } -/*******************************************************************\ - -Function: reference_compatible - - Inputs: A typechecked expression 'expr', a - reference 'type'. - - Outputs: True iff an the reference 'type' is reference-compatible - to 'expr'. - - Purpose: Reference-compatible - -\*******************************************************************/ - +/// Reference-compatible +/// \par parameters: A typechecked expression 'expr', a +/// reference 'type'. +/// \return True iff an the reference 'type' is reference-compatible to 'expr'. bool cpp_typecheckt::reference_compatible( const exprt &expr, const typet &type, @@ -1372,50 +1224,40 @@ bool cpp_typecheckt::reference_compatible( return false; } -/*******************************************************************\ - -Function: reference_binding - - Inputs: A typechecked expression 'expr', a - reference 'type'. - - Outputs: True iff an the reference can be bound to the expression. - The result of the conversion is stored in 'new_expr'. - - - Purpose: Reference binding - - When a parameter of reference type binds directly (8.5.3) to an - argument expression, the implicit conversion sequence is the - identity conversion, unless the argument expression has a type - that is a derived class of the parameter type, in which case the - implicit conversion sequence is a derived-to-base Conversion - (13.3.3.1). - - If the parameter binds directly to the result of applying a - conversion function to the argument expression, the implicit - conversion sequence is a user-defined conversion sequence - (13.3.3.1.2), with the second standard conversion sequence - either an identity conversion or, if the conversion function - returns an entity of a type that is a derived class of the - parameter type, a derived-to-base Conversion. - - When a parameter of reference type is not bound directly to - an argument expression, the conversion sequence is the one - required to convert the argument expression to the underlying - type of the reference according to 13.3.3.1. Conceptually, this - conversion sequence corresponds to copy-initializing a temporary - of the underlying type with the argument expression. Any - difference in top-level cv-qualification is subsumed by the - initialization itself and does not constitute a conversion. - - A standard conversion sequence cannot be formed if it requires - binding a reference to non-const to an rvalue (except when - binding an implicit object parameter; see the special rules - for that case in 13.3.1). - -\*******************************************************************/ - +/// Reference binding +/// +/// When a parameter of reference type binds directly (8.5.3) to an +/// argument expression, the implicit conversion sequence is the +/// identity conversion, unless the argument expression has a type +/// that is a derived class of the parameter type, in which case the +/// implicit conversion sequence is a derived-to-base Conversion +/// (13.3.3.1). +/// +/// If the parameter binds directly to the result of applying a +/// conversion function to the argument expression, the implicit +/// conversion sequence is a user-defined conversion sequence +/// (13.3.3.1.2), with the second standard conversion sequence +/// either an identity conversion or, if the conversion function +/// returns an entity of a type that is a derived class of the +/// parameter type, a derived-to-base Conversion. +/// +/// When a parameter of reference type is not bound directly to +/// an argument expression, the conversion sequence is the one +/// required to convert the argument expression to the underlying +/// type of the reference according to 13.3.3.1. Conceptually, this +/// conversion sequence corresponds to copy-initializing a temporary +/// of the underlying type with the argument expression. Any +/// difference in top-level cv-qualification is subsumed by the +/// initialization itself and does not constitute a conversion. +/// +/// A standard conversion sequence cannot be formed if it requires +/// binding a reference to non-const to an rvalue (except when +/// binding an implicit object parameter; see the special rules +/// for that case in 13.3.1). +/// \par parameters: A typechecked expression 'expr', a +/// reference 'type'. +/// \return True iff an the reference can be bound to the expression. The result +/// of the conversion is stored in 'new_expr'. bool cpp_typecheckt::reference_binding( exprt expr, const typet &type, @@ -1619,21 +1461,12 @@ bool cpp_typecheckt::reference_binding( return false; } -/*******************************************************************\ - -Function: implicit_conversion_sequence - - Inputs: A typechecked expression 'expr', a destination - type 'type'. - - Outputs: True iff an implicit conversion sequence exists. - The result of the conversion is stored in 'new_expr'. - The rank of the sequence is stored in 'rank' - - Purpose: implicit conversion sequence - -\*******************************************************************/ - +/// implicit conversion sequence +/// \par parameters: A typechecked expression 'expr', a destination +/// type 'type'. +/// \return True iff an implicit conversion sequence exists. The result of the +/// conversion is stored in 'new_expr'. The rank of the sequence is stored in +/// 'rank' bool cpp_typecheckt::implicit_conversion_sequence( const exprt &expr, const typet &type, @@ -1671,20 +1504,11 @@ bool cpp_typecheckt::implicit_conversion_sequence( return true; } -/*******************************************************************\ - -Function: implicit_conversion_sequence - - Inputs: A typechecked expression 'expr', a destination - type 'type'. - - Outputs: True iff an implicit conversion sequence exists. - The result of the conversion is stored in 'new_expr'. - - Purpose: implicit conversion sequence - -\*******************************************************************/ - +/// implicit conversion sequence +/// \par parameters: A typechecked expression 'expr', a destination +/// type 'type'. +/// \return True iff an implicit conversion sequence exists. The result of the +/// conversion is stored in 'new_expr'. bool cpp_typecheckt::implicit_conversion_sequence( const exprt &expr, const typet &type, @@ -1694,22 +1518,11 @@ bool cpp_typecheckt::implicit_conversion_sequence( return implicit_conversion_sequence(expr, type, new_expr, rank); } -/*******************************************************************\ - -Function: implicit_conversion_sequence - - Inputs: A typechecked expression 'expr', a destination - type 'type'. - - Outputs: True iff an implicit conversion sequence exists. - The rank of the sequence is stored in 'rank' - - - Purpose: implicit conversion sequence - - -\*******************************************************************/ - +/// implicit conversion sequence +/// \par parameters: A typechecked expression 'expr', a destination +/// type 'type'. +/// \return True iff an implicit conversion sequence exists. The rank of the +/// sequence is stored in 'rank' bool cpp_typecheckt::implicit_conversion_sequence( const exprt &expr, const typet &type, @@ -1719,18 +1532,6 @@ bool cpp_typecheckt::implicit_conversion_sequence( return implicit_conversion_sequence(expr, type, new_expr, rank); } -/*******************************************************************\ - -Function: cpp_typecheck_baset::implicit_typecast - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void cpp_typecheckt::implicit_typecast(exprt &expr, const typet &type) { exprt e=expr; @@ -1750,61 +1551,48 @@ void cpp_typecheckt::implicit_typecast(exprt &expr, const typet &type) } } -/*******************************************************************\ - -Function: cpp_typecheck_baset::reference_initializer - - Inputs: - - Outputs: - - Purpose: - - A reference to type "cv1 T1" is initialized by an expression of - type "cv2 T2" as follows: - - - If the initializer expression - - is an lvalue (but is not a bit-field), and "cv1 T1" is - reference-compatible with "cv2 T2," or - - has a class type (i.e., T2 is a class type) and can be - implicitly converted to an lvalue of type "cv3 T3," where - "cv1 T1" is reference-compatible with "cv3 T3" 92) (this - conversion is selected by enumerating the applicable conversion - functions (13.3.1.6) and choosing the best one through overload - resolution (13.3)), - - then the reference is bound directly to the initializer - expression lvalue in the first case, and the reference is - bound to the lvalue result of the conversion in the second - case. In these cases the reference is said to bind directly - to the initializer expression. - - - Otherwise, the reference shall be to a non-volatile const type - - If the initializer expression is an rvalue, with T2 a class - type, and "cv1 T1" is reference-compatible with "cv2 T2," the - reference is bound in one of the following ways (the choice is - implementation-defined): - - - The reference is bound to the object represented by the - rvalue (see 3.10) or to a sub-object within that object. - - - A temporary of type "cv1 T2" [sic] is created, and a - constructor is called to copy the entire rvalue object into - the temporary. The reference is bound to the temporary or - to a sub-object within the temporary. - - The constructor that would be used to make the copy shall be - callable whether or not the copy is actually done. - - Otherwise, a temporary of type "cv1 T1" is created and - initialized from the initializer expression using the rules for - a non-reference copy initialization (8.5). The reference is then - bound to the temporary. If T1 is reference-related to T2, cv1 - must be the same cv-qualification as, or greater cvqualification - than, cv2; otherwise, the program is ill-formed. - -\*******************************************************************/ - +/// A reference to type "cv1 T1" is initialized by an expression of +/// type "cv2 T2" as follows: +/// +/// - If the initializer expression +/// - is an lvalue (but is not a bit-field), and "cv1 T1" is +/// reference-compatible with "cv2 T2," or +/// - has a class type (i.e., T2 is a class type) and can be +/// implicitly converted to an lvalue of type "cv3 T3," where +/// "cv1 T1" is reference-compatible with "cv3 T3" 92) (this +/// conversion is selected by enumerating the applicable conversion +/// functions (13.3.1.6) and choosing the best one through overload +/// resolution (13.3)), +/// +/// then the reference is bound directly to the initializer +/// expression lvalue in the first case, and the reference is +/// bound to the lvalue result of the conversion in the second +/// case. In these cases the reference is said to bind directly +/// to the initializer expression. +/// +/// - Otherwise, the reference shall be to a non-volatile const type +/// - If the initializer expression is an rvalue, with T2 a class +/// type, and "cv1 T1" is reference-compatible with "cv2 T2," the +/// reference is bound in one of the following ways (the choice is +/// implementation-defined): +/// +/// - The reference is bound to the object represented by the +/// rvalue (see 3.10) or to a sub-object within that object. +/// +/// - A temporary of type "cv1 T2" [sic] is created, and a +/// constructor is called to copy the entire rvalue object into +/// the temporary. The reference is bound to the temporary or +/// to a sub-object within the temporary. +/// +/// The constructor that would be used to make the copy shall be +/// callable whether or not the copy is actually done. +/// +/// Otherwise, a temporary of type "cv1 T1" is created and +/// initialized from the initializer expression using the rules for +/// a non-reference copy initialization (8.5). The reference is then +/// bound to the temporary. If T1 is reference-related to T2, cv1 +/// must be the same cv-qualification as, or greater cvqualification +/// than, cv2; otherwise, the program is ill-formed. void cpp_typecheckt::reference_initializer( exprt &expr, const typet &type) @@ -1825,19 +1613,6 @@ void cpp_typecheckt::reference_initializer( throw 0; } -/*******************************************************************\ - -Function: cpp_typecheckt::cast_away_constness - - Inputs: - - Outputs: - - Purpose: - - -\*******************************************************************/ - bool cpp_typecheckt::cast_away_constness( const typet &t1, const typet &t2) const @@ -1901,18 +1676,6 @@ bool cpp_typecheckt::cast_away_constness( return !standard_conversion_qualification(e1, snt2.back(), e2); } -/*******************************************************************\ - -Function: cpp_typecheckt::const_typecast - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool cpp_typecheckt::const_typecast( const exprt &expr, const typet &type, @@ -1972,18 +1735,6 @@ bool cpp_typecheckt::const_typecast( return false; } -/*******************************************************************\ - -Function: cpp_typecheckt::dynamic_typecast - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool cpp_typecheckt::dynamic_typecast( const exprt &expr, const typet &type, @@ -2036,18 +1787,6 @@ bool cpp_typecheckt::dynamic_typecast( return static_typecast(e, type, new_expr); } -/*******************************************************************\ - -Function: cpp_typecheckt::reinterpret_typecastcast - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool cpp_typecheckt::reinterpret_typecast( const exprt &expr, const typet &type, @@ -2152,18 +1891,6 @@ bool cpp_typecheckt::reinterpret_typecast( return false; } -/*******************************************************************\ - -Function: cpp_typecheckt::static_typecast - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool cpp_typecheckt::static_typecast( const exprt &expr, // source expression const typet &type, // destination type diff --git a/src/cpp/cpp_typecheck_declaration.cpp b/src/cpp/cpp_typecheck_declaration.cpp index 980413225b1..8568b525a91 100644 --- a/src/cpp/cpp_typecheck_declaration.cpp +++ b/src/cpp/cpp_typecheck_declaration.cpp @@ -6,21 +6,12 @@ Author: Daniel Kroening, kroening@cs.cmu.edu \********************************************************************/ +/// \file +/// C++ Language Type Checking + #include "cpp_typecheck.h" #include "cpp_declarator_converter.h" -/*******************************************************************\ - -Function: cpp_typecheckt::convert - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void cpp_typecheckt::convert(cpp_declarationt &declaration) { // see if the declaration is empty @@ -44,18 +35,6 @@ void cpp_typecheckt::convert(cpp_declarationt &declaration) method_bodies.swap(old_method_bodies); } -/*******************************************************************\ - -Function: cpp_typecheckt::convert_anonymous_union - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void cpp_typecheckt::convert_anonymous_union( cpp_declarationt &declaration, codet &code) @@ -130,18 +109,6 @@ void cpp_typecheckt::convert_anonymous_union( code.swap(new_code); } -/*******************************************************************\ - -Function: cpp_typecheckt::convert_non_template_declaration - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void cpp_typecheckt::convert_non_template_declaration( cpp_declarationt &declaration) { diff --git a/src/cpp/cpp_typecheck_destructor.cpp b/src/cpp/cpp_typecheck_destructor.cpp index 4b1be9ceeb4..b8038d5c01f 100644 --- a/src/cpp/cpp_typecheck_destructor.cpp +++ b/src/cpp/cpp_typecheck_destructor.cpp @@ -6,19 +6,10 @@ Author: Daniel Kroening, kroening@cs.cmu.edu \*******************************************************************/ -#include "cpp_typecheck.h" - -/*******************************************************************\ - -Function: cpp_typecheckt::find_dtor - - Inputs: - - Outputs: - - Note: +/// \file +/// C++ Language Type Checking -\*******************************************************************/ +#include "cpp_typecheck.h" bool cpp_typecheckt::find_dtor(const symbolt &symbol) const { @@ -34,20 +25,7 @@ bool cpp_typecheckt::find_dtor(const symbolt &symbol) const return false; } -/*******************************************************************\ - -Function: default_dtor - - Inputs: - - Outputs: - - Purpose: - - Note: - -\*******************************************************************/ - +/// Note: void cpp_typecheckt::default_dtor( const symbolt &symbol, cpp_declarationt &dtor) @@ -77,20 +55,9 @@ void cpp_typecheckt::default_dtor( dtor.move_to_operands(decl); } -/*******************************************************************\ - -Function: cpp_typecheckt::dtor - - Inputs: - - Outputs: - - Purpose: produces destructor code for a class object - - Note: - -\*******************************************************************/ - +/// produces destructor code for a class object +/// +/// Note: codet cpp_typecheckt::dtor(const symbolt &symbol) { assert(symbol.type.id()==ID_struct || diff --git a/src/cpp/cpp_typecheck_enum_type.cpp b/src/cpp/cpp_typecheck_enum_type.cpp index 09c57e9e9bc..9284ca9b296 100644 --- a/src/cpp/cpp_typecheck_enum_type.cpp +++ b/src/cpp/cpp_typecheck_enum_type.cpp @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// C++ Language Type Checking + #include #include @@ -14,18 +17,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "cpp_typecheck.h" #include "cpp_enum_type.h" -/*******************************************************************\ - -Function: cpp_typecheckt::typecheck_enum_body - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void cpp_typecheckt::typecheck_enum_body(symbolt &enum_symbol) { c_enum_typet &c_enum_type=to_c_enum_type(enum_symbol.type); @@ -89,18 +80,6 @@ void cpp_typecheckt::typecheck_enum_body(symbolt &enum_symbol) } } -/*******************************************************************\ - -Function: cpp_typecheckt::typecheck_enum_type - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void cpp_typecheckt::typecheck_enum_type(typet &type) { // first save qualifiers diff --git a/src/cpp/cpp_typecheck_expr.cpp b/src/cpp/cpp_typecheck_expr.cpp index a29d27634d8..9f7d785e502 100644 --- a/src/cpp/cpp_typecheck_expr.cpp +++ b/src/cpp/cpp_typecheck_expr.cpp @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@cs.cmu.edu \*******************************************************************/ +/// \file +/// C++ Language Type Checking + #include #include @@ -27,18 +30,6 @@ Author: Daniel Kroening, kroening@cs.cmu.edu #include "cpp_exception_id.h" #include "expr2cpp.h" -/*******************************************************************\ - -Function: cpp_typecheckt::find_parent - -Inputs: - -Outputs: - -Purpose: - -\*******************************************************************/ - bool cpp_typecheckt::find_parent( const symbolt &symb, const irep_idt &base_name, @@ -56,18 +47,7 @@ bool cpp_typecheckt::find_parent( return false; } -/*******************************************************************\ - -Function: cpp_typecheckt::typecheck_expr_main - -Inputs: - -Outputs: - -Purpose: Called after the operands are done - -\*******************************************************************/ - +/// Called after the operands are done void cpp_typecheckt::typecheck_expr_main(exprt &expr) { if(expr.id()==ID_cpp_name) @@ -156,18 +136,6 @@ void cpp_typecheckt::typecheck_expr_main(exprt &expr) c_typecheck_baset::typecheck_expr_main(expr); } -/*******************************************************************\ - -Function: cpp_typecheckt::typecheck_expr_trinary - -Inputs: - -Outputs: - -Purpose: - -\*******************************************************************/ - void cpp_typecheckt::typecheck_expr_trinary(if_exprt &expr) { assert(expr.operands().size()==3); @@ -329,18 +297,6 @@ void cpp_typecheckt::typecheck_expr_trinary(if_exprt &expr) return; } -/*******************************************************************\ - -Function: cpp_typecheckt::typecheck_expr_member - -Inputs: - -Outputs: - -Purpose: - -\*******************************************************************/ - void cpp_typecheckt::typecheck_expr_member(exprt &expr) { typecheck_expr_member( @@ -348,18 +304,6 @@ void cpp_typecheckt::typecheck_expr_member(exprt &expr) cpp_typecheck_fargst()); } -/*******************************************************************\ - -Function: cpp_typecheckt::typecheck_expr_sizeof - -Inputs: - -Outputs: - -Purpose: - -\*******************************************************************/ - void cpp_typecheckt::typecheck_expr_sizeof(exprt &expr) { // We need to overload, "sizeof-expression" can be mis-parsed @@ -415,35 +359,11 @@ void cpp_typecheckt::typecheck_expr_sizeof(exprt &expr) c_typecheck_baset::typecheck_expr_sizeof(expr); } -/*******************************************************************\ - -Function: cpp_typecheckt::typecheck_expr_ptrmember - -Inputs: - -Outputs: - -Purpose: - -\*******************************************************************/ - void cpp_typecheckt::typecheck_expr_ptrmember(exprt &expr) { typecheck_expr_ptrmember(expr, cpp_typecheck_fargst()); } -/*******************************************************************\ - -Function: cpp_typecheckt::typecheck_function_expr - -Inputs: - -Outputs: - -Purpose: - -\*******************************************************************/ - void cpp_typecheckt::typecheck_function_expr( exprt &expr, const cpp_typecheck_fargst &fargs) @@ -500,18 +420,6 @@ void cpp_typecheckt::typecheck_function_expr( typecheck_expr(expr); } -/*******************************************************************\ - -Function: cpp_typecheckt::overloadable - -Inputs: - -Outputs: - -Purpose: - -\*******************************************************************/ - bool cpp_typecheckt::overloadable(const exprt &expr) { // at least one argument must have class or enumerated type @@ -532,18 +440,6 @@ bool cpp_typecheckt::overloadable(const exprt &expr) return false; } -/*******************************************************************\ - -Function: cpp_typecheckt::operator_is_overloaded - -Inputs: - -Outputs: - -Purpose: - -\*******************************************************************/ - struct operator_entryt { const irep_idt id; @@ -802,18 +698,6 @@ bool cpp_typecheckt::operator_is_overloaded(exprt &expr) return false; } -/*******************************************************************\ - -Function: cpp_typecheckt::typecheck_expr_address_of - -Inputs: - -Outputs: - -Purpose: - -\*******************************************************************/ - void cpp_typecheckt::typecheck_expr_address_of(exprt &expr) { if(expr.operands().size()!=1) @@ -875,18 +759,6 @@ void cpp_typecheckt::typecheck_expr_address_of(exprt &expr) expr.type()=reference_typet(expr.type().subtype()); } -/*******************************************************************\ - -Function: cpp_typecheckt::typecheck_expr_throw - -Inputs: - -Outputs: - -Purpose: - -\*******************************************************************/ - void cpp_typecheckt::typecheck_expr_throw(exprt &expr) { // these are of type void @@ -913,18 +785,6 @@ void cpp_typecheckt::typecheck_expr_throw(exprt &expr) } } -/*******************************************************************\ - -Function: cpp_typecheckt::typecheck_expr_new - -Inputs: - -Outputs: - -Purpose: - -\*******************************************************************/ - void cpp_typecheckt::typecheck_expr_new(exprt &expr) { // next, find out if we do an array @@ -1002,18 +862,6 @@ void cpp_typecheckt::typecheck_expr_new(exprt &expr) sizeof_expr.add("#c_sizeof_type")=expr.type().subtype(); } -/*******************************************************************\ - -Function: cpp_typecheckt::typecheck_expr_explicit_typecast - -Inputs: - -Outputs: - -Purpose: - -\*******************************************************************/ - static exprt collect_comma_expression(const exprt &src) { exprt result; @@ -1116,18 +964,6 @@ void cpp_typecheckt::typecheck_expr_explicit_typecast(exprt &expr) } } -/*******************************************************************\ - -Function: cpp_typecheckt::typecheck_expr_explicit_constructor_call - -Inputs: - -Outputs: - -Purpose: - -\*******************************************************************/ - void cpp_typecheckt::typecheck_expr_explicit_constructor_call(exprt &expr) { typecheck_type(expr.type()); @@ -1150,18 +986,6 @@ void cpp_typecheckt::typecheck_expr_explicit_constructor_call(exprt &expr) } } -/*******************************************************************\ - -Function: cpp_typecheckt::typecheck_expr_this - -Inputs: - -Outputs: - -Purpose: - -\*******************************************************************/ - void cpp_typecheckt::typecheck_expr_this(exprt &expr) { if(cpp_scopes.current_scope().class_identifier.empty()) @@ -1181,18 +1005,6 @@ void cpp_typecheckt::typecheck_expr_this(exprt &expr) expr.add_source_location()=source_location; } -/*******************************************************************\ - -Function: cpp_typecheckt::typecheck_expr_delete - -Inputs: - -Outputs: - -Purpose: - -\*******************************************************************/ - void cpp_typecheckt::typecheck_expr_delete(exprt &expr) { if(expr.operands().size()!=1) @@ -1250,18 +1062,6 @@ void cpp_typecheckt::typecheck_expr_delete(exprt &expr) expr.set(ID_destructor, destructor_code); } -/*******************************************************************\ - -Function: cpp_typecheckt::typecheck_expr_typecast - -Inputs: - -Outputs: - -Purpose: - -\*******************************************************************/ - void cpp_typecheckt::typecheck_expr_typecast(exprt &expr) { // should not be called @@ -1271,18 +1071,6 @@ void cpp_typecheckt::typecheck_expr_typecast(exprt &expr) #endif } -/*******************************************************************\ - -Function: cpp_typecheckt::typecheck_expr_member - -Inputs: - -Outputs: - -Purpose: - -\*******************************************************************/ - void cpp_typecheckt::typecheck_expr_member( exprt &expr, const cpp_typecheck_fargst &fargs) @@ -1464,18 +1252,6 @@ void cpp_typecheckt::typecheck_expr_member( } } -/*******************************************************************\ - -Function: cpp_typecheckt::typecheck_expr_ptrmember - -Inputs: - -Outputs: - -Purpose: - -\*******************************************************************/ - void cpp_typecheckt::typecheck_expr_ptrmember( exprt &expr, const cpp_typecheck_fargst &fargs) @@ -1514,18 +1290,6 @@ void cpp_typecheckt::typecheck_expr_ptrmember( typecheck_expr_member(expr, fargs); } -/*******************************************************************\ - -Function: cpp_typecheckt::typecheck_cast_expr - -Inputs: - -Outputs: - -Purpose: - -\*******************************************************************/ - void cpp_typecheckt::typecheck_cast_expr(exprt &expr) { side_effect_expr_function_callt e = @@ -1635,18 +1399,6 @@ void cpp_typecheckt::typecheck_cast_expr(exprt &expr) expr.swap(new_expr); } -/*******************************************************************\ - -Function: cpp_typecheckt::typecheck_expr_cpp_name - -Inputs: - -Outputs: - -Purpose: - -\*******************************************************************/ - void cpp_typecheckt::typecheck_expr_cpp_name( exprt &expr, const cpp_typecheck_fargst &fargs) @@ -2147,18 +1899,6 @@ void cpp_typecheckt::typecheck_expr_cpp_name( add_implicit_dereference(expr); } -/*******************************************************************\ - -Function: cpp_typecheckt::add_implicit_dereference - -Inputs: - -Outputs: - -Purpose: - -\*******************************************************************/ - void cpp_typecheckt::add_implicit_dereference(exprt &expr) { if(is_reference(expr.type())) @@ -2173,18 +1913,6 @@ void cpp_typecheckt::add_implicit_dereference(exprt &expr) } } -/*******************************************************************\ - -Function: cpp_typecheckt::typecheck_side_effect_function_call - -Inputs: - -Outputs: - -Purpose: - -\*******************************************************************/ - void cpp_typecheckt::typecheck_side_effect_function_call( side_effect_expr_function_callt &expr) { @@ -2549,18 +2277,8 @@ void cpp_typecheckt::typecheck_side_effect_function_call( expr.swap(tmp); } -/*******************************************************************\ - -Function: cpp_typecheckt::typecheck_function_call_arguments - - Inputs: type-checked arguments, type-checked function - - Outputs: type-adjusted function arguments - -Purpose: - -\*******************************************************************/ - +/// \param type:checked arguments, type-checked function +/// \return type-adjusted function arguments void cpp_typecheckt::typecheck_function_call_arguments( side_effect_expr_function_callt &expr) { @@ -2614,18 +2332,6 @@ void cpp_typecheckt::typecheck_function_call_arguments( c_typecheck_baset::typecheck_function_call_arguments(expr); } -/*******************************************************************\ - -Function: cpp_typecheckt::typecheck_expr_side_effect - -Inputs: - -Outputs: - -Purpose: - -\*******************************************************************/ - void cpp_typecheckt::typecheck_expr_side_effect( side_effect_exprt &expr) { @@ -2660,18 +2366,6 @@ void cpp_typecheckt::typecheck_expr_side_effect( c_typecheck_baset::typecheck_expr_side_effect(expr); } -/*******************************************************************\ - -Function: cpp_typecheckt::typecheck_method_application - -Inputs: - -Outputs: - -Purpose: - -\*******************************************************************/ - void cpp_typecheckt::typecheck_method_application( side_effect_expr_function_callt &expr) { @@ -2732,18 +2426,6 @@ void cpp_typecheckt::typecheck_method_application( } } -/*******************************************************************\ - -Function: cpp_typecheckt::typecheck_side_effect_assignment - -Inputs: - -Outputs: - -Purpose: - -\*******************************************************************/ - void cpp_typecheckt::typecheck_side_effect_assignment(side_effect_exprt &expr) { if(expr.operands().size()!=2) @@ -2831,18 +2513,6 @@ void cpp_typecheckt::typecheck_side_effect_assignment(side_effect_exprt &expr) expr=new_expr; } -/*******************************************************************\ - -Function: cpp_typecheckt::typecheck_side_effect_inc_dec - -Inputs: - -Outputs: - -Purpose: - -\*******************************************************************/ - void cpp_typecheckt::typecheck_side_effect_inc_dec( side_effect_exprt &expr) { @@ -2919,18 +2589,6 @@ void cpp_typecheckt::typecheck_side_effect_inc_dec( expr.swap(new_expr); } -/*******************************************************************\ - -Function: cpp_typecheckt::typecheck_expr_dereference - -Inputs: - -Outputs: - -Purpose: - -\*******************************************************************/ - void cpp_typecheckt::typecheck_expr_dereference(exprt &expr) { if(expr.operands().size()!=1) @@ -2955,18 +2613,6 @@ void cpp_typecheckt::typecheck_expr_dereference(exprt &expr) c_typecheck_baset::typecheck_expr_dereference(expr); } -/*******************************************************************\ - -Function: cpp_typecheckt::convert_pmop - -Inputs: - -Outputs: - -Purpose: - -\*******************************************************************/ - void cpp_typecheckt::convert_pmop(exprt &expr) { assert(expr.id()=="pointer-to-member"); @@ -3037,18 +2683,6 @@ void cpp_typecheckt::convert_pmop(exprt &expr) return; } -/*******************************************************************\ - -Function: cpp_typecheckt::typecheck_expr_function_identifier - -Inputs: - -Outputs: - -Purpose: - -\*******************************************************************/ - void cpp_typecheckt::typecheck_expr_function_identifier(exprt &expr) { if(expr.id()==ID_symbol) @@ -3068,18 +2702,6 @@ void cpp_typecheckt::typecheck_expr_function_identifier(exprt &expr) c_typecheck_baset::typecheck_expr_function_identifier(expr); } -/*******************************************************************\ - -Function: cpp_typecheckt::typecheck_expr - -Inputs: - -Outputs: - -Purpose: - -\*******************************************************************/ - void cpp_typecheckt::typecheck_expr(exprt &expr) { bool override_constantness= @@ -3102,18 +2724,6 @@ void cpp_typecheckt::typecheck_expr(exprt &expr) expr.type().set(ID_C_constant, false); } -/*******************************************************************\ - -Function: cpp_typecheckt::explict_typecast_ambiguity - -Inputs: - -Outputs: - -Purpose: - -\*******************************************************************/ - void cpp_typecheckt::explicit_typecast_ambiguity(exprt &expr) { // There is an ambiguity in the C++ grammar as follows: @@ -3169,18 +2779,6 @@ void cpp_typecheckt::explicit_typecast_ambiguity(exprt &expr) } } -/*******************************************************************\ - -Function: cpp_typecheckt::typecheck_expr_binary_arithmetic - -Inputs: - -Outputs: - -Purpose: - -\*******************************************************************/ - void cpp_typecheckt::typecheck_expr_binary_arithmetic(exprt &expr) { if(expr.operands().size()!=2) @@ -3197,35 +2795,11 @@ void cpp_typecheckt::typecheck_expr_binary_arithmetic(exprt &expr) c_typecheck_baset::typecheck_expr_binary_arithmetic(expr); } -/*******************************************************************\ - -Function: cpp_typecheckt::typecheck_expr_index - -Inputs: - -Outputs: - -Purpose: - -\*******************************************************************/ - void cpp_typecheckt::typecheck_expr_index(exprt &expr) { c_typecheck_baset::typecheck_expr_index(expr); } -/*******************************************************************\ - -Function: cpp_typecheckt::typecheck_expr_comma - -Inputs: - -Outputs: - -Purpose: - -\*******************************************************************/ - void cpp_typecheckt::typecheck_expr_comma(exprt &expr) { if(expr.operands().size()!=2) @@ -3243,18 +2817,6 @@ void cpp_typecheckt::typecheck_expr_comma(exprt &expr) c_typecheck_baset::typecheck_expr_comma(expr); } -/*******************************************************************\ - -Function: cpp_typecheckt::typecheck_expr_rel - -Inputs: - -Outputs: - -Purpose: - -\*******************************************************************/ - void cpp_typecheckt::typecheck_expr_rel(binary_relation_exprt &expr) { c_typecheck_baset::typecheck_expr_rel(expr); diff --git a/src/cpp/cpp_typecheck_fargs.cpp b/src/cpp/cpp_typecheck_fargs.cpp index 592c538fc2c..e4dde682732 100644 --- a/src/cpp/cpp_typecheck_fargs.cpp +++ b/src/cpp/cpp_typecheck_fargs.cpp @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@cs.cmu.edu \*******************************************************************/ +/// \file +/// C++ Language Type Checking + #include #include @@ -15,18 +18,6 @@ Author: Daniel Kroening, kroening@cs.cmu.edu #include "cpp_typecheck_fargs.h" #include "cpp_typecheck.h" -/*******************************************************************\ - -Function: cpp_typecheck_fargst::has_class_type - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool cpp_typecheck_fargst::has_class_type() const { for(exprt::operandst::const_iterator it=operands.begin(); @@ -40,18 +31,6 @@ bool cpp_typecheck_fargst::has_class_type() const return false; } -/*******************************************************************\ - -Function: cpp_typecheck_fargst::build - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void cpp_typecheck_fargst::build( const side_effect_expr_function_callt &function_call) { @@ -64,18 +43,6 @@ void cpp_typecheck_fargst::build( operands.push_back(function_call.op1().operands()[i]); } -/*******************************************************************\ - -Function: cpp_typecheck_fargst::exact_match - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool cpp_typecheck_fargst::match( const code_typet &code_type, unsigned &distance, diff --git a/src/cpp/cpp_typecheck_fargs.h b/src/cpp/cpp_typecheck_fargs.h index 370cc10ed65..5b6a62e0b4a 100644 --- a/src/cpp/cpp_typecheck_fargs.h +++ b/src/cpp/cpp_typecheck_fargs.h @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@cs.cmu.edu \*******************************************************************/ +/// \file +/// C++ Language Type Checking + #ifndef CPROVER_CPP_CPP_TYPECHECK_FARGS_H #define CPROVER_CPP_CPP_TYPECHECK_FARGS_H diff --git a/src/cpp/cpp_typecheck_function.cpp b/src/cpp/cpp_typecheck_function.cpp index a55bbf41d6b..5dd98b47336 100644 --- a/src/cpp/cpp_typecheck_function.cpp +++ b/src/cpp/cpp_typecheck_function.cpp @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@cs.cmu.edu \*******************************************************************/ +/// \file +/// C++ Language Type Checking + #include #include "cpp_template_type.h" @@ -13,18 +16,6 @@ Author: Daniel Kroening, kroening@cs.cmu.edu #include "cpp_type2name.h" #include "cpp_util.h" -/*******************************************************************\ - -Function: cpp_typecheckt::convert_parameter - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void cpp_typecheckt::convert_parameter( const irep_idt &mode, code_typet::parametert ¶meter) @@ -69,18 +60,6 @@ void cpp_typecheckt::convert_parameter( cpp_scopes.put_into_scope(*new_symbol); } -/*******************************************************************\ - -Function: cpp_typecheckt::convert_parameters - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void cpp_typecheckt::convert_parameters( const irep_idt &mode, code_typet &function_type) @@ -95,18 +74,6 @@ void cpp_typecheckt::convert_parameters( convert_parameter(mode, *it); } -/*******************************************************************\ - -Function: cpp_typecheckt::convert_function - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void cpp_typecheckt::convert_function(symbolt &symbol) { code_typet &function_type= @@ -171,18 +138,7 @@ void cpp_typecheckt::convert_function(symbolt &symbol) return_type = old_return_type; } -/*******************************************************************\ - -Function: cpp_typecheckt::function_identifier - - Inputs: - - Outputs: - - Purpose: for function overloading - -\*******************************************************************/ - +/// for function overloading irep_idt cpp_typecheckt::function_identifier(const typet &type) { const code_typet &function_type= diff --git a/src/cpp/cpp_typecheck_initializer.cpp b/src/cpp/cpp_typecheck_initializer.cpp index f51490e77f8..6666af581ed 100644 --- a/src/cpp/cpp_typecheck_initializer.cpp +++ b/src/cpp/cpp_typecheck_initializer.cpp @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@cs.cmu.edu \*******************************************************************/ +/// \file +/// C++ Language Type Checking + #include #include @@ -16,18 +19,7 @@ Author: Daniel Kroening, kroening@cs.cmu.edu #include "cpp_typecheck.h" #include "cpp_util.h" -/*******************************************************************\ - -Function: cpp_typecheckt::convert_initializer - - Inputs: - - Outputs: - - Purpose: Initialize an object with a value - -\*******************************************************************/ - +/// Initialize an object with a value void cpp_typecheckt::convert_initializer(symbolt &symbol) { // this is needed for template arguments that are types @@ -179,18 +171,6 @@ void cpp_typecheckt::convert_initializer(symbolt &symbol) } } -/*******************************************************************\ - -Function: cpp_typecheckt::zero_initializer - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void cpp_typecheckt::zero_initializer( const exprt &object, const typet &type, diff --git a/src/cpp/cpp_typecheck_linkage_spec.cpp b/src/cpp/cpp_typecheck_linkage_spec.cpp index 39ebc12db29..a21a5913979 100644 --- a/src/cpp/cpp_typecheck_linkage_spec.cpp +++ b/src/cpp/cpp_typecheck_linkage_spec.cpp @@ -6,19 +6,10 @@ Author: Daniel Kroening, kroening@cs.cmu.edu \*******************************************************************/ -#include "cpp_typecheck.h" - -/*******************************************************************\ - -Function: cpp_typecheckt::convert - - Inputs: +/// \file +/// C++ Language Type Checking - Outputs: - - Purpose: - -\*******************************************************************/ +#include "cpp_typecheck.h" void cpp_typecheckt::convert(cpp_linkage_spect &linkage_spec) { diff --git a/src/cpp/cpp_typecheck_method_bodies.cpp b/src/cpp/cpp_typecheck_method_bodies.cpp index 0b16bebd8d8..d37b686a215 100644 --- a/src/cpp/cpp_typecheck_method_bodies.cpp +++ b/src/cpp/cpp_typecheck_method_bodies.cpp @@ -7,19 +7,10 @@ Author: Daniel Kroening, kroening@cs.cmu.edu \*******************************************************************/ -#include "cpp_typecheck.h" - -/*******************************************************************\ - -Function: cpp_typecheckt::typecheck_method_bodies - - Inputs: +/// \file +/// C++ Language Type Checking - Outputs: - - Purpose: - -\*******************************************************************/ +#include "cpp_typecheck.h" void cpp_typecheckt::typecheck_method_bodies( method_bodiest &bodies) diff --git a/src/cpp/cpp_typecheck_namespace.cpp b/src/cpp/cpp_typecheck_namespace.cpp index 81fea3a3eae..437a874aebd 100644 --- a/src/cpp/cpp_typecheck_namespace.cpp +++ b/src/cpp/cpp_typecheck_namespace.cpp @@ -6,22 +6,13 @@ Author: Daniel Kroening, kroening@cs.cmu.edu \*******************************************************************/ +/// \file +/// C++ Language Type Checking + #include #include "cpp_typecheck.h" -/*******************************************************************\ - -Function: cpp_typecheckt::convert - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void cpp_typecheckt::convert(cpp_namespace_spect &namespace_spec) { // save the scope diff --git a/src/cpp/cpp_typecheck_resolve.cpp b/src/cpp/cpp_typecheck_resolve.cpp index 82250a8a748..a9b9953e3ac 100644 --- a/src/cpp/cpp_typecheck_resolve.cpp +++ b/src/cpp/cpp_typecheck_resolve.cpp @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@cs.cmu.edu \*******************************************************************/ +/// \file +/// C++ Language Type Checking + #include #include @@ -25,35 +28,11 @@ Author: Daniel Kroening, kroening@cs.cmu.edu #include "cpp_util.h" #include "cpp_convert_type.h" -/*******************************************************************\ - -Function: cpp_typecheck_resolvet::cpp_typecheck_resolvet - -Inputs: - -Outputs: - -Purpose: - -\*******************************************************************/ - cpp_typecheck_resolvet::cpp_typecheck_resolvet(cpp_typecheckt &_cpp_typecheck): cpp_typecheck(_cpp_typecheck) { } -/*******************************************************************\ - -Function: cpp_typecheck_resolvet::convert_identifiers - -Inputs: - -Outputs: - -Purpose: - -\*******************************************************************/ - void cpp_typecheck_resolvet::convert_identifiers( const cpp_scopest::id_sett &id_set, const wantt want, @@ -78,18 +57,6 @@ void cpp_typecheck_resolvet::convert_identifiers( } } -/*******************************************************************\ - -Function: cpp_typecheck_resolvet::apply_template_args - -Inputs: - -Outputs: - -Purpose: - -\*******************************************************************/ - void cpp_typecheck_resolvet::apply_template_args( resolve_identifierst &identifiers, const cpp_template_args_non_tct &template_args, @@ -116,18 +83,7 @@ void cpp_typecheck_resolvet::apply_template_args( } } -/*******************************************************************\ - -Function: cpp_typecheck_resolvet::guess_function_template_args - -Inputs: - -Outputs: - -Purpose: guess arguments of function templates - -\*******************************************************************/ - +/// guess arguments of function templates void cpp_typecheck_resolvet::guess_function_template_args( resolve_identifierst &identifiers, const cpp_typecheck_fargst &fargs) @@ -179,18 +135,6 @@ void cpp_typecheck_resolvet::guess_function_template_args( } } -/*******************************************************************\ - -Function: cpp_typecheck_resolvet::remove_templates - -Inputs: - -Outputs: - -Purpose: - -\*******************************************************************/ - void cpp_typecheck_resolvet::remove_templates( resolve_identifierst &identifiers) { @@ -207,18 +151,6 @@ void cpp_typecheck_resolvet::remove_templates( } } -/*******************************************************************\ - -Function: cpp_typecheck_resolvet::remove_duplicates - -Inputs: - -Outputs: - -Purpose: - -\*******************************************************************/ - void cpp_typecheck_resolvet::remove_duplicates( resolve_identifierst &identifiers) { @@ -253,18 +185,6 @@ void cpp_typecheck_resolvet::remove_duplicates( } } -/*******************************************************************\ - -Function: cpp_typecheck_resolvet::convert_template_parameter - -Inputs: - -Outputs: - -Purpose: - -\*******************************************************************/ - exprt cpp_typecheck_resolvet::convert_template_parameter( const cpp_idt &identifier) { @@ -286,18 +206,6 @@ exprt cpp_typecheck_resolvet::convert_template_parameter( return e; } -/*******************************************************************\ - -Function: cpp_typecheck_resolvet::convert_identifier - -Inputs: - -Outputs: - -Purpose: - -\*******************************************************************/ - exprt cpp_typecheck_resolvet::convert_identifier( const cpp_idt &identifier, const wantt want, @@ -466,18 +374,6 @@ exprt cpp_typecheck_resolvet::convert_identifier( return e; } -/*******************************************************************\ - -Function: cpp_typecheck_resolvet::filter - -Inputs: - -Outputs: - -Purpose: - -\*******************************************************************/ - void cpp_typecheck_resolvet::filter( resolve_identifierst &identifiers, const wantt want) @@ -515,18 +411,6 @@ void cpp_typecheck_resolvet::filter( } } -/*******************************************************************\ - -Function: cpp_typecheck_resolvet::exact_match_functions - -Inputs: - -Outputs: - -Purpose: - -\*******************************************************************/ - void cpp_typecheck_resolvet::exact_match_functions( resolve_identifierst &identifiers, const cpp_typecheck_fargst &fargs) @@ -552,18 +436,6 @@ void cpp_typecheck_resolvet::exact_match_functions( } } -/*******************************************************************\ - -Function: cpp_typecheck_resolvet::disambiguate_functions - -Inputs: - -Outputs: - -Purpose: - -\*******************************************************************/ - void cpp_typecheck_resolvet::disambiguate_functions( resolve_identifierst &identifiers, const cpp_typecheck_fargst &fargs) @@ -709,18 +581,6 @@ void cpp_typecheck_resolvet::disambiguate_functions( } } -/*******************************************************************\ - -Function: cpp_typecheck_resolvet::make_constructors - -Inputs: - -Outputs: - -Purpose: - -\*******************************************************************/ - void cpp_typecheck_resolvet::make_constructors( resolve_identifierst &identifiers) { @@ -812,18 +672,6 @@ void cpp_typecheck_resolvet::make_constructors( identifiers.swap(new_identifiers); } -/*******************************************************************\ - -Function: cpp_typecheck_resolvet::do_builtin - -Inputs: - -Outputs: - -Purpose: - -\*******************************************************************/ - exprt cpp_typecheck_resolvet::do_builtin( const irep_idt &base_name, const cpp_template_args_non_tct &template_args) @@ -1010,20 +858,9 @@ exprt cpp_typecheck_resolvet::do_builtin( return dest; } -/*******************************************************************\ - -Function: cpp_typecheck_resolvet::resolve_scope - -Inputs: a cpp_name - -Outputs: a base_name, and potentially template arguments for - the base name; as side-effect, we got to the right - scope - -Purpose: - -\*******************************************************************/ - +/// \par parameters: a cpp_name +/// \return a base_name, and potentially template arguments for the base name; +/// as side-effect, we got to the right scope cpp_scopet &cpp_typecheck_resolvet::resolve_scope( const cpp_namet &cpp_name, irep_idt &base_name, @@ -1164,18 +1001,7 @@ cpp_scopet &cpp_typecheck_resolvet::resolve_scope( return cpp_typecheck.cpp_scopes.current_scope(); } -/*******************************************************************\ - -Function: cpp_typecheck_resolvet::disambiguate_template_classes - -Inputs: - -Outputs: - -Purpose: disambiguate partial specialization - -\*******************************************************************/ - +/// disambiguate partial specialization symbol_typet cpp_typecheck_resolvet::disambiguate_template_classes( const irep_idt &base_name, const cpp_scopest::id_sett &id_set, @@ -1403,18 +1229,6 @@ symbol_typet cpp_typecheck_resolvet::disambiguate_template_classes( #endif } -/*******************************************************************\ - -Function: cpp_typecheck_resolvet::resolve_namespace - -Inputs: - -Outputs: - -Purpose: - -\*******************************************************************/ - cpp_scopet &cpp_typecheck_resolvet::resolve_namespace( const cpp_namet &cpp_name) { @@ -1460,18 +1274,6 @@ cpp_scopet &cpp_typecheck_resolvet::resolve_namespace( } } -/*******************************************************************\ - -Function: cpp_typecheck_resolvet::show_identifiers - -Inputs: - -Outputs: - -Purpose: - -\*******************************************************************/ - void cpp_typecheck_resolvet::show_identifiers( const irep_idt &base_name, const resolve_identifierst &identifiers, @@ -1568,18 +1370,6 @@ void cpp_typecheck_resolvet::show_identifiers( } } -/*******************************************************************\ - -Function: cpp_typecheck_resolvet::resolve - -Inputs: - -Outputs: - -Purpose: - -\*******************************************************************/ - exprt cpp_typecheck_resolvet::resolve( const cpp_namet &cpp_name, const wantt want, @@ -1918,18 +1708,6 @@ exprt cpp_typecheck_resolvet::resolve( return result; } -/*******************************************************************\ - -Function: cpp_typecheck_resolvet::guess_template_args - -Inputs: - -Outputs: - -Purpose: - -\*******************************************************************/ - void cpp_typecheck_resolvet::guess_template_args( const exprt &template_expr, const exprt &desired_expr) @@ -1975,18 +1753,6 @@ void cpp_typecheck_resolvet::guess_template_args( } } -/*******************************************************************\ - -Function: cpp_typecheck_resolvet::guess_template_args - -Inputs: - -Outputs: - -Purpose: - -\*******************************************************************/ - void cpp_typecheck_resolvet::guess_template_args( const typet &template_type, const typet &desired_type) @@ -2128,18 +1894,7 @@ void cpp_typecheck_resolvet::guess_template_args( } } -/*******************************************************************\ - -Function: cpp_typecheck_resolvet::guess_function_template_args - -Inputs: - -Outputs: - -Purpose: Guess template arguments for function templates - -\*******************************************************************/ - +/// Guess template arguments for function templates exprt cpp_typecheck_resolvet::guess_function_template_args( const exprt &expr, const cpp_typecheck_fargst &fargs) @@ -2279,18 +2034,6 @@ exprt cpp_typecheck_resolvet::guess_function_template_args( return template_function_instance; } -/*******************************************************************\ - -Function: cpp_typecheck_resolvet::apply_template_args - -Inputs: - -Outputs: - -Purpose: - -\*******************************************************************/ - void cpp_typecheck_resolvet::apply_template_args( exprt &expr, const cpp_template_args_non_tct &template_args_non_tc, @@ -2395,18 +2138,6 @@ void cpp_typecheck_resolvet::apply_template_args( } } -/*******************************************************************\ - -Function: cpp_typecheck_resolvet::disambiguate_functions - -Inputs: - -Outputs: - -Purpose: - -\*******************************************************************/ - bool cpp_typecheck_resolvet::disambiguate_functions( const exprt &expr, unsigned &args_distance, @@ -2469,18 +2200,6 @@ bool cpp_typecheck_resolvet::disambiguate_functions( return fargs.match(type, args_distance, cpp_typecheck); } -/*******************************************************************\ - -Function: cpp_typecheck_resolvet::filter_for_named_scopes - -Inputs: - -Outputs: - -Purpose: - -\*******************************************************************/ - void cpp_typecheck_resolvet::filter_for_named_scopes( cpp_scopest::id_sett &id_set) { @@ -2619,18 +2338,6 @@ void cpp_typecheck_resolvet::filter_for_named_scopes( id_set.swap(new_set); } -/*******************************************************************\ - -Function: cpp_typecheck_resolvet::filter_for_namespaces - -Inputs: - -Outputs: - -Purpose: - -\*******************************************************************/ - void cpp_typecheck_resolvet::filter_for_namespaces( cpp_scopest::id_sett &id_set) { @@ -2651,18 +2358,6 @@ void cpp_typecheck_resolvet::filter_for_namespaces( } } -/*******************************************************************\ - -Function: cpp_typecheck_resolvet::resolve_with_arguments - -Inputs: - -Outputs: - -Purpose: - -\*******************************************************************/ - void cpp_typecheck_resolvet::resolve_with_arguments( cpp_scopest::id_sett &id_set, const irep_idt &base_name, diff --git a/src/cpp/cpp_typecheck_resolve.h b/src/cpp/cpp_typecheck_resolve.h index 6d9031b62e0..1b6e1af615a 100644 --- a/src/cpp/cpp_typecheck_resolve.h +++ b/src/cpp/cpp_typecheck_resolve.h @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@cs.cmu.edu \*******************************************************************/ +/// \file +/// C++ Language Type Checking + #ifndef CPROVER_CPP_CPP_TYPECHECK_RESOLVE_H #define CPROVER_CPP_CPP_TYPECHECK_RESOLVE_H diff --git a/src/cpp/cpp_typecheck_static_assert.cpp b/src/cpp/cpp_typecheck_static_assert.cpp index 3e449a9f043..e72dc318095 100644 --- a/src/cpp/cpp_typecheck_static_assert.cpp +++ b/src/cpp/cpp_typecheck_static_assert.cpp @@ -6,22 +6,13 @@ Author: Daniel Kroening, kroening@cs.cmu.edu \*******************************************************************/ +/// \file +/// C++ Language Type Checking + #include #include "cpp_typecheck.h" -/*******************************************************************\ - -Function: cpp_typecheckt::convert - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void cpp_typecheckt::convert(cpp_static_assertt &cpp_static_assert) { typecheck_expr(cpp_static_assert.op0()); diff --git a/src/cpp/cpp_typecheck_template.cpp b/src/cpp/cpp_typecheck_template.cpp index 29acce8c65c..5706f380e46 100644 --- a/src/cpp/cpp_typecheck_template.cpp +++ b/src/cpp/cpp_typecheck_template.cpp @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@cs.cmu.edu \*******************************************************************/ +/// \file +/// C++ Language Type Checking + #include #include "cpp_type2name.h" @@ -15,18 +18,6 @@ Author: Daniel Kroening, kroening@cs.cmu.edu #include "cpp_convert_type.h" #include "cpp_template_args.h" -/*******************************************************************\ - -Function: cpp_typecheckt::salvage_default_arguments - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void cpp_typecheckt::salvage_default_arguments( const template_typet &old_type, template_typet &new_type) @@ -48,18 +39,6 @@ void cpp_typecheckt::salvage_default_arguments( } } -/*******************************************************************\ - -Function: cpp_typecheckt::typecheck_class_template - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void cpp_typecheckt::typecheck_class_template( cpp_declarationt &declaration) { @@ -223,18 +202,7 @@ void cpp_typecheckt::typecheck_class_template( cpp_idt::id_classt::TEMPLATE_SCOPE); } -/*******************************************************************\ - -Function: cpp_typecheckt::typecheck_function_template - - Inputs: - - Outputs: - - Purpose: typecheck function templates - -\*******************************************************************/ - +/// typecheck function templates void cpp_typecheckt::typecheck_function_template( cpp_declarationt &declaration) { @@ -337,19 +305,7 @@ void cpp_typecheckt::typecheck_function_template( cpp_scopes.id_map[symbol_name] = &template_scope; } -/*******************************************************************\ - -Function: cpp_typecheckt::typecheck_class_template_member - - Inputs: - - Outputs: - - Purpose: typecheck class tempalte members; - these can be methods or static members - -\*******************************************************************/ - +/// typecheck class tempalte members; these can be methods or static members void cpp_typecheckt::typecheck_class_template_member( cpp_declarationt &declaration) { @@ -462,18 +418,6 @@ void cpp_typecheckt::typecheck_class_template_member( } } -/*******************************************************************\ - -Function: cpp_typecheckt::class_template_identifier - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string cpp_typecheckt::class_template_identifier( const irep_idt &base_name, const template_typet &template_type, @@ -533,18 +477,6 @@ std::string cpp_typecheckt::class_template_identifier( return identifier; } -/*******************************************************************\ - -Function: cpp_typecheckt::function_template_identifier - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string cpp_typecheckt::function_template_identifier( const irep_idt &base_name, const template_typet &template_type, @@ -562,18 +494,6 @@ std::string cpp_typecheckt::function_template_identifier( return identifier; } -/*******************************************************************\ - -Function: cpp_typecheckt::convert_class_template_specialization - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void cpp_typecheckt::convert_class_template_specialization( cpp_declarationt &declaration) { @@ -695,18 +615,6 @@ void cpp_typecheckt::convert_class_template_specialization( } } -/*******************************************************************\ - -Function: cpp_typecheckt::convert_template_function_or_member_specialization - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void cpp_typecheckt::convert_template_function_or_member_specialization( cpp_declarationt &declaration) { @@ -808,18 +716,6 @@ void cpp_typecheckt::convert_template_function_or_member_specialization( } } -/*******************************************************************\ - -Function: cpp_typecheckt::typecheck_template_parameters - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - cpp_scopet &cpp_typecheckt::typecheck_template_parameters( template_typet &type) { @@ -951,18 +847,8 @@ cpp_scopet &cpp_typecheckt::typecheck_template_parameters( return template_scope; } -/*******************************************************************\ - -Function: cpp_typecheckt::typecheck_template_args - - Inputs: location, non-typechecked template arguments - - Outputs: typechecked template arguments - - Purpose: - -\*******************************************************************/ - +/// \par parameters: location, non-typechecked template arguments +/// \return typechecked template arguments cpp_template_args_tct cpp_typecheckt::typecheck_template_args( const source_locationt &source_location, const symbolt &template_symbol, @@ -1100,18 +986,6 @@ cpp_template_args_tct cpp_typecheckt::typecheck_template_args( return result; } -/*******************************************************************\ - -Function: cpp_typecheckt::convert_template_declaration - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void cpp_typecheckt::convert_template_declaration( cpp_declarationt &declaration) { diff --git a/src/cpp/cpp_typecheck_type.cpp b/src/cpp/cpp_typecheck_type.cpp index 3672acfc0d2..8536e80fa73 100644 --- a/src/cpp/cpp_typecheck_type.cpp +++ b/src/cpp/cpp_typecheck_type.cpp @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@cs.cmu.edu \*******************************************************************/ +/// \file +/// C++ Language Type Checking + #include #include @@ -14,18 +17,6 @@ Author: Daniel Kroening, kroening@cs.cmu.edu #include "cpp_convert_type.h" #include "expr2cpp.h" -/*******************************************************************\ - -Function: cpp_typecheckt::typecheck_type - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void cpp_typecheckt::typecheck_type(typet &type) { assert(type.id()!=irep_idt()); diff --git a/src/cpp/cpp_typecheck_using.cpp b/src/cpp/cpp_typecheck_using.cpp index 9ad812ca8ec..8a67e6a4092 100644 --- a/src/cpp/cpp_typecheck_using.cpp +++ b/src/cpp/cpp_typecheck_using.cpp @@ -6,22 +6,13 @@ Author: Daniel Kroening, kroening@cs.cmu.edu \*******************************************************************/ +/// \file +/// C++ Language Type Checking + #include #include "cpp_typecheck.h" -/*******************************************************************\ - -Function: cpp_typecheckt::convert - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void cpp_typecheckt::convert(cpp_usingt &cpp_using) { // there are two forms of using clauses: diff --git a/src/cpp/cpp_typecheck_virtual_table.cpp b/src/cpp/cpp_typecheck_virtual_table.cpp index ec52b1270ae..4e766297206 100644 --- a/src/cpp/cpp_typecheck_virtual_table.cpp +++ b/src/cpp/cpp_typecheck_virtual_table.cpp @@ -6,19 +6,14 @@ Author: Daniel Kroening, kroening@cs.cmu.edu \*******************************************************************/ +/// \file +/// C++ Language Type Checking + #include #include #include "cpp_typecheck.h" -/*******************************************************************\ - -Function: cpp_typecheckt::do_virtual_table - -Author: Daniel Kroening, kroening@kroening.com - -\*******************************************************************/ - void cpp_typecheckt::do_virtual_table(const symbolt &symbol) { assert(symbol.type.id()==ID_struct); diff --git a/src/cpp/cpp_using.h b/src/cpp/cpp_using.h index fadc71accc4..580edec7c81 100644 --- a/src/cpp/cpp_using.h +++ b/src/cpp/cpp_using.h @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@cs.cmu.edu \*******************************************************************/ +/// \file +/// C++ Language Type Checking + #ifndef CPROVER_CPP_CPP_USING_H #define CPROVER_CPP_CPP_USING_H diff --git a/src/cpp/cpp_util.cpp b/src/cpp/cpp_util.cpp index 1a3c8dfd773..f57fffb71cc 100644 --- a/src/cpp/cpp_util.cpp +++ b/src/cpp/cpp_util.cpp @@ -11,18 +11,6 @@ #include "cpp_util.h" -/*******************************************************************\ - -Function: cpp_symbol_expr - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - exprt cpp_symbol_expr(const symbolt &symbol) { exprt tmp(ID_symbol, symbol.type); diff --git a/src/cpp/cpp_util.h b/src/cpp/cpp_util.h index 17351354c1d..16400514fcb 100644 --- a/src/cpp/cpp_util.h +++ b/src/cpp/cpp_util.h @@ -12,32 +12,8 @@ #include #include -/*******************************************************************\ - -Function: cpp_symbol_expr - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - exprt cpp_symbol_expr(const symbolt &symbol); -/*******************************************************************\ - -Function: already_typechecked - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - inline void already_typechecked(irept &irep) { exprt tmp("already_typechecked"); diff --git a/src/cpp/expr2cpp.cpp b/src/cpp/expr2cpp.cpp index 715809ca3c1..d0036b58927 100644 --- a/src/cpp/expr2cpp.cpp +++ b/src/cpp/expr2cpp.cpp @@ -47,18 +47,6 @@ class expr2cppt:public expr2ct typedef std::unordered_set id_sett; }; -/*******************************************************************\ - -Function: expr2cppt::convert_struct - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string expr2cppt::convert_struct( const exprt &src, unsigned &precedence) @@ -123,18 +111,6 @@ std::string expr2cppt::convert_struct( return dest; } -/*******************************************************************\ - -Function: expr2cppt::convert_constant - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string expr2cppt::convert_constant( const constant_exprt &src, unsigned &precedence) @@ -151,18 +127,6 @@ std::string expr2cppt::convert_constant( return expr2ct::convert_constant(src, precedence); } -/*******************************************************************\ - -Function: expr2cppt::convert_rec - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string expr2cppt::convert_rec( const typet &src, const c_qualifierst &qualifiers, @@ -421,18 +385,6 @@ std::string expr2cppt::convert_rec( return expr2ct::convert_rec(src, qualifiers, declarator); } -/*******************************************************************\ - -Function: expr2cppt::convert_cpp_this - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string expr2cppt::convert_cpp_this( const exprt &src, unsigned precedence) @@ -440,18 +392,6 @@ std::string expr2cppt::convert_cpp_this( return "this"; } -/*******************************************************************\ - -Function: expr2cppt::convert_cpp_new - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string expr2cppt::convert_cpp_new( const exprt &src, unsigned precedence) @@ -477,18 +417,6 @@ std::string expr2cppt::convert_cpp_new( return dest; } -/*******************************************************************\ - -Function: expr2cppt::convert_code_cpp_delete - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string expr2cppt::convert_code_cpp_delete( const exprt &src, unsigned indent) @@ -508,18 +436,6 @@ std::string expr2cppt::convert_code_cpp_delete( return dest; } -/*******************************************************************\ - -Function: expr2cppt::convert - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string expr2cppt::convert_with_precedence( const exprt &src, unsigned &precedence) @@ -551,18 +467,6 @@ std::string expr2cppt::convert_with_precedence( return expr2ct::convert_with_precedence(src, precedence); } -/*******************************************************************\ - -Function: expr2cppt::convert_code - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string expr2cppt::convert_code( const codet &src, unsigned indent) @@ -580,18 +484,6 @@ std::string expr2cppt::convert_code( return expr2ct::convert_code(src, indent); } -/*******************************************************************\ - -Function: expr2cppt::convert_extractbit - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string expr2cppt::convert_extractbit( const exprt &src, unsigned precedence) @@ -600,18 +492,6 @@ std::string expr2cppt::convert_extractbit( return convert(src.op0())+"["+convert(src.op1())+"]"; } -/*******************************************************************\ - -Function: expr2cppt::convert_extractbits - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string expr2cppt::convert_extractbits( const exprt &src, unsigned precedence) @@ -622,18 +502,6 @@ std::string expr2cppt::convert_extractbits( convert(src.op2())+")"; } -/*******************************************************************\ - -Function: expr2cpp - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string expr2cpp(const exprt &expr, const namespacet &ns) { expr2cppt expr2cpp(ns); @@ -641,18 +509,6 @@ std::string expr2cpp(const exprt &expr, const namespacet &ns) return expr2cpp.convert(expr); } -/*******************************************************************\ - -Function: type2cpp - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string type2cpp(const typet &type, const namespacet &ns) { expr2cppt expr2cpp(ns); diff --git a/src/cpp/parse.cpp b/src/cpp/parse.cpp index 536c54f5169..54795864447 100644 --- a/src/cpp/parse.cpp +++ b/src/cpp/parse.cpp @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@cs.cmu.edu \*******************************************************************/ +/// \file +/// C++ Language Parsing + #include #include @@ -177,18 +180,6 @@ class save_scopet new_scopet *old_scope; }; -/*******************************************************************\ - -Function: - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void new_scopet::print_rec(std::ostream &out, unsigned indent) const { for(id_mapt::const_iterator @@ -424,18 +415,6 @@ class Parser // NOLINT(readability/identifiers) unsigned int max_errors; }; -/*******************************************************************\ - -Function: Parser::add_id - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - new_scopet &Parser::add_id(const irept &cpp_name, new_scopet::kindt kind) { irep_idt id; @@ -449,18 +428,6 @@ new_scopet &Parser::add_id(const irept &cpp_name, new_scopet::kindt kind) return add_id(id, kind); } -/*******************************************************************\ - -Function: Parser::add_id - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - new_scopet &Parser::add_id(const irep_idt &id, new_scopet::kindt kind) { new_scopet &s=current_scope->id_map[id]; @@ -472,54 +439,18 @@ new_scopet &Parser::add_id(const irep_idt &id, new_scopet::kindt kind) return s; } -/*******************************************************************\ - -Function: Parser::make_sub_scope - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void Parser::make_sub_scope(const irept &cpp_name, new_scopet::kindt kind) { new_scopet &s=add_id(cpp_name, kind); current_scope=&s; } -/*******************************************************************\ - -Function: Parser::make_sub_scope - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void Parser::make_sub_scope(const irep_idt &id, new_scopet::kindt kind) { new_scopet &s=add_id(id, kind); current_scope=&s; } -/*******************************************************************\ - -Function: Parser::rString - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool Parser::rString(cpp_tokent &tk) { if(lex.get_token(tk)!=TOK_STRING) @@ -528,18 +459,6 @@ bool Parser::rString(cpp_tokent &tk) return true; } -/*******************************************************************\ - -Function: Parser::merge_types - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void Parser::merge_types(const typet &src, typet &dest) { if(src.is_nil()) @@ -560,18 +479,6 @@ void Parser::merge_types(const typet &src, typet &dest) } } -/*******************************************************************\ - -Function: - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool Parser::SyntaxError() { #define ERROR_TOKENS 4 @@ -606,18 +513,6 @@ bool Parser::SyntaxError() return ++number_of_errors < max_errors; } -/*******************************************************************\ - -Function: - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool Parser::rProgram(cpp_itemt &item) { while(lex.LookAhead(0)!='\0') @@ -637,18 +532,6 @@ bool Parser::rProgram(cpp_itemt &item) return false; } -/*******************************************************************\ - -Function: - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - /* definition : null.declaration @@ -696,18 +579,6 @@ bool Parser::rDefinition(cpp_itemt &item) return rDeclaration(item.make_declaration()); } -/*******************************************************************\ - -Function: - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool Parser::rNullDeclaration(cpp_declarationt &decl) { cpp_tokent tk; @@ -720,18 +591,6 @@ bool Parser::rNullDeclaration(cpp_declarationt &decl) return true; } -/*******************************************************************\ - -Function: - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - /* typedef : TYPEDEF type.specifier declarators ';' @@ -761,18 +620,6 @@ bool Parser::rTypedef(cpp_declarationt &declaration) return true; } -/*******************************************************************\ - -Function: - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - /* USING Identifier '=' type.specifier ';' */ @@ -825,18 +672,6 @@ bool Parser::rTypedefUsing(cpp_declarationt &declaration) return true; } -/*******************************************************************\ - -Function: - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool Parser::rTypedefStatement(codet &statement) { statement=codet(ID_decl); @@ -844,18 +679,6 @@ bool Parser::rTypedefStatement(codet &statement) return rTypedef((cpp_declarationt &)statement.op0()); } -/*******************************************************************\ - -Function: - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - /* type.specifier : {cv.qualify} (integral.or.class.spec | name) {cv.qualify} @@ -918,18 +741,6 @@ bool Parser::rTypeSpecifier(typet &tspec, bool check) return true; } -/*******************************************************************\ - -Function: - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - // isTypeSpecifier() returns true if the next is probably a type specifier. bool Parser::isTypeSpecifier() @@ -959,18 +770,6 @@ bool Parser::isTypeSpecifier() return false; } -/*******************************************************************\ - -Function: - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - /* linkage.spec : EXTERN String definition @@ -1009,18 +808,6 @@ bool Parser::rLinkageSpec(cpp_linkage_spect &linkage_spec) return true; } -/*******************************************************************\ - -Function: - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - /* namespace.spec : { INLINE } NAMESPACE Identifier definition @@ -1074,18 +861,6 @@ bool Parser::rNamespaceSpec(cpp_namespace_spect &namespace_spec) } } -/*******************************************************************\ - -Function: - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - /* using.declaration : USING { NAMESPACE } name ';' */ @@ -1114,18 +889,6 @@ bool Parser::rUsing(cpp_usingt &cpp_using) return true; } -/*******************************************************************\ - -Function: - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - /* static_assert.declaration : STATIC_ASSERT ( expression , expression ) ';' */ @@ -1160,18 +923,6 @@ bool Parser::rStaticAssert(cpp_static_assertt &cpp_static_assert) return true; } -/*******************************************************************\ - -Function: - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - /* linkage.body : '{' (definition)* '}' @@ -1207,18 +958,6 @@ bool Parser::rLinkageBody(cpp_linkage_spect::itemst &items) return true; } -/*******************************************************************\ - -Function: - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - /* template.decl : TEMPLATE '<' temp.arg.list '>' declaration @@ -1292,18 +1031,6 @@ bool Parser::rTemplateDecl(cpp_declarationt &decl) return true; } -/*******************************************************************\ - -Function: - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool Parser::rTemplateDecl2(typet &decl, TemplateDeclKind &kind) { cpp_tokent tk; @@ -1358,18 +1085,6 @@ bool Parser::rTemplateDecl2(typet &decl, TemplateDeclKind &kind) return true; } -/*******************************************************************\ - -Function: - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - /* temp.arg.list : empty @@ -1402,18 +1117,6 @@ bool Parser::rTempArgList(irept &args) return true; } -/*******************************************************************\ - -Function: - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - /* temp.arg.declaration : CLASS [Identifier] {'=' type.name} @@ -1605,18 +1308,6 @@ bool Parser::rTempArgDeclaration(cpp_declarationt &declaration) return true; } -/*******************************************************************\ - -Function: - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - /* extern.template.decl : EXTERN TEMPLATE declaration @@ -1640,18 +1331,6 @@ bool Parser::rExternTemplateDecl(irept &decl) return true; } -/*******************************************************************\ - -Function: - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - /* declaration : integral.declaration @@ -1768,18 +1447,6 @@ bool Parser::rDeclaration(cpp_declarationt &declaration) } } -/*******************************************************************\ - -Function: - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - /* single declaration, for use in a condition (controlling expression of switch/while/if) */ bool Parser::rSimpleDeclaration(cpp_declarationt &declaration) @@ -1840,18 +1507,6 @@ bool Parser::rSimpleDeclaration(cpp_declarationt &declaration) return true; } -/*******************************************************************\ - -Function: - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool Parser::rIntegralDeclaration( cpp_declarationt &declaration, cpp_storage_spect &storage_spec, @@ -1965,18 +1620,6 @@ bool Parser::rIntegralDeclaration( } } -/*******************************************************************\ - -Function: - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool Parser::rConstDeclaration( cpp_declarationt &declaration, cpp_storage_spect &storage_spec, @@ -2002,18 +1645,6 @@ bool Parser::rConstDeclaration( return true; } -/*******************************************************************\ - -Function: - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool Parser::rOtherDeclaration( cpp_declarationt &declaration, cpp_storage_spect &storage_spec, @@ -2191,18 +1822,6 @@ bool Parser::rOtherDeclaration( return true; } -/*******************************************************************\ - -Function: - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - /* This returns true for an declaration like: T (a); @@ -2242,18 +1861,6 @@ bool Parser::isConstructorDecl() } } -/*******************************************************************\ - -Function: - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - /* ptr.to.member : {'::'} (identifier {'<' any* '>'} '::')+ '*' @@ -2311,18 +1918,6 @@ bool Parser::isPtrToMember(int i) return false; } -/*******************************************************************\ - -Function: - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - /* member.spec : (FRIEND | INLINE | VIRTUAL | EXPLICIT)+ @@ -2353,18 +1948,6 @@ bool Parser::optMemberSpec(cpp_member_spect &member_spec) return true; } -/*******************************************************************\ - -Function: - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - /* storage.spec : STATIC | EXTERN | AUTO | REGISTER | MUTABLE | ASM | THREAD_LOCAL @@ -2402,18 +1985,6 @@ bool Parser::optStorageSpec(cpp_storage_spect &storage_spec) return true; } -/*******************************************************************\ - -Function: - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - /* cv.qualify : (CONSTEXPR | CONST | VOLATILE | RESTRICT)+ */ @@ -2486,18 +2057,6 @@ bool Parser::optCvQualify(typet &cv) return true; } -/*******************************************************************\ - -Function: - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - /* dcl.align : ALIGNAS unary.expr @@ -2541,18 +2100,6 @@ bool Parser::optAlignas(typet &cv) return true; } -/*******************************************************************\ - -Function: - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool Parser::rAttribute() { cpp_tokent tk; @@ -2577,18 +2124,6 @@ bool Parser::rAttribute() return true; } -/*******************************************************************\ - -Function: - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool Parser::optAttribute(cpp_declarationt &declaration) { if(lex.LookAhead(0)!='[' || @@ -2621,18 +2156,6 @@ bool Parser::optAttribute(cpp_declarationt &declaration) return true; } -/*******************************************************************\ - -Function: - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - /* integral.or.class.spec @@ -2860,18 +2383,6 @@ bool Parser::optIntegralTypeOrClassSpec(typet &p) } } -/*******************************************************************\ - -Function: - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - /* constructor.decl : '(' {arg.decl.list} ')' {cv.qualify} {throw.decl} @@ -2990,18 +2501,6 @@ bool Parser::rConstructorDecl( return true; } -/*******************************************************************\ - -Function: - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - /* throw.decl : THROW '(' (name {','})* {name} ')' | THROW '(' '...' ')' @@ -3070,18 +2569,6 @@ bool Parser::optThrowDecl(irept &throw_decl) return true; } -/*******************************************************************\ - -Function: - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - /* declarators : declarator.with.init (',' declarator.with.init)* @@ -3109,18 +2596,6 @@ bool Parser::rDeclarators( } } -/*******************************************************************\ - -Function: - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - /* declarator.with.init : ':' expression @@ -3235,18 +2710,6 @@ bool Parser::rDeclaratorWithInit( } } -/*******************************************************************\ - -Function: - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - /* __stdcall, __fastcall, __clrcall, __cdecl These are Visual-Studio specific. @@ -3269,18 +2732,6 @@ bool Parser::rDeclaratorQualifier() return true; } -/*******************************************************************\ - -Function: - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - /* declarator : (ptr.operator)* (name | '(' declarator ')') @@ -3538,18 +2989,6 @@ bool Parser::rDeclarator( return true; } -/*******************************************************************\ - -Function: Parser::optPtrOperator - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - /* ptr.operator : (('*' | ptr.to.member)['&'] {cv.qualify})+ @@ -3675,18 +3114,6 @@ bool Parser::optPtrOperator(typet &ptrs) return true; } -/*******************************************************************\ - -Function: - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - /* member.initializers : ':' member.init (',' member.init)* @@ -3719,18 +3146,6 @@ bool Parser::rMemberInitializers(irept &init) return true; } -/*******************************************************************\ - -Function: - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - /* member.init : name '(' function.arguments ')' @@ -3807,18 +3222,6 @@ bool Parser::rMemberInit(exprt &init) return true; } -/*******************************************************************\ - -Function: - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - /* name : {'::'} name2 ('::' name2)* @@ -3962,18 +3365,6 @@ bool Parser::rName(irept &name) } } -/*******************************************************************\ - -Function: - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - /* operator.name : '+' | '-' | '*' | '/' | '%' | '^' | '&' | '|' | '~' @@ -4084,18 +3475,6 @@ bool Parser::rOperatorName(irept &name) return true; } -/*******************************************************************\ - -Function: Parser::rCastOperatorName - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - /* cast.operator.name : {cv.qualify} (integral.or.class.spec | name) {cv.qualify} @@ -4138,18 +3517,6 @@ bool Parser::rCastOperatorName(irept &name) return true; } -/*******************************************************************\ - -Function: - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - /* ptr.to.member : {'::'} (identifier {template.args} '::')+ '*' @@ -4244,18 +3611,6 @@ bool Parser::rPtrToMember(irept &ptr_to_mem) return false; } -/*******************************************************************\ - -Function: - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - /* template.args : '<' '>' @@ -4399,18 +3754,6 @@ bool Parser::rTemplateArgs(irept &template_args) } } -/*******************************************************************\ - -Function: - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - /* arg.decl.list.or.init : arg.decl.list @@ -4457,18 +3800,6 @@ bool Parser::rArgDeclListOrInit( } } -/*******************************************************************\ - -Function: - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - /* arg.decl.list : empty @@ -4522,18 +3853,6 @@ bool Parser::rArgDeclList(irept &arglist) return true; } -/*******************************************************************\ - -Function: - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - /* arg.declaration : {userdef.keyword | REGISTER} type.specifier arg.declarator @@ -4577,18 +3896,6 @@ bool Parser::rArgDeclaration(cpp_declarationt &declaration) return true; } -/*******************************************************************\ - -Function: - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - /* initialize.expr : expression @@ -4676,18 +3983,6 @@ bool Parser::rInitializeExpr(exprt &expr) return true; } -/*******************************************************************\ - -Function: - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - /* function.arguments : empty @@ -4728,18 +4023,6 @@ bool Parser::rFunctionArguments(exprt &args) } } -/*******************************************************************\ - -Function: - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - /* enum.spec : ENUM Identifier @@ -4827,18 +4110,6 @@ bool Parser::rEnumSpec(typet &spec) return true; } -/*******************************************************************\ - -Function: - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - /* enum.body : Identifier {'=' expression} (',' Identifier {'=' expression})* {','} @@ -4890,18 +4161,6 @@ bool Parser::rEnumBody(irept &body) } } -/*******************************************************************\ - -Function: - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - /* class.spec : {userdef.keyword} class.key class.body @@ -5010,18 +4269,6 @@ bool Parser::rClassSpec(typet &spec) return true; } -/*******************************************************************\ - -Function: - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - /* base.specifiers : ':' base.specifier (',' base.specifier)* @@ -5097,18 +4344,6 @@ bool Parser::rBaseSpecifiers(irept &bases) } } -/*******************************************************************\ - -Function: - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - /* class.body : '{' (class.members)* '}' */ @@ -5156,18 +4391,6 @@ bool Parser::rClassBody(exprt &body) return true; } -/*******************************************************************\ - -Function: - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - /* class.member : (PUBLIC | PROTECTED | PRIVATE) ':' @@ -5248,18 +4471,6 @@ bool Parser::rClassMember(cpp_itemt &member) } } -/*******************************************************************\ - -Function: - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - /* access.decl : name ';' e.g. ::; @@ -5280,18 +4491,6 @@ bool Parser::rAccessDecl(irept &mem) return true; } -/*******************************************************************\ - -Function: - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - /* comma.expression : expression @@ -5336,18 +4535,6 @@ bool Parser::rCommaExpression(exprt &exp) return true; } -/*******************************************************************\ - -Function: - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - /* expression : conditional.expr {(AssignOp | '=') expression} right-to-left @@ -5429,18 +4616,6 @@ bool Parser::rExpression(exprt &exp, bool template_args) return true; } -/*******************************************************************\ - -Function: - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - /* conditional.expr : logical.or.expr {'?' comma.expression ':' conditional.expr} right-to-left @@ -5489,18 +4664,6 @@ bool Parser::rConditionalExpr(exprt &exp, bool template_args) return true; } -/*******************************************************************\ - -Function: - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - /* logical.or.expr : logical.and.expr @@ -5540,18 +4703,6 @@ bool Parser::rLogicalOrExpr(exprt &exp, bool template_args) return true; } -/*******************************************************************\ - -Function: - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - /* logical.and.expr : inclusive.or.expr @@ -5591,18 +4742,6 @@ bool Parser::rLogicalAndExpr(exprt &exp, bool template_args) return true; } -/*******************************************************************\ - -Function: - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - /* inclusive.or.expr : exclusive.or.expr @@ -5642,18 +4781,6 @@ bool Parser::rInclusiveOrExpr(exprt &exp, bool template_args) return true; } -/*******************************************************************\ - -Function: - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - /* exclusive.or.expr : and.expr @@ -5693,18 +4820,6 @@ bool Parser::rExclusiveOrExpr(exprt &exp, bool template_args) return true; } -/*******************************************************************\ - -Function: - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - /* and.expr : equality.expr @@ -5744,18 +4859,6 @@ bool Parser::rAndExpr(exprt &exp, bool template_args) return true; } -/*******************************************************************\ - -Function: - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - /* equality.expr : relational.expr @@ -5796,18 +4899,6 @@ bool Parser::rEqualityExpr(exprt &exp, bool template_args) return true; } -/*******************************************************************\ - -Function: - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - /* relational.expr : shift.expr @@ -5860,18 +4951,6 @@ bool Parser::rRelationalExpr(exprt &exp, bool template_args) return true; } -/*******************************************************************\ - -Function: - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - /* shift.expr : additive.expr @@ -5912,18 +4991,6 @@ bool Parser::rShiftExpr(exprt &exp, bool template_args) return true; } -/*******************************************************************\ - -Function: - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - /* additive.expr : multiply.expr @@ -5971,18 +5038,6 @@ bool Parser::rAdditiveExpr(exprt &exp) return true; } -/*******************************************************************\ - -Function: - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - /* multiply.expr : pm.expr @@ -6035,18 +5090,6 @@ bool Parser::rMultiplyExpr(exprt &exp) return true; } -/*******************************************************************\ - -Function: - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - /* pm.expr (pointer to member .*, ->*) : cast.expr @@ -6092,18 +5135,6 @@ bool Parser::rPmExpr(exprt &exp) return true; } -/*******************************************************************\ - -Function: - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - /* cast.expr : unary.expr @@ -6165,18 +5196,6 @@ bool Parser::rCastExpr(exprt &exp) } } -/*******************************************************************\ - -Function: - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - /* type.name : type.specifier cast.declarator @@ -6214,18 +5233,6 @@ bool Parser::rTypeName(typet &tname) return true; } -/*******************************************************************\ - -Function: - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - /* type.name | type.specifier { '(' type.specifier ( ',' type.specifier )* @@ -6403,18 +5410,6 @@ bool Parser::rTypeNameOrFunctionType(typet &tname) return true; } -/*******************************************************************\ - -Function: - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - /* unary.expr : postfix.expr @@ -6528,18 +5523,6 @@ bool Parser::rUnaryExpr(exprt &exp) return rPostfixExpr(exp); } -/*******************************************************************\ - -Function: - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - /* throw.expression : THROW {expression} @@ -6578,18 +5561,6 @@ bool Parser::rThrowExpr(exprt &exp) return true; } -/*******************************************************************\ - -Function: - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - /* typeid.expr : TYPEID '(' expression ')' @@ -6654,18 +5625,6 @@ bool Parser::rTypeidExpr(exprt &exp) return false; } -/*******************************************************************\ - -Function: - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - /* sizeof.expr : SIZEOF unary.expr @@ -6740,18 +5699,6 @@ bool Parser::rSizeofExpr(exprt &exp) return true; } -/*******************************************************************\ - -Function: - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - /* alignof.expr | ALIGNOF '(' type.name ')' @@ -6781,18 +5728,6 @@ bool Parser::rAlignofExpr(exprt &exp) return true; } -/*******************************************************************\ - -Function: - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - /* noexcept.expr : NOEXCEPT '(' expression ')' @@ -6842,18 +5777,6 @@ bool Parser::isAllocateExpr(int t) return t==TOK_NEW || t==TOK_DELETE; } -/*******************************************************************\ - -Function: - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - /* allocate.expr : {Scope | userdef.keyword} NEW allocate.type @@ -6942,18 +5865,6 @@ bool Parser::rAllocateExpr(exprt &exp) return false; } -/*******************************************************************\ - -Function: - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - /* allocate.type : {'(' function.arguments ')'} type.specifier new.declarator @@ -7051,18 +5962,6 @@ bool Parser::rAllocateType( return true; } -/*******************************************************************\ - -Function: - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - /* new.declarator : empty @@ -7098,18 +5997,6 @@ bool Parser::rNewDeclarator(typet &decl) return true; } -/*******************************************************************\ - -Function: - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - /* allocate.initializer : '(' {initialize.expr (',' initialize.expr)* } ')' @@ -7155,18 +6042,6 @@ bool Parser::rAllocateInitializer(exprt &init) return true; } -/*******************************************************************\ - -Function: - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - /* postfix.exp : primary.exp @@ -7318,18 +6193,6 @@ bool Parser::rPostfixExpr(exprt &exp) } } -/*******************************************************************\ - -Function: - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - /* __uuidof( expression ) __uuidof( type ) @@ -7380,18 +6243,6 @@ bool Parser::rMSCuuidof(exprt &expr) return true; } -/*******************************************************************\ - -Function: - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - /* __if_exists ( identifier ) { token stream } __if_not_exists ( identifier ) { token stream } @@ -7442,18 +6293,6 @@ bool Parser::rMSC_if_existsExpr(exprt &expr) return true; } -/*******************************************************************\ - -Function: - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool Parser::rMSC_if_existsStatement(codet &code) { cpp_tokent tk1; @@ -7506,18 +6345,6 @@ bool Parser::rMSC_if_existsStatement(codet &code) return true; } -/*******************************************************************\ - -Function: - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - /* __is_base_of ( base, derived ) __is_convertible_to ( from, to ) @@ -7570,18 +6397,6 @@ bool Parser::rTypePredicate(exprt &expr) return true; } -/*******************************************************************\ - -Function: - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - /* primary.exp : Constant @@ -7822,18 +6637,6 @@ bool Parser::rPrimaryExpr(exprt &exp) } } -/*******************************************************************\ - -Function: - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - /* var.name : {'::'} name2 ('::' name2)* @@ -7857,18 +6660,6 @@ bool Parser::rVarName(exprt &name) return false; } -/*******************************************************************\ - -Function: - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool Parser::rVarNameCore(exprt &name) { #ifdef DEBUG @@ -8002,18 +6793,6 @@ bool Parser::rVarNameCore(exprt &name) } } -/*******************************************************************\ - -Function: - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool Parser::moreVarName() { if(lex.LookAhead(0)==TOK_SCOPE) @@ -8026,18 +6805,6 @@ bool Parser::moreVarName() return false; } -/*******************************************************************\ - -Function: - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - /* template.args : '<' any* '>' @@ -8139,18 +6906,6 @@ bool Parser::maybeTemplateArgs() return false; } -/*******************************************************************\ - -Function: - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - /* function.body : compound.statement | { asm } @@ -8200,18 +6955,6 @@ bool Parser::rFunctionBody(cpp_declaratort &declarator) } } -/*******************************************************************\ - -Function: - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - /* compound.statement : '{' (statement)* '}' @@ -8258,18 +7001,6 @@ bool Parser::rCompoundStatement(codet &statement) return true; } -/*******************************************************************\ - -Function: - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - /* statement : compound.statement @@ -8549,18 +7280,6 @@ bool Parser::rStatement(codet &statement) } } -/*******************************************************************\ - -Function: - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - /* if.statement : IF '(' comma.expression ')' statement { ELSE statement } @@ -8609,18 +7328,6 @@ bool Parser::rIfStatement(codet &statement) return true; } -/*******************************************************************\ - -Function: - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - /* switch.statement : SWITCH '(' comma.expression ')' statement @@ -8654,18 +7361,6 @@ bool Parser::rSwitchStatement(codet &statement) return true; } -/*******************************************************************\ - -Function: - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - /* while.statement : WHILE '(' comma.expression ')' statement @@ -8699,18 +7394,6 @@ bool Parser::rWhileStatement(codet &statement) return true; } -/*******************************************************************\ - -Function: - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - /* do.statement : DO statement WHILE '(' comma.expression ')' ';' @@ -8750,18 +7433,6 @@ bool Parser::rDoStatement(codet &statement) return true; } -/*******************************************************************\ - -Function: - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - /* for.statement : FOR '(' expr.statement {comma.expression} ';' {comma.expression} ')' @@ -8823,18 +7494,6 @@ bool Parser::rForStatement(codet &statement) return true; } -/*******************************************************************\ - -Function: - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - /* try.statement : TRY compound.statement (exception.handler)+ ';' @@ -8929,18 +7588,6 @@ bool Parser::rTryStatement(codet &statement) return true; } -/*******************************************************************\ - -Function: - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool Parser::rMSC_tryStatement(codet &statement) { // These are for 'structured exception handling', @@ -8996,18 +7643,6 @@ bool Parser::rMSC_tryStatement(codet &statement) return true; } -/*******************************************************************\ - -Function: - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool Parser::rMSC_leaveStatement(codet &statement) { // These are for 'structured exception handling', @@ -9024,18 +7659,6 @@ bool Parser::rMSC_leaveStatement(codet &statement) return true; } -/*******************************************************************\ - -Function: - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool Parser::rGCCAsmStatement(codet &statement) { cpp_tokent tk; @@ -9137,18 +7760,6 @@ bool Parser::rGCCAsmStatement(codet &statement) return true; } -/*******************************************************************\ - -Function: - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool Parser::rMSCAsmStatement(codet &statement) { cpp_tokent tk; @@ -9217,18 +7828,6 @@ bool Parser::rMSCAsmStatement(codet &statement) return true; } -/*******************************************************************\ - -Function: - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - /* expr.statement : ';' @@ -9310,18 +7909,6 @@ bool Parser::rExprStatement(codet &statement) } } -/*******************************************************************\ - -Function: - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool Parser::rCondition(exprt &statement) { cpp_token_buffert::post pos=lex.Save(); @@ -9347,18 +7934,6 @@ bool Parser::rCondition(exprt &statement) } } -/*******************************************************************\ - -Function: - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - /* declaration.statement : decl.head integral.or.class.spec {cv.qualify} {declarators} ';' @@ -9437,18 +8012,6 @@ bool Parser::rDeclarationStatement(codet &statement) } } -/*******************************************************************\ - -Function: - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - /* integral.decl.statement : decl.head integral.or.class.spec {cv.qualify} {declarators} ';' @@ -9494,18 +8057,6 @@ bool Parser::rIntegralDeclStatement( return true; } -/*******************************************************************\ - -Function: - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - /* other.decl.statement :decl.head name {cv.qualify} declarators ';' @@ -9560,35 +8111,11 @@ bool Parser::rOtherDeclStatement( return true; } -/*******************************************************************\ - -Function: - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool Parser::MaybeTypeNameOrClassTemplate(cpp_tokent &) { return true; } -/*******************************************************************\ - -Function: - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void Parser::SkipTo(int token) { cpp_tokent tk; @@ -9603,18 +8130,6 @@ void Parser::SkipTo(int token) } } -/*******************************************************************\ - -Function: Parser::operator() - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool Parser::operator()() { number_of_errors=0; @@ -9635,18 +8150,6 @@ bool Parser::operator()() return number_of_errors!=0; } -/*******************************************************************\ - -Function: cpp_parse - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool cpp_parse() { Parser parser(cpp_parser); diff --git a/src/cpp/recursion_counter.h b/src/cpp/recursion_counter.h index fab87c254f7..82ec1a77bbc 100644 --- a/src/cpp/recursion_counter.h +++ b/src/cpp/recursion_counter.h @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@cs.cmu.edu \*******************************************************************/ +/// \file +/// C++ Language Type Checking + #ifndef CPROVER_CPP_RECURSION_COUNTER_H #define CPROVER_CPP_RECURSION_COUNTER_H diff --git a/src/cpp/template_map.cpp b/src/cpp/template_map.cpp index 62d5b026207..83d5794ff97 100644 --- a/src/cpp/template_map.cpp +++ b/src/cpp/template_map.cpp @@ -6,22 +6,13 @@ Author: Daniel Kroening, kroening@cs.cmu.edu \*******************************************************************/ +/// \file +/// C++ Language Type Checking + #include #include "template_map.h" -/*******************************************************************\ - -Function: template_mapt::apply - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void template_mapt::apply(typet &type) const { if(type.id()==ID_array) @@ -74,18 +65,6 @@ void template_mapt::apply(typet &type) const } } -/*******************************************************************\ - -Function: template_mapt::apply - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void template_mapt::apply(exprt &expr) const { apply(expr.type()); @@ -106,18 +85,6 @@ void template_mapt::apply(exprt &expr) const apply(*it); } -/*******************************************************************\ - -Function: template_mapt::lookup - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - exprt template_mapt::lookup(const irep_idt &identifier) const { type_mapt::const_iterator t_it= @@ -139,18 +106,6 @@ exprt template_mapt::lookup(const irep_idt &identifier) const return static_cast(get_nil_irep()); } -/*******************************************************************\ - -Function: template_mapt::lookup_type - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - typet template_mapt::lookup_type(const irep_idt &identifier) const { type_mapt::const_iterator t_it= @@ -162,18 +117,6 @@ typet template_mapt::lookup_type(const irep_idt &identifier) const return static_cast(get_nil_irep()); } -/*******************************************************************\ - -Function: template_mapt::lookup_expr - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - exprt template_mapt::lookup_expr(const irep_idt &identifier) const { expr_mapt::const_iterator e_it= @@ -185,18 +128,6 @@ exprt template_mapt::lookup_expr(const irep_idt &identifier) const return static_cast(get_nil_irep()); } -/*******************************************************************\ - -Function: template_mapt::print - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void template_mapt::print(std::ostream &out) const { for(type_mapt::const_iterator it=type_map.begin(); @@ -210,18 +141,6 @@ void template_mapt::print(std::ostream &out) const out << it->first << " = " << it->second.pretty() << std::endl; } -/*******************************************************************\ - -Function: template_mapt::build - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void template_mapt::build( const template_typet &template_type, const cpp_template_args_tct &template_args) @@ -264,18 +183,6 @@ void template_mapt::build( } } -/*******************************************************************\ - -Function: template_mapt::set - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void template_mapt::set( const template_parametert ¶meter, const exprt &value) @@ -302,18 +209,6 @@ void template_mapt::set( } } -/*******************************************************************\ - -Function: template_mapt::build_unassigned - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void template_mapt::build_unassigned( const template_typet &template_type) { @@ -344,18 +239,6 @@ void template_mapt::build_unassigned( } } -/*******************************************************************\ - -Function: template_mapt::build_template_args - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - cpp_template_args_tct template_mapt::build_template_args( const template_typet &template_type) const { diff --git a/src/cpp/template_map.h b/src/cpp/template_map.h index c1347eca059..74531f3aaa9 100644 --- a/src/cpp/template_map.h +++ b/src/cpp/template_map.h @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@cs.cmu.edu \*******************************************************************/ +/// \file +/// C++ Language Type Checking + #ifndef CPROVER_CPP_TEMPLATE_MAP_H #define CPROVER_CPP_TEMPLATE_MAP_H diff --git a/src/doxygen.cfg b/src/doxyfile similarity index 82% rename from src/doxygen.cfg rename to src/doxyfile index b46c3b28f01..611614a3a9b 100644 --- a/src/doxygen.cfg +++ b/src/doxyfile @@ -14,211 +14,211 @@ # Project related configuration options #--------------------------------------------------------------------------- -# This tag specifies the encoding used for all characters in the config file -# that follow. The default is UTF-8 which is also the encoding used for all -# text before the first occurrence of this tag. Doxygen uses libiconv (or the -# iconv built into libc) for the transcoding. See +# This tag specifies the encoding used for all characters in the config file +# that follow. The default is UTF-8 which is also the encoding used for all +# text before the first occurrence of this tag. Doxygen uses libiconv (or the +# iconv built into libc) for the transcoding. See # http://www.gnu.org/software/libiconv for the list of possible encodings. DOXYFILE_ENCODING = UTF-8 -# The PROJECT_NAME tag is a single word (or a sequence of words surrounded +# The PROJECT_NAME tag is a single word (or a sequence of words surrounded # by quotes) that should identify the project. PROJECT_NAME = cprover -# The PROJECT_NUMBER tag can be used to enter a project or revision number. -# This could be handy for archiving the generated documentation or +# The PROJECT_NUMBER tag can be used to enter a project or revision number. +# This could be handy for archiving the generated documentation or # if some version control system is used. -PROJECT_NUMBER = +PROJECT_NUMBER = -# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) -# base path where the generated documentation will be put. -# If a relative path is entered, it will be relative to the location +# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) +# base path where the generated documentation will be put. +# If a relative path is entered, it will be relative to the location # where doxygen was started. If left blank the current directory will be used. OUTPUT_DIRECTORY = ../doc -# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create -# 4096 sub-directories (in 2 levels) under the output directory of each output -# format and will distribute the generated files over these directories. -# Enabling this option can be useful when feeding doxygen a huge amount of -# source files, where putting all generated files in the same directory would +# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create +# 4096 sub-directories (in 2 levels) under the output directory of each output +# format and will distribute the generated files over these directories. +# Enabling this option can be useful when feeding doxygen a huge amount of +# source files, where putting all generated files in the same directory would # otherwise cause performance problems for the file system. CREATE_SUBDIRS = NO -# The OUTPUT_LANGUAGE tag is used to specify the language in which all -# documentation generated by doxygen is written. Doxygen will use this -# information to generate all constant output in the proper language. -# The default language is English, other supported languages are: -# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional, -# Croatian, Czech, Danish, Dutch, Farsi, Finnish, French, German, Greek, -# Hungarian, Italian, Japanese, Japanese-en (Japanese with English messages), -# Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian, Polish, -# Portuguese, Romanian, Russian, Serbian, Slovak, Slovene, Spanish, Swedish, +# The OUTPUT_LANGUAGE tag is used to specify the language in which all +# documentation generated by doxygen is written. Doxygen will use this +# information to generate all constant output in the proper language. +# The default language is English, other supported languages are: +# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional, +# Croatian, Czech, Danish, Dutch, Farsi, Finnish, French, German, Greek, +# Hungarian, Italian, Japanese, Japanese-en (Japanese with English messages), +# Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian, Polish, +# Portuguese, Romanian, Russian, Serbian, Slovak, Slovene, Spanish, Swedish, # and Ukrainian. OUTPUT_LANGUAGE = English -# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will -# include brief member descriptions after the members that are listed in -# the file and class documentation (similar to JavaDoc). +# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will +# include brief member descriptions after the members that are listed in +# the file and class documentation (similar to JavaDoc). # Set to NO to disable this. BRIEF_MEMBER_DESC = YES -# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend -# the brief description of a member or function before the detailed description. -# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the +# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend +# the brief description of a member or function before the detailed description. +# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the # brief descriptions will be completely suppressed. REPEAT_BRIEF = YES -# This tag implements a quasi-intelligent brief description abbreviator -# that is used to form the text in various listings. Each string -# in this list, if found as the leading text of the brief description, will be -# stripped from the text and the result after processing the whole list, is -# used as the annotated text. Otherwise, the brief description is used as-is. -# If left blank, the following values are used ("$name" is automatically -# replaced with the name of the entity): "The $name class" "The $name widget" -# "The $name file" "is" "provides" "specifies" "contains" +# This tag implements a quasi-intelligent brief description abbreviator +# that is used to form the text in various listings. Each string +# in this list, if found as the leading text of the brief description, will be +# stripped from the text and the result after processing the whole list, is +# used as the annotated text. Otherwise, the brief description is used as-is. +# If left blank, the following values are used ("$name" is automatically +# replaced with the name of the entity): "The $name class" "The $name widget" +# "The $name file" "is" "provides" "specifies" "contains" # "represents" "a" "an" "the" -ABBREVIATE_BRIEF = +ABBREVIATE_BRIEF = -# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then -# Doxygen will generate a detailed section even if there is only a brief +# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then +# Doxygen will generate a detailed section even if there is only a brief # description. ALWAYS_DETAILED_SEC = NO -# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all -# inherited members of a class in the documentation of that class as if those -# members were ordinary class members. Constructors, destructors and assignment +# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all +# inherited members of a class in the documentation of that class as if those +# members were ordinary class members. Constructors, destructors and assignment # operators of the base classes will not be shown. INLINE_INHERITED_MEMB = NO -# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full -# path before files name in the file list and in the header files. If set +# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full +# path before files name in the file list and in the header files. If set # to NO the shortest path that makes the file name unique will be used. FULL_PATH_NAMES = YES -# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag -# can be used to strip a user-defined part of the path. Stripping is -# only done if one of the specified strings matches the left-hand part of -# the path. The tag can be used to show relative paths in the file list. -# If left blank the directory from which doxygen is run is used as the +# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag +# can be used to strip a user-defined part of the path. Stripping is +# only done if one of the specified strings matches the left-hand part of +# the path. The tag can be used to show relative paths in the file list. +# If left blank the directory from which doxygen is run is used as the # path to strip. -STRIP_FROM_PATH = +STRIP_FROM_PATH = -# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of -# the path mentioned in the documentation of a class, which tells -# the reader which header file to include in order to use a class. -# If left blank only the name of the header file containing the class -# definition is used. Otherwise one should specify the include paths that +# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of +# the path mentioned in the documentation of a class, which tells +# the reader which header file to include in order to use a class. +# If left blank only the name of the header file containing the class +# definition is used. Otherwise one should specify the include paths that # are normally passed to the compiler using the -I flag. -STRIP_FROM_INC_PATH = +STRIP_FROM_INC_PATH = -# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter -# (but less readable) file names. This can be useful is your file systems +# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter +# (but less readable) file names. This can be useful is your file systems # doesn't support long names like on DOS, Mac, or CD-ROM. SHORT_NAMES = NO -# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen -# will interpret the first line (until the first dot) of a JavaDoc-style -# comment as the brief description. If set to NO, the JavaDoc -# comments will behave just like regular Qt-style comments +# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen +# will interpret the first line (until the first dot) of a JavaDoc-style +# comment as the brief description. If set to NO, the JavaDoc +# comments will behave just like regular Qt-style comments # (thus requiring an explicit @brief command for a brief description.) JAVADOC_AUTOBRIEF = YES -# If the QT_AUTOBRIEF tag is set to YES then Doxygen will -# interpret the first line (until the first dot) of a Qt-style -# comment as the brief description. If set to NO, the comments -# will behave just like regular Qt-style comments (thus requiring +# If the QT_AUTOBRIEF tag is set to YES then Doxygen will +# interpret the first line (until the first dot) of a Qt-style +# comment as the brief description. If set to NO, the comments +# will behave just like regular Qt-style comments (thus requiring # an explicit \brief command for a brief description.) QT_AUTOBRIEF = NO -# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen -# treat a multi-line C++ special comment block (i.e. a block of //! or /// -# comments) as a brief description. This used to be the default behaviour. -# The new default is to treat a multi-line C++ comment block as a detailed +# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen +# treat a multi-line C++ special comment block (i.e. a block of //! or /// +# comments) as a brief description. This used to be the default behaviour. +# The new default is to treat a multi-line C++ comment block as a detailed # description. Set this tag to YES if you prefer the old behaviour instead. MULTILINE_CPP_IS_BRIEF = NO -# If the DETAILS_AT_TOP tag is set to YES then Doxygen +# If the DETAILS_AT_TOP tag is set to YES then Doxygen # will output the detailed description near the top, like JavaDoc. -# If set to NO, the detailed description appears after the member +# If set to NO, the detailed description appears after the member # documentation. DETAILS_AT_TOP = YES -# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented -# member inherits the documentation from any documented member that it +# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented +# member inherits the documentation from any documented member that it # re-implements. INHERIT_DOCS = YES -# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce -# a new page for each member. If set to NO, the documentation of a member will +# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce +# a new page for each member. If set to NO, the documentation of a member will # be part of the file/class/namespace that contains it. SEPARATE_MEMBER_PAGES = NO -# The TAB_SIZE tag can be used to set the number of spaces in a tab. +# The TAB_SIZE tag can be used to set the number of spaces in a tab. # Doxygen uses this value to replace tabs by spaces in code fragments. TAB_SIZE = 8 -# This tag can be used to specify a number of aliases that acts -# as commands in the documentation. An alias has the form "name=value". -# For example adding "sideeffect=\par Side Effects:\n" will allow you to -# put the command \sideeffect (or @sideeffect) in the documentation, which -# will result in a user-defined paragraph with heading "Side Effects:". +# This tag can be used to specify a number of aliases that acts +# as commands in the documentation. An alias has the form "name=value". +# For example adding "sideeffect=\par Side Effects:\n" will allow you to +# put the command \sideeffect (or @sideeffect) in the documentation, which +# will result in a user-defined paragraph with heading "Side Effects:". # You can put \n's in the value part of an alias to insert newlines. -ALIASES = +ALIASES = -# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C -# sources only. Doxygen will then generate output that is more tailored for C. -# For instance, some of the names that are used will be different. The list +# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C +# sources only. Doxygen will then generate output that is more tailored for C. +# For instance, some of the names that are used will be different. The list # of all members will be omitted, etc. OPTIMIZE_OUTPUT_FOR_C = NO -# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java -# sources only. Doxygen will then generate output that is more tailored for -# Java. For instance, namespaces will be presented as packages, qualified +# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java +# sources only. Doxygen will then generate output that is more tailored for +# Java. For instance, namespaces will be presented as packages, qualified # scopes will look different, etc. OPTIMIZE_OUTPUT_JAVA = NO -# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran -# sources only. Doxygen will then generate output that is more tailored for +# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran +# sources only. Doxygen will then generate output that is more tailored for # Fortran. OPTIMIZE_FOR_FORTRAN = NO -# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL -# sources. Doxygen will then generate output that is tailored for +# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL +# sources. Doxygen will then generate output that is tailored for # VHDL. OPTIMIZE_OUTPUT_VHDL = NO -# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want -# to include (a tag file for) the STL sources as input, then you should -# set this tag to YES in order to let doxygen match functions declarations and -# definitions whose arguments contain STL classes (e.g. func(std::string); v.s. -# func(std::string) {}). This also make the inheritance and collaboration +# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want +# to include (a tag file for) the STL sources as input, then you should +# set this tag to YES in order to let doxygen match functions declarations and +# definitions whose arguments contain STL classes (e.g. func(std::string); v.s. +# func(std::string) {}). This also make the inheritance and collaboration # diagrams that involve STL classes more complete and accurate. BUILTIN_STL_SUPPORT = YES @@ -228,42 +228,42 @@ BUILTIN_STL_SUPPORT = YES CPP_CLI_SUPPORT = NO -# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only. -# Doxygen will parse them like normal C++ but will assume all classes use public +# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only. +# Doxygen will parse them like normal C++ but will assume all classes use public # instead of private inheritance when no explicit protection keyword is present. SIP_SUPPORT = NO -# For Microsoft's IDL there are propget and propput attributes to indicate getter -# and setter methods for a property. Setting this option to YES (the default) -# will make doxygen to replace the get and set methods by a property in the -# documentation. This will only work if the methods are indeed getting or -# setting a simple type. If this is not the case, or you want to show the +# For Microsoft's IDL there are propget and propput attributes to indicate getter +# and setter methods for a property. Setting this option to YES (the default) +# will make doxygen to replace the get and set methods by a property in the +# documentation. This will only work if the methods are indeed getting or +# setting a simple type. If this is not the case, or you want to show the # methods anyway, you should set this option to NO. IDL_PROPERTY_SUPPORT = YES -# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC -# tag is set to YES, then doxygen will reuse the documentation of the first -# member in the group (if any) for the other members of the group. By default +# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC +# tag is set to YES, then doxygen will reuse the documentation of the first +# member in the group (if any) for the other members of the group. By default # all members of a group must be documented explicitly. DISTRIBUTE_GROUP_DOC = NO -# Set the SUBGROUPING tag to YES (the default) to allow class member groups of -# the same type (for instance a group of public functions) to be put as a -# subgroup of that type (e.g. under the Public Functions section). Set it to -# NO to prevent subgrouping. Alternatively, this can be done per class using +# Set the SUBGROUPING tag to YES (the default) to allow class member groups of +# the same type (for instance a group of public functions) to be put as a +# subgroup of that type (e.g. under the Public Functions section). Set it to +# NO to prevent subgrouping. Alternatively, this can be done per class using # the \nosubgrouping command. SUBGROUPING = YES -# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum -# is documented as struct, union, or enum with the name of the typedef. So -# typedef struct TypeS {} TypeT, will appear in the documentation as a struct -# with name TypeT. When disabled the typedef will appear as a member of a file, -# namespace, or class. And the struct will be named TypeS. This can typically -# be useful for C code in case the coding convention dictates that all compound +# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum +# is documented as struct, union, or enum with the name of the typedef. So +# typedef struct TypeS {} TypeT, will appear in the documentation as a struct +# with name TypeT. When disabled the typedef will appear as a member of a file, +# namespace, or class. And the struct will be named TypeS. This can typically +# be useful for C code in case the coding convention dictates that all compound # types are typedef'ed and only the typedef is referenced, never the tag name. TYPEDEF_HIDES_STRUCT = NO @@ -272,368 +272,368 @@ TYPEDEF_HIDES_STRUCT = NO # Build related configuration options #--------------------------------------------------------------------------- -# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in -# documentation are documented, even if no documentation was available. -# Private class members and static file members will be hidden unless +# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in +# documentation are documented, even if no documentation was available. +# Private class members and static file members will be hidden unless # the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES -EXTRACT_ALL = NO +EXTRACT_ALL = YES -# If the EXTRACT_PRIVATE tag is set to YES all private members of a class +# If the EXTRACT_PRIVATE tag is set to YES all private members of a class # will be included in the documentation. EXTRACT_PRIVATE = NO -# If the EXTRACT_STATIC tag is set to YES all static members of a file +# If the EXTRACT_STATIC tag is set to YES all static members of a file # will be included in the documentation. EXTRACT_STATIC = NO -# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) -# defined locally in source files will be included in the documentation. +# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) +# defined locally in source files will be included in the documentation. # If set to NO only classes defined in header files are included. EXTRACT_LOCAL_CLASSES = YES -# This flag is only useful for Objective-C code. When set to YES local -# methods, which are defined in the implementation section but not in -# the interface are included in the documentation. +# This flag is only useful for Objective-C code. When set to YES local +# methods, which are defined in the implementation section but not in +# the interface are included in the documentation. # If set to NO (the default) only methods in the interface are included. EXTRACT_LOCAL_METHODS = NO -# If this flag is set to YES, the members of anonymous namespaces will be -# extracted and appear in the documentation as a namespace called -# 'anonymous_namespace{file}', where file will be replaced with the base -# name of the file that contains the anonymous namespace. By default +# If this flag is set to YES, the members of anonymous namespaces will be +# extracted and appear in the documentation as a namespace called +# 'anonymous_namespace{file}', where file will be replaced with the base +# name of the file that contains the anonymous namespace. By default # anonymous namespace are hidden. EXTRACT_ANON_NSPACES = NO -# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all -# undocumented members of documented classes, files or namespaces. -# If set to NO (the default) these members will be included in the -# various overviews, but no documentation section is generated. +# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all +# undocumented members of documented classes, files or namespaces. +# If set to NO (the default) these members will be included in the +# various overviews, but no documentation section is generated. # This option has no effect if EXTRACT_ALL is enabled. -HIDE_UNDOC_MEMBERS = YES +HIDE_UNDOC_MEMBERS = NO -# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all -# undocumented classes that are normally visible in the class hierarchy. -# If set to NO (the default) these classes will be included in the various +# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all +# undocumented classes that are normally visible in the class hierarchy. +# If set to NO (the default) these classes will be included in the various # overviews. This option has no effect if EXTRACT_ALL is enabled. -HIDE_UNDOC_CLASSES = YES +HIDE_UNDOC_CLASSES = NO -# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all -# friend (class|struct|union) declarations. -# If set to NO (the default) these declarations will be included in the +# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all +# friend (class|struct|union) declarations. +# If set to NO (the default) these declarations will be included in the # documentation. HIDE_FRIEND_COMPOUNDS = NO -# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any -# documentation blocks found inside the body of a function. -# If set to NO (the default) these blocks will be appended to the +# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any +# documentation blocks found inside the body of a function. +# If set to NO (the default) these blocks will be appended to the # function's detailed documentation block. HIDE_IN_BODY_DOCS = NO -# The INTERNAL_DOCS tag determines if documentation -# that is typed after a \internal command is included. If the tag is set -# to NO (the default) then the documentation will be excluded. +# The INTERNAL_DOCS tag determines if documentation +# that is typed after a \internal command is included. If the tag is set +# to NO (the default) then the documentation will be excluded. # Set it to YES to include the internal documentation. INTERNAL_DOCS = NO -# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate -# file names in lower-case letters. If set to YES upper-case letters are also -# allowed. This is useful if you have classes or files whose names only differ -# in case and if your file system supports case sensitive file names. Windows +# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate +# file names in lower-case letters. If set to YES upper-case letters are also +# allowed. This is useful if you have classes or files whose names only differ +# in case and if your file system supports case sensitive file names. Windows # and Mac users are advised to set this option to NO. CASE_SENSE_NAMES = NO -# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen -# will show members with their full class and namespace scopes in the +# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen +# will show members with their full class and namespace scopes in the # documentation. If set to YES the scope will be hidden. HIDE_SCOPE_NAMES = NO -# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen -# will put a list of the files that are included by a file in the documentation +# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen +# will put a list of the files that are included by a file in the documentation # of that file. SHOW_INCLUDE_FILES = YES -# If the INLINE_INFO tag is set to YES (the default) then a tag [inline] +# If the INLINE_INFO tag is set to YES (the default) then a tag [inline] # is inserted in the documentation for inline members. INLINE_INFO = YES -# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen -# will sort the (detailed) documentation of file and class members -# alphabetically by member name. If set to NO the members will appear in +# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen +# will sort the (detailed) documentation of file and class members +# alphabetically by member name. If set to NO the members will appear in # declaration order. SORT_MEMBER_DOCS = YES -# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the -# brief documentation of file, namespace and class members alphabetically -# by member name. If set to NO (the default) the members will appear in +# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the +# brief documentation of file, namespace and class members alphabetically +# by member name. If set to NO (the default) the members will appear in # declaration order. SORT_BRIEF_DOCS = NO -# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the -# hierarchy of group names into alphabetical order. If set to NO (the default) +# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the +# hierarchy of group names into alphabetical order. If set to NO (the default) # the group names will appear in their defined order. SORT_GROUP_NAMES = NO -# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be -# sorted by fully-qualified names, including namespaces. If set to -# NO (the default), the class list will be sorted only by class name, -# not including the namespace part. +# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be +# sorted by fully-qualified names, including namespaces. If set to +# NO (the default), the class list will be sorted only by class name, +# not including the namespace part. # Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. -# Note: This option applies only to the class list, not to the +# Note: This option applies only to the class list, not to the # alphabetical list. SORT_BY_SCOPE_NAME = NO -# The GENERATE_TODOLIST tag can be used to enable (YES) or -# disable (NO) the todo list. This list is created by putting \todo +# The GENERATE_TODOLIST tag can be used to enable (YES) or +# disable (NO) the todo list. This list is created by putting \todo # commands in the documentation. GENERATE_TODOLIST = YES -# The GENERATE_TESTLIST tag can be used to enable (YES) or -# disable (NO) the test list. This list is created by putting \test +# The GENERATE_TESTLIST tag can be used to enable (YES) or +# disable (NO) the test list. This list is created by putting \test # commands in the documentation. GENERATE_TESTLIST = YES -# The GENERATE_BUGLIST tag can be used to enable (YES) or -# disable (NO) the bug list. This list is created by putting \bug +# The GENERATE_BUGLIST tag can be used to enable (YES) or +# disable (NO) the bug list. This list is created by putting \bug # commands in the documentation. GENERATE_BUGLIST = YES -# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or -# disable (NO) the deprecated list. This list is created by putting +# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or +# disable (NO) the deprecated list. This list is created by putting # \deprecated commands in the documentation. GENERATE_DEPRECATEDLIST= YES -# The ENABLED_SECTIONS tag can be used to enable conditional +# The ENABLED_SECTIONS tag can be used to enable conditional # documentation sections, marked by \if sectionname ... \endif. -ENABLED_SECTIONS = +ENABLED_SECTIONS = -# The MAX_INITIALIZER_LINES tag determines the maximum number of lines -# the initial value of a variable or define consists of for it to appear in -# the documentation. If the initializer consists of more lines than specified -# here it will be hidden. Use a value of 0 to hide initializers completely. -# The appearance of the initializer of individual variables and defines in the -# documentation can be controlled using \showinitializer or \hideinitializer +# The MAX_INITIALIZER_LINES tag determines the maximum number of lines +# the initial value of a variable or define consists of for it to appear in +# the documentation. If the initializer consists of more lines than specified +# here it will be hidden. Use a value of 0 to hide initializers completely. +# The appearance of the initializer of individual variables and defines in the +# documentation can be controlled using \showinitializer or \hideinitializer # command in the documentation regardless of this setting. MAX_INITIALIZER_LINES = 30 -# Set the SHOW_USED_FILES tag to NO to disable the list of files generated -# at the bottom of the documentation of classes and structs. If set to YES the +# Set the SHOW_USED_FILES tag to NO to disable the list of files generated +# at the bottom of the documentation of classes and structs. If set to YES the # list will mention the files that were used to generate the documentation. SHOW_USED_FILES = YES -# If the sources in your project are distributed over multiple directories -# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy +# If the sources in your project are distributed over multiple directories +# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy # in the documentation. The default is NO. SHOW_DIRECTORIES = NO # Set the SHOW_FILES tag to NO to disable the generation of the Files page. -# This will remove the Files entry from the Quick Index and from the +# This will remove the Files entry from the Quick Index and from the # Folder Tree View (if specified). The default is YES. SHOW_FILES = YES -# Set the SHOW_NAMESPACES tag to NO to disable the generation of the +# Set the SHOW_NAMESPACES tag to NO to disable the generation of the # Namespaces page. This will remove the Namespaces entry from the Quick Index # and from the Folder Tree View (if specified). The default is YES. SHOW_NAMESPACES = YES -# The FILE_VERSION_FILTER tag can be used to specify a program or script that -# doxygen should invoke to get the current version for each file (typically from -# the version control system). Doxygen will invoke the program by executing (via -# popen()) the command , where is the value of -# the FILE_VERSION_FILTER tag, and is the name of an input file -# provided by doxygen. Whatever the program writes to standard output +# The FILE_VERSION_FILTER tag can be used to specify a program or script that +# doxygen should invoke to get the current version for each file (typically from +# the version control system). Doxygen will invoke the program by executing (via +# popen()) the command , where is the value of +# the FILE_VERSION_FILTER tag, and is the name of an input file +# provided by doxygen. Whatever the program writes to standard output # is used as the file version. See the manual for examples. -FILE_VERSION_FILTER = +FILE_VERSION_FILTER = #--------------------------------------------------------------------------- # configuration options related to warning and progress messages #--------------------------------------------------------------------------- -# The QUIET tag can be used to turn on/off the messages that are generated +# The QUIET tag can be used to turn on/off the messages that are generated # by doxygen. Possible values are YES and NO. If left blank NO is used. -QUIET = NO +QUIET = YES -# The WARNINGS tag can be used to turn on/off the warning messages that are -# generated by doxygen. Possible values are YES and NO. If left blank +# The WARNINGS tag can be used to turn on/off the warning messages that are +# generated by doxygen. Possible values are YES and NO. If left blank # NO is used. WARNINGS = YES -# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings -# for undocumented members. If EXTRACT_ALL is set to YES then this flag will +# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings +# for undocumented members. If EXTRACT_ALL is set to YES then this flag will # automatically be disabled. WARN_IF_UNDOCUMENTED = YES -# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for -# potential errors in the documentation, such as not documenting some -# parameters in a documented function, or documenting parameters that +# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for +# potential errors in the documentation, such as not documenting some +# parameters in a documented function, or documenting parameters that # don't exist or using markup commands wrongly. WARN_IF_DOC_ERROR = YES -# This WARN_NO_PARAMDOC option can be abled to get warnings for -# functions that are documented, but have no documentation for their parameters -# or return value. If set to NO (the default) doxygen will only warn about -# wrong or incomplete parameter documentation, but not about the absence of +# This WARN_NO_PARAMDOC option can be abled to get warnings for +# functions that are documented, but have no documentation for their parameters +# or return value. If set to NO (the default) doxygen will only warn about +# wrong or incomplete parameter documentation, but not about the absence of # documentation. WARN_NO_PARAMDOC = NO -# The WARN_FORMAT tag determines the format of the warning messages that -# doxygen can produce. The string should contain the $file, $line, and $text -# tags, which will be replaced by the file and line number from which the -# warning originated and the warning text. Optionally the format may contain -# $version, which will be replaced by the version of the file (if it could +# The WARN_FORMAT tag determines the format of the warning messages that +# doxygen can produce. The string should contain the $file, $line, and $text +# tags, which will be replaced by the file and line number from which the +# warning originated and the warning text. Optionally the format may contain +# $version, which will be replaced by the version of the file (if it could # be obtained via FILE_VERSION_FILTER) WARN_FORMAT = "$file:$line: $text" -# The WARN_LOGFILE tag can be used to specify a file to which warning -# and error messages should be written. If left blank the output is written +# The WARN_LOGFILE tag can be used to specify a file to which warning +# and error messages should be written. If left blank the output is written # to stderr. -WARN_LOGFILE = +WARN_LOGFILE = #--------------------------------------------------------------------------- # configuration options related to the input files #--------------------------------------------------------------------------- -# The INPUT tag can be used to specify the files and/or directories that contain -# documented source files. You may enter file names like "myfile.cpp" or -# directories like "/usr/src/myproject". Separate the files or directories +# The INPUT tag can be used to specify the files and/or directories that contain +# documented source files. You may enter file names like "myfile.cpp" or +# directories like "/usr/src/myproject". Separate the files or directories # with spaces. -INPUT = util goto-programs pointer-analysis solvers +INPUT = . -# This tag can be used to specify the character encoding of the source files -# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is -# also the default input encoding. Doxygen uses libiconv (or the iconv built -# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for +# This tag can be used to specify the character encoding of the source files +# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is +# also the default input encoding. Doxygen uses libiconv (or the iconv built +# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for # the list of possible encodings. INPUT_ENCODING = UTF-8 -# If the value of the INPUT tag contains directories, you can use the -# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp -# and *.h) to filter out the source-files in the directories. If left -# blank the following patterns are tested: -# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx +# If the value of the INPUT tag contains directories, you can use the +# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp +# and *.h) to filter out the source-files in the directories. If left +# blank the following patterns are tested: +# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx # *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py *.f90 FILE_PATTERNS = *.cpp *.h -# The RECURSIVE tag can be used to turn specify whether or not subdirectories -# should be searched for input files as well. Possible values are YES and NO. +# The RECURSIVE tag can be used to turn specify whether or not subdirectories +# should be searched for input files as well. Possible values are YES and NO. # If left blank NO is used. RECURSIVE = YES -# The EXCLUDE tag can be used to specify files and/or directories that should -# excluded from the INPUT source files. This way you can easily exclude a +# The EXCLUDE tag can be used to specify files and/or directories that should +# excluded from the INPUT source files. This way you can easily exclude a # subdirectory from a directory tree whose root is specified with the INPUT tag. EXCLUDE = solvers/z3/ -# The EXCLUDE_SYMLINKS tag can be used select whether or not files or -# directories that are symbolic links (a Unix filesystem feature) are excluded +# The EXCLUDE_SYMLINKS tag can be used select whether or not files or +# directories that are symbolic links (a Unix filesystem feature) are excluded # from the input. EXCLUDE_SYMLINKS = NO -# If the value of the INPUT tag contains directories, you can use the -# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude -# certain files from those directories. Note that the wildcards are matched -# against the file with absolute path, so to exclude all test directories +# If the value of the INPUT tag contains directories, you can use the +# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude +# certain files from those directories. Note that the wildcards are matched +# against the file with absolute path, so to exclude all test directories # for example use the pattern */test/* -EXCLUDE_PATTERNS = */.svn/* +EXCLUDE_PATTERNS = */.svn/* */.git/* -# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names -# (namespaces, classes, functions, etc.) that should be excluded from the -# output. The symbol name can be a fully qualified name, a word, or if the -# wildcard * is used, a substring. Examples: ANamespace, AClass, +# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names +# (namespaces, classes, functions, etc.) that should be excluded from the +# output. The symbol name can be a fully qualified name, a word, or if the +# wildcard * is used, a substring. Examples: ANamespace, AClass, # AClass::ANamespace, ANamespace::*Test -EXCLUDE_SYMBOLS = +EXCLUDE_SYMBOLS = -# The EXAMPLE_PATH tag can be used to specify one or more files or -# directories that contain example code fragments that are included (see +# The EXAMPLE_PATH tag can be used to specify one or more files or +# directories that contain example code fragments that are included (see # the \include command). -EXAMPLE_PATH = +EXAMPLE_PATH = -# If the value of the EXAMPLE_PATH tag contains directories, you can use the -# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp -# and *.h) to filter out the source-files in the directories. If left +# If the value of the EXAMPLE_PATH tag contains directories, you can use the +# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp +# and *.h) to filter out the source-files in the directories. If left # blank all files are included. -EXAMPLE_PATTERNS = +EXAMPLE_PATTERNS = -# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be -# searched for input files to be used with the \include or \dontinclude -# commands irrespective of the value of the RECURSIVE tag. +# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be +# searched for input files to be used with the \include or \dontinclude +# commands irrespective of the value of the RECURSIVE tag. # Possible values are YES and NO. If left blank NO is used. EXAMPLE_RECURSIVE = NO -# The IMAGE_PATH tag can be used to specify one or more files or -# directories that contain image that are included in the documentation (see +# The IMAGE_PATH tag can be used to specify one or more files or +# directories that contain image that are included in the documentation (see # the \image command). -IMAGE_PATH = +IMAGE_PATH = -# The INPUT_FILTER tag can be used to specify a program that doxygen should -# invoke to filter for each input file. Doxygen will invoke the filter program -# by executing (via popen()) the command , where -# is the value of the INPUT_FILTER tag, and is the name of an -# input file. Doxygen will then use the output that the filter program writes -# to standard output. If FILTER_PATTERNS is specified, this tag will be +# The INPUT_FILTER tag can be used to specify a program that doxygen should +# invoke to filter for each input file. Doxygen will invoke the filter program +# by executing (via popen()) the command , where +# is the value of the INPUT_FILTER tag, and is the name of an +# input file. Doxygen will then use the output that the filter program writes +# to standard output. If FILTER_PATTERNS is specified, this tag will be # ignored. -INPUT_FILTER = +INPUT_FILTER = -# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern -# basis. Doxygen will compare the file name with each pattern and apply the -# filter if there is a match. The filters are a list of the form: -# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further -# info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER +# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern +# basis. Doxygen will compare the file name with each pattern and apply the +# filter if there is a match. The filters are a list of the form: +# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further +# info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER # is applied to all files. -FILTER_PATTERNS = +FILTER_PATTERNS = -# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using -# INPUT_FILTER) will be used to filter the input files when producing source +# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using +# INPUT_FILTER) will be used to filter the input files when producing source # files to browse (i.e. when SOURCE_BROWSER is set to YES). FILTER_SOURCE_FILES = NO @@ -642,32 +642,32 @@ FILTER_SOURCE_FILES = NO # configuration options related to source browsing #--------------------------------------------------------------------------- -# If the SOURCE_BROWSER tag is set to YES then a list of source files will -# be generated. Documented entities will be cross-referenced with these sources. -# Note: To get rid of all source code in the generated output, make sure also +# If the SOURCE_BROWSER tag is set to YES then a list of source files will +# be generated. Documented entities will be cross-referenced with these sources. +# Note: To get rid of all source code in the generated output, make sure also # VERBATIM_HEADERS is set to NO. SOURCE_BROWSER = NO -# Setting the INLINE_SOURCES tag to YES will include the body +# Setting the INLINE_SOURCES tag to YES will include the body # of functions and classes directly in the documentation. INLINE_SOURCES = NO -# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct -# doxygen to hide any special comment blocks from generated source code +# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct +# doxygen to hide any special comment blocks from generated source code # fragments. Normal C and C++ comments will always remain visible. STRIP_CODE_COMMENTS = YES -# If the REFERENCED_BY_RELATION tag is set to YES -# then for each documented function all documented +# If the REFERENCED_BY_RELATION tag is set to YES +# then for each documented function all documented # functions referencing it will be listed. REFERENCED_BY_RELATION = YES -# If the REFERENCES_RELATION tag is set to YES -# then for each documented function all documented entities +# If the REFERENCES_RELATION tag is set to YES +# then for each documented function all documented entities # called/used by that function will be listed. REFERENCES_RELATION = YES @@ -679,16 +679,16 @@ REFERENCES_RELATION = YES REFERENCES_LINK_SOURCE = YES -# If the USE_HTAGS tag is set to YES then the references to source code -# will point to the HTML generated by the htags(1) tool instead of doxygen -# built-in source browser. The htags tool is part of GNU's global source -# tagging system (see http://www.gnu.org/software/global/global.html). You +# If the USE_HTAGS tag is set to YES then the references to source code +# will point to the HTML generated by the htags(1) tool instead of doxygen +# built-in source browser. The htags tool is part of GNU's global source +# tagging system (see http://www.gnu.org/software/global/global.html). You # will need version 4.8.6 or higher. USE_HTAGS = NO -# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen -# will generate a verbatim copy of the header file for each class for +# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen +# will generate a verbatim copy of the header file for each class for # which an include is specified. Set to NO to disable this. VERBATIM_HEADERS = YES @@ -697,129 +697,129 @@ VERBATIM_HEADERS = YES # configuration options related to the alphabetical class index #--------------------------------------------------------------------------- -# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index -# of all compounds will be generated. Enable this if the project +# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index +# of all compounds will be generated. Enable this if the project # contains a lot of classes, structs, unions or interfaces. ALPHABETICAL_INDEX = NO -# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then -# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns +# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then +# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns # in which this list will be split (can be a number in the range [1..20]) COLS_IN_ALPHA_INDEX = 5 -# In case all classes in a project start with a common prefix, all -# classes will be put under the same header in the alphabetical index. -# The IGNORE_PREFIX tag can be used to specify one or more prefixes that +# In case all classes in a project start with a common prefix, all +# classes will be put under the same header in the alphabetical index. +# The IGNORE_PREFIX tag can be used to specify one or more prefixes that # should be ignored while generating the index headers. -IGNORE_PREFIX = +IGNORE_PREFIX = #--------------------------------------------------------------------------- # configuration options related to the HTML output #--------------------------------------------------------------------------- -# If the GENERATE_HTML tag is set to YES (the default) Doxygen will +# If the GENERATE_HTML tag is set to YES (the default) Doxygen will # generate HTML output. GENERATE_HTML = YES -# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `html' will be used as the default path. HTML_OUTPUT = html -# The HTML_FILE_EXTENSION tag can be used to specify the file extension for -# each generated HTML page (for example: .htm,.php,.asp). If it is left blank +# The HTML_FILE_EXTENSION tag can be used to specify the file extension for +# each generated HTML page (for example: .htm,.php,.asp). If it is left blank # doxygen will generate files with .html extension. HTML_FILE_EXTENSION = .html -# The HTML_HEADER tag can be used to specify a personal HTML header for -# each generated HTML page. If it is left blank doxygen will generate a +# The HTML_HEADER tag can be used to specify a personal HTML header for +# each generated HTML page. If it is left blank doxygen will generate a # standard header. -HTML_HEADER = +HTML_HEADER = -# The HTML_FOOTER tag can be used to specify a personal HTML footer for -# each generated HTML page. If it is left blank doxygen will generate a +# The HTML_FOOTER tag can be used to specify a personal HTML footer for +# each generated HTML page. If it is left blank doxygen will generate a # standard footer. -HTML_FOOTER = +HTML_FOOTER = -# The HTML_STYLESHEET tag can be used to specify a user-defined cascading -# style sheet that is used by each HTML page. It can be used to -# fine-tune the look of the HTML output. If the tag is left blank doxygen -# will generate a default style sheet. Note that doxygen will try to copy -# the style sheet file to the HTML output directory, so don't put your own +# The HTML_STYLESHEET tag can be used to specify a user-defined cascading +# style sheet that is used by each HTML page. It can be used to +# fine-tune the look of the HTML output. If the tag is left blank doxygen +# will generate a default style sheet. Note that doxygen will try to copy +# the style sheet file to the HTML output directory, so don't put your own # stylesheet in the HTML output directory as well, or it will be erased! -HTML_STYLESHEET = +HTML_STYLESHEET = -# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, -# files or namespaces will be aligned in HTML using tables. If set to +# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, +# files or namespaces will be aligned in HTML using tables. If set to # NO a bullet list will be used. HTML_ALIGN_MEMBERS = YES -# If the GENERATE_HTMLHELP tag is set to YES, additional index files -# will be generated that can be used as input for tools like the -# Microsoft HTML help workshop to generate a compiled HTML help file (.chm) +# If the GENERATE_HTMLHELP tag is set to YES, additional index files +# will be generated that can be used as input for tools like the +# Microsoft HTML help workshop to generate a compiled HTML help file (.chm) # of the generated HTML documentation. GENERATE_HTMLHELP = NO -# If the GENERATE_DOCSET tag is set to YES, additional index files -# will be generated that can be used as input for Apple's Xcode 3 -# integrated development environment, introduced with OSX 10.5 (Leopard). -# To create a documentation set, doxygen will generate a Makefile in the -# HTML output directory. Running make will produce the docset in that -# directory and running "make install" will install the docset in -# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find +# If the GENERATE_DOCSET tag is set to YES, additional index files +# will be generated that can be used as input for Apple's Xcode 3 +# integrated development environment, introduced with OSX 10.5 (Leopard). +# To create a documentation set, doxygen will generate a Makefile in the +# HTML output directory. Running make will produce the docset in that +# directory and running "make install" will install the docset in +# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find # it at startup. GENERATE_DOCSET = NO -# When GENERATE_DOCSET tag is set to YES, this tag determines the name of the -# feed. A documentation feed provides an umbrella under which multiple -# documentation sets from a single provider (such as a company or product suite) +# When GENERATE_DOCSET tag is set to YES, this tag determines the name of the +# feed. A documentation feed provides an umbrella under which multiple +# documentation sets from a single provider (such as a company or product suite) # can be grouped. DOCSET_FEEDNAME = "Doxygen generated docs" -# When GENERATE_DOCSET tag is set to YES, this tag specifies a string that -# should uniquely identify the documentation set bundle. This should be a -# reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen +# When GENERATE_DOCSET tag is set to YES, this tag specifies a string that +# should uniquely identify the documentation set bundle. This should be a +# reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen # will append .docset to the name. DOCSET_BUNDLE_ID = org.doxygen.Project -# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML -# documentation will contain sections that can be hidden and shown after the -# page has loaded. For this to work a browser that supports -# JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox +# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML +# documentation will contain sections that can be hidden and shown after the +# page has loaded. For this to work a browser that supports +# JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox # Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari). HTML_DYNAMIC_SECTIONS = NO -# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can -# be used to specify the file name of the resulting .chm file. You -# can add a path in front of the file if the result should not be +# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can +# be used to specify the file name of the resulting .chm file. You +# can add a path in front of the file if the result should not be # written to the html output directory. -CHM_FILE = +CHM_FILE = -# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can -# be used to specify the location (absolute path including file name) of -# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run +# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can +# be used to specify the location (absolute path including file name) of +# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run # the HTML help compiler on the generated index.hhp. -HHC_LOCATION = +HHC_LOCATION = -# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag -# controls if a separate .chi index file is generated (YES) or that +# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag +# controls if a separate .chi index file is generated (YES) or that # it should be included in the master .chm file (NO). GENERATE_CHI = NO @@ -828,26 +828,26 @@ GENERATE_CHI = NO # is used to encode HtmlHelp index (hhk), content (hhc) and project file # content. -CHM_INDEX_ENCODING = +CHM_INDEX_ENCODING = -# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag -# controls whether a binary table of contents is generated (YES) or a +# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag +# controls whether a binary table of contents is generated (YES) or a # normal table of contents (NO) in the .chm file. BINARY_TOC = NO -# The TOC_EXPAND flag can be set to YES to add extra items for group members +# The TOC_EXPAND flag can be set to YES to add extra items for group members # to the contents of the HTML help documentation and to the tree view. TOC_EXPAND = NO -# The DISABLE_INDEX tag can be used to turn on/off the condensed index at -# top of each HTML page. The value NO (the default) enables the index and +# The DISABLE_INDEX tag can be used to turn on/off the condensed index at +# top of each HTML page. The value NO (the default) enables the index and # the value YES disables it. DISABLE_INDEX = NO -# This tag can be used to set the number of enum values (range [1..20]) +# This tag can be used to set the number of enum values (range [1..20]) # that doxygen will group on one line in the generated HTML documentation. ENUM_VALUES_PER_LINE = 4 @@ -855,11 +855,11 @@ ENUM_VALUES_PER_LINE = 4 # The GENERATE_TREEVIEW tag is used to specify whether a tree-like index # structure should be generated to display hierarchical information. # If the tag value is set to FRAME, a side panel will be generated -# containing a tree-like index structure (just like the one that -# is generated for HTML Help). For this to work a browser that supports -# JavaScript, DHTML, CSS and frames is required (for instance Mozilla 1.0+, -# Netscape 6.0+, Internet explorer 5.0+, or Konqueror). Windows users are -# probably better off using the HTML help feature. Other possible values +# containing a tree-like index structure (just like the one that +# is generated for HTML Help). For this to work a browser that supports +# JavaScript, DHTML, CSS and frames is required (for instance Mozilla 1.0+, +# Netscape 6.0+, Internet explorer 5.0+, or Konqueror). Windows users are +# probably better off using the HTML help feature. Other possible values # for this tag are: HIERARCHIES, which will generate the Groups, Directories, # and Class Hiererachy pages using a tree view instead of an ordered list; # ALL, which combines the behavior of FRAME and HIERARCHIES; and NONE, which @@ -869,16 +869,16 @@ ENUM_VALUES_PER_LINE = 4 GENERATE_TREEVIEW = NONE -# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be -# used to set the initial width (in pixels) of the frame in which the tree +# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be +# used to set the initial width (in pixels) of the frame in which the tree # is shown. TREEVIEW_WIDTH = 250 -# Use this tag to change the font size of Latex formulas included -# as images in the HTML documentation. The default is 10. Note that -# when you change the font size after a successful doxygen run you need -# to manually remove any form_*.png images from the HTML output directory +# Use this tag to change the font size of Latex formulas included +# as images in the HTML documentation. The default is 10. Note that +# when you change the font size after a successful doxygen run you need +# to manually remove any form_*.png images from the HTML output directory # to force them to be regenerated. FORMULA_FONTSIZE = 10 @@ -887,74 +887,74 @@ FORMULA_FONTSIZE = 10 # configuration options related to the LaTeX output #--------------------------------------------------------------------------- -# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will +# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will # generate Latex output. GENERATE_LATEX = NO -# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `latex' will be used as the default path. LATEX_OUTPUT = latex -# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be +# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be # invoked. If left blank `latex' will be used as the default command name. LATEX_CMD_NAME = latex -# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to -# generate index for LaTeX. If left blank `makeindex' will be used as the +# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to +# generate index for LaTeX. If left blank `makeindex' will be used as the # default command name. MAKEINDEX_CMD_NAME = makeindex -# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact -# LaTeX documents. This may be useful for small projects and may help to +# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact +# LaTeX documents. This may be useful for small projects and may help to # save some trees in general. COMPACT_LATEX = NO -# The PAPER_TYPE tag can be used to set the paper type that is used -# by the printer. Possible values are: a4, a4wide, letter, legal and +# The PAPER_TYPE tag can be used to set the paper type that is used +# by the printer. Possible values are: a4, a4wide, letter, legal and # executive. If left blank a4wide will be used. PAPER_TYPE = a4wide -# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX +# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX # packages that should be included in the LaTeX output. -EXTRA_PACKAGES = +EXTRA_PACKAGES = -# The LATEX_HEADER tag can be used to specify a personal LaTeX header for -# the generated latex document. The header should contain everything until -# the first chapter. If it is left blank doxygen will generate a +# The LATEX_HEADER tag can be used to specify a personal LaTeX header for +# the generated latex document. The header should contain everything until +# the first chapter. If it is left blank doxygen will generate a # standard header. Notice: only use this tag if you know what you are doing! -LATEX_HEADER = +LATEX_HEADER = -# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated -# is prepared for conversion to pdf (using ps2pdf). The pdf file will -# contain links (just like the HTML output) instead of page references +# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated +# is prepared for conversion to pdf (using ps2pdf). The pdf file will +# contain links (just like the HTML output) instead of page references # This makes the output suitable for online browsing using a pdf viewer. PDF_HYPERLINKS = YES -# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of -# plain latex in the generated Makefile. Set this option to YES to get a +# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of +# plain latex in the generated Makefile. Set this option to YES to get a # higher quality PDF documentation. USE_PDFLATEX = YES -# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. -# command to the generated LaTeX files. This will instruct LaTeX to keep -# running if errors occur, instead of asking the user for help. +# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. +# command to the generated LaTeX files. This will instruct LaTeX to keep +# running if errors occur, instead of asking the user for help. # This option is also used when generating formulas in HTML. LATEX_BATCHMODE = NO -# If LATEX_HIDE_INDICES is set to YES then doxygen will not -# include the index chapters (such as File Index, Compound Index, etc.) +# If LATEX_HIDE_INDICES is set to YES then doxygen will not +# include the index chapters (such as File Index, Compound Index, etc.) # in the output. LATEX_HIDE_INDICES = NO @@ -963,68 +963,68 @@ LATEX_HIDE_INDICES = NO # configuration options related to the RTF output #--------------------------------------------------------------------------- -# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output -# The RTF output is optimized for Word 97 and may not look very pretty with +# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output +# The RTF output is optimized for Word 97 and may not look very pretty with # other RTF readers or editors. GENERATE_RTF = NO -# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `rtf' will be used as the default path. RTF_OUTPUT = rtf -# If the COMPACT_RTF tag is set to YES Doxygen generates more compact -# RTF documents. This may be useful for small projects and may help to +# If the COMPACT_RTF tag is set to YES Doxygen generates more compact +# RTF documents. This may be useful for small projects and may help to # save some trees in general. COMPACT_RTF = NO -# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated -# will contain hyperlink fields. The RTF file will -# contain links (just like the HTML output) instead of page references. -# This makes the output suitable for online browsing using WORD or other -# programs which support those fields. +# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated +# will contain hyperlink fields. The RTF file will +# contain links (just like the HTML output) instead of page references. +# This makes the output suitable for online browsing using WORD or other +# programs which support those fields. # Note: wordpad (write) and others do not support links. RTF_HYPERLINKS = NO -# Load stylesheet definitions from file. Syntax is similar to doxygen's -# config file, i.e. a series of assignments. You only have to provide +# Load stylesheet definitions from file. Syntax is similar to doxygen's +# config file, i.e. a series of assignments. You only have to provide # replacements, missing definitions are set to their default value. -RTF_STYLESHEET_FILE = +RTF_STYLESHEET_FILE = -# Set optional variables used in the generation of an rtf document. +# Set optional variables used in the generation of an rtf document. # Syntax is similar to doxygen's config file. -RTF_EXTENSIONS_FILE = +RTF_EXTENSIONS_FILE = #--------------------------------------------------------------------------- # configuration options related to the man page output #--------------------------------------------------------------------------- -# If the GENERATE_MAN tag is set to YES (the default) Doxygen will +# If the GENERATE_MAN tag is set to YES (the default) Doxygen will # generate man pages GENERATE_MAN = NO -# The MAN_OUTPUT tag is used to specify where the man pages will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# The MAN_OUTPUT tag is used to specify where the man pages will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `man' will be used as the default path. MAN_OUTPUT = man -# The MAN_EXTENSION tag determines the extension that is added to +# The MAN_EXTENSION tag determines the extension that is added to # the generated man pages (default is the subroutine's section .3) MAN_EXTENSION = .3 -# If the MAN_LINKS tag is set to YES and Doxygen generates man output, -# then it will generate one additional man file for each entity -# documented in the real man page(s). These additional files -# only source the real man page, but without them the man command +# If the MAN_LINKS tag is set to YES and Doxygen generates man output, +# then it will generate one additional man file for each entity +# documented in the real man page(s). These additional files +# only source the real man page, but without them the man command # would be unable to find the correct page. The default is NO. MAN_LINKS = NO @@ -1033,33 +1033,33 @@ MAN_LINKS = NO # configuration options related to the XML output #--------------------------------------------------------------------------- -# If the GENERATE_XML tag is set to YES Doxygen will -# generate an XML file that captures the structure of +# If the GENERATE_XML tag is set to YES Doxygen will +# generate an XML file that captures the structure of # the code including all documentation. GENERATE_XML = NO -# The XML_OUTPUT tag is used to specify where the XML pages will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# The XML_OUTPUT tag is used to specify where the XML pages will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `xml' will be used as the default path. XML_OUTPUT = xml -# The XML_SCHEMA tag can be used to specify an XML schema, -# which can be used by a validating XML parser to check the +# The XML_SCHEMA tag can be used to specify an XML schema, +# which can be used by a validating XML parser to check the # syntax of the XML files. -XML_SCHEMA = +XML_SCHEMA = -# The XML_DTD tag can be used to specify an XML DTD, -# which can be used by a validating XML parser to check the +# The XML_DTD tag can be used to specify an XML DTD, +# which can be used by a validating XML parser to check the # syntax of the XML files. -XML_DTD = +XML_DTD = -# If the XML_PROGRAMLISTING tag is set to YES Doxygen will -# dump the program listings (including syntax highlighting -# and cross-referencing information) to the XML output. Note that +# If the XML_PROGRAMLISTING tag is set to YES Doxygen will +# dump the program listings (including syntax highlighting +# and cross-referencing information) to the XML output. Note that # enabling this will significantly increase the size of the XML output. XML_PROGRAMLISTING = YES @@ -1068,10 +1068,10 @@ XML_PROGRAMLISTING = YES # configuration options for the AutoGen Definitions output #--------------------------------------------------------------------------- -# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will -# generate an AutoGen Definitions (see autogen.sf.net) file -# that captures the structure of the code including all -# documentation. Note that this feature is still experimental +# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will +# generate an AutoGen Definitions (see autogen.sf.net) file +# that captures the structure of the code including all +# documentation. Note that this feature is still experimental # and incomplete at the moment. GENERATE_AUTOGEN_DEF = NO @@ -1080,338 +1080,338 @@ GENERATE_AUTOGEN_DEF = NO # configuration options related to the Perl module output #--------------------------------------------------------------------------- -# If the GENERATE_PERLMOD tag is set to YES Doxygen will -# generate a Perl module file that captures the structure of -# the code including all documentation. Note that this -# feature is still experimental and incomplete at the +# If the GENERATE_PERLMOD tag is set to YES Doxygen will +# generate a Perl module file that captures the structure of +# the code including all documentation. Note that this +# feature is still experimental and incomplete at the # moment. GENERATE_PERLMOD = NO -# If the PERLMOD_LATEX tag is set to YES Doxygen will generate -# the necessary Makefile rules, Perl scripts and LaTeX code to be able +# If the PERLMOD_LATEX tag is set to YES Doxygen will generate +# the necessary Makefile rules, Perl scripts and LaTeX code to be able # to generate PDF and DVI output from the Perl module output. PERLMOD_LATEX = NO -# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be -# nicely formatted so it can be parsed by a human reader. This is useful -# if you want to understand what is going on. On the other hand, if this -# tag is set to NO the size of the Perl module output will be much smaller +# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be +# nicely formatted so it can be parsed by a human reader. This is useful +# if you want to understand what is going on. On the other hand, if this +# tag is set to NO the size of the Perl module output will be much smaller # and Perl will parse it just the same. PERLMOD_PRETTY = YES -# The names of the make variables in the generated doxyrules.make file -# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. -# This is useful so different doxyrules.make files included by the same +# The names of the make variables in the generated doxyrules.make file +# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. +# This is useful so different doxyrules.make files included by the same # Makefile don't overwrite each other's variables. -PERLMOD_MAKEVAR_PREFIX = +PERLMOD_MAKEVAR_PREFIX = #--------------------------------------------------------------------------- -# Configuration options related to the preprocessor +# Configuration options related to the preprocessor #--------------------------------------------------------------------------- -# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will -# evaluate all C-preprocessor directives found in the sources and include +# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will +# evaluate all C-preprocessor directives found in the sources and include # files. ENABLE_PREPROCESSING = YES -# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro -# names in the source code. If set to NO (the default) only conditional -# compilation will be performed. Macro expansion can be done in a controlled +# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro +# names in the source code. If set to NO (the default) only conditional +# compilation will be performed. Macro expansion can be done in a controlled # way by setting EXPAND_ONLY_PREDEF to YES. MACRO_EXPANSION = YES -# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES -# then the macro expansion is limited to the macros specified with the +# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES +# then the macro expansion is limited to the macros specified with the # PREDEFINED and EXPAND_AS_DEFINED tags. EXPAND_ONLY_PREDEF = NO -# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files +# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files # in the INCLUDE_PATH (see below) will be search if a #include is found. SEARCH_INCLUDES = YES -# The INCLUDE_PATH tag can be used to specify one or more directories that -# contain include files that are not input files but should be processed by +# The INCLUDE_PATH tag can be used to specify one or more directories that +# contain include files that are not input files but should be processed by # the preprocessor. -INCLUDE_PATH = +INCLUDE_PATH = -# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard -# patterns (like *.h and *.hpp) to filter out the header-files in the -# directories. If left blank, the patterns specified with FILE_PATTERNS will +# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard +# patterns (like *.h and *.hpp) to filter out the header-files in the +# directories. If left blank, the patterns specified with FILE_PATTERNS will # be used. -INCLUDE_FILE_PATTERNS = +INCLUDE_FILE_PATTERNS = -# The PREDEFINED tag can be used to specify one or more macro names that -# are defined before the preprocessor is started (similar to the -D option of -# gcc). The argument of the tag is a list of macros of the form: name -# or name=definition (no spaces). If the definition and the = are -# omitted =1 is assumed. To prevent a macro definition from being -# undefined via #undef or recursively expanded use the := operator +# The PREDEFINED tag can be used to specify one or more macro names that +# are defined before the preprocessor is started (similar to the -D option of +# gcc). The argument of the tag is a list of macros of the form: name +# or name=definition (no spaces). If the definition and the = are +# omitted =1 is assumed. To prevent a macro definition from being +# undefined via #undef or recursively expanded use the := operator # instead of the = operator. -PREDEFINED = +PREDEFINED = -# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then -# this tag can be used to specify a list of macro names that should be expanded. -# The macro definition that is found in the sources will be used. +# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then +# this tag can be used to specify a list of macro names that should be expanded. +# The macro definition that is found in the sources will be used. # Use the PREDEFINED tag if you want to use a different macro definition. -EXPAND_AS_DEFINED = +EXPAND_AS_DEFINED = -# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then -# doxygen's preprocessor will remove all function-like macros that are alone -# on a line, have an all uppercase name, and do not end with a semicolon. Such -# function macros are typically used for boiler-plate code, and will confuse +# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then +# doxygen's preprocessor will remove all function-like macros that are alone +# on a line, have an all uppercase name, and do not end with a semicolon. Such +# function macros are typically used for boiler-plate code, and will confuse # the parser if not removed. SKIP_FUNCTION_MACROS = YES #--------------------------------------------------------------------------- -# Configuration::additions related to external references +# Configuration::additions related to external references #--------------------------------------------------------------------------- -# The TAGFILES option can be used to specify one or more tagfiles. -# Optionally an initial location of the external documentation -# can be added for each tagfile. The format of a tag file without -# this location is as follows: -# TAGFILES = file1 file2 ... -# Adding location for the tag files is done as follows: -# TAGFILES = file1=loc1 "file2 = loc2" ... -# where "loc1" and "loc2" can be relative or absolute paths or -# URLs. If a location is present for each tag, the installdox tool +# The TAGFILES option can be used to specify one or more tagfiles. +# Optionally an initial location of the external documentation +# can be added for each tagfile. The format of a tag file without +# this location is as follows: +# TAGFILES = file1 file2 ... +# Adding location for the tag files is done as follows: +# TAGFILES = file1=loc1 "file2 = loc2" ... +# where "loc1" and "loc2" can be relative or absolute paths or +# URLs. If a location is present for each tag, the installdox tool # does not have to be run to correct the links. # Note that each tag file must have a unique name # (where the name does NOT include the path) -# If a tag file is not located in the directory in which doxygen +# If a tag file is not located in the directory in which doxygen # is run, you must also specify the path to the tagfile here. -TAGFILES = +TAGFILES = -# When a file name is specified after GENERATE_TAGFILE, doxygen will create +# When a file name is specified after GENERATE_TAGFILE, doxygen will create # a tag file that is based on the input files it reads. -GENERATE_TAGFILE = +GENERATE_TAGFILE = -# If the ALLEXTERNALS tag is set to YES all external classes will be listed -# in the class index. If set to NO only the inherited external classes +# If the ALLEXTERNALS tag is set to YES all external classes will be listed +# in the class index. If set to NO only the inherited external classes # will be listed. ALLEXTERNALS = NO -# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed -# in the modules index. If set to NO, only the current project's groups will +# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed +# in the modules index. If set to NO, only the current project's groups will # be listed. EXTERNAL_GROUPS = YES -# The PERL_PATH should be the absolute path and name of the perl script +# The PERL_PATH should be the absolute path and name of the perl script # interpreter (i.e. the result of `which perl'). PERL_PATH = /usr/bin/perl #--------------------------------------------------------------------------- -# Configuration options related to the dot tool +# Configuration options related to the dot tool #--------------------------------------------------------------------------- -# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will -# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base -# or super classes. Setting the tag to NO turns the diagrams off. Note that -# this option is superseded by the HAVE_DOT option below. This is only a -# fallback. It is recommended to install and use dot, since it yields more +# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will +# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base +# or super classes. Setting the tag to NO turns the diagrams off. Note that +# this option is superseded by the HAVE_DOT option below. This is only a +# fallback. It is recommended to install and use dot, since it yields more # powerful graphs. CLASS_DIAGRAMS = YES -# You can define message sequence charts within doxygen comments using the \msc -# command. Doxygen will then run the mscgen tool (see -# http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the -# documentation. The MSCGEN_PATH tag allows you to specify the directory where -# the mscgen tool resides. If left empty the tool is assumed to be found in the +# You can define message sequence charts within doxygen comments using the \msc +# command. Doxygen will then run the mscgen tool (see +# http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the +# documentation. The MSCGEN_PATH tag allows you to specify the directory where +# the mscgen tool resides. If left empty the tool is assumed to be found in the # default search path. -MSCGEN_PATH = +MSCGEN_PATH = -# If set to YES, the inheritance and collaboration graphs will hide -# inheritance and usage relations if the target is undocumented +# If set to YES, the inheritance and collaboration graphs will hide +# inheritance and usage relations if the target is undocumented # or is not a class. HIDE_UNDOC_RELATIONS = YES -# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is -# available from the path. This tool is part of Graphviz, a graph visualization -# toolkit from AT&T and Lucent Bell Labs. The other options in this section +# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is +# available from the path. This tool is part of Graphviz, a graph visualization +# toolkit from AT&T and Lucent Bell Labs. The other options in this section # have no effect if this option is set to NO (the default) HAVE_DOT = NO -# By default doxygen will write a font called FreeSans.ttf to the output -# directory and reference it in all dot files that doxygen generates. This -# font does not include all possible unicode characters however, so when you need -# these (or just want a differently looking font) you can specify the font name -# using DOT_FONTNAME. You need need to make sure dot is able to find the font, -# which can be done by putting it in a standard location or by setting the -# DOTFONTPATH environment variable or by setting DOT_FONTPATH to the directory +# By default doxygen will write a font called FreeSans.ttf to the output +# directory and reference it in all dot files that doxygen generates. This +# font does not include all possible unicode characters however, so when you need +# these (or just want a differently looking font) you can specify the font name +# using DOT_FONTNAME. You need need to make sure dot is able to find the font, +# which can be done by putting it in a standard location or by setting the +# DOTFONTPATH environment variable or by setting DOT_FONTPATH to the directory # containing the font. DOT_FONTNAME = FreeSans -# By default doxygen will tell dot to use the output directory to look for the -# FreeSans.ttf font (which doxygen will put there itself). If you specify a -# different font using DOT_FONTNAME you can set the path where dot +# By default doxygen will tell dot to use the output directory to look for the +# FreeSans.ttf font (which doxygen will put there itself). If you specify a +# different font using DOT_FONTNAME you can set the path where dot # can find it using this tag. -DOT_FONTPATH = +DOT_FONTPATH = -# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen -# will generate a graph for each documented class showing the direct and -# indirect inheritance relations. Setting this tag to YES will force the +# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for each documented class showing the direct and +# indirect inheritance relations. Setting this tag to YES will force the # the CLASS_DIAGRAMS tag to NO. CLASS_GRAPH = YES -# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen -# will generate a graph for each documented class showing the direct and -# indirect implementation dependencies (inheritance, containment, and +# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for each documented class showing the direct and +# indirect implementation dependencies (inheritance, containment, and # class references variables) of the class with other documented classes. COLLABORATION_GRAPH = YES -# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen +# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen # will generate a graph for groups, showing the direct groups dependencies GROUP_GRAPHS = YES -# If the UML_LOOK tag is set to YES doxygen will generate inheritance and -# collaboration diagrams in a style similar to the OMG's Unified Modeling +# If the UML_LOOK tag is set to YES doxygen will generate inheritance and +# collaboration diagrams in a style similar to the OMG's Unified Modeling # Language. UML_LOOK = NO -# If set to YES, the inheritance and collaboration graphs will show the +# If set to YES, the inheritance and collaboration graphs will show the # relations between templates and their instances. TEMPLATE_RELATIONS = YES -# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT -# tags are set to YES then doxygen will generate a graph for each documented -# file showing the direct and indirect include dependencies of the file with +# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT +# tags are set to YES then doxygen will generate a graph for each documented +# file showing the direct and indirect include dependencies of the file with # other documented files. INCLUDE_GRAPH = YES -# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and -# HAVE_DOT tags are set to YES then doxygen will generate a graph for each -# documented header file showing the documented files that directly or +# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and +# HAVE_DOT tags are set to YES then doxygen will generate a graph for each +# documented header file showing the documented files that directly or # indirectly include this file. INCLUDED_BY_GRAPH = YES -# If the CALL_GRAPH and HAVE_DOT options are set to YES then -# doxygen will generate a call dependency graph for every global function -# or class method. Note that enabling this option will significantly increase -# the time of a run. So in most cases it will be better to enable call graphs +# If the CALL_GRAPH and HAVE_DOT options are set to YES then +# doxygen will generate a call dependency graph for every global function +# or class method. Note that enabling this option will significantly increase +# the time of a run. So in most cases it will be better to enable call graphs # for selected functions only using the \callgraph command. CALL_GRAPH = NO -# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then -# doxygen will generate a caller dependency graph for every global function -# or class method. Note that enabling this option will significantly increase -# the time of a run. So in most cases it will be better to enable caller +# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then +# doxygen will generate a caller dependency graph for every global function +# or class method. Note that enabling this option will significantly increase +# the time of a run. So in most cases it will be better to enable caller # graphs for selected functions only using the \callergraph command. CALLER_GRAPH = NO -# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen +# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen # will graphical hierarchy of all classes instead of a textual one. GRAPHICAL_HIERARCHY = YES -# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES -# then doxygen will show the dependencies a directory has on other directories +# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES +# then doxygen will show the dependencies a directory has on other directories # in a graphical way. The dependency relations are determined by the #include # relations between the files in the directories. DIRECTORY_GRAPH = YES -# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images +# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images # generated by dot. Possible values are png, jpg, or gif # If left blank png will be used. DOT_IMAGE_FORMAT = png -# The tag DOT_PATH can be used to specify the path where the dot tool can be +# The tag DOT_PATH can be used to specify the path where the dot tool can be # found. If left blank, it is assumed the dot tool can be found in the path. -DOT_PATH = +DOT_PATH = -# The DOTFILE_DIRS tag can be used to specify one or more directories that -# contain dot files that are included in the documentation (see the +# The DOTFILE_DIRS tag can be used to specify one or more directories that +# contain dot files that are included in the documentation (see the # \dotfile command). -DOTFILE_DIRS = +DOTFILE_DIRS = -# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of -# nodes that will be shown in the graph. If the number of nodes in a graph -# becomes larger than this value, doxygen will truncate the graph, which is -# visualized by representing a node as a red box. Note that doxygen if the -# number of direct children of the root node in a graph is already larger than -# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note +# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of +# nodes that will be shown in the graph. If the number of nodes in a graph +# becomes larger than this value, doxygen will truncate the graph, which is +# visualized by representing a node as a red box. Note that doxygen if the +# number of direct children of the root node in a graph is already larger than +# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note # that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH. DOT_GRAPH_MAX_NODES = 50 -# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the -# graphs generated by dot. A depth value of 3 means that only nodes reachable -# from the root by following a path via at most 3 edges will be shown. Nodes -# that lay further from the root node will be omitted. Note that setting this -# option to 1 or 2 may greatly reduce the computation time needed for large -# code bases. Also note that the size of a graph can be further restricted by +# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the +# graphs generated by dot. A depth value of 3 means that only nodes reachable +# from the root by following a path via at most 3 edges will be shown. Nodes +# that lay further from the root node will be omitted. Note that setting this +# option to 1 or 2 may greatly reduce the computation time needed for large +# code bases. Also note that the size of a graph can be further restricted by # DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction. MAX_DOT_GRAPH_DEPTH = 0 -# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent -# background. This is enabled by default, which results in a transparent -# background. Warning: Depending on the platform used, enabling this option -# may lead to badly anti-aliased labels on the edges of a graph (i.e. they +# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent +# background. This is enabled by default, which results in a transparent +# background. Warning: Depending on the platform used, enabling this option +# may lead to badly anti-aliased labels on the edges of a graph (i.e. they # become hard to read). DOT_TRANSPARENT = YES -# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output -# files in one run (i.e. multiple -o and -T options on the command line). This -# makes dot run faster, but since only newer versions of dot (>1.8.10) +# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output +# files in one run (i.e. multiple -o and -T options on the command line). This +# makes dot run faster, but since only newer versions of dot (>1.8.10) # support this, this feature is disabled by default. DOT_MULTI_TARGETS = NO -# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will -# generate a legend page explaining the meaning of the various boxes and +# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will +# generate a legend page explaining the meaning of the various boxes and # arrows in the dot generated graphs. GENERATE_LEGEND = YES -# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will -# remove the intermediate dot files that are used to generate +# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will +# remove the intermediate dot files that are used to generate # the various graphs. DOT_CLEANUP = YES #--------------------------------------------------------------------------- -# Configuration::additions related to the search engine +# Configuration::additions related to the search engine #--------------------------------------------------------------------------- -# The SEARCHENGINE tag specifies whether or not a search engine should be +# The SEARCHENGINE tag specifies whether or not a search engine should be # used. If set to NO the values of all tags below this one will be ignored. SEARCHENGINE = NO diff --git a/src/goto-analyzer/goto_analyzer_main.cpp b/src/goto-analyzer/goto_analyzer_main.cpp index 78baf16d6a1..64e14c74936 100644 --- a/src/goto-analyzer/goto_analyzer_main.cpp +++ b/src/goto-analyzer/goto_analyzer_main.cpp @@ -6,22 +6,13 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Goto-Analyser Main Module + #include #include "goto_analyzer_parse_options.h" -/*******************************************************************\ - -Function: main / wmain - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - #ifdef _MSC_VER int wmain(int argc, const wchar_t **argv_wide) { diff --git a/src/goto-analyzer/goto_analyzer_parse_options.cpp b/src/goto-analyzer/goto_analyzer_parse_options.cpp index c783243a0d3..d9498ea3c2a 100644 --- a/src/goto-analyzer/goto_analyzer_parse_options.cpp +++ b/src/goto-analyzer/goto_analyzer_parse_options.cpp @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Goto-Analyser Command Line Option Processing + #include // exit() #include #include @@ -50,18 +53,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "unreachable_instructions.h" #include "static_analyzer.h" -/*******************************************************************\ - -Function: goto_analyzer_parse_optionst::goto_analyzer_parse_optionst - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - goto_analyzer_parse_optionst::goto_analyzer_parse_optionst( int argc, const char **argv): @@ -71,18 +62,6 @@ goto_analyzer_parse_optionst::goto_analyzer_parse_optionst( { } -/*******************************************************************\ - -Function: goto_analyzer_parse_optionst::register_languages - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_analyzer_parse_optionst::register_languages() { register_language(new_ansi_c_language); @@ -91,18 +70,6 @@ void goto_analyzer_parse_optionst::register_languages() register_language(new_jsil_language); } -/*******************************************************************\ - -Function: goto_analyzer_parse_optionst::eval_verbosity - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_analyzer_parse_optionst::eval_verbosity() { // this is our default verbosity @@ -118,18 +85,6 @@ void goto_analyzer_parse_optionst::eval_verbosity() ui_message_handler.set_verbosity(v); } -/*******************************************************************\ - -Function: goto_analyzer_parse_optionst::get_command_line_options - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_analyzer_parse_optionst::get_command_line_options(optionst &options) { if(config.set(cmdline)) @@ -177,18 +132,7 @@ void goto_analyzer_parse_optionst::get_command_line_options(optionst &options) #endif } -/*******************************************************************\ - -Function: goto_analyzer_parse_optionst::doit - - Inputs: - - Outputs: - - Purpose: invoke main modules - -\*******************************************************************/ - +/// invoke main modules int goto_analyzer_parse_optionst::doit() { if(cmdline.isset("version")) @@ -362,18 +306,6 @@ int goto_analyzer_parse_optionst::doit() return 6; } -/*******************************************************************\ - -Function: goto_analyzer_parse_optionst::set_properties - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool goto_analyzer_parse_optionst::set_properties() { try @@ -402,18 +334,6 @@ bool goto_analyzer_parse_optionst::set_properties() return false; } -/*******************************************************************\ - -Function: goto_analyzer_parse_optionst::process_goto_program - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool goto_analyzer_parse_optionst::process_goto_program( const optionst &options) { @@ -501,18 +421,7 @@ bool goto_analyzer_parse_optionst::process_goto_program( return false; } -/*******************************************************************\ - -Function: goto_analyzer_parse_optionst::help - - Inputs: - - Outputs: - - Purpose: display command line help - -\*******************************************************************/ - +/// display command line help void goto_analyzer_parse_optionst::help() { std::cout << diff --git a/src/goto-analyzer/goto_analyzer_parse_options.h b/src/goto-analyzer/goto_analyzer_parse_options.h index 538bf47ac3e..48b299049b9 100644 --- a/src/goto-analyzer/goto_analyzer_parse_options.h +++ b/src/goto-analyzer/goto_analyzer_parse_options.h @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Goto-Analyser Command Line Option Processing + #ifndef CPROVER_GOTO_ANALYZER_GOTO_ANALYZER_PARSE_OPTIONS_H #define CPROVER_GOTO_ANALYZER_GOTO_ANALYZER_PARSE_OPTIONS_H diff --git a/src/goto-analyzer/static_analyzer.cpp b/src/goto-analyzer/static_analyzer.cpp index 1168cff1a73..ed576253247 100644 --- a/src/goto-analyzer/static_analyzer.cpp +++ b/src/goto-analyzer/static_analyzer.cpp @@ -47,18 +47,6 @@ class static_analyzert:public messaget tvt eval(goto_programt::const_targett); }; -/*******************************************************************\ - -Function: static_analyzert::operator() - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool static_analyzert::operator()() { status() << "performing interval analysis" << eom; @@ -74,18 +62,6 @@ bool static_analyzert::operator()() return false; } -/*******************************************************************\ - -Function: static_analyzert::eval - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - tvt static_analyzert::eval(goto_programt::const_targett t) { exprt guard=t->guard; @@ -96,18 +72,6 @@ tvt static_analyzert::eval(goto_programt::const_targett t) return tvt::unknown(); } -/*******************************************************************\ - -Function: static_analyzert::plain_text_report - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void static_analyzert::plain_text_report() { unsigned pass=0, fail=0, unknown=0; @@ -159,18 +123,6 @@ void static_analyzert::plain_text_report() << unknown << " unknown\n"; } -/*******************************************************************\ - -Function: static_analyzert::json_report - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void static_analyzert::json_report(const std::string &file_name) { json_arrayt json_result; @@ -218,18 +170,6 @@ void static_analyzert::json_report(const std::string &file_name) out << json_result; } -/*******************************************************************\ - -Function: static_analyzert::xml_report - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void static_analyzert::xml_report(const std::string &file_name) { xmlt xml_result; @@ -277,18 +217,6 @@ void static_analyzert::xml_report(const std::string &file_name) out << xml_result; } -/*******************************************************************\ - -Function: static_analyzer - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool static_analyzer( const goto_modelt &goto_model, const optionst &options, @@ -298,18 +226,6 @@ bool static_analyzer( goto_model, options, message_handler)(); } -/*******************************************************************\ - -Function: show_intervals - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void show_intervals( const goto_modelt &goto_model, std::ostream &out) diff --git a/src/goto-analyzer/taint_analysis.cpp b/src/goto-analyzer/taint_analysis.cpp index f3caa711607..7e59ac5c399 100644 --- a/src/goto-analyzer/taint_analysis.cpp +++ b/src/goto-analyzer/taint_analysis.cpp @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Taint Analysis + #include #include @@ -22,14 +25,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "taint_analysis.h" #include "taint_parser.h" -/*******************************************************************\ - - Class: taint_analysist - - Purpose: - -\*******************************************************************/ - class taint_analysist:public messaget { public: @@ -52,18 +47,6 @@ class taint_analysist:public messaget void instrument(const namespacet &, goto_functionst::goto_functiont &); }; -/*******************************************************************\ - -Function: taint_analysist::instrument - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void taint_analysist::instrument( const namespacet &ns, goto_functionst &goto_functions) @@ -72,18 +55,6 @@ void taint_analysist::instrument( instrument(ns, function.second); } -/*******************************************************************\ - -Function: taint_analysist::instrument - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void taint_analysist::instrument( const namespacet &ns, goto_functionst::goto_functiont &goto_function) @@ -245,18 +216,6 @@ void taint_analysist::instrument( } } -/*******************************************************************\ - -Function: taint_analysist::operator() - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool taint_analysist::operator()( const std::string &taint_file_name, const symbol_tablet &symbol_table, @@ -444,18 +403,6 @@ bool taint_analysist::operator()( } } -/*******************************************************************\ - -Function: taint_analysis - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool taint_analysis( goto_modelt &goto_model, const std::string &taint_file_name, diff --git a/src/goto-analyzer/taint_analysis.h b/src/goto-analyzer/taint_analysis.h index a47a974b009..f9b73d2640e 100644 --- a/src/goto-analyzer/taint_analysis.h +++ b/src/goto-analyzer/taint_analysis.h @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Taint Analysis + #ifndef CPROVER_GOTO_ANALYZER_TAINT_ANALYSIS_H #define CPROVER_GOTO_ANALYZER_TAINT_ANALYSIS_H diff --git a/src/goto-analyzer/taint_parser.cpp b/src/goto-analyzer/taint_parser.cpp index e60fb2ded54..234a8e53c3b 100644 --- a/src/goto-analyzer/taint_parser.cpp +++ b/src/goto-analyzer/taint_parser.cpp @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Taint Parser + #include #include @@ -14,18 +17,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "taint_parser.h" -/*******************************************************************\ - -Function: taint_parser - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool taint_parser( const std::string &file_name, taint_parse_treet &dest, @@ -131,18 +122,6 @@ bool taint_parser( return false; } -/*******************************************************************\ - -Function: taint_parse_treet::rulet::output - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void taint_parse_treet::rulet::output(std::ostream &out) const { if(!id.empty()) @@ -168,18 +147,6 @@ void taint_parse_treet::rulet::output(std::ostream &out) const out << '\n'; } -/*******************************************************************\ - -Function: taint_parse_treet::output - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void taint_parse_treet::output(std::ostream &out) const { for(const auto &rule : rules) diff --git a/src/goto-analyzer/taint_parser.h b/src/goto-analyzer/taint_parser.h index bc02e66c1ce..79746041265 100644 --- a/src/goto-analyzer/taint_parser.h +++ b/src/goto-analyzer/taint_parser.h @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Taint Parser + #ifndef CPROVER_GOTO_ANALYZER_TAINT_PARSER_H #define CPROVER_GOTO_ANALYZER_TAINT_PARSER_H diff --git a/src/goto-analyzer/unreachable_instructions.cpp b/src/goto-analyzer/unreachable_instructions.cpp index 73514f5b5d5..78e03822945 100644 --- a/src/goto-analyzer/unreachable_instructions.cpp +++ b/src/goto-analyzer/unreachable_instructions.cpp @@ -8,6 +8,9 @@ Date: April 2016 \*******************************************************************/ +/// \file +/// List all unreachable instructions + #include #include @@ -23,18 +26,6 @@ Date: April 2016 typedef std::map dead_mapt; -/*******************************************************************\ - -Function: unreachable_instructions - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - static void unreachable_instructions( const goto_programt &goto_program, dead_mapt &dest) @@ -54,18 +45,6 @@ static void unreachable_instructions( } } -/*******************************************************************\ - -Function: all_unreachable - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - static void all_unreachable( const goto_programt &goto_program, dead_mapt &dest) @@ -75,18 +54,6 @@ static void all_unreachable( dest.insert(std::make_pair(it->location_number, it)); } -/*******************************************************************\ - -Function: output_dead_plain - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - static void output_dead_plain( const namespacet &ns, const goto_programt &goto_program, @@ -107,18 +74,6 @@ static void output_dead_plain( goto_program.output_instruction(ns, "", os, it->second); } -/*******************************************************************\ - -Function: add_to_json - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - static void add_to_json( const namespacet &ns, const goto_programt &goto_program, @@ -166,18 +121,6 @@ static void add_to_json( } } -/*******************************************************************\ - -Function: unreachable_instructions - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void unreachable_instructions( const goto_modelt &goto_model, const bool json, @@ -221,18 +164,6 @@ void unreachable_instructions( os << json_result << std::endl; } -/*******************************************************************\ - -Function: json_output_function - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - static void json_output_function( const irep_idt &function, const source_locationt &first_location, @@ -252,18 +183,6 @@ static void json_output_function( json_numbert(id2string(last_location.get_line())); } -/*******************************************************************\ - -Function: list_functions - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - static void list_functions( const goto_modelt &goto_model, const bool json, @@ -328,18 +247,6 @@ static void list_functions( os << json_result << std::endl; } -/*******************************************************************\ - -Function: unreachable_functions - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void unreachable_functions( const goto_modelt &goto_model, const bool json, @@ -348,18 +255,6 @@ void unreachable_functions( list_functions(goto_model, json, os, true); } -/*******************************************************************\ - -Function: reachable_functions - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void reachable_functions( const goto_modelt &goto_model, const bool json, diff --git a/src/goto-analyzer/unreachable_instructions.h b/src/goto-analyzer/unreachable_instructions.h index a408e004bd8..9b71e4f66f5 100644 --- a/src/goto-analyzer/unreachable_instructions.h +++ b/src/goto-analyzer/unreachable_instructions.h @@ -8,6 +8,9 @@ Date: April 2016 \*******************************************************************/ +/// \file +/// List all unreachable instructions + #ifndef CPROVER_GOTO_ANALYZER_UNREACHABLE_INSTRUCTIONS_H #define CPROVER_GOTO_ANALYZER_UNREACHABLE_INSTRUCTIONS_H diff --git a/src/goto-cc/armcc_cmdline.cpp b/src/goto-cc/armcc_cmdline.cpp index 4b58f765f17..f937f2a1e25 100644 --- a/src/goto-cc/armcc_cmdline.cpp +++ b/src/goto-cc/armcc_cmdline.cpp @@ -6,23 +6,17 @@ Author: Daniel Kroening \*******************************************************************/ +/// \file +/// A special command line object to mimick ARM's armcc + #include #include #include "armcc_cmdline.h" -/*******************************************************************\ - -Function: armcc_cmdlinet::parse - - Inputs: argument count, argument strings - - Outputs: none - - Purpose: parses the commandline options into a cmdlinet - -\*******************************************************************/ - +/// parses the commandline options into a cmdlinet +/// \par parameters: argument count, argument strings +/// \return none // see // http://infocenter.arm.com/help/topic/com.arm.doc.dui0472c/Cchbggjb.html diff --git a/src/goto-cc/armcc_cmdline.h b/src/goto-cc/armcc_cmdline.h index 3cb108b1791..f8996366395 100644 --- a/src/goto-cc/armcc_cmdline.h +++ b/src/goto-cc/armcc_cmdline.h @@ -8,6 +8,9 @@ Date: June 2006 \*******************************************************************/ +/// \file +/// A special command line object to mimick ARM's armcc + #ifndef CPROVER_GOTO_CC_ARMCC_CMDLINE_H #define CPROVER_GOTO_CC_ARMCC_CMDLINE_H diff --git a/src/goto-cc/armcc_mode.cpp b/src/goto-cc/armcc_mode.cpp index 9eb677f631d..d8a6a015325 100644 --- a/src/goto-cc/armcc_mode.cpp +++ b/src/goto-cc/armcc_mode.cpp @@ -6,6 +6,9 @@ Author: CM Wintersteiger, 2006 \*******************************************************************/ +/// \file +/// Command line option container + #ifdef _WIN32 #define EX_OK 0 #define EX_USAGE 64 @@ -24,18 +27,7 @@ Author: CM Wintersteiger, 2006 #include "armcc_mode.h" #include "compile.h" -/*******************************************************************\ - -Function: armcc_modet::doit - - Inputs: - - Outputs: - - Purpose: does it. - -\*******************************************************************/ - +/// does it. int armcc_modet::doit() { if(cmdline.isset('?') || cmdline.isset("help")) @@ -197,18 +189,7 @@ int armcc_modet::doit() return compiler.doit() ? EX_USAGE : EX_OK; } -/*******************************************************************\ - -Function: armcc_modet::help_mode - - Inputs: - - Outputs: - - Purpose: display command line help - -\*******************************************************************/ - +/// display command line help void armcc_modet::help_mode() { std::cout << "goto-armcc understands the options " diff --git a/src/goto-cc/armcc_mode.h b/src/goto-cc/armcc_mode.h index cbbe90a2a1e..d4b8c4779e9 100644 --- a/src/goto-cc/armcc_mode.h +++ b/src/goto-cc/armcc_mode.h @@ -8,6 +8,9 @@ Date: June 2006 \*******************************************************************/ +/// \file +/// Base class for command line interpretation for CL + #ifndef CPROVER_GOTO_CC_ARMCC_MODE_H #define CPROVER_GOTO_CC_ARMCC_MODE_H diff --git a/src/goto-cc/as86_cmdline.cpp b/src/goto-cc/as86_cmdline.cpp index 4d1210c2794..cd66ae60d9a 100644 --- a/src/goto-cc/as86_cmdline.cpp +++ b/src/goto-cc/as86_cmdline.cpp @@ -6,6 +6,9 @@ Author: Michael Tautschnig \*******************************************************************/ +/// \file +/// A special command line object for as86 (of Bruce's C Compiler) + #include #include @@ -13,18 +16,6 @@ Author: Michael Tautschnig #include "as86_cmdline.h" -/*******************************************************************\ - -Function: as86_cmdlinet::parse - - Inputs: argument count, argument strings - - Outputs: none - - Purpose: parses the commandline options into a cmdlinet - -\*******************************************************************/ - // non-as86 options const char *goto_as86_options_with_argument[]= { diff --git a/src/goto-cc/as86_cmdline.h b/src/goto-cc/as86_cmdline.h index 85f8d439cae..ac03786d585 100644 --- a/src/goto-cc/as86_cmdline.h +++ b/src/goto-cc/as86_cmdline.h @@ -8,6 +8,10 @@ Date: July 2016 \*******************************************************************/ +/// \file +/// A special command line object for as86 (of Bruce's C Compiler) Author: +/// Michael Tautschnig Date: July 2016 + #ifndef CPROVER_GOTO_CC_AS86_CMDLINE_H #define CPROVER_GOTO_CC_AS86_CMDLINE_H diff --git a/src/goto-cc/as_cmdline.cpp b/src/goto-cc/as_cmdline.cpp index 8a6f32c16b5..162f0d8d2aa 100644 --- a/src/goto-cc/as_cmdline.cpp +++ b/src/goto-cc/as_cmdline.cpp @@ -6,6 +6,9 @@ Author: Michael Tautschnig \*******************************************************************/ +/// \file +/// A special command line object for GNU Assembler + #include #include @@ -13,18 +16,6 @@ Author: Michael Tautschnig #include "as_cmdline.h" -/*******************************************************************\ - -Function: as_cmdlinet::parse - - Inputs: argument count, argument strings - - Outputs: none - - Purpose: parses the commandline options into a cmdlinet - -\*******************************************************************/ - // non-as options const char *goto_as_options_with_argument[]= { diff --git a/src/goto-cc/as_cmdline.h b/src/goto-cc/as_cmdline.h index 19dd7dc0be0..fbf26957815 100644 --- a/src/goto-cc/as_cmdline.h +++ b/src/goto-cc/as_cmdline.h @@ -8,6 +8,10 @@ Date: July 2016 \*******************************************************************/ +/// \file +/// A special command line object for GNU Assembler Author: Michael Tautschnig +/// Date: July 2016 + #ifndef CPROVER_GOTO_CC_AS_CMDLINE_H #define CPROVER_GOTO_CC_AS_CMDLINE_H diff --git a/src/goto-cc/as_mode.cpp b/src/goto-cc/as_mode.cpp index bb87b6c6abb..3c62419a085 100644 --- a/src/goto-cc/as_mode.cpp +++ b/src/goto-cc/as_mode.cpp @@ -6,6 +6,9 @@ Author: Michael Tautschnig \*******************************************************************/ +/// \file +/// Assembler Mode + #ifdef _WIN32 #define EX_OK 0 #define EX_USAGE 64 @@ -30,18 +33,6 @@ Author: Michael Tautschnig #include "as_mode.h" -/*******************************************************************\ - -Function: assembler_name - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - static std::string assembler_name( const cmdlinet &cmdline, const std::string &base_name) @@ -64,18 +55,6 @@ static std::string assembler_name( return result; } -/*******************************************************************\ - -Function: as_modet::as_modet - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - as_modet::as_modet( goto_cc_cmdlinet &_cmdline, const std::string &_base_name, @@ -86,18 +65,7 @@ as_modet::as_modet( { } -/*******************************************************************\ - -Function: as_modet::doit - - Inputs: - - Outputs: - - Purpose: does it. - -\*******************************************************************/ - +/// does it. int as_modet::doit() { if(cmdline.isset('?') || @@ -284,18 +252,7 @@ int as_modet::doit() return EX_OK; } -/*******************************************************************\ - -Function: as_modet::run_as - - Inputs: - - Outputs: - - Purpose: run as or as86 with original command line - -\*******************************************************************/ - +/// run as or as86 with original command line int as_modet::run_as() { assert(!cmdline.parsed_argv.empty()); @@ -319,18 +276,6 @@ int as_modet::run_as() return run(new_argv[0], new_argv, cmdline.stdin_file, ""); } -/*******************************************************************\ - -Function: as_modet::as_hybrid_binary - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - int as_modet::as_hybrid_binary() { std::string output_file="a.out"; @@ -415,18 +360,7 @@ int as_modet::as_hybrid_binary() return result; } -/*******************************************************************\ - -Function: as_modet::help_mode - - Inputs: - - Outputs: - - Purpose: display command line help - -\*******************************************************************/ - +/// display command line help void as_modet::help_mode() { std::cout << "goto-as understands the options of as plus the following.\n\n"; diff --git a/src/goto-cc/as_mode.h b/src/goto-cc/as_mode.h index 04ad255a764..46284da8153 100644 --- a/src/goto-cc/as_mode.h +++ b/src/goto-cc/as_mode.h @@ -8,6 +8,9 @@ Date: July 2016 \*******************************************************************/ +/// \file +/// Assembler Mode + #ifndef CPROVER_GOTO_CC_AS_MODE_H #define CPROVER_GOTO_CC_AS_MODE_H diff --git a/src/goto-cc/bcc_cmdline.cpp b/src/goto-cc/bcc_cmdline.cpp index 2ed56554270..858923ee2f5 100644 --- a/src/goto-cc/bcc_cmdline.cpp +++ b/src/goto-cc/bcc_cmdline.cpp @@ -6,6 +6,9 @@ Author: Michael Tautschnig \*******************************************************************/ +/// \file +/// A special command line object for Bruce's C Compiler + #include #include @@ -13,18 +16,6 @@ Author: Michael Tautschnig #include "bcc_cmdline.h" -/*******************************************************************\ - -Function: bcc_cmdlinet::parse - - Inputs: argument count, argument strings - - Outputs: none - - Purpose: parses the commandline options into a cmdlinet - -\*******************************************************************/ - // non-bcc options const char *goto_bcc_options_with_argument[]= { diff --git a/src/goto-cc/bcc_cmdline.h b/src/goto-cc/bcc_cmdline.h index 578001925da..18c402bd892 100644 --- a/src/goto-cc/bcc_cmdline.h +++ b/src/goto-cc/bcc_cmdline.h @@ -8,6 +8,10 @@ Date: July 2016 \*******************************************************************/ +/// \file +/// A special command line object for Bruce's C Compiler Author: Michael +/// Tautschnig Date: July 2016 + #ifndef CPROVER_GOTO_CC_BCC_CMDLINE_H #define CPROVER_GOTO_CC_BCC_CMDLINE_H diff --git a/src/goto-cc/compile.cpp b/src/goto-cc/compile.cpp index 58f74669c32..dbebbcb8513 100644 --- a/src/goto-cc/compile.cpp +++ b/src/goto-cc/compile.cpp @@ -8,6 +8,9 @@ Date: June 2006 \*******************************************************************/ +/// \file +/// Compile and link source and object files. + #include #include #include @@ -65,19 +68,9 @@ Date: June 2006 #define pclose _pclose #endif -/*******************************************************************\ - -Function: compilet::doit - - Inputs: none - - Outputs: true on error, false otherwise - - Purpose: reads and source and object files, compiles and links them - into goto program objects. - -\*******************************************************************/ - +/// reads and source and object files, compiles and links them into goto program +/// objects. +/// \return true on error, false otherwise bool compilet::doit() { compiled_functions.clear(); @@ -136,19 +129,8 @@ bool compilet::doit() return false; } -/*******************************************************************\ - -Function: compilet::add_input_file - - Inputs: none - - Outputs: false on success, true on error. - - Purpose: puts input file names into a list and does preprocessing for - libraries. - -\*******************************************************************/ - +/// puts input file names into a list and does preprocessing for libraries. +/// \return false on success, true on error. bool compilet::add_input_file(const std::string &file_name) { // first of all, try to open the file @@ -288,19 +270,9 @@ bool compilet::add_input_file(const std::string &file_name) return false; } -/*******************************************************************\ - -Function: compilet::find_library - - Inputs: library name - - Outputs: true if found, false otherwise - - Purpose: tries to find a library object file that matches the given - library name. - -\*******************************************************************/ - +/// tries to find a library object file that matches the given library name. +/// \par parameters: library name +/// \return true if found, false otherwise bool compilet::find_library(const std::string &name) { std::string tmp; @@ -337,19 +309,10 @@ bool compilet::find_library(const std::string &name) return false; } -/*******************************************************************\ - -Function: compilet::is_elf_file - - Inputs: file name - - Outputs: true if the given file name exists and is an ELF file, - false otherwise - - Purpose: checking if we can load an object file - -\*******************************************************************/ - +/// checking if we can load an object file +/// \par parameters: file name +/// \return true if the given file name exists and is an ELF file, false +/// otherwise bool compilet::is_elf_file(const std::string &file_name) { std::fstream in; @@ -368,18 +331,8 @@ bool compilet::is_elf_file(const std::string &file_name) return false; } -/*******************************************************************\ - -Function: compilet::link - - Inputs: none - - Outputs: true on error, false otherwise - - Purpose: parses object files and links them - -\*******************************************************************/ - +/// parses object files and links them +/// \return true on error, false otherwise bool compilet::link() { // "compile" hitherto uncompiled functions @@ -423,19 +376,9 @@ bool compilet::link() return false; } -/*******************************************************************\ - -Function: compilet::compile - - Inputs: none - - Outputs: true on error, false otherwise - - Purpose: parses source files and writes object files, or keeps the - symbols in the symbol_table depending on the doLink flag. - -\*******************************************************************/ - +/// parses source files and writes object files, or keeps the symbols in the +/// symbol_table depending on the doLink flag. +/// \return true on error, false otherwise bool compilet::compile() { while(!source_files.empty()) @@ -489,18 +432,8 @@ bool compilet::compile() return false; } -/*******************************************************************\ - -Function: compilet::parse - - Inputs: file_name - - Outputs: true on error, false otherwise - - Purpose: parses a source file (low-level parsing) - -\*******************************************************************/ - +/// parses a source file (low-level parsing) +/// \return true on error, false otherwise bool compilet::parse(const std::string &file_name) { if(file_name=="-") @@ -590,18 +523,8 @@ bool compilet::parse(const std::string &file_name) return false; } -/*******************************************************************\ - -Function: compilet::parse_stdin - - Inputs: file_name - - Outputs: true on error, false otherwise - - Purpose: parses a source file (low-level parsing) - -\*******************************************************************/ - +/// parses a source file (low-level parsing) +/// \return true on error, false otherwise bool compilet::parse_stdin() { ansi_c_languaget language; @@ -643,19 +566,10 @@ bool compilet::parse_stdin() return false; } -/*******************************************************************\ - -Function: compilet::write_object_file - - Inputs: file_name, functions table - - Outputs: true on error, false otherwise - - Purpose: writes the goto functions in the function table to a - binary format object file. - -\*******************************************************************/ - +/// writes the goto functions in the function table to a binary format object +/// file. +/// \par parameters: file_name, functions table +/// \return true on error, false otherwise bool compilet::write_object_file( const std::string &file_name, const symbol_tablet &lsymbol_table, @@ -664,19 +578,10 @@ bool compilet::write_object_file( return write_bin_object_file(file_name, lsymbol_table, functions); } -/*******************************************************************\ - -Function: compilet::write_bin_object_file - - Inputs: file_name, functions table - - Outputs: true on error, false otherwise - - Purpose: writes the goto functions in the function table to a - binary format object file. - -\*******************************************************************/ - +/// writes the goto functions in the function table to a binary format object +/// file. +/// \par parameters: file_name, functions table +/// \return true on error, false otherwise bool compilet::write_bin_object_file( const std::string &file_name, const symbol_tablet &lsymbol_table, @@ -710,18 +615,8 @@ bool compilet::write_bin_object_file( return false; } -/*******************************************************************\ - -Function: compilet::parse_source - - Inputs: file_name - - Outputs: true on error, false otherwise - - Purpose: parses a source file - -\*******************************************************************/ - +/// parses a source file +/// \return true on error, false otherwise bool compilet::parse_source(const std::string &file_name) { if(parse(file_name)) @@ -740,18 +635,8 @@ bool compilet::parse_source(const std::string &file_name) return false; } -/*******************************************************************\ - -Function: compilet::compilet - - Inputs: none - - Outputs: nothing - - Purpose: constructor - -\*******************************************************************/ - +/// constructor +/// \return nothing compilet::compilet(cmdlinet &_cmdline): language_uit(_cmdline, ui_message_handler), ui_message_handler(_cmdline, "goto-cc " CBMC_VERSION), @@ -763,18 +648,8 @@ compilet::compilet(cmdlinet &_cmdline): working_directory=get_current_working_directory(); } -/*******************************************************************\ - -Function: compilet::~compilet - - Inputs: none - - Outputs: nothing - - Purpose: cleans up temporary files - -\*******************************************************************/ - +/// cleans up temporary files +/// \return nothing compilet::~compilet() { // clean up temp dirs @@ -785,18 +660,6 @@ compilet::~compilet() delete_directory(*it); } -/*******************************************************************\ - -Function: compilet::function_body_count - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - unsigned compilet::function_body_count(const goto_functionst &functions) { int fbs=0; @@ -811,35 +674,11 @@ unsigned compilet::function_body_count(const goto_functionst &functions) return fbs; } -/*******************************************************************\ - -Function: compilet::add_compiler_specific_defines - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void compilet::add_compiler_specific_defines(configt &config) const { config.ansi_c.defines.push_back("__GOTO_CC_VERSION__=" CBMC_VERSION); } -/*******************************************************************\ - -Function: compilet::convert_symbols - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void compilet::convert_symbols(goto_functionst &dest) { goto_convert_functionst converter(symbol_table, dest, ui_message_handler); diff --git a/src/goto-cc/compile.h b/src/goto-cc/compile.h index 936f4cd21d5..b25c2f24c9d 100644 --- a/src/goto-cc/compile.h +++ b/src/goto-cc/compile.h @@ -8,6 +8,9 @@ Date: June 2006 \*******************************************************************/ +/// \file +/// Compile and link source and object files. + #ifndef CPROVER_GOTO_CC_COMPILE_H #define CPROVER_GOTO_CC_COMPILE_H diff --git a/src/goto-cc/cw_mode.cpp b/src/goto-cc/cw_mode.cpp index 18f1bf60494..5fbacbfcfe1 100644 --- a/src/goto-cc/cw_mode.cpp +++ b/src/goto-cc/cw_mode.cpp @@ -6,6 +6,9 @@ Author: CM Wintersteiger, 2006 \*******************************************************************/ +/// \file +/// Command line option container + #ifdef _WIN32 #define EX_OK 0 #define EX_USAGE 64 @@ -24,18 +27,7 @@ Author: CM Wintersteiger, 2006 #include "cw_mode.h" #include "compile.h" -/*******************************************************************\ - -Function: cw_modet::doit - - Inputs: - - Outputs: - - Purpose: does it. - -\*******************************************************************/ - +/// does it. int cw_modet::doit() { if(cmdline.isset('?') || cmdline.isset("help")) @@ -186,18 +178,7 @@ int cw_modet::doit() return compiler.doit() ? EX_USAGE : EX_OK; } -/*******************************************************************\ - -Function: cw_modet::help_mode - - Inputs: - - Outputs: - - Purpose: display command line help - -\*******************************************************************/ - +/// display command line help void cw_modet::help_mode() { std::cout << "goto-cw understands the options of " diff --git a/src/goto-cc/cw_mode.h b/src/goto-cc/cw_mode.h index 865b1f7ea15..58bd7129fc1 100644 --- a/src/goto-cc/cw_mode.h +++ b/src/goto-cc/cw_mode.h @@ -8,6 +8,9 @@ Date: June 2006 \*******************************************************************/ +/// \file +/// Base class for command line interpretation + #ifndef CPROVER_GOTO_CC_CW_MODE_H #define CPROVER_GOTO_CC_CW_MODE_H diff --git a/src/goto-cc/gcc_cmdline.cpp b/src/goto-cc/gcc_cmdline.cpp index f9bd0d1ead4..e25830ffbcd 100644 --- a/src/goto-cc/gcc_cmdline.cpp +++ b/src/goto-cc/gcc_cmdline.cpp @@ -6,6 +6,9 @@ Author: CM Wintersteiger, 2006 \*******************************************************************/ +/// \file +/// A special command line object for the gcc-like options + #include #include #include @@ -15,18 +18,9 @@ Author: CM Wintersteiger, 2006 #include "gcc_cmdline.h" -/*******************************************************************\ - -Function: gcc_cmdlinet::parse - - Inputs: argument count, argument strings - - Outputs: none - - Purpose: parses the commandline options into a cmdlinet - -\*******************************************************************/ - +/// parses the commandline options into a cmdlinet +/// \par parameters: argument count, argument strings +/// \return none // non-gcc options const char *goto_cc_options_with_separated_argument[]= { @@ -230,18 +224,6 @@ bool gcc_cmdlinet::parse(int argc, const char **argv) return result; } -/*******************************************************************\ - -Function: gcc_cmdlinet::parse_arguments - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool gcc_cmdlinet::parse_arguments( const argst &args, bool in_spec_file) @@ -439,19 +421,7 @@ bool gcc_cmdlinet::parse_arguments( return false; } -/*******************************************************************\ - -Function: gcc_cmdlinet::parse_specs_line - - Inputs: - - Outputs: - - Purpose: Parse GCC spec files - https://gcc.gnu.org/onlinedocs/gcc/Spec-Files.html - -\*******************************************************************/ - +/// Parse GCC spec files https://gcc.gnu.org/onlinedocs/gcc/Spec-Files.html void gcc_cmdlinet::parse_specs_line(const std::string &line) { // initial whitespace has been stripped @@ -471,19 +441,7 @@ void gcc_cmdlinet::parse_specs_line(const std::string &line) parse_arguments(args, true); } -/*******************************************************************\ - -Function: gcc_cmdlinet::parse_specs - - Inputs: - - Outputs: - - Purpose: Parse GCC spec files - https://gcc.gnu.org/onlinedocs/gcc/Spec-Files.html - -\*******************************************************************/ - +/// Parse GCC spec files https://gcc.gnu.org/onlinedocs/gcc/Spec-Files.html void gcc_cmdlinet::parse_specs() { const std::string &specs_file_name=get_value("specs"); diff --git a/src/goto-cc/gcc_cmdline.h b/src/goto-cc/gcc_cmdline.h index 2e233f032c5..92ac348118c 100644 --- a/src/goto-cc/gcc_cmdline.h +++ b/src/goto-cc/gcc_cmdline.h @@ -8,6 +8,9 @@ Date: June 2006 \*******************************************************************/ +/// \file +/// A special command line object for the gcc-like options + #ifndef CPROVER_GOTO_CC_GCC_CMDLINE_H #define CPROVER_GOTO_CC_GCC_CMDLINE_H diff --git a/src/goto-cc/gcc_mode.cpp b/src/goto-cc/gcc_mode.cpp index 19444ef1fc5..cc12b40e1ce 100644 --- a/src/goto-cc/gcc_mode.cpp +++ b/src/goto-cc/gcc_mode.cpp @@ -6,6 +6,9 @@ Author: CM Wintersteiger, 2006 \*******************************************************************/ +/// \file +/// GCC Mode + #ifdef _WIN32 #define EX_OK 0 #define EX_USAGE 64 @@ -31,18 +34,6 @@ Author: CM Wintersteiger, 2006 #include "compile.h" #include "gcc_mode.h" -/*******************************************************************\ - -Function: compiler_name - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - static std::string compiler_name( const cmdlinet &cmdline, const std::string &base_name) @@ -73,18 +64,6 @@ static std::string compiler_name( return result; } -/*******************************************************************\ - -Function: linker_name - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - static std::string linker_name( const cmdlinet &cmdline, const std::string &base_name) @@ -105,18 +84,6 @@ static std::string linker_name( return result; } -/*******************************************************************\ - -Function: gcc_modet::gcc_modet - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - gcc_modet::gcc_modet( goto_cc_cmdlinet &_cmdline, const std::string &_base_name, @@ -128,18 +95,6 @@ gcc_modet::gcc_modet( { } -/*******************************************************************\ - -Function: gcc_modet::needs_preprocessing - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool gcc_modet::needs_preprocessing(const std::string &file) { if(has_suffix(file, ".c") || @@ -154,18 +109,7 @@ bool gcc_modet::needs_preprocessing(const std::string &file) return false; } -/*******************************************************************\ - -Function: gcc_modet::doit - - Inputs: - - Outputs: - - Purpose: does it. - -\*******************************************************************/ - +/// does it. int gcc_modet::doit() { if(cmdline.isset('?') || @@ -523,18 +467,7 @@ int gcc_modet::doit() return EX_OK; } -/*******************************************************************\ - -Function: gcc_modet::preprocess - - Inputs: - - Outputs: - - Purpose: call gcc for preprocessing - -\*******************************************************************/ - +/// call gcc for preprocessing int gcc_modet::preprocess( const std::string &language, const std::string &src, @@ -615,18 +548,7 @@ int gcc_modet::preprocess( return run(new_argv[0], new_argv, cmdline.stdin_file, stdout_file); } -/*******************************************************************\ - -Function: gcc_modet::run_gcc - - Inputs: - - Outputs: - - Purpose: run gcc or clang with original command line - -\*******************************************************************/ - +/// run gcc or clang with original command line int gcc_modet::run_gcc() { assert(!cmdline.parsed_argv.empty()); @@ -650,18 +572,6 @@ int gcc_modet::run_gcc() return run(new_argv[0], new_argv, cmdline.stdin_file, ""); } -/*******************************************************************\ - -Function: gcc_modet::gcc_hybrid_binary - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - int gcc_modet::gcc_hybrid_binary() { { @@ -801,18 +711,6 @@ int gcc_modet::gcc_hybrid_binary() return result; } -/*******************************************************************\ - -Function: gcc_modet::asm_output - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - int gcc_modet::asm_output( bool act_as_bcc, const std::list &preprocessed_source_files) @@ -897,18 +795,7 @@ int gcc_modet::asm_output( return EX_OK; } -/*******************************************************************\ - -Function: gcc_modet::help_mode - - Inputs: - - Outputs: - - Purpose: display command line help - -\*******************************************************************/ - +/// display command line help void gcc_modet::help_mode() { if(act_as_ld) diff --git a/src/goto-cc/gcc_mode.h b/src/goto-cc/gcc_mode.h index b37b87448d6..5563639e07c 100644 --- a/src/goto-cc/gcc_mode.h +++ b/src/goto-cc/gcc_mode.h @@ -8,6 +8,9 @@ Date: June 2006 \*******************************************************************/ +/// \file +/// Base class for command line interpretation + #ifndef CPROVER_GOTO_CC_GCC_MODE_H #define CPROVER_GOTO_CC_GCC_MODE_H diff --git a/src/goto-cc/goto_cc_cmdline.cpp b/src/goto-cc/goto_cc_cmdline.cpp index 7b3bc78cdda..a9090012ad1 100644 --- a/src/goto-cc/goto_cc_cmdline.cpp +++ b/src/goto-cc/goto_cc_cmdline.cpp @@ -8,6 +8,9 @@ Date: April 2010 \*******************************************************************/ +/// \file +/// Command line interpretation for goto-cc + #include #include #include @@ -18,36 +21,12 @@ Date: April 2010 #include "goto_cc_cmdline.h" -/*******************************************************************\ - -Function: goto_cc_cmdlinet::~goto_cc_cmdlinet - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - goto_cc_cmdlinet::~goto_cc_cmdlinet() { if(!stdin_file.empty()) remove(stdin_file.c_str()); } -/*******************************************************************\ - -Function: goto_cc_cmdlinet::in_list - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool goto_cc_cmdlinet::in_list(const char *option, const char **list) { for(std::size_t i=0; list[i]!=NULL; i++) @@ -59,18 +38,6 @@ bool goto_cc_cmdlinet::in_list(const char *option, const char **list) return false; } -/*******************************************************************\ - -Function: goto_cc_cmdlinet::prefix_in_list - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool goto_cc_cmdlinet::prefix_in_list( const char *option, const char **list, @@ -88,18 +55,6 @@ bool goto_cc_cmdlinet::prefix_in_list( return false; } -/*******************************************************************\ - -Function: goto_cc_cmdlinet::get_optnr - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::size_t goto_cc_cmdlinet::get_optnr(const std::string &opt_string) { int optnr; @@ -153,18 +108,6 @@ std::size_t goto_cc_cmdlinet::get_optnr(const std::string &opt_string) return optnr; } -/*******************************************************************\ - -Function: goto_cc_cmdlinet::add_infile_arg - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_cc_cmdlinet::add_infile_arg(const std::string &arg) { parsed_argv.push_back(argt(arg)); diff --git a/src/goto-cc/goto_cc_cmdline.h b/src/goto-cc/goto_cc_cmdline.h index d3608400f30..f699946da68 100644 --- a/src/goto-cc/goto_cc_cmdline.h +++ b/src/goto-cc/goto_cc_cmdline.h @@ -8,6 +8,9 @@ Date: April 2010 \*******************************************************************/ +/// \file +/// Command line interpretation for goto-cc + #ifndef CPROVER_GOTO_CC_GOTO_CC_CMDLINE_H #define CPROVER_GOTO_CC_GOTO_CC_CMDLINE_H diff --git a/src/goto-cc/goto_cc_languages.cpp b/src/goto-cc/goto_cc_languages.cpp index a8bf5d9a07e..0c076187ee7 100644 --- a/src/goto-cc/goto_cc_languages.cpp +++ b/src/goto-cc/goto_cc_languages.cpp @@ -6,6 +6,9 @@ Author: CM Wintersteiger \*******************************************************************/ +/// \file +/// Language Registration + #include #include @@ -19,18 +22,6 @@ Author: CM Wintersteiger #include "goto_cc_mode.h" -/*******************************************************************\ - -Function: goto_cc_modet::register_languages - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_cc_modet::register_languages() { register_language(new_ansi_c_language); diff --git a/src/goto-cc/goto_cc_main.cpp b/src/goto-cc/goto_cc_main.cpp index 8c42b4fee4d..2b1745c668a 100644 --- a/src/goto-cc/goto_cc_main.cpp +++ b/src/goto-cc/goto_cc_main.cpp @@ -8,6 +8,9 @@ Date: May 2006 \*******************************************************************/ +/// \file +/// GOTO-CC Main Module + #include #include @@ -28,18 +31,6 @@ Date: May 2006 #include "armcc_mode.h" #include "as_mode.h" -/*******************************************************************\ - -Function: to_lower_string - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string to_lower_string(const std::string &s) { std::string result=s; @@ -47,18 +38,6 @@ std::string to_lower_string(const std::string &s) return result; } -/*******************************************************************\ - -Function: main - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - #ifdef _MSC_VER int wmain(int argc, const wchar_t **argv_wide) #else diff --git a/src/goto-cc/goto_cc_mode.cpp b/src/goto-cc/goto_cc_mode.cpp index a0e363ad112..8822122d022 100644 --- a/src/goto-cc/goto_cc_mode.cpp +++ b/src/goto-cc/goto_cc_mode.cpp @@ -6,6 +6,9 @@ Author: CM Wintersteiger, 2006 \*******************************************************************/ +/// \file +/// Command line option container + #include #include @@ -21,18 +24,7 @@ Author: CM Wintersteiger, 2006 #include "goto_cc_mode.h" -/*******************************************************************\ - -Function: goto_cc_modet::goto_cc_modet - - Inputs: - - Outputs: - - Purpose: constructor - -\*******************************************************************/ - +/// constructor goto_cc_modet::goto_cc_modet( goto_cc_cmdlinet &_cmdline, const std::string &_base_name, @@ -44,34 +36,12 @@ goto_cc_modet::goto_cc_modet( register_languages(); } -/*******************************************************************\ - -Function: goto_cc_modet::~goto_cc_modet - - Inputs: - - Outputs: - - Purpose: constructor - -\*******************************************************************/ - +/// constructor goto_cc_modet::~goto_cc_modet() { } -/*******************************************************************\ - -Function: goto_cc_modet::help - - Inputs: - - Outputs: - - Purpose: display command line help - -\*******************************************************************/ - +/// display command line help void goto_cc_modet::help() { std::cout << @@ -97,18 +67,8 @@ void goto_cc_modet::help() "\n"; } -/*******************************************************************\ - -Function: goto_cc_modet::main - - Inputs: argc/argv - - Outputs: error code - - Purpose: starts the compiler - -\*******************************************************************/ - +/// starts the compiler +/// \return error code int goto_cc_modet::main(int argc, const char **argv) { if(cmdline.parse(argc, argv)) @@ -146,18 +106,8 @@ int goto_cc_modet::main(int argc, const char **argv) } } -/*******************************************************************\ - -Function: goto_cc_modet::usage_error - - Inputs: none - - Outputs: none - - Purpose: prints a message informing the user about incorrect options - -\*******************************************************************/ - +/// prints a message informing the user about incorrect options +/// \return none void goto_cc_modet::usage_error() { std::cerr << "Usage error!\n\n"; diff --git a/src/goto-cc/goto_cc_mode.h b/src/goto-cc/goto_cc_mode.h index d25fbb750b5..a0b6ea47a96 100644 --- a/src/goto-cc/goto_cc_mode.h +++ b/src/goto-cc/goto_cc_mode.h @@ -8,6 +8,9 @@ Date: June 2006 \*******************************************************************/ +/// \file +/// Command line interpretation for goto-cc. + #ifndef CPROVER_GOTO_CC_GOTO_CC_MODE_H #define CPROVER_GOTO_CC_GOTO_CC_MODE_H diff --git a/src/goto-cc/ld_cmdline.cpp b/src/goto-cc/ld_cmdline.cpp index 242c1245941..4b4bf24962c 100644 --- a/src/goto-cc/ld_cmdline.cpp +++ b/src/goto-cc/ld_cmdline.cpp @@ -6,6 +6,9 @@ Author: Daniel Kroening, 2013 \*******************************************************************/ +/// \file +/// A special command line object for the ld-like options + #include #include @@ -13,18 +16,9 @@ Author: Daniel Kroening, 2013 #include "ld_cmdline.h" -/*******************************************************************\ - -Function: ld_cmdlinet::parse - - Inputs: argument count, argument strings - - Outputs: none - - Purpose: parses the commandline options into a cmdlinet - -\*******************************************************************/ - +/// parses the commandline options into a cmdlinet +/// \par parameters: argument count, argument strings +/// \return none const char *goto_ld_options_with_argument[]= { "--verbosity", diff --git a/src/goto-cc/ld_cmdline.h b/src/goto-cc/ld_cmdline.h index 449d0104427..18f42ec2d68 100644 --- a/src/goto-cc/ld_cmdline.h +++ b/src/goto-cc/ld_cmdline.h @@ -8,6 +8,9 @@ Date: Feb 2013 \*******************************************************************/ +/// \file +/// A special command line object for the ld-like options + #ifndef CPROVER_GOTO_CC_LD_CMDLINE_H #define CPROVER_GOTO_CC_LD_CMDLINE_H diff --git a/src/goto-cc/ms_cl_cmdline.cpp b/src/goto-cc/ms_cl_cmdline.cpp index fb9c8b4e23c..31eec139fba 100644 --- a/src/goto-cc/ms_cl_cmdline.cpp +++ b/src/goto-cc/ms_cl_cmdline.cpp @@ -6,6 +6,9 @@ Author: Daniel Kroening \*******************************************************************/ +/// \file +/// A special command line object for the CL options + #include #include #include @@ -16,18 +19,9 @@ Author: Daniel Kroening #include "ms_cl_cmdline.h" -/*******************************************************************\ - -Function: ms_cl_cmdlinet::parse - - Inputs: argument count, argument strings - - Outputs: none - - Purpose: parses the commandline options into a cmdlinet - -\*******************************************************************/ - +/// parses the commandline options into a cmdlinet +/// \par parameters: argument count, argument strings +/// \return none const char *non_ms_cl_options[]= { "--show-symbol-table", @@ -100,18 +94,7 @@ bool ms_cl_cmdlinet::parse(const std::vector &options) return false; } -/*******************************************************************\ - -Function: ms_cl_cmdlinet::parse_env - - Inputs: - - Outputs: none - - Purpose: - -\*******************************************************************/ - +/// \return none void ms_cl_cmdlinet::parse_env() { // first do environment @@ -133,18 +116,9 @@ void ms_cl_cmdlinet::parse_env() #endif } -/*******************************************************************\ - -Function: ms_cl_cmdlinet::parse - - Inputs: argument count, argument strings - - Outputs: none - - Purpose: parses the commandline options into a cmdlinet - -\*******************************************************************/ - +/// parses the commandline options into a cmdlinet +/// \par parameters: argument count, argument strings +/// \return none bool ms_cl_cmdlinet::parse(int argc, const char **argv) { // should really use "wide" argv from wmain() @@ -158,18 +132,6 @@ bool ms_cl_cmdlinet::parse(int argc, const char **argv) return parse(options); } -/*******************************************************************\ - -Function: my_wgetline - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - static std::istream &my_wgetline(std::istream &in, std::wstring &dest) { // We should support this properly, @@ -205,18 +167,7 @@ static std::istream &my_wgetline(std::istream &in, std::wstring &dest) return in; } -/*******************************************************************\ - -Function: ms_cl_cmdlinet::process_response_file - - Inputs: - - Outputs: none - - Purpose: - -\*******************************************************************/ - +/// \return none void ms_cl_cmdlinet::process_response_file(const std::string &file) { std::ifstream infile(file); @@ -278,18 +229,7 @@ void ms_cl_cmdlinet::process_response_file(const std::string &file) } } -/*******************************************************************\ - -Function: ms_cl_cmdlinet::process_response_file_line - - Inputs: - - Outputs: none - - Purpose: - -\*******************************************************************/ - +/// \return none void ms_cl_cmdlinet::process_response_file_line(const std::string &line) { // In a response file, multiple compiler options and source-code files can @@ -329,18 +269,7 @@ void ms_cl_cmdlinet::process_response_file_line(const std::string &line) parse(options); } -/*******************************************************************\ - -Function: ms_cl_cmdlinet::process_non_cl_option - - Inputs: - - Outputs: none - - Purpose: - -\*******************************************************************/ - +/// \return none void ms_cl_cmdlinet::process_non_cl_option( const std::string &s) { @@ -355,18 +284,7 @@ void ms_cl_cmdlinet::process_non_cl_option( << s << "'" << std::endl; } -/*******************************************************************\ - -Function: ms_cl_cmdlinet::process_cl_option - - Inputs: - - Outputs: none - - Purpose: - -\*******************************************************************/ - +/// \return none const char *ms_cl_flags[]= { "c", // compile only diff --git a/src/goto-cc/ms_cl_cmdline.h b/src/goto-cc/ms_cl_cmdline.h index 627309ea6ef..0c05f1e7577 100644 --- a/src/goto-cc/ms_cl_cmdline.h +++ b/src/goto-cc/ms_cl_cmdline.h @@ -8,6 +8,9 @@ Date: June 2006 \*******************************************************************/ +/// \file +/// A special command line object for the gcc-like options + #ifndef CPROVER_GOTO_CC_MS_CL_CMDLINE_H #define CPROVER_GOTO_CC_MS_CL_CMDLINE_H diff --git a/src/goto-cc/ms_cl_mode.cpp b/src/goto-cc/ms_cl_mode.cpp index 25dc0e039e2..c375ebdfec7 100644 --- a/src/goto-cc/ms_cl_mode.cpp +++ b/src/goto-cc/ms_cl_mode.cpp @@ -6,6 +6,9 @@ Author: CM Wintersteiger, 2006 \*******************************************************************/ +/// \file +/// Visual Studio CL Mode + #ifdef _WIN32 #define EX_OK 0 #define EX_USAGE 64 @@ -27,18 +30,7 @@ Author: CM Wintersteiger, 2006 #include "ms_cl_mode.h" #include "compile.h" -/*******************************************************************\ - -Function: ms_cl_modet::doit - - Inputs: - - Outputs: - - Purpose: does it. - -\*******************************************************************/ - +/// does it. static bool is_directory(const std::string &s) { if(s.empty()) @@ -179,18 +171,7 @@ int ms_cl_modet::doit() return compiler.doit() ? EX_USAGE : EX_OK; } -/*******************************************************************\ - -Function: ms_cl_modet::help_mode - - Inputs: - - Outputs: - - Purpose: display command line help - -\*******************************************************************/ - +/// display command line help void ms_cl_modet::help_mode() { std::cout << "goto-cl understands the options of CL plus the following.\n\n"; diff --git a/src/goto-cc/ms_cl_mode.h b/src/goto-cc/ms_cl_mode.h index 673c6efed35..3c1d387441c 100644 --- a/src/goto-cc/ms_cl_mode.h +++ b/src/goto-cc/ms_cl_mode.h @@ -8,6 +8,9 @@ Date: June 2006 \*******************************************************************/ +/// \file +/// Visual Studio CL Mode + #ifndef CPROVER_GOTO_CC_MS_CL_MODE_H #define CPROVER_GOTO_CC_MS_CL_MODE_H diff --git a/src/goto-cc/xml_binaries/read_goto_object.cpp b/src/goto-cc/xml_binaries/read_goto_object.cpp index 01fffa8d4b5..1f8d65b8ada 100644 --- a/src/goto-cc/xml_binaries/read_goto_object.cpp +++ b/src/goto-cc/xml_binaries/read_goto_object.cpp @@ -8,6 +8,9 @@ Date: June 2006 \*******************************************************************/ +/// \file +/// Read goto object files. + #include #include #include @@ -22,19 +25,9 @@ Date: June 2006 #include "xml_irep_hashing.h" #include "xml_symbol_hashing.h" -/*******************************************************************\ - -Function: read_goto_object - - Inputs: input stream, symbol_table, functions - - Outputs: true on error, false otherwise - - Purpose: reads a goto object xml file back into a symbol and a - function table - -\*******************************************************************/ - +/// reads a goto object xml file back into a symbol and a function table +/// \par parameters: input stream, symbol_table, functions +/// \return true on error, false otherwise bool read_goto_object( std::istream &in, const std::string &filename, diff --git a/src/goto-cc/xml_binaries/read_goto_object.h b/src/goto-cc/xml_binaries/read_goto_object.h index 15589dba852..36981051008 100644 --- a/src/goto-cc/xml_binaries/read_goto_object.h +++ b/src/goto-cc/xml_binaries/read_goto_object.h @@ -8,6 +8,9 @@ Date: June 2006 \*******************************************************************/ +/// \file +/// Read goto object files. + #ifndef CPROVER_GOTO_CC_XML_BINARIES_READ_GOTO_OBJECT_H #define CPROVER_GOTO_CC_XML_BINARIES_READ_GOTO_OBJECT_H diff --git a/src/goto-cc/xml_binaries/xml_goto_function.cpp b/src/goto-cc/xml_binaries/xml_goto_function.cpp index 27021511fa8..ff35c86e253 100644 --- a/src/goto-cc/xml_binaries/xml_goto_function.cpp +++ b/src/goto-cc/xml_binaries/xml_goto_function.cpp @@ -8,42 +8,27 @@ Date: June 2006 \*******************************************************************/ +/// \file +/// Convert goto functions to xml structures and back. + #include #include "xml_goto_function.h" #include "xml_goto_program.h" -/*******************************************************************\ - -Function: convert - - Inputs: goto_function and an xml node - - Outputs: none - - Purpose: takes a goto_function and creates an according xml structure - -\*******************************************************************/ - +/// takes a goto_function and creates an according xml structure +/// \par parameters: goto_function and an xml node +/// \return none void convert(const goto_functionst::goto_functiont &function, xmlt &xml) { if(function.body_available) convert(function.body, xml); } -/*******************************************************************\ - -Function: convert - - Inputs: xml structure and a goto_function to fill - - Outputs: none - - Purpose: constructs the goto_function according to the information - in the xml structure. - -\*******************************************************************/ - +/// constructs the goto_function according to the information in the xml +/// structure. +/// \par parameters: xml structure and a goto_function to fill +/// \return none void convert(const xmlt &xml, goto_functionst::goto_functiont &function) { function.body.clear(); diff --git a/src/goto-cc/xml_binaries/xml_goto_function.h b/src/goto-cc/xml_binaries/xml_goto_function.h index 8f9db9982c6..b15722976b8 100644 --- a/src/goto-cc/xml_binaries/xml_goto_function.h +++ b/src/goto-cc/xml_binaries/xml_goto_function.h @@ -8,6 +8,9 @@ Date: June 2006 \*******************************************************************/ +/// \file +/// Convert goto functions into xml structures and back + #ifndef CPROVER_GOTO_CC_XML_BINARIES_XML_GOTO_FUNCTION_H #define CPROVER_GOTO_CC_XML_BINARIES_XML_GOTO_FUNCTION_H diff --git a/src/goto-cc/xml_binaries/xml_goto_function_hashing.cpp b/src/goto-cc/xml_binaries/xml_goto_function_hashing.cpp index f5ba898e55d..8d578451fac 100644 --- a/src/goto-cc/xml_binaries/xml_goto_function_hashing.cpp +++ b/src/goto-cc/xml_binaries/xml_goto_function_hashing.cpp @@ -9,21 +9,15 @@ Date: July 2006 \*******************************************************************/ +/// \file +/// Convert goto functions to xml structures and back (with irep hashing) + #include "xml_goto_function_hashing.h" #include "xml_goto_program_hashing.h" -/*******************************************************************\ - -Function: xml_goto_function_convertt::convert - - Inputs: goto_function and an xml node - - Outputs: none - - Purpose: takes a goto_function and creates an according xml structure - -\*******************************************************************/ - +/// takes a goto_function and creates an according xml structure +/// \par parameters: goto_function and an xml node +/// \return none void xml_goto_function_convertt::convert( const goto_functionst::goto_functiont &function, xmlt &xml) @@ -33,19 +27,10 @@ void xml_goto_function_convertt::convert( gpconverter.convert(function.body, xml); } -/*******************************************************************\ - -Function: xml_goto_function_convertt::convert - - Inputs: xml structure and a goto_function to fill - - Outputs: none - - Purpose: constructs the goto_function according to the information - in the xml structure. - -\*******************************************************************/ - +/// constructs the goto_function according to the information in the xml +/// structure. +/// \par parameters: xml structure and a goto_function to fill +/// \return none void xml_goto_function_convertt::convert( const xmlt &xml, goto_functionst::goto_functiont &function) diff --git a/src/goto-cc/xml_binaries/xml_goto_function_hashing.h b/src/goto-cc/xml_binaries/xml_goto_function_hashing.h index a0b86b72376..e558a702c68 100644 --- a/src/goto-cc/xml_binaries/xml_goto_function_hashing.h +++ b/src/goto-cc/xml_binaries/xml_goto_function_hashing.h @@ -9,6 +9,9 @@ Date: July 2006 \*******************************************************************/ +/// \file +/// Convert goto functions into xml structures and back (with irep hashing). + #ifndef CPROVER_GOTO_CC_XML_BINARIES_XML_GOTO_FUNCTION_HASHING_H #define CPROVER_GOTO_CC_XML_BINARIES_XML_GOTO_FUNCTION_HASHING_H diff --git a/src/goto-cc/xml_binaries/xml_goto_program.cpp b/src/goto-cc/xml_binaries/xml_goto_program.cpp index ee6a53960c0..a49a9e8eb8a 100644 --- a/src/goto-cc/xml_binaries/xml_goto_program.cpp +++ b/src/goto-cc/xml_binaries/xml_goto_program.cpp @@ -8,6 +8,9 @@ Date: June 2006 \*******************************************************************/ +/// \file +/// Convert goto programs to xml structures and back. + #include #include @@ -15,19 +18,10 @@ Date: June 2006 #include "xml_goto_program.h" -/*******************************************************************\ - -Function: convert - - Inputs: goto program, namespace and an xml structure to fill - - Outputs: none - - Purpose: constructs the xml structure according to the goto program - and the namespace into the given xml object. - -\*******************************************************************/ - +/// constructs the xml structure according to the goto program and the namespace +/// into the given xml object. +/// \par parameters: goto program, namespace and an xml structure to fill +/// \return none void convert(const goto_programt &goto_program, xmlt &xml) { @@ -200,20 +194,11 @@ void convert(const goto_programt &goto_program, } } -/*******************************************************************\ - -Function: convert - - Inputs: an xml structure, namespace, function symbol - and a goto program to fill - - Outputs: none - - Purpose: constructs the goto program according to the xml structure - and the namespace into the given goto program object. - -\*******************************************************************/ - +/// constructs the goto program according to the xml structure and the namespace +/// into the given goto program object. +/// \par parameters: an xml structure, namespace, function symbol +/// and a goto program to fill +/// \return none void convert(const xmlt &xml, goto_programt &goto_program) { goto_program.clear(); @@ -394,19 +379,11 @@ void convert(const xmlt &xml, goto_programt &goto_program) // std::cout << "TNI: " << goto_program.target_numbers.size() << std::endl; } -/*******************************************************************\ - -Function: find_instruction - - Inputs: a target label string, the instructions list and an xml program - - Outputs: iterator to the found instruction or .end() - - Purpose: finds the index of the instruction labelled with the given - target label in the given xml-program - -\*******************************************************************/ - +/// finds the index of the instruction labelled with the given target label in +/// the given xml-program +/// \par parameters: a target label string, the instructions list and an xml +/// program +/// \return iterator to the found instruction or .end() goto_programt::targett find_instruction( const xmlt &xml, diff --git a/src/goto-cc/xml_binaries/xml_goto_program.h b/src/goto-cc/xml_binaries/xml_goto_program.h index 04bab08af3e..cd5cb4e6c17 100644 --- a/src/goto-cc/xml_binaries/xml_goto_program.h +++ b/src/goto-cc/xml_binaries/xml_goto_program.h @@ -8,6 +8,9 @@ Date: June 2006 \*******************************************************************/ +/// \file +/// Convert goto programs into xml structures and back + #ifndef CPROVER_GOTO_CC_XML_BINARIES_XML_GOTO_PROGRAM_H #define CPROVER_GOTO_CC_XML_BINARIES_XML_GOTO_PROGRAM_H diff --git a/src/goto-cc/xml_binaries/xml_goto_program_hashing.cpp b/src/goto-cc/xml_binaries/xml_goto_program_hashing.cpp index fa1ac0c2b00..82054b85c21 100644 --- a/src/goto-cc/xml_binaries/xml_goto_program_hashing.cpp +++ b/src/goto-cc/xml_binaries/xml_goto_program_hashing.cpp @@ -9,25 +9,19 @@ Date: July 2006 \*******************************************************************/ +/// \file +/// Convert goto programs to xml structures and back (with irep hashing) + #include #include #include "xml_irep_hashing.h" #include "xml_goto_program_hashing.h" -/*******************************************************************\ - -Function: xml_goto_program_convertt::convert - - Inputs: goto program and an xml structure to fill - - Outputs: none - - Purpose: constructs the xml structure according to the goto program - and the namespace into the given xml object. - -\*******************************************************************/ - +/// constructs the xml structure according to the goto program and the namespace +/// into the given xml object. +/// \par parameters: goto program and an xml structure to fill +/// \return none void xml_goto_program_convertt::convert( const goto_programt &goto_program, xmlt &xml) @@ -196,18 +190,10 @@ void xml_goto_program_convertt::convert( } } -/*******************************************************************\ - -Function: xml_goto_program_convertt::convert - - Inputs: an xml structure and a goto program to fill - - Outputs: none - - Purpose: constructs the goto program according to the xml structure - and the namespace into the given goto program object. - -\*******************************************************************/ +/// constructs the goto program according to the xml structure and the namespace +/// into the given goto program object. +/// \par parameters: an xml structure and a goto program to fill +/// \return none void xml_goto_program_convertt::convert( const xmlt &xml, goto_programt &goto_program) @@ -393,18 +379,11 @@ void xml_goto_program_convertt::convert( // std::cout << "TNI: " << goto_program.target_numbers.size() << std::endl; } -/*******************************************************************\ - -Function: xml_goto_program_convertt::find_instruction - - Inputs: a target label string, the instructions list and an xml program - - Outputs: iterator to the found instruction or .end() - - Purpose: finds the index of the instruction labelled with the given - target label in the given xml-program - -\*******************************************************************/ +/// finds the index of the instruction labelled with the given target label in +/// the given xml-program +/// \par parameters: a target label string, the instructions list and an xml +/// program +/// \return iterator to the found instruction or .end() goto_programt::targett xml_goto_program_convertt::find_instruction( const xmlt &xml, goto_programt::instructionst &instructions, diff --git a/src/goto-cc/xml_binaries/xml_goto_program_hashing.h b/src/goto-cc/xml_binaries/xml_goto_program_hashing.h index a3af286f1a7..63622775799 100644 --- a/src/goto-cc/xml_binaries/xml_goto_program_hashing.h +++ b/src/goto-cc/xml_binaries/xml_goto_program_hashing.h @@ -9,6 +9,9 @@ Date: July 2006 \*******************************************************************/ +/// \file +/// Convert goto programs into xml structures and back (with irep hashing) + #ifndef CPROVER_GOTO_CC_XML_BINARIES_XML_GOTO_PROGRAM_HASHING_H #define CPROVER_GOTO_CC_XML_BINARIES_XML_GOTO_PROGRAM_HASHING_H diff --git a/src/goto-cc/xml_binaries/xml_irep_hashing.cpp b/src/goto-cc/xml_binaries/xml_irep_hashing.cpp index 54aa9c06bf8..c2d3ab67720 100644 --- a/src/goto-cc/xml_binaries/xml_irep_hashing.cpp +++ b/src/goto-cc/xml_binaries/xml_irep_hashing.cpp @@ -8,24 +8,15 @@ Date: July 2006 \*******************************************************************/ +/// \file +/// XML-irep conversions with hashing + #include #include #include "xml_irep_hashing.h" #include "string_hash.h" -/*******************************************************************\ - -Function: xml_irep_convertt::convert - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void xml_irep_convertt::convert( const irept &irep, xmlt &xml) @@ -54,18 +45,6 @@ void xml_irep_convertt::convert( } } -/*******************************************************************\ - -Function: xml_irep_convertt::convert - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void xml_irep_convertt::convert( const xmlt &xml, irept &irep) @@ -112,18 +91,6 @@ void xml_irep_convertt::convert( } } -/*******************************************************************\ - -Function: xml_irep_convertt::reference_convert - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void xml_irep_convertt::reference_convert( const irept &irep, xmlt &xml) @@ -144,17 +111,6 @@ void xml_irep_convertt::reference_convert( } } -/*******************************************************************\ - -Function: xml_irep_convertt::add_with_childs - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ unsigned long xml_irep_convertt::add_with_childs(const irept &iwi) { unsigned long id=insert((unsigned long)&iwi, iwi); @@ -191,19 +147,9 @@ unsigned long xml_irep_convertt::add_with_childs(const irept &iwi) return id; } -/*******************************************************************\ - -Function: xml_irep_convertt::resolve_references - - Inputs: none - - Outputs: none - - Purpose: resolves references to ireps from an irep after reading - an irep hash map into memory. - -\*******************************************************************/ - +/// resolves references to ireps from an irep after reading an irep hash map +/// into memory. +/// \return none void xml_irep_convertt::resolve_references(const irept &cur) { if(cur.id() == "__REFERENCE__") @@ -232,18 +178,9 @@ void xml_irep_convertt::resolve_references(const irept &cur) resolve_references(iti->second); } -/*******************************************************************\ - -Function: xml_irep_convertt::long_to_string - - Inputs: an irep pointer - - Outputs: a new string - - Purpose: converts the hash value to a readable string - -\*******************************************************************/ - +/// converts the hash value to a readable string +/// \par parameters: an irep pointer +/// \return a new string std::string xml_irep_convertt::long_to_string(const unsigned long l) { std::stringstream s; @@ -251,19 +188,10 @@ std::string xml_irep_convertt::long_to_string(const unsigned long l) return s.str(); } -/*******************************************************************\ - -Function: xml_irep_convertt::string_to_long - - Inputs: a string - - Outputs: an unsigned long - - Purpose: converts the string to an unsigned long that used to give - a pointer to an irep in an old compilation - -\*******************************************************************/ - +/// converts the string to an unsigned long that used to give a pointer to an +/// irep in an old compilation +/// \par parameters: a string +/// \return an unsigned long unsigned long xml_irep_convertt::string_to_long(const std::string &s) { std::stringstream ss(s); @@ -272,54 +200,27 @@ unsigned long xml_irep_convertt::string_to_long(const std::string &s) return res; } -/*******************************************************************\ - -Function: xml_irep_convertt::find_irep_by_id - - Inputs: an id - - Outputs: an iterator into the ireps hash set - - Purpose: finds an irep in the ireps hash set by its id - -\*******************************************************************/ - +/// finds an irep in the ireps hash set by its id +/// \par parameters: an id +/// \return an iterator into the ireps hash set xml_irep_convertt::ireps_containert::id_containert::const_iterator xml_irep_convertt::find_irep_by_id(const unsigned int id) { return ireps_container.id_container.find(id); } -/*******************************************************************\ - -Function: xml_irep_convertt::find_irep_by_content - - Inputs: an irep - - Outputs: an iterator into the ireps hash set - - Purpose: finds an irep in the ireps hash set by checking contents - -\*******************************************************************/ - - xml_irep_convertt::ireps_containert::content_containert::const_iterator +/// finds an irep in the ireps hash set by checking contents +/// \par parameters: an irep +/// \return an iterator into the ireps hash set +xml_irep_convertt::ireps_containert::content_containert::const_iterator xml_irep_convertt::find_irep_by_content(const irept &irep) { return ireps_container.content_container.find(irep); } -/*******************************************************************\ - -Function: xml_irep_convertt::insert - - Inputs: an unsigned long and an irep - - Outputs: true on success, false otherwise - - Purpose: inserts an irep into the hashtable - -\*******************************************************************/ - +/// inserts an irep into the hashtable +/// \par parameters: an unsigned long and an irep +/// \return true on success, false otherwise unsigned long xml_irep_convertt::insert( unsigned long id, const irept &i) @@ -346,18 +247,9 @@ unsigned long xml_irep_convertt::insert( } } -/*******************************************************************\ - -Function: xml_irep_convertt::insert - - Inputs: a string and an irep - - Outputs: true on success, false otherwise - - Purpose: inserts an irep into the hashtable - -\*******************************************************************/ - +/// inserts an irep into the hashtable +/// \par parameters: a string and an irep +/// \return true on success, false otherwise unsigned long xml_irep_convertt::insert( const std::string &id, const irept &i) @@ -365,19 +257,9 @@ unsigned long xml_irep_convertt::insert( return insert(string_to_long(id), i); } -/*******************************************************************\ - -Function: xml_irep_convertt::convert_map - - Inputs: an xml node - - Outputs: nothing - - Purpose: converts the current hash map of ireps into the given xml - structure - -\*******************************************************************/ - +/// converts the current hash map of ireps into the given xml structure +/// \par parameters: an xml node +/// \return nothing void xml_irep_convertt::convert_map(xmlt &xml) { ireps_containert::id_containert::iterator hit= @@ -392,19 +274,10 @@ void xml_irep_convertt::convert_map(xmlt &xml) } } -/*******************************************************************\ - -Function: xml_irep_convertt::output_map - - Inputs: an output stream - - Outputs: nothing - - Purpose: converts the current hash map of ireps into xml nodes and - outputs them to the stream - -\*******************************************************************/ - +/// converts the current hash map of ireps into xml nodes and outputs them to +/// the stream +/// \par parameters: an output stream +/// \return nothing void xml_irep_convertt::output_map(std::ostream &out, unsigned indent) { ireps_containert::id_containert::iterator hit= diff --git a/src/goto-cc/xml_binaries/xml_irep_hashing.h b/src/goto-cc/xml_binaries/xml_irep_hashing.h index 6fc074c9941..2391580a61b 100644 --- a/src/goto-cc/xml_binaries/xml_irep_hashing.h +++ b/src/goto-cc/xml_binaries/xml_irep_hashing.h @@ -8,6 +8,9 @@ Date: July 2006 \*******************************************************************/ +/// \file +/// XML-irep conversions with hashing + #ifndef CPROVER_GOTO_CC_XML_BINARIES_XML_IREP_HASHING_H #define CPROVER_GOTO_CC_XML_BINARIES_XML_IREP_HASHING_H diff --git a/src/goto-cc/xml_binaries/xml_symbol.cpp b/src/goto-cc/xml_binaries/xml_symbol.cpp index 051d6b38d4f..e62ebe7f657 100644 --- a/src/goto-cc/xml_binaries/xml_symbol.cpp +++ b/src/goto-cc/xml_binaries/xml_symbol.cpp @@ -8,21 +8,15 @@ Date: June 2006 \*******************************************************************/ +/// \file +/// Compile and link source and object files. + #include "xml_irep.h" #include "xml_symbol.h" -/*******************************************************************\ - -Function: convert - - Inputs: a symbol and an xml node - - Outputs: none - - Purpose: converts a symbol to an xml symbol node - -\*******************************************************************/ - +/// converts a symbol to an xml symbol node +/// \par parameters: a symbol and an xml node +/// \return none void convert(const symbolt &sym, xmlt &root) { xmlt &xmlsym = root.new_element("symbol"); @@ -68,18 +62,9 @@ void convert(const symbolt &sym, xmlt &root) xmlloc.name = "location"; // convert overwrote this } -/*******************************************************************\ - -Function: convert - - Inputs: an xml node and a symbol - - Outputs: none - - Purpose: converts an xml symbol node to a symbol - -\*******************************************************************/ - +/// converts an xml symbol node to a symbol +/// \par parameters: an xml node and a symbol +/// \return none void convert(const xmlt &xmlsym, symbolt &symbol) { symbol.name=xmlsym.get_attribute("name"); diff --git a/src/goto-cc/xml_binaries/xml_symbol.h b/src/goto-cc/xml_binaries/xml_symbol.h index d50f8b75610..0044cf98000 100644 --- a/src/goto-cc/xml_binaries/xml_symbol.h +++ b/src/goto-cc/xml_binaries/xml_symbol.h @@ -8,6 +8,9 @@ Date: June 2006 \*******************************************************************/ +/// \file +/// Converts symbols to xml structures and back. + #ifndef CPROVER_GOTO_CC_XML_BINARIES_XML_SYMBOL_H #define CPROVER_GOTO_CC_XML_BINARIES_XML_SYMBOL_H diff --git a/src/goto-cc/xml_binaries/xml_symbol_hashing.cpp b/src/goto-cc/xml_binaries/xml_symbol_hashing.cpp index ab6c17ab412..862522451e1 100644 --- a/src/goto-cc/xml_binaries/xml_symbol_hashing.cpp +++ b/src/goto-cc/xml_binaries/xml_symbol_hashing.cpp @@ -8,21 +8,15 @@ Date: July 2006 \*******************************************************************/ +/// \file +/// XML-symbol conversions with irep hashing + #include "xml_symbol_hashing.h" #include "xml_irep_hashing.h" -/*******************************************************************\ - -Function: xml_symbol_convertt::convert - - Inputs: a symbol and an xml node - - Outputs: none - - Purpose: converts a symbol to an xml symbol node - -\*******************************************************************/ - +/// converts a symbol to an xml symbol node +/// \par parameters: a symbol and an xml node +/// \return none void xml_symbol_convertt::convert(const symbolt &sym, xmlt &root) { xmlt &xmlsym = root.new_element("symbol"); @@ -31,18 +25,9 @@ void xml_symbol_convertt::convert(const symbolt &sym, xmlt &root) irepconverter.reference_convert(irepcache.back(), xmlsym); } -/*******************************************************************\ - -Function: xml_symbol_convertt::convert - - Inputs: an xml node and a symbol - - Outputs: none - - Purpose: converts an xml symbol node to a symbol - -\*******************************************************************/ - +/// converts an xml symbol node to a symbol +/// \par parameters: an xml node and a symbol +/// \return none void xml_symbol_convertt::convert(const xmlt &xmlsym, symbolt &symbol) { irept t; diff --git a/src/goto-cc/xml_binaries/xml_symbol_hashing.h b/src/goto-cc/xml_binaries/xml_symbol_hashing.h index 0ade830430e..bb5f3e9a060 100644 --- a/src/goto-cc/xml_binaries/xml_symbol_hashing.h +++ b/src/goto-cc/xml_binaries/xml_symbol_hashing.h @@ -8,6 +8,9 @@ Date: July 2006 \*******************************************************************/ +/// \file +/// XML-symbol conversions with irep hashing + #ifndef CPROVER_GOTO_CC_XML_BINARIES_XML_SYMBOL_HASHING_H #define CPROVER_GOTO_CC_XML_BINARIES_XML_SYMBOL_HASHING_H diff --git a/src/goto-diff/change_impact.cpp b/src/goto-diff/change_impact.cpp index 6ca431c0f1d..2006c69822a 100644 --- a/src/goto-diff/change_impact.cpp +++ b/src/goto-diff/change_impact.cpp @@ -8,6 +8,9 @@ Date: April 2016 \*******************************************************************/ +/// \file +/// Data and control-dependencies of syntactic diff + #include #include @@ -47,18 +50,6 @@ Date: April 2016 queue.push(entry); } -/*******************************************************************\ - -Function: full_slicert::operator() - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void full_slicert::operator()( goto_functionst &goto_functions, const namespacet &ns, @@ -144,18 +135,6 @@ void full_slicert::operator()( } -/*******************************************************************\ - -Function: full_slicert::fixedpoint - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void full_slicert::fixedpoint( goto_functionst &goto_functions, queuet &queue, @@ -206,18 +185,6 @@ void full_slicert::fixedpoint( } -/*******************************************************************\ - -Function: full_slicert::add_dependencies - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void full_slicert::add_dependencies( const cfgt::nodet &node, queuet &queue, @@ -319,18 +286,6 @@ class change_impactt goto_programt::const_targett &target) const; }; -/*******************************************************************\ - -Function: change_impactt::change_impactt - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - change_impactt::change_impactt( const goto_modelt &model_old, const goto_modelt &model_new, @@ -357,18 +312,6 @@ change_impactt::change_impactt( new_dep_graph(new_goto_functions, ns_new); } -/*******************************************************************\ - -Function: change_impactt::change_impact - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void change_impactt::change_impact(const irep_idt &function) { unified_difft::goto_program_difft diff; @@ -401,18 +344,6 @@ void change_impactt::change_impact(const irep_idt &function) new_change_impact[function]); } -/*******************************************************************\ - -Function: change_impactt::change_impact - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void change_impactt::change_impact( const goto_programt &old_goto_program, const goto_programt &new_goto_program, @@ -493,18 +424,6 @@ void change_impactt::change_impact( } -/*******************************************************************\ - -Function: change_impactt::propogate_dep_forward - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void change_impactt::propogate_dep_forward( const dependence_grapht::nodet &d_node, const dependence_grapht &dep_graph, @@ -532,18 +451,6 @@ void change_impactt::propogate_dep_forward( } } -/*******************************************************************\ - -Function: change_impactt::propogate_dep_back - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void change_impactt::propogate_dep_back( const dependence_grapht::nodet &d_node, const dependence_grapht &dep_graph, @@ -574,18 +481,6 @@ void change_impactt::propogate_dep_back( } } -/*******************************************************************\ - -Function: change_impactt::operator() - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void change_impactt::operator()() { // sorted iteration over intersection(old functions, new functions) @@ -656,18 +551,6 @@ void change_impactt::operator()() } } -/*******************************************************************\ - -Function: change_impact::output_change_impact - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void change_impactt::output_change_impact( const irep_idt &function, const goto_program_change_impactt &c_i, @@ -713,18 +596,6 @@ void change_impactt::output_change_impact( } } -/*******************************************************************\ - -Function: change_impact::output_change_impact - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void change_impactt::output_change_impact( const irep_idt &function, const goto_program_change_impactt &o_c_i, @@ -841,18 +712,6 @@ void change_impactt::output_change_impact( } } -/*******************************************************************\ - -Function: change_impactt::output_instruction - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void change_impactt::output_instruction(char prefix, const goto_programt &goto_program, const namespacet &ns, @@ -876,18 +735,6 @@ void change_impactt::output_instruction(char prefix, } } -/*******************************************************************\ - -Function: change_impact - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void change_impact( const goto_modelt &model_old, const goto_modelt &model_new, diff --git a/src/goto-diff/change_impact.h b/src/goto-diff/change_impact.h index 234ec15a7c8..d56e57184e1 100644 --- a/src/goto-diff/change_impact.h +++ b/src/goto-diff/change_impact.h @@ -8,6 +8,9 @@ Date: April 2016 \*******************************************************************/ +/// \file +/// Data and control-dependencies of syntactic diff + #ifndef CPROVER_GOTO_DIFF_CHANGE_IMPACT_H #define CPROVER_GOTO_DIFF_CHANGE_IMPACT_H diff --git a/src/goto-diff/goto_diff.h b/src/goto-diff/goto_diff.h index bb6a7bb05cc..2b6a9ac923d 100644 --- a/src/goto-diff/goto_diff.h +++ b/src/goto-diff/goto_diff.h @@ -6,6 +6,9 @@ Author: Peter Schrammel \*******************************************************************/ +/// \file +/// GOTO-DIFF Base Class + #ifndef CPROVER_GOTO_DIFF_GOTO_DIFF_H #define CPROVER_GOTO_DIFF_GOTO_DIFF_H diff --git a/src/goto-diff/goto_diff_base.cpp b/src/goto-diff/goto_diff_base.cpp index 7c6a0e5bf4e..cd945b11a7a 100644 --- a/src/goto-diff/goto_diff_base.cpp +++ b/src/goto-diff/goto_diff_base.cpp @@ -6,22 +6,13 @@ Author: Peter Schrammel \*******************************************************************/ +/// \file +/// GOTO-DIFF Base Class + #include #include "goto_diff.h" -/*******************************************************************\ - -Function: goto_difft::output_functions - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::ostream &goto_difft::output_functions(std::ostream &out) const { switch(ui) @@ -85,18 +76,6 @@ std::ostream &goto_difft::output_functions(std::ostream &out) const return out; } -/*******************************************************************\ - -Function: goto_difft::convert_function_group - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_difft::convert_function_group( json_arrayt &result, const irep_id_sett &function_group) const @@ -108,18 +87,6 @@ void goto_difft::convert_function_group( } } -/*******************************************************************\ - -Function: goto_difft::convert_functions - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_difft::convert_function( json_objectt &result, const irep_idt &function_name) const diff --git a/src/goto-diff/goto_diff_languages.cpp b/src/goto-diff/goto_diff_languages.cpp index c467ab92cd3..d1ad10c5a0b 100644 --- a/src/goto-diff/goto_diff_languages.cpp +++ b/src/goto-diff/goto_diff_languages.cpp @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Language Registration + #include #include @@ -21,18 +24,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "goto_diff_languages.h" -/*******************************************************************\ - -Function: goto_diff_languagest::register_languages - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_diff_languagest::register_languages() { register_language(new_ansi_c_language); diff --git a/src/goto-diff/goto_diff_languages.h b/src/goto-diff/goto_diff_languages.h index b0489e85544..7bd4c24e525 100644 --- a/src/goto-diff/goto_diff_languages.h +++ b/src/goto-diff/goto_diff_languages.h @@ -6,6 +6,9 @@ Author: Peter Schrammel \*******************************************************************/ +/// \file +/// GOTO-DIFF Languages + #ifndef CPROVER_GOTO_DIFF_GOTO_DIFF_LANGUAGES_H #define CPROVER_GOTO_DIFF_GOTO_DIFF_LANGUAGES_H diff --git a/src/goto-diff/goto_diff_main.cpp b/src/goto-diff/goto_diff_main.cpp index 96655ea5455..52897394b06 100644 --- a/src/goto-diff/goto_diff_main.cpp +++ b/src/goto-diff/goto_diff_main.cpp @@ -6,6 +6,9 @@ Author: Peter Schrammel \*******************************************************************/ +/// \file +/// GOTO-DIFF Main Module + #include #ifdef IREP_HASH_STATS @@ -14,18 +17,6 @@ Author: Peter Schrammel #include "goto_diff_parse_options.h" -/*******************************************************************\ - -Function: main / wmain - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - #ifdef IREP_HASH_STATS extern unsigned long long irep_hash_cnt; extern unsigned long long irep_cmp_cnt; diff --git a/src/goto-diff/goto_diff_parse_options.cpp b/src/goto-diff/goto_diff_parse_options.cpp index f0266b006e4..9f9cd2c6227 100644 --- a/src/goto-diff/goto_diff_parse_options.cpp +++ b/src/goto-diff/goto_diff_parse_options.cpp @@ -6,6 +6,9 @@ Author: Peter Schrammel \*******************************************************************/ +/// \file +/// GOTO-DIFF Command Line Option Processing + #include #include // exit() #include @@ -44,18 +47,6 @@ Author: Peter Schrammel #include "unified_diff.h" #include "change_impact.h" -/*******************************************************************\ - -Function: goto_diff_parse_optionst::goto_diff_parse_optionst - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - goto_diff_parse_optionst::goto_diff_parse_optionst(int argc, const char **argv): parse_options_baset(GOTO_DIFF_OPTIONS, argc, argv), goto_diff_languagest(cmdline, ui_message_handler), @@ -64,18 +55,6 @@ goto_diff_parse_optionst::goto_diff_parse_optionst(int argc, const char **argv): { } -/*******************************************************************\ - -Function: goto_diff_parse_optionst::goto_diff_parse_optionst - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - ::goto_diff_parse_optionst::goto_diff_parse_optionst( int argc, const char **argv, @@ -87,18 +66,6 @@ ::goto_diff_parse_optionst::goto_diff_parse_optionst( { } -/*******************************************************************\ - -Function: goto_diff_parse_optionst::eval_verbosity - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_diff_parse_optionst::eval_verbosity() { // this is our default verbosity @@ -114,18 +81,6 @@ void goto_diff_parse_optionst::eval_verbosity() ui_message_handler.set_verbosity(v); } -/*******************************************************************\ - -Function: goto_diff_parse_optionst::get_command_line_options - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_diff_parse_optionst::get_command_line_options(optionst &options) { if(config.set(cmdline)) @@ -280,18 +235,7 @@ void goto_diff_parse_optionst::get_command_line_options(optionst &options) } } -/*******************************************************************\ - -Function: goto_diff_parse_optionst::doit - - Inputs: - - Outputs: - - Purpose: invoke main modules - -\*******************************************************************/ - +/// invoke main modules int goto_diff_parse_optionst::doit() { if(cmdline.isset("version")) @@ -385,18 +329,6 @@ int goto_diff_parse_optionst::doit() return 0; } -/*******************************************************************\ - -Function: goto_diff_parse_optionst::get_goto_program - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - int goto_diff_parse_optionst::get_goto_program( const optionst &options, goto_diff_languagest &languages, @@ -454,18 +386,6 @@ int goto_diff_parse_optionst::get_goto_program( return -1; // no error, continue } -/*******************************************************************\ - -Function: goto_diff_parse_optionst::process_goto_program - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool goto_diff_parse_optionst::process_goto_program( const optionst &options, goto_modelt &goto_model) @@ -552,18 +472,7 @@ bool goto_diff_parse_optionst::process_goto_program( return false; } -/*******************************************************************\ - -Function: goto_diff_parse_optionst::help - - Inputs: - - Outputs: - - Purpose: display command line help - -\*******************************************************************/ - +/// display command line help void goto_diff_parse_optionst::help() { std::cout << diff --git a/src/goto-diff/goto_diff_parse_options.h b/src/goto-diff/goto_diff_parse_options.h index e78bd1537e7..505de8410f4 100644 --- a/src/goto-diff/goto_diff_parse_options.h +++ b/src/goto-diff/goto_diff_parse_options.h @@ -6,6 +6,9 @@ Author: Peter Schrammel \*******************************************************************/ +/// \file +/// GOTO-DIFF Command Line Option Processing + #ifndef CPROVER_GOTO_DIFF_GOTO_DIFF_PARSE_OPTIONS_H #define CPROVER_GOTO_DIFF_GOTO_DIFF_PARSE_OPTIONS_H diff --git a/src/goto-diff/syntactic_diff.cpp b/src/goto-diff/syntactic_diff.cpp index 4c0e831dfdc..030d35e0f3c 100644 --- a/src/goto-diff/syntactic_diff.cpp +++ b/src/goto-diff/syntactic_diff.cpp @@ -6,19 +6,10 @@ Author: Peter Schrammel \*******************************************************************/ -#include "syntactic_diff.h" - -/*******************************************************************\ - -Function: syntactic_difft::operator() - - Inputs: +/// \file +/// Syntactic GOTO-DIFF - Outputs: - - Purpose: - -\*******************************************************************/ +#include "syntactic_diff.h" bool syntactic_difft::operator()() { diff --git a/src/goto-diff/syntactic_diff.h b/src/goto-diff/syntactic_diff.h index dd10374dc4b..8496eb8165e 100644 --- a/src/goto-diff/syntactic_diff.h +++ b/src/goto-diff/syntactic_diff.h @@ -6,6 +6,9 @@ Author: Peter Schrammel \*******************************************************************/ +/// \file +/// Syntactic GOTO-DIFF + #ifndef CPROVER_GOTO_DIFF_SYNTACTIC_DIFF_H #define CPROVER_GOTO_DIFF_SYNTACTIC_DIFF_H diff --git a/src/goto-diff/unified_diff.cpp b/src/goto-diff/unified_diff.cpp index 8cf1f8f27b3..b30b3653893 100644 --- a/src/goto-diff/unified_diff.cpp +++ b/src/goto-diff/unified_diff.cpp @@ -8,24 +8,15 @@ Date: April 2016 \*******************************************************************/ +/// \file +/// Unified diff (using LCSS) of goto functions + #include #include #include "unified_diff.h" -/*******************************************************************\ - -Function: unified_difft::unified_difft - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - unified_difft::unified_difft(const goto_modelt &model_old, const goto_modelt &model_new): old_goto_functions(model_old.goto_functions), @@ -35,18 +26,6 @@ unified_difft::unified_difft(const goto_modelt &model_old, { } -/*******************************************************************\ - -Function: unified_difft::get_diff - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void unified_difft::get_diff( const irep_idt &function, goto_program_difft &dest) const @@ -82,18 +61,6 @@ void unified_difft::get_diff( dest); } -/*******************************************************************\ - -Function: unified_difft::get_diff - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void unified_difft::get_diff( const irep_idt &identifier, const goto_programt &old_goto_program, @@ -133,18 +100,6 @@ void unified_difft::get_diff( } } -/*******************************************************************\ - -Function: unified_difft::output_diff - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void unified_difft::output_diff( const irep_idt &identifier, const goto_programt &old_goto_program, @@ -206,18 +161,6 @@ void unified_difft::output_diff( } } -/*******************************************************************\ - -Function: unified_difft::lcss - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void unified_difft::lcss( const irep_idt &identifier, const goto_programt &old_goto_program, @@ -371,18 +314,6 @@ void unified_difft::lcss( differences.push_back(differencet::SAME); } -/*******************************************************************\ - -Function: unified_difft::unified_diff - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void unified_difft::unified_diff( const irep_idt &identifier, const goto_programt &old_goto_program, @@ -407,18 +338,6 @@ void unified_difft::unified_diff( lcss(identifier, old_goto_program, new_goto_program, differences); } -/*******************************************************************\ - -Function: unified_difft::operator() - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool unified_difft::operator()() { typedef std::map #include diff --git a/src/goto-instrument/accelerate/accelerate.h b/src/goto-instrument/accelerate/accelerate.h index 03c61a3fa39..d3aac4ac124 100644 --- a/src/goto-instrument/accelerate/accelerate.h +++ b/src/goto-instrument/accelerate/accelerate.h @@ -6,6 +6,9 @@ Author: Matt Lewis \*******************************************************************/ +/// \file +/// Loop Acceleration + #ifndef CPROVER_GOTO_INSTRUMENT_ACCELERATE_ACCELERATE_H #define CPROVER_GOTO_INSTRUMENT_ACCELERATE_ACCELERATE_H diff --git a/src/goto-instrument/accelerate/acceleration_utils.cpp b/src/goto-instrument/accelerate/acceleration_utils.cpp index 1d42ebf1945..36dd90068b0 100644 --- a/src/goto-instrument/accelerate/acceleration_utils.cpp +++ b/src/goto-instrument/accelerate/acceleration_utils.cpp @@ -6,6 +6,9 @@ Author: Matt Lewis \*******************************************************************/ +/// \file +/// Loop Acceleration + #include #include #include diff --git a/src/goto-instrument/accelerate/acceleration_utils.h b/src/goto-instrument/accelerate/acceleration_utils.h index de378ee7509..e05c7ed48da 100644 --- a/src/goto-instrument/accelerate/acceleration_utils.h +++ b/src/goto-instrument/accelerate/acceleration_utils.h @@ -6,6 +6,9 @@ Author: Matt Lewis \*******************************************************************/ +/// \file +/// Loop Acceleration + #ifndef CPROVER_GOTO_INSTRUMENT_ACCELERATE_ACCELERATION_UTILS_H #define CPROVER_GOTO_INSTRUMENT_ACCELERATE_ACCELERATION_UTILS_H diff --git a/src/goto-instrument/accelerate/accelerator.h b/src/goto-instrument/accelerate/accelerator.h index 143c4cbfbab..57f17b5a618 100644 --- a/src/goto-instrument/accelerate/accelerator.h +++ b/src/goto-instrument/accelerate/accelerator.h @@ -6,6 +6,9 @@ Author: Matt Lewis \*******************************************************************/ +/// \file +/// Loop Acceleration + #ifndef CPROVER_GOTO_INSTRUMENT_ACCELERATE_ACCELERATOR_H #define CPROVER_GOTO_INSTRUMENT_ACCELERATE_ACCELERATOR_H diff --git a/src/goto-instrument/accelerate/all_paths_enumerator.cpp b/src/goto-instrument/accelerate/all_paths_enumerator.cpp index b8db795bdfd..5ec92bc49f5 100644 --- a/src/goto-instrument/accelerate/all_paths_enumerator.cpp +++ b/src/goto-instrument/accelerate/all_paths_enumerator.cpp @@ -6,6 +6,9 @@ Author: Matt Lewis \*******************************************************************/ +/// \file +/// Loop Acceleration + #include #include "all_paths_enumerator.h" diff --git a/src/goto-instrument/accelerate/all_paths_enumerator.h b/src/goto-instrument/accelerate/all_paths_enumerator.h index 8f8d37b84f3..3bd1b6b9ac6 100644 --- a/src/goto-instrument/accelerate/all_paths_enumerator.h +++ b/src/goto-instrument/accelerate/all_paths_enumerator.h @@ -6,6 +6,9 @@ Author: Matt Lewis \*******************************************************************/ +/// \file +/// Loop Acceleration + #ifndef CPROVER_GOTO_INSTRUMENT_ACCELERATE_ALL_PATHS_ENUMERATOR_H #define CPROVER_GOTO_INSTRUMENT_ACCELERATE_ALL_PATHS_ENUMERATOR_H diff --git a/src/goto-instrument/accelerate/cone_of_influence.cpp b/src/goto-instrument/accelerate/cone_of_influence.cpp index 0f0b969e342..e7689e6ed65 100644 --- a/src/goto-instrument/accelerate/cone_of_influence.cpp +++ b/src/goto-instrument/accelerate/cone_of_influence.cpp @@ -6,6 +6,9 @@ Author: Matt Lewis \*******************************************************************/ +/// \file +/// Loop Acceleration + #include #include diff --git a/src/goto-instrument/accelerate/cone_of_influence.h b/src/goto-instrument/accelerate/cone_of_influence.h index 4c9ac072e38..bc29c24d593 100644 --- a/src/goto-instrument/accelerate/cone_of_influence.h +++ b/src/goto-instrument/accelerate/cone_of_influence.h @@ -6,6 +6,9 @@ Author: Matt Lewis \*******************************************************************/ +/// \file +/// Loop Acceleration + #ifndef CPROVER_GOTO_INSTRUMENT_ACCELERATE_CONE_OF_INFLUENCE_H #define CPROVER_GOTO_INSTRUMENT_ACCELERATE_CONE_OF_INFLUENCE_H diff --git a/src/goto-instrument/accelerate/disjunctive_polynomial_acceleration.cpp b/src/goto-instrument/accelerate/disjunctive_polynomial_acceleration.cpp index e2ede0567cb..fe004b782d2 100644 --- a/src/goto-instrument/accelerate/disjunctive_polynomial_acceleration.cpp +++ b/src/goto-instrument/accelerate/disjunctive_polynomial_acceleration.cpp @@ -6,6 +6,9 @@ Author: Matt Lewis \*******************************************************************/ +/// \file +/// Loop Acceleration + #include #include #include diff --git a/src/goto-instrument/accelerate/disjunctive_polynomial_acceleration.h b/src/goto-instrument/accelerate/disjunctive_polynomial_acceleration.h index bbf01917b5e..168c2c99888 100644 --- a/src/goto-instrument/accelerate/disjunctive_polynomial_acceleration.h +++ b/src/goto-instrument/accelerate/disjunctive_polynomial_acceleration.h @@ -6,6 +6,9 @@ Author: Matt Lewis \*******************************************************************/ +/// \file +/// Loop Acceleration + #ifndef CPROVER_GOTO_INSTRUMENT_ACCELERATE_DISJUNCTIVE_POLYNOMIAL_ACCELERATION_H #define CPROVER_GOTO_INSTRUMENT_ACCELERATE_DISJUNCTIVE_POLYNOMIAL_ACCELERATION_H diff --git a/src/goto-instrument/accelerate/enumerating_loop_acceleration.cpp b/src/goto-instrument/accelerate/enumerating_loop_acceleration.cpp index d47c0c6287a..b514a2d4c88 100644 --- a/src/goto-instrument/accelerate/enumerating_loop_acceleration.cpp +++ b/src/goto-instrument/accelerate/enumerating_loop_acceleration.cpp @@ -6,6 +6,9 @@ Author: Matt Lewis \*******************************************************************/ +/// \file +/// Loop Acceleration + #include #include "enumerating_loop_acceleration.h" diff --git a/src/goto-instrument/accelerate/enumerating_loop_acceleration.h b/src/goto-instrument/accelerate/enumerating_loop_acceleration.h index 8c7d3614c32..f84d3fbd23b 100644 --- a/src/goto-instrument/accelerate/enumerating_loop_acceleration.h +++ b/src/goto-instrument/accelerate/enumerating_loop_acceleration.h @@ -6,6 +6,9 @@ Author: Matt Lewis \*******************************************************************/ +/// \file +/// Loop Acceleration + #ifndef CPROVER_GOTO_INSTRUMENT_ACCELERATE_ENUMERATING_LOOP_ACCELERATION_H #define CPROVER_GOTO_INSTRUMENT_ACCELERATE_ENUMERATING_LOOP_ACCELERATION_H diff --git a/src/goto-instrument/accelerate/linearize.cpp b/src/goto-instrument/accelerate/linearize.cpp index 24d06e18559..87c4db589cb 100644 --- a/src/goto-instrument/accelerate/linearize.cpp +++ b/src/goto-instrument/accelerate/linearize.cpp @@ -6,6 +6,9 @@ Author: Matt Lewis \*******************************************************************/ +/// \file +/// Loop Acceleration + #include "linearize.h" #include diff --git a/src/goto-instrument/accelerate/linearize.h b/src/goto-instrument/accelerate/linearize.h index 047937d0e76..90192ce1dfe 100644 --- a/src/goto-instrument/accelerate/linearize.h +++ b/src/goto-instrument/accelerate/linearize.h @@ -6,6 +6,9 @@ Author: Matt Lewis \*******************************************************************/ +/// \file +/// Loop Acceleration + #ifndef CPROVER_GOTO_INSTRUMENT_ACCELERATE_LINEARIZE_H #define CPROVER_GOTO_INSTRUMENT_ACCELERATE_LINEARIZE_H diff --git a/src/goto-instrument/accelerate/loop_acceleration.h b/src/goto-instrument/accelerate/loop_acceleration.h index 5cee315435a..67350ebf752 100644 --- a/src/goto-instrument/accelerate/loop_acceleration.h +++ b/src/goto-instrument/accelerate/loop_acceleration.h @@ -6,6 +6,9 @@ Author: Matt Lewis \*******************************************************************/ +/// \file +/// Loop Acceleration + #ifndef CPROVER_GOTO_INSTRUMENT_ACCELERATE_LOOP_ACCELERATION_H #define CPROVER_GOTO_INSTRUMENT_ACCELERATE_LOOP_ACCELERATION_H diff --git a/src/goto-instrument/accelerate/overflow_instrumenter.cpp b/src/goto-instrument/accelerate/overflow_instrumenter.cpp index 6e126aeb581..efe9c978429 100644 --- a/src/goto-instrument/accelerate/overflow_instrumenter.cpp +++ b/src/goto-instrument/accelerate/overflow_instrumenter.cpp @@ -6,6 +6,9 @@ Author: Matt Lewis \*******************************************************************/ +/// \file +/// Loop Acceleration + #include #include diff --git a/src/goto-instrument/accelerate/overflow_instrumenter.h b/src/goto-instrument/accelerate/overflow_instrumenter.h index 718cff5c054..a20cd823031 100644 --- a/src/goto-instrument/accelerate/overflow_instrumenter.h +++ b/src/goto-instrument/accelerate/overflow_instrumenter.h @@ -6,6 +6,9 @@ Author: Matt Lewis \*******************************************************************/ +/// \file +/// Loop Acceleration + #ifndef CPROVER_GOTO_INSTRUMENT_ACCELERATE_OVERFLOW_INSTRUMENTER_H #define CPROVER_GOTO_INSTRUMENT_ACCELERATE_OVERFLOW_INSTRUMENTER_H diff --git a/src/goto-instrument/accelerate/path.cpp b/src/goto-instrument/accelerate/path.cpp index b0e176c5213..effa48f7684 100644 --- a/src/goto-instrument/accelerate/path.cpp +++ b/src/goto-instrument/accelerate/path.cpp @@ -6,6 +6,9 @@ Author: Matt Lewis \*******************************************************************/ +/// \file +/// Loop Acceleration + #include #include diff --git a/src/goto-instrument/accelerate/path.h b/src/goto-instrument/accelerate/path.h index dc7249b3dc9..7dae7fcf989 100644 --- a/src/goto-instrument/accelerate/path.h +++ b/src/goto-instrument/accelerate/path.h @@ -6,6 +6,9 @@ Author: Matt Lewis \*******************************************************************/ +/// \file +/// Loop Acceleration + #ifndef CPROVER_GOTO_INSTRUMENT_ACCELERATE_PATH_H #define CPROVER_GOTO_INSTRUMENT_ACCELERATE_PATH_H diff --git a/src/goto-instrument/accelerate/path_acceleration.h b/src/goto-instrument/accelerate/path_acceleration.h index 60898789349..868dc3c6602 100644 --- a/src/goto-instrument/accelerate/path_acceleration.h +++ b/src/goto-instrument/accelerate/path_acceleration.h @@ -6,6 +6,9 @@ Author: Matt Lewis \*******************************************************************/ +/// \file +/// Loop Acceleration + #ifndef CPROVER_GOTO_INSTRUMENT_ACCELERATE_PATH_ACCELERATION_H #define CPROVER_GOTO_INSTRUMENT_ACCELERATE_PATH_ACCELERATION_H diff --git a/src/goto-instrument/accelerate/path_enumerator.h b/src/goto-instrument/accelerate/path_enumerator.h index 417d32d01e4..8afe105272c 100644 --- a/src/goto-instrument/accelerate/path_enumerator.h +++ b/src/goto-instrument/accelerate/path_enumerator.h @@ -6,6 +6,9 @@ Author: Matt Lewis \*******************************************************************/ +/// \file +/// Loop Acceleration + #ifndef CPROVER_GOTO_INSTRUMENT_ACCELERATE_PATH_ENUMERATOR_H #define CPROVER_GOTO_INSTRUMENT_ACCELERATE_PATH_ENUMERATOR_H diff --git a/src/goto-instrument/accelerate/polynomial.cpp b/src/goto-instrument/accelerate/polynomial.cpp index 3e51f25325c..b37cfaafe82 100644 --- a/src/goto-instrument/accelerate/polynomial.cpp +++ b/src/goto-instrument/accelerate/polynomial.cpp @@ -6,6 +6,9 @@ Author: Matt Lewis \*******************************************************************/ +/// \file +/// Loop Acceleration + #include #include diff --git a/src/goto-instrument/accelerate/polynomial.h b/src/goto-instrument/accelerate/polynomial.h index 2e60953f02a..ac8ceb05034 100644 --- a/src/goto-instrument/accelerate/polynomial.h +++ b/src/goto-instrument/accelerate/polynomial.h @@ -6,6 +6,9 @@ Author: Matt Lewis \*******************************************************************/ +/// \file +/// Loop Acceleration + #ifndef CPROVER_GOTO_INSTRUMENT_ACCELERATE_POLYNOMIAL_H #define CPROVER_GOTO_INSTRUMENT_ACCELERATE_POLYNOMIAL_H diff --git a/src/goto-instrument/accelerate/polynomial_accelerator.cpp b/src/goto-instrument/accelerate/polynomial_accelerator.cpp index ccf24d6e475..8df57513d1e 100644 --- a/src/goto-instrument/accelerate/polynomial_accelerator.cpp +++ b/src/goto-instrument/accelerate/polynomial_accelerator.cpp @@ -6,6 +6,9 @@ Author: Matt Lewis \*******************************************************************/ +/// \file +/// Loop Acceleration + #include #include #include diff --git a/src/goto-instrument/accelerate/polynomial_accelerator.h b/src/goto-instrument/accelerate/polynomial_accelerator.h index b75b7fcae6f..7530b66b849 100644 --- a/src/goto-instrument/accelerate/polynomial_accelerator.h +++ b/src/goto-instrument/accelerate/polynomial_accelerator.h @@ -6,6 +6,9 @@ Author: Matt Lewis \*******************************************************************/ +/// \file +/// Loop Acceleration + #ifndef CPROVER_GOTO_INSTRUMENT_ACCELERATE_POLYNOMIAL_ACCELERATOR_H #define CPROVER_GOTO_INSTRUMENT_ACCELERATE_POLYNOMIAL_ACCELERATOR_H diff --git a/src/goto-instrument/accelerate/sat_path_enumerator.cpp b/src/goto-instrument/accelerate/sat_path_enumerator.cpp index 2a64a2d5949..505a281f73f 100644 --- a/src/goto-instrument/accelerate/sat_path_enumerator.cpp +++ b/src/goto-instrument/accelerate/sat_path_enumerator.cpp @@ -6,6 +6,9 @@ Author: Matt Lewis \*******************************************************************/ +/// \file +/// Loop Acceleration + #include #include #include diff --git a/src/goto-instrument/accelerate/sat_path_enumerator.h b/src/goto-instrument/accelerate/sat_path_enumerator.h index 61998bc3420..c8b8b1747e9 100644 --- a/src/goto-instrument/accelerate/sat_path_enumerator.h +++ b/src/goto-instrument/accelerate/sat_path_enumerator.h @@ -6,6 +6,9 @@ Author: Matt Lewis \*******************************************************************/ +/// \file +/// Loop Acceleration + #ifndef CPROVER_GOTO_INSTRUMENT_ACCELERATE_SAT_PATH_ENUMERATOR_H #define CPROVER_GOTO_INSTRUMENT_ACCELERATE_SAT_PATH_ENUMERATOR_H diff --git a/src/goto-instrument/accelerate/scratch_program.cpp b/src/goto-instrument/accelerate/scratch_program.cpp index c09410eb77d..93c16f88489 100644 --- a/src/goto-instrument/accelerate/scratch_program.cpp +++ b/src/goto-instrument/accelerate/scratch_program.cpp @@ -6,6 +6,9 @@ Author: Matt Lewis \*******************************************************************/ +/// \file +/// Loop Acceleration + #include #include diff --git a/src/goto-instrument/accelerate/scratch_program.h b/src/goto-instrument/accelerate/scratch_program.h index 2523a3184e3..da860f39e1a 100644 --- a/src/goto-instrument/accelerate/scratch_program.h +++ b/src/goto-instrument/accelerate/scratch_program.h @@ -6,6 +6,9 @@ Author: Matt Lewis \*******************************************************************/ +/// \file +/// Loop Acceleration + #ifndef CPROVER_GOTO_INSTRUMENT_ACCELERATE_SCRATCH_PROGRAM_H #define CPROVER_GOTO_INSTRUMENT_ACCELERATE_SCRATCH_PROGRAM_H diff --git a/src/goto-instrument/accelerate/subsumed.h b/src/goto-instrument/accelerate/subsumed.h index bcc30cdbc5e..abd2daea6f7 100644 --- a/src/goto-instrument/accelerate/subsumed.h +++ b/src/goto-instrument/accelerate/subsumed.h @@ -6,6 +6,9 @@ Author: Matt Lewis \*******************************************************************/ +/// \file +/// Loop Acceleration + #ifndef CPROVER_GOTO_INSTRUMENT_ACCELERATE_SUBSUMED_H #define CPROVER_GOTO_INSTRUMENT_ACCELERATE_SUBSUMED_H diff --git a/src/goto-instrument/accelerate/trace_automaton.cpp b/src/goto-instrument/accelerate/trace_automaton.cpp index 086b1be7d31..6dbef396249 100644 --- a/src/goto-instrument/accelerate/trace_automaton.cpp +++ b/src/goto-instrument/accelerate/trace_automaton.cpp @@ -6,6 +6,9 @@ Author: Matt Lewis \*******************************************************************/ +/// \file +/// Loop Acceleration + #include #include diff --git a/src/goto-instrument/accelerate/trace_automaton.h b/src/goto-instrument/accelerate/trace_automaton.h index 5aa57841b3c..6536193fb1d 100644 --- a/src/goto-instrument/accelerate/trace_automaton.h +++ b/src/goto-instrument/accelerate/trace_automaton.h @@ -6,6 +6,9 @@ Author: Matt Lewis \*******************************************************************/ +/// \file +/// Loop Acceleration + #ifndef CPROVER_GOTO_INSTRUMENT_ACCELERATE_TRACE_AUTOMATON_H #define CPROVER_GOTO_INSTRUMENT_ACCELERATE_TRACE_AUTOMATON_H diff --git a/src/goto-instrument/accelerate/util.cpp b/src/goto-instrument/accelerate/util.cpp index 6ebd487c277..7075d92558e 100644 --- a/src/goto-instrument/accelerate/util.cpp +++ b/src/goto-instrument/accelerate/util.cpp @@ -6,6 +6,9 @@ Author: Matt Lewis \*******************************************************************/ +/// \file +/// Loop Acceleration + #include #include diff --git a/src/goto-instrument/accelerate/util.h b/src/goto-instrument/accelerate/util.h index 26c3eea0424..768a1b1bfe9 100644 --- a/src/goto-instrument/accelerate/util.h +++ b/src/goto-instrument/accelerate/util.h @@ -6,6 +6,9 @@ Author: Matt Lewis \*******************************************************************/ +/// \file +/// Loop Acceleration + #ifndef CPROVER_GOTO_INSTRUMENT_ACCELERATE_UTIL_H #define CPROVER_GOTO_INSTRUMENT_ACCELERATE_UTIL_H diff --git a/src/goto-instrument/alignment_checks.cpp b/src/goto-instrument/alignment_checks.cpp index 1418982cd8d..a2bb369a04f 100644 --- a/src/goto-instrument/alignment_checks.cpp +++ b/src/goto-instrument/alignment_checks.cpp @@ -6,24 +6,15 @@ Module: Alignment Checks \*******************************************************************/ +/// \file +/// Alignment Checks + #include #include #include #include "alignment_checks.h" -/*******************************************************************\ - -Function: print_struct_alignment_problems - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void print_struct_alignment_problems( const symbol_tablet &symbol_table, std::ostream &out) diff --git a/src/goto-instrument/alignment_checks.h b/src/goto-instrument/alignment_checks.h index 37324939844..43362cb95f8 100644 --- a/src/goto-instrument/alignment_checks.h +++ b/src/goto-instrument/alignment_checks.h @@ -6,6 +6,9 @@ Module: Alignment Checks \*******************************************************************/ +/// \file +/// Alignment Checks + #ifndef CPROVER_GOTO_INSTRUMENT_ALIGNMENT_CHECKS_H #define CPROVER_GOTO_INSTRUMENT_ALIGNMENT_CHECKS_H diff --git a/src/goto-instrument/branch.cpp b/src/goto-instrument/branch.cpp index 6bd6c64c72a..689a9f48432 100644 --- a/src/goto-instrument/branch.cpp +++ b/src/goto-instrument/branch.cpp @@ -6,24 +6,15 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Branch Instrumentation + #include #include #include "function.h" #include "branch.h" -/*******************************************************************\ - -Function: branch - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void branch( symbol_tablet &symbol_table, goto_functionst &goto_functions, diff --git a/src/goto-instrument/branch.h b/src/goto-instrument/branch.h index acb014b1d93..842f3092b7a 100644 --- a/src/goto-instrument/branch.h +++ b/src/goto-instrument/branch.h @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Branch Instrumentation + #ifndef CPROVER_GOTO_INSTRUMENT_BRANCH_H #define CPROVER_GOTO_INSTRUMENT_BRANCH_H diff --git a/src/goto-instrument/call_sequences.cpp b/src/goto-instrument/call_sequences.cpp index d8c651bd1a7..8a0ebddf4ed 100644 --- a/src/goto-instrument/call_sequences.cpp +++ b/src/goto-instrument/call_sequences.cpp @@ -8,6 +8,9 @@ Date: April 2013 \*******************************************************************/ +/// \file +/// Printing function call sequences for Ofer + #include #include #include @@ -17,18 +20,6 @@ Date: April 2013 #include "call_sequences.h" -/*******************************************************************\ - -Function: show_call_sequences - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void show_call_sequences( const irep_idt &function, const goto_programt &goto_program, @@ -70,18 +61,6 @@ void show_call_sequences( } } -/*******************************************************************\ - -Function: show_call_sequences - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void show_call_sequences( const irep_idt &function, const goto_programt &goto_program) @@ -118,18 +97,6 @@ void show_call_sequences( std::cout << std::endl; } -/*******************************************************************\ - -Function: show_call_sequences - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void show_call_sequences(const goto_functionst &goto_functions) { // do per function @@ -138,18 +105,6 @@ void show_call_sequences(const goto_functionst &goto_functions) show_call_sequences(f_it->first, f_it->second.body); } -/*******************************************************************\ - -Function: check_call_sequence - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - class check_call_sequencet { public: @@ -326,18 +281,6 @@ void check_call_sequencet::operator()() std::cout << "sequence not feasible\n"; } -/*******************************************************************\ - -Function: check_call_sequence - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void check_call_sequence(const goto_functionst &goto_functions) { // read the sequence from stdin @@ -357,18 +300,6 @@ void check_call_sequence(const goto_functionst &goto_functions) check_call_sequencet(goto_functions, sequence)(); } -/*******************************************************************\ - -Function: list_calls_and_arguments - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - static void list_calls_and_arguments( const namespacet &ns, const irep_idt &function, @@ -415,18 +346,6 @@ static void list_calls_and_arguments( } } -/*******************************************************************\ - -Function: show_call_sequences - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void list_calls_and_arguments( const namespacet &ns, const goto_functionst &goto_functions) diff --git a/src/goto-instrument/call_sequences.h b/src/goto-instrument/call_sequences.h index ecfc5921ef8..7d432ddbb4b 100644 --- a/src/goto-instrument/call_sequences.h +++ b/src/goto-instrument/call_sequences.h @@ -8,6 +8,9 @@ Date: September 2011 \*******************************************************************/ +/// \file +/// Memory-mapped I/O Instrumentation for Goto Programs + #ifndef CPROVER_GOTO_INSTRUMENT_CALL_SEQUENCES_H #define CPROVER_GOTO_INSTRUMENT_CALL_SEQUENCES_H diff --git a/src/goto-instrument/code_contracts.cpp b/src/goto-instrument/code_contracts.cpp index 46914d78fb0..963c90ef968 100644 --- a/src/goto-instrument/code_contracts.cpp +++ b/src/goto-instrument/code_contracts.cpp @@ -8,6 +8,9 @@ Date: February 2016 \*******************************************************************/ +/// \file +/// Verify and use annotated invariants and pre/post-conditions + #include #include #include @@ -59,18 +62,6 @@ class code_contractst const source_locationt &source_location); }; -/*******************************************************************\ - -Function: check_apply_invariants - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - static void check_apply_invariants( goto_functionst::goto_functiont &goto_function, const local_may_aliast &local_may_alias, @@ -169,18 +160,6 @@ static void check_apply_invariants( loop_end->guard.make_not(); } -/*******************************************************************\ - -Function: code_contractst::apply_contract - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void code_contractst::apply_contract( goto_programt &goto_program, goto_programt::targett target) @@ -241,18 +220,6 @@ void code_contractst::apply_contract( summarized.insert(function); } -/*******************************************************************\ - -Function: code_contractst::code_contracts - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void code_contractst::code_contracts( goto_functionst::goto_functiont &goto_function) { @@ -276,18 +243,6 @@ void code_contractst::code_contracts( apply_contract(goto_function.body, it); } -/*******************************************************************\ - -Function: code_contractst::new_tmp_symbol - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - const symbolt &code_contractst::new_tmp_symbol( const typet &type, const source_locationt &source_location) @@ -301,18 +256,6 @@ const symbolt &code_contractst::new_tmp_symbol( symbol_table); } -/*******************************************************************\ - -Function: code_contractst::add_contract_check - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void code_contractst::add_contract_check( const irep_idt &function, goto_programt &dest) @@ -436,18 +379,6 @@ void code_contractst::add_contract_check( dest.destructive_insert(dest.instructions.begin(), check); } -/*******************************************************************\ - -Function: code_contractst::operator() - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void code_contractst::operator()() { Forall_goto_functions(it, goto_functions) @@ -468,18 +399,6 @@ void code_contractst::operator()() goto_functions.update(); } -/*******************************************************************\ - -Function: code_contracts - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void code_contracts( symbol_tablet &symbol_table, goto_functionst &goto_functions) diff --git a/src/goto-instrument/code_contracts.h b/src/goto-instrument/code_contracts.h index 8886bd29545..006f4702480 100644 --- a/src/goto-instrument/code_contracts.h +++ b/src/goto-instrument/code_contracts.h @@ -8,6 +8,9 @@ Date: February 2016 \*******************************************************************/ +/// \file +/// Verify and use annotated invariants and pre/post-conditions + #ifndef CPROVER_GOTO_INSTRUMENT_CODE_CONTRACTS_H #define CPROVER_GOTO_INSTRUMENT_CODE_CONTRACTS_H diff --git a/src/goto-instrument/concurrency.cpp b/src/goto-instrument/concurrency.cpp index 69a6813a013..e04ff9c8695 100644 --- a/src/goto-instrument/concurrency.cpp +++ b/src/goto-instrument/concurrency.cpp @@ -8,6 +8,9 @@ Date: October 2012 \*******************************************************************/ +/// \file +/// Encoding for Threaded Goto Programs + #include #include #include @@ -73,18 +76,6 @@ class concurrency_instrumentationt thread_local_varst thread_local_vars; }; -/*******************************************************************\ - -Function: concurrency_instrumentationt::instrument - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void concurrency_instrumentationt::instrument(exprt &expr) { std::set symbols; @@ -118,18 +109,6 @@ void concurrency_instrumentationt::instrument(exprt &expr) } } -/*******************************************************************\ - -Function: concurrency_instrumentationt::instrument - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void concurrency_instrumentationt::instrument( goto_programt &goto_program, const is_threadedt &is_threaded) @@ -158,18 +137,6 @@ void concurrency_instrumentationt::instrument( } } -/*******************************************************************\ - -Function: concurrency_instrumentationt::collect - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void concurrency_instrumentationt::collect(const exprt &expr) { std::set symbols; @@ -212,18 +179,6 @@ void concurrency_instrumentationt::collect(const exprt &expr) } } -/*******************************************************************\ - -Function: concurrency_instrumentationt::collect - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void concurrency_instrumentationt::collect( const goto_programt &goto_program, const is_threadedt &is_threaded) @@ -242,35 +197,11 @@ void concurrency_instrumentationt::collect( } } -/*******************************************************************\ - -Function: concurrency_instrumentationt::add_array_symbols - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void concurrency_instrumentationt::add_array_symbols() { // for( } -/*******************************************************************\ - -Function: concurrency_instrumentationt::instrument - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void concurrency_instrumentationt::instrument( goto_functionst &goto_functions) { @@ -289,18 +220,6 @@ void concurrency_instrumentationt::instrument( instrument(f_it->second.body, is_threaded); } -/*******************************************************************\ - -Function: concurrency - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void concurrency( value_setst &value_sets, class symbol_tablet &symbol_table, diff --git a/src/goto-instrument/concurrency.h b/src/goto-instrument/concurrency.h index e751a62f3d4..cf09d4da68b 100644 --- a/src/goto-instrument/concurrency.h +++ b/src/goto-instrument/concurrency.h @@ -8,6 +8,9 @@ Date: February 2006 \*******************************************************************/ +/// \file +/// Encoding for Threaded Goto Programs + #ifndef CPROVER_GOTO_INSTRUMENT_CONCURRENCY_H #define CPROVER_GOTO_INSTRUMENT_CONCURRENCY_H diff --git a/src/goto-instrument/count_eloc.cpp b/src/goto-instrument/count_eloc.cpp index a54bc11f2ad..d986d335e9f 100644 --- a/src/goto-instrument/count_eloc.cpp +++ b/src/goto-instrument/count_eloc.cpp @@ -8,6 +8,9 @@ Date: December 2012 \*******************************************************************/ +/// \file +/// Count effective lines of code + #include #include @@ -22,18 +25,6 @@ typedef std::unordered_set linest; typedef std::unordered_map filest; typedef std::unordered_map working_dirst; -/*******************************************************************\ - -Function: collect_eloc - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - static void collect_eloc( const goto_functionst &goto_functions, working_dirst &dest) @@ -52,18 +43,6 @@ static void collect_eloc( } } -/*******************************************************************\ - -Function: count_eloc - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void count_eloc(const goto_functionst &goto_functions) { std::size_t eloc=0; @@ -78,18 +57,6 @@ void count_eloc(const goto_functionst &goto_functions) std::cout << "Effective lines of code: " << eloc << '\n'; } -/*******************************************************************\ - -Function: list_eloc - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void list_eloc(const goto_functionst &goto_functions) { working_dirst eloc_map; @@ -107,18 +74,6 @@ void list_eloc(const goto_functionst &goto_functions) } } -/*******************************************************************\ - -Function: print_path_lengths - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void print_path_lengths(const goto_functionst &goto_functions) { const irep_idt &entry_point=goto_functions.entry_point(); diff --git a/src/goto-instrument/count_eloc.h b/src/goto-instrument/count_eloc.h index 87c1dea18ef..38760038836 100644 --- a/src/goto-instrument/count_eloc.h +++ b/src/goto-instrument/count_eloc.h @@ -8,6 +8,9 @@ Date: December 2012 \*******************************************************************/ +/// \file +/// Count effective lines of code + #ifndef CPROVER_GOTO_INSTRUMENT_COUNT_ELOC_H #define CPROVER_GOTO_INSTRUMENT_COUNT_ELOC_H diff --git a/src/goto-instrument/cover.cpp b/src/goto-instrument/cover.cpp index c3c5e0a5c06..a7c37f959ae 100644 --- a/src/goto-instrument/cover.cpp +++ b/src/goto-instrument/cover.cpp @@ -8,6 +8,9 @@ Date: May 2016 \*******************************************************************/ +/// \file +/// Coverage Instrumentation + #include #include #include @@ -101,18 +104,6 @@ class basic_blockst } }; -/*******************************************************************\ - -Function: coverage_goalst::get_coverage - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool coverage_goalst::get_coverage_goals( const std::string &coverage_file, message_handlert &message_handler, @@ -165,35 +156,11 @@ bool coverage_goalst::get_coverage_goals( return false; } -/*******************************************************************\ - -Function: coverage_goalst::add_goal - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void coverage_goalst::add_goal(source_locationt goal) { existing_goals.push_back(goal); } -/*******************************************************************\ - -Function: coverage_goalst::is_existing_goal - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool coverage_goalst::is_existing_goal(source_locationt source_location) const { for(const auto &existing_loc : existing_goals) @@ -206,18 +173,6 @@ bool coverage_goalst::is_existing_goal(source_locationt source_location) const return false; } -/*******************************************************************\ - -Function: as_string - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - const char *as_string(coverage_criteriont c) { switch(c) @@ -234,18 +189,6 @@ const char *as_string(coverage_criteriont c) } } -/*******************************************************************\ - -Function: is_condition - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool is_condition(const exprt &src) { if(src.type().id()!=ID_bool) @@ -259,18 +202,6 @@ bool is_condition(const exprt &src) return true; } -/*******************************************************************\ - -Function: collect_conditions_rec - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void collect_conditions_rec(const exprt &src, std::set &dest) { if(src.id()==ID_address_of) @@ -285,18 +216,6 @@ void collect_conditions_rec(const exprt &src, std::set &dest) dest.insert(src); } -/*******************************************************************\ - -Function: collect_conditions - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::set collect_conditions(const exprt &src) { std::set result; @@ -304,18 +223,6 @@ std::set collect_conditions(const exprt &src) return result; } -/*******************************************************************\ - -Function: collect_conditions - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::set collect_conditions(const goto_programt::const_targett t) { switch(t->type) @@ -336,18 +243,6 @@ std::set collect_conditions(const goto_programt::const_targett t) return std::set(); } -/*******************************************************************\ - -Function: collect_operands - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void collect_operands(const exprt &src, std::vector &dest) { for(const exprt &op : src.operands()) @@ -359,19 +254,7 @@ void collect_operands(const exprt &src, std::vector &dest) } } -/*******************************************************************\ - -Function: collect_mcdc_controlling_rec - - Inputs: - - Outputs: - - Purpose: To recursively collect controlling exprs for - for mcdc coverage. - -\*******************************************************************/ - +/// To recursively collect controlling exprs for for mcdc coverage. void collect_mcdc_controlling_rec( const exprt &src, const std::vector &conditions, @@ -482,18 +365,6 @@ void collect_mcdc_controlling_rec( } } -/*******************************************************************\ - -Function: collect_mcdc_controlling - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::set collect_mcdc_controlling( const std::set &decisions) { @@ -505,19 +376,8 @@ std::set collect_mcdc_controlling( return result; } -/*******************************************************************\ - -Function: replacement_conjunction - - Inputs: - - Outputs: - - Purpose: To replace the i-th expr of ''operands'' with each - expr inside ''replacement_exprs''. - -\*******************************************************************/ - +/// To replace the i-th expr of ''operands'' with each expr inside +/// ''replacement_exprs''. std::set replacement_conjunction( const std::set &replacement_exprs, const std::vector &operands, @@ -538,20 +398,8 @@ std::set replacement_conjunction( return result; } -/*******************************************************************\ - -Function: collect_mcdc_controlling_nested - - Inputs: - - Outputs: - - Purpose: This nested method iteratively applies - ''collect_mcdc_controlling'' to every non-atomic expr - within a decision - -\*******************************************************************/ - +/// This nested method iteratively applies ''collect_mcdc_controlling'' to every +/// non-atomic expr within a decision std::set collect_mcdc_controlling_nested( const std::set &decisions) { @@ -645,20 +493,10 @@ std::set collect_mcdc_controlling_nested( return result; } -/*******************************************************************\ - -Function: sign_of_expr - - Inputs: E should be the pre-processed output by - ''collect_mcdc_controlling_nested'' - - Outputs: +1 : not negated - -1 : negated - - Purpose: The sign of expr ''e'' within the super-expr ''E'' - -\*******************************************************************/ - +/// The sign of expr ''e'' within the super-expr ''E'' +/// \par parameters: E should be the pre-processed output by +/// ''collect_mcdc_controlling_nested'' +/// \return +1 : not negated -1 : negated std::set sign_of_expr(const exprt &e, const exprt &E) { std::set signs; @@ -713,21 +551,9 @@ std::set sign_of_expr(const exprt &e, const exprt &E) return signs; } -/*******************************************************************\ - -Function: remove_repetition - - Inputs: - - Outputs: - - Purpose: After the ''collect_mcdc_controlling_nested'', there - can be the recurrence of the same expr in the resulted - set of exprs, and this method will remove the - repetitive ones. - -\*******************************************************************/ - +/// After the ''collect_mcdc_controlling_nested'', there can be the recurrence +/// of the same expr in the resulted set of exprs, and this method will remove +/// the repetitive ones. void remove_repetition(std::set &exprs) { // to obtain the set of atomic conditions @@ -814,19 +640,7 @@ void remove_repetition(std::set &exprs) exprs=new_exprs; } -/*******************************************************************\ - -Function: eval_expr - - Inputs: - - Outputs: - - Purpose: To evaluate the value of expr ''src'', according to - the atomic expr values - -\*******************************************************************/ - +/// To evaluate the value of expr ''src'', according to the atomic expr values bool eval_expr( const std::map &atomic_exprs, const exprt &src) @@ -873,18 +687,7 @@ bool eval_expr( } } -/*******************************************************************\ - -Function: values_of_atomic_exprs - - Inputs: - - Outputs: - - Purpose: To obtain values of atomic exprs within the super expr - -\*******************************************************************/ - +/// To obtain values of atomic exprs within the super expr std::map values_of_atomic_exprs( const exprt &e, const std::set &conditions) @@ -909,22 +712,10 @@ std::map values_of_atomic_exprs( return atomic_exprs; } -/*******************************************************************\ - -Function: is_mcdc_pair - - Inputs: - - Outputs: - - Purpose: To check if the two input controlling exprs are mcdc - pairs regarding an atomic expr ''c''. A mcdc pair of - (e1, e2) regarding ''c'' means that ''e1'' and ''e2'' - result in different ''decision'' values, and this is - caused by the different choice of ''c'' value. - -\*******************************************************************/ - +/// To check if the two input controlling exprs are mcdc pairs regarding an +/// atomic expr ''c''. A mcdc pair of (e1, e2) regarding ''c'' means that ''e1'' +/// and ''e2'' result in different ''decision'' values, and this is caused by +/// the different choice of ''c'' value. bool is_mcdc_pair( const exprt &e1, const exprt &e2, @@ -985,19 +776,8 @@ bool is_mcdc_pair( return false; } -/*******************************************************************\ - -Function: has_mcdc_pair - - Inputs: - - Outputs: - - Purpose: To check if we can find the mcdc pair of the - input ''expr_set'' regarding the atomic expr ''c'' - -\*******************************************************************/ - +/// To check if we can find the mcdc pair of the input ''expr_set'' regarding +/// the atomic expr ''c'' bool has_mcdc_pair( const exprt &c, const std::set &expr_set, @@ -1017,24 +797,12 @@ bool has_mcdc_pair( return false; } -/*******************************************************************\ - -Function: minimize_mcdc_controlling - - Inputs: The input ''controlling'' should have been processed by - ''collect_mcdc_controlling_nested'' - and - ''remove_repetition'' - - Outputs: - - Purpose: This method minimizes the controlling conditions for - mcdc coverage. The minimum is in a sense that by deleting - any controlling condition in the set, the mcdc coverage - for the decision will be not complete. - -\*******************************************************************/ - +/// This method minimizes the controlling conditions for mcdc coverage. The +/// minimum is in a sense that by deleting any controlling condition in the set, +/// the mcdc coverage for the decision will be not complete. +/// \par parameters: The input ''controlling'' should have been processed by +/// ''collect_mcdc_controlling_nested'' and +/// ''remove_repetition'' void minimize_mcdc_controlling( std::set &controlling, const exprt &decision) @@ -1112,18 +880,6 @@ void minimize_mcdc_controlling( } } -/*******************************************************************\ - -Function: collect_decisions_rec - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void collect_decisions_rec(const exprt &src, std::set &dest) { if(src.id()==ID_address_of) @@ -1153,18 +909,6 @@ void collect_decisions_rec(const exprt &src, std::set &dest) } } -/*******************************************************************\ - -Function: collect_decisions - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::set collect_decisions(const exprt &src) { std::set result; @@ -1172,18 +916,6 @@ std::set collect_decisions(const exprt &src) return result; } -/*******************************************************************\ - -Function: collect_decisions - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::set collect_decisions(const goto_programt::const_targett t) { switch(t->type) @@ -1204,18 +936,6 @@ std::set collect_decisions(const goto_programt::const_targett t) return std::set(); } -/*******************************************************************\ - -Function: instrument_cover_goals - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void instrument_cover_goals( const symbol_tablet &symbol_table, goto_programt &goto_program, @@ -1232,21 +952,10 @@ void instrument_cover_goals( false); } -/*******************************************************************\ - -Function: program_is_trivial - - Inputs: Program `goto_program` - - Outputs: Returns true if trivial - - Purpose: Call a goto_program trivial unless it has: - * Any declarations - * At least 2 branches - * At least 5 assignments - -\*******************************************************************/ - +/// Call a goto_program trivial unless it has: * Any declarations * At least 2 +/// branches * At least 5 assignments +/// \par parameters: Program `goto_program` +/// \return Returns true if trivial bool program_is_trivial(const goto_programt &goto_program) { unsigned long count_assignments=0, count_goto=0; @@ -1269,18 +978,6 @@ bool program_is_trivial(const goto_programt &goto_program) return true; } -/*******************************************************************\ - -Function: instrument_cover_goals - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void instrument_cover_goals( const symbol_tablet &symbol_table, goto_programt &goto_program, @@ -1625,18 +1322,6 @@ void instrument_cover_goals( } } -/*******************************************************************\ - -Function: instrument_cover_goals - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void instrument_cover_goals( const symbol_tablet &symbol_table, goto_functionst &goto_functions, @@ -1662,18 +1347,6 @@ void instrument_cover_goals( } } -/*******************************************************************\ - -Function: instrument_cover_goals - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void instrument_cover_goals( const symbol_tablet &symbol_table, goto_functionst &goto_functions, @@ -1691,18 +1364,6 @@ void instrument_cover_goals( false); } -/*******************************************************************\ - -Function: instrument_cover_goals - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool instrument_cover_goals( const cmdlinet &cmdline, const symbol_tablet &symbol_table, diff --git a/src/goto-instrument/cover.h b/src/goto-instrument/cover.h index 28d057ea43a..06fc0ede321 100644 --- a/src/goto-instrument/cover.h +++ b/src/goto-instrument/cover.h @@ -8,6 +8,9 @@ Date: May 2016 \*******************************************************************/ +/// \file +/// Coverage Instrumentation + #ifndef CPROVER_GOTO_INSTRUMENT_COVER_H #define CPROVER_GOTO_INSTRUMENT_COVER_H diff --git a/src/goto-instrument/document_properties.cpp b/src/goto-instrument/document_properties.cpp index 183caa6fdb9..4e0a07f89f2 100644 --- a/src/goto-instrument/document_properties.cpp +++ b/src/goto-instrument/document_properties.cpp @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Subgoal Documentation + #include #include @@ -65,18 +68,6 @@ class document_propertiest void doit(); }; -/*******************************************************************\ - -Function: document_propertiest::strip_space - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void document_propertiest::strip_space(std::list &lines) { unsigned strip=50; @@ -106,18 +97,6 @@ void document_propertiest::strip_space(std::list &lines) } } -/*******************************************************************\ - -Function: escape_latex - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string escape_latex(const std::string &s, bool alltt) { std::string dest; @@ -139,18 +118,6 @@ std::string escape_latex(const std::string &s, bool alltt) return dest; } -/*******************************************************************\ - -Function: escape_html - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string escape_html(const std::string &s) { std::string dest; @@ -169,18 +136,6 @@ std::string escape_html(const std::string &s) return dest; } -/*******************************************************************\ - -Function: is_empty - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool is_empty(const std::string &s) { for(unsigned i=0; i claim_sett; @@ -428,18 +359,6 @@ void document_propertiest::doit() } } -/*******************************************************************\ - -Function: document_properties_html - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void document_properties_html( const goto_functionst &goto_functions, std::ostream &out) @@ -447,18 +366,6 @@ void document_properties_html( document_propertiest(goto_functions, out).html(); } -/*******************************************************************\ - -Function: document_properties_latex - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void document_properties_latex( const goto_functionst &goto_functions, std::ostream &out) diff --git a/src/goto-instrument/document_properties.h b/src/goto-instrument/document_properties.h index deeae63b645..35406ae2f30 100644 --- a/src/goto-instrument/document_properties.h +++ b/src/goto-instrument/document_properties.h @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Documentation of Properties + #ifndef CPROVER_GOTO_INSTRUMENT_DOCUMENT_PROPERTIES_H #define CPROVER_GOTO_INSTRUMENT_DOCUMENT_PROPERTIES_H diff --git a/src/goto-instrument/dot.cpp b/src/goto-instrument/dot.cpp index 455381c4c51..4f56ca26337 100644 --- a/src/goto-instrument/dot.cpp +++ b/src/goto-instrument/dot.cpp @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Dump Goto-Program as DOT Graph + #include #include #include @@ -62,19 +65,10 @@ class dott std::set &); }; -/*******************************************************************\ - -Function: dott::write_dot_subgraph - - Inputs: output stream, name and goto program - - Outputs: true on error, false otherwise - - Purpose: writes the dot graph that corresponds to the goto program - to the output stream. - -\*******************************************************************/ - +/// writes the dot graph that corresponds to the goto program to the output +/// stream. +/// \par parameters: output stream, name and goto program +/// \return true on error, false otherwise void dott::write_dot_subgraph( std::ostream &out, const std::string &name, @@ -226,18 +220,6 @@ void dott::write_dot_subgraph( subgraphscount++; } -/*******************************************************************\ - -Function: dott::do_dot_function_calls - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void dott::do_dot_function_calls( std::ostream &out) { @@ -277,18 +259,6 @@ void dott::do_dot_function_calls( } } -/*******************************************************************\ - -Function: dott::output - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void dott::output(std::ostream &out) { out << "digraph G {" << std::endl; @@ -305,19 +275,9 @@ void dott::output(std::ostream &out) out << "}" << std::endl; } -/*******************************************************************\ - -Function: dott::escape - - Inputs: a string - - Outputs: the escaped string - - Purpose: escapes a string. beware, this might not work for all - kinds of strings. - -\*******************************************************************/ - +/// escapes a string. beware, this might not work for all kinds of strings. +/// \par parameters: a string +/// \return the escaped string std::string &dott::escape(std::string &str) { for(std::string::size_type i=0; i #include @@ -24,36 +27,12 @@ Author: Daniel Kroening, kroening@kroening.com #include "dump_c.h" -/*******************************************************************\ - -Function: operator<< - -Inputs: - -Outputs: - -Purpose: - -\*******************************************************************/ - inline std::ostream &operator << (std::ostream &out, dump_ct &src) { src(out); return out; } -/*******************************************************************\ - -Function: dump_ct::operator() - -Inputs: - -Outputs: - -Purpose: - -\*******************************************************************/ - void dump_ct::operator()(std::ostream &os) { std::stringstream func_decl_stream; @@ -295,18 +274,7 @@ void dump_ct::operator()(std::ostream &os) os << func_body_stream.str(); } -/*******************************************************************\ - -Function: dump_ct::convert_compound_declarations - -Inputs: - -Outputs: - -Purpose: declare compound types - -\*******************************************************************/ - +/// declare compound types void dump_ct::convert_compound_declaration( const symbolt &symbol, std::ostream &os_body) @@ -321,18 +289,6 @@ void dump_ct::convert_compound_declaration( convert_compound(symbol.type, symbol_typet(symbol.name), true, os_body); } -/*******************************************************************\ - -Function: dump_ct::convert_compound - -Inputs: - -Outputs: - -Purpose: - -\*******************************************************************/ - void dump_ct::convert_compound( const typet &type, const typet &unresolved, @@ -386,18 +342,6 @@ void dump_ct::convert_compound( convert_compound_enum(type, os); } -/*******************************************************************\ - -Function: dump_ct::convert_compound - -Inputs: - -Outputs: - -Purpose: - -\*******************************************************************/ - void dump_ct::convert_compound( const struct_union_typet &type, const typet &unresolved, @@ -554,18 +498,6 @@ void dump_ct::convert_compound( os << std::endl; } -/*******************************************************************\ - -Function: dump_ct::convert_compound_enum - -Inputs: - -Outputs: - -Purpose: - -\*******************************************************************/ - void dump_ct::convert_compound_enum( const typet &type, std::ostream &os) @@ -609,18 +541,6 @@ void dump_ct::convert_compound_enum( os << ";\n\n"; } -/*******************************************************************\ - -Function: dump_ct::cleanup_decl - -Inputs: - -Outputs: - -Purpose: - -\*******************************************************************/ - void dump_ct::cleanup_decl( code_declt &decl, std::list &local_static, @@ -661,18 +581,6 @@ void dump_ct::cleanup_decl( decl.swap(b.op0()); } -/*******************************************************************\ - -Function: dump_ct::convert_global_variables - -Inputs: - -Outputs: - -Purpose: - -\*******************************************************************/ - void dump_ct::convert_global_variable( const symbolt &symbol, std::ostream &os, @@ -736,18 +644,6 @@ void dump_ct::convert_global_variable( } } -/*******************************************************************\ - -Function: dump_ct::convert_function_declarations - -Inputs: - -Outputs: - -Purpose: - -\*******************************************************************/ - void dump_ct::convert_function_declaration( const symbolt &symbol, const bool skip_main, @@ -816,18 +712,6 @@ void dump_ct::convert_function_declaration( } } -/*******************************************************************\ - -Function: find_block_position_rec - -Inputs: - -Outputs: - -Purpose: - -\*******************************************************************/ - static bool find_block_position_rec( const irep_idt &identifier, codet &root, @@ -907,18 +791,6 @@ static bool find_block_position_rec( return false; } -/*******************************************************************\ - -Function: dump_ct::insert_local_static_decls - -Inputs: - -Outputs: - -Purpose: - -\*******************************************************************/ - void dump_ct::insert_local_static_decls( code_blockt &b, const std::list &local_static, @@ -953,18 +825,6 @@ void dump_ct::insert_local_static_decls( } } -/*******************************************************************\ - -Function: dump_ct::insert_local_type_decls - -Inputs: - -Outputs: - -Purpose: - -\*******************************************************************/ - void dump_ct::insert_local_type_decls( code_blockt &b, const std::list &type_decls) @@ -1002,18 +862,6 @@ void dump_ct::insert_local_type_decls( } } -/*******************************************************************\ - -Function: dump_ct::cleanup_expr - -Inputs: - -Outputs: - -Purpose: - -\*******************************************************************/ - void dump_ct::cleanup_expr(exprt &expr) { Forall_operands(it, expr) @@ -1161,18 +1009,6 @@ void dump_ct::cleanup_expr(exprt &expr) } } -/*******************************************************************\ - -Function: dump_ct::cleanup_type - -Inputs: - -Outputs: - -Purpose: - -\*******************************************************************/ - void dump_ct::cleanup_type(typet &type) { Forall_subtypes(it, type) @@ -1198,18 +1034,6 @@ void dump_ct::cleanup_type(typet &type) !type.get(ID_tag).empty()); } -/*******************************************************************\ - -Function: dump_ct::type_to_string - -Inputs: - -Outputs: - -Purpose: - -\*******************************************************************/ - std::string dump_ct::type_to_string(const typet &type) { std::string ret; @@ -1219,18 +1043,6 @@ std::string dump_ct::type_to_string(const typet &type) return ret; } -/*******************************************************************\ - -Function: dump_ct::expr_to_string - -Inputs: - -Outputs: - -Purpose: - -\*******************************************************************/ - std::string dump_ct::expr_to_string(const exprt &expr) { std::string ret; @@ -1240,18 +1052,6 @@ std::string dump_ct::expr_to_string(const exprt &expr) return ret; } -/*******************************************************************\ - -Function: dump_c - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void dump_c( const goto_functionst &src, const bool use_system_headers, @@ -1262,18 +1062,6 @@ void dump_c( out << goto2c; } -/*******************************************************************\ - -Function: dump_cpp - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void dump_cpp( const goto_functionst &src, const bool use_system_headers, diff --git a/src/goto-instrument/dump_c.h b/src/goto-instrument/dump_c.h index ff0efd496a6..263165aec97 100644 --- a/src/goto-instrument/dump_c.h +++ b/src/goto-instrument/dump_c.h @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Dump C from Goto Program + #ifndef CPROVER_GOTO_INSTRUMENT_DUMP_C_H #define CPROVER_GOTO_INSTRUMENT_DUMP_C_H diff --git a/src/goto-instrument/dump_c_class.h b/src/goto-instrument/dump_c_class.h index c8c77da5102..4f47cd4cad4 100644 --- a/src/goto-instrument/dump_c_class.h +++ b/src/goto-instrument/dump_c_class.h @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Dump Goto-Program as C/C++ Source + #ifndef CPROVER_GOTO_INSTRUMENT_DUMP_C_CLASS_H #define CPROVER_GOTO_INSTRUMENT_DUMP_C_CLASS_H diff --git a/src/goto-instrument/full_slicer.cpp b/src/goto-instrument/full_slicer.cpp index 887805ad80a..ca8de0f2cf7 100644 --- a/src/goto-instrument/full_slicer.cpp +++ b/src/goto-instrument/full_slicer.cpp @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Slicing + #include #include #ifdef DEBUG_FULL_SLICERT @@ -15,18 +18,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "full_slicer_class.h" -/*******************************************************************\ - -Function: full_slicert::add_dependencies - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void full_slicert::add_dependencies( const cfgt::nodet &node, queuet &queue, @@ -43,18 +34,6 @@ void full_slicert::add_dependencies( add_to_queue(queue, dep_node_to_cfg[it->first], node.PC); } -/*******************************************************************\ - -Function: full_slicert::add_dependencies - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void full_slicert::add_function_calls( const cfgt::nodet &node, queuet &queue, @@ -79,18 +58,6 @@ void full_slicert::add_function_calls( add_to_queue(queue, it->first, node.PC); } -/*******************************************************************\ - -Function: full_slicert::add_decl_dead - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void full_slicert::add_decl_dead( const cfgt::nodet &node, queuet &queue, @@ -122,18 +89,6 @@ void full_slicert::add_decl_dead( } } -/*******************************************************************\ - -Function: full_slicert::add_jumps - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void full_slicert::add_jumps( queuet &queue, jumpst &jumps, @@ -257,18 +212,6 @@ void full_slicert::add_jumps( } } -/*******************************************************************\ - -Function: full_slicert::fixedpoint - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void full_slicert::fixedpoint( goto_functionst &goto_functions, queuet &queue, @@ -318,18 +261,6 @@ void full_slicert::fixedpoint( } } -/*******************************************************************\ - -Function: implicit - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - static bool implicit(goto_programt::const_targett target) { // some variables are used during symbolic execution only @@ -350,18 +281,6 @@ static bool implicit(goto_programt::const_targett target) return s.get_identifier()==CPROVER_PREFIX "rounding_mode"; } -/*******************************************************************\ - -Function: full_slicert::operator() - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void full_slicert::operator()( goto_functionst &goto_functions, const namespacet &ns, @@ -446,18 +365,6 @@ void full_slicert::operator()( goto_functions.update(); } -/*******************************************************************\ - -Function: full_slicer - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void full_slicer( goto_functionst &goto_functions, const namespacet &ns, @@ -466,18 +373,6 @@ void full_slicer( full_slicert()(goto_functions, ns, criterion); } -/*******************************************************************\ - -Function: full_slicer - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void full_slicer( goto_functionst &goto_functions, const namespacet &ns) @@ -486,18 +381,6 @@ void full_slicer( full_slicert()(goto_functions, ns, a); } -/*******************************************************************\ - -Function: property_slicer - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void property_slicer( goto_functionst &goto_functions, const namespacet &ns, @@ -507,18 +390,6 @@ void property_slicer( full_slicert()(goto_functions, ns, p); } -/*******************************************************************\ - -Function: slicing_criteriont::~slicing_criteriont - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - slicing_criteriont::~slicing_criteriont() { } diff --git a/src/goto-instrument/full_slicer.h b/src/goto-instrument/full_slicer.h index d590025c8c4..9e39786c5a2 100644 --- a/src/goto-instrument/full_slicer.h +++ b/src/goto-instrument/full_slicer.h @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Slicing + #ifndef CPROVER_GOTO_INSTRUMENT_FULL_SLICER_H #define CPROVER_GOTO_INSTRUMENT_FULL_SLICER_H diff --git a/src/goto-instrument/full_slicer_class.h b/src/goto-instrument/full_slicer_class.h index 93894513f57..de1c50b54f4 100644 --- a/src/goto-instrument/full_slicer_class.h +++ b/src/goto-instrument/full_slicer_class.h @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Goto Program Slicing + #ifndef CPROVER_GOTO_INSTRUMENT_FULL_SLICER_CLASS_H #define CPROVER_GOTO_INSTRUMENT_FULL_SLICER_CLASS_H @@ -32,14 +35,6 @@ echo 'digraph g {' > c.dot ; cat c.goto | \ dot -Tpdf -oc-red.pdf c-red.dot #endif -/*******************************************************************\ - - Class: full_slicert - - Purpose: - -\*******************************************************************/ - class full_slicert { public: diff --git a/src/goto-instrument/function.cpp b/src/goto-instrument/function.cpp index 1ad749814bd..77eae15902a 100644 --- a/src/goto-instrument/function.cpp +++ b/src/goto-instrument/function.cpp @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Function Entering and Exiting + #include #include #include @@ -16,18 +19,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "function.h" -/*******************************************************************\ - -Function: function_to_call - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - code_function_callt function_to_call( symbol_tablet &symbol_table, const irep_idt &id, @@ -87,18 +78,6 @@ code_function_callt function_to_call( return call; } -/*******************************************************************\ - -Function: function_enter - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void function_enter( symbol_tablet &symbol_table, goto_functionst &goto_functions, @@ -126,18 +105,6 @@ void function_enter( } } -/*******************************************************************\ - -Function: function_exit - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void function_exit( symbol_tablet &symbol_table, goto_functionst &goto_functions, diff --git a/src/goto-instrument/function.h b/src/goto-instrument/function.h index 207555a7cb5..88b486df6b0 100644 --- a/src/goto-instrument/function.h +++ b/src/goto-instrument/function.h @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Function Entering and Exiting + #ifndef CPROVER_GOTO_INSTRUMENT_FUNCTION_H #define CPROVER_GOTO_INSTRUMENT_FUNCTION_H diff --git a/src/goto-instrument/function_modifies.cpp b/src/goto-instrument/function_modifies.cpp index 0d5148c92c8..f4d18c4a1e7 100644 --- a/src/goto-instrument/function_modifies.cpp +++ b/src/goto-instrument/function_modifies.cpp @@ -6,22 +6,13 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Modifies + #include #include "function_modifies.h" -/*******************************************************************\ - -Function: function_modifiest::get_modifies_lhs - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void function_modifiest::get_modifies_lhs( const local_may_aliast &local_may_alias, const goto_programt::const_targett t, @@ -51,18 +42,6 @@ void function_modifiest::get_modifies_lhs( } } -/*******************************************************************\ - -Function: function_modifiest::get_modifies - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void function_modifiest::get_modifies( const local_may_aliast &local_may_alias, const goto_programt::const_targett i_it, @@ -90,18 +69,6 @@ void function_modifiest::get_modifies( } } -/*******************************************************************\ - -Function: function_modifiest::get_modifies_function - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void function_modifiest::get_modifies_function( const exprt &function, modifiest &modifies) diff --git a/src/goto-instrument/function_modifies.h b/src/goto-instrument/function_modifies.h index b4f44cda6d3..64becb1412c 100644 --- a/src/goto-instrument/function_modifies.h +++ b/src/goto-instrument/function_modifies.h @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Modifies + #ifndef CPROVER_GOTO_INSTRUMENT_FUNCTION_MODIFIES_H #define CPROVER_GOTO_INSTRUMENT_FUNCTION_MODIFIES_H diff --git a/src/goto-instrument/goto_instrument_languages.cpp b/src/goto-instrument/goto_instrument_languages.cpp index 4cc03bca860..2193318b136 100644 --- a/src/goto-instrument/goto_instrument_languages.cpp +++ b/src/goto-instrument/goto_instrument_languages.cpp @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Language Registration + #include #include @@ -14,18 +17,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "goto_instrument_parse_options.h" -/*******************************************************************\ - -Function: goto_instrument_parse_optionst::register_languages - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_instrument_parse_optionst::register_languages() { register_language(new_ansi_c_language); diff --git a/src/goto-instrument/goto_instrument_main.cpp b/src/goto-instrument/goto_instrument_main.cpp index f25cbbcf9d8..fb394efbb3d 100644 --- a/src/goto-instrument/goto_instrument_main.cpp +++ b/src/goto-instrument/goto_instrument_main.cpp @@ -6,22 +6,13 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Main Module + #include #include "goto_instrument_parse_options.h" -/*******************************************************************\ - -Function: main - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - #ifdef _MSC_VER int wmain(int argc, const wchar_t **argv_wide) { diff --git a/src/goto-instrument/goto_instrument_parse_options.cpp b/src/goto-instrument/goto_instrument_parse_options.cpp index bebf863c862..94de6aebc4f 100644 --- a/src/goto-instrument/goto_instrument_parse_options.cpp +++ b/src/goto-instrument/goto_instrument_parse_options.cpp @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Main Module + #include #include #include @@ -91,18 +94,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "model_argc_argv.h" #include "undefined_functions.h" -/*******************************************************************\ - -Function: goto_instrument_parse_optionst::eval_verbosity - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_instrument_parse_optionst::eval_verbosity() { unsigned int v=8; @@ -117,18 +108,7 @@ void goto_instrument_parse_optionst::eval_verbosity() ui_message_handler.set_verbosity(v); } -/*******************************************************************\ - -Function: goto_instrument_parse_optionst::doit - - Inputs: - - Outputs: - - Purpose: invoke main modules - -\*******************************************************************/ - +/// invoke main modules int goto_instrument_parse_optionst::doit() { if(cmdline.isset("version")) @@ -814,18 +794,6 @@ int goto_instrument_parse_optionst::doit() } } -/*******************************************************************\ - -Function: goto_instrument_parse_optionst::do_indirect_call_and_rtti_removal - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_instrument_parse_optionst::do_indirect_call_and_rtti_removal( bool force) { @@ -848,21 +816,9 @@ void goto_instrument_parse_optionst::do_indirect_call_and_rtti_removal( remove_instanceof(symbol_table, goto_functions); } -/*******************************************************************\ - -Function: goto_instrument_parse_optionst::do_remove_const_function_pointers_only - - Inputs: - - Outputs: - - Purpose: Remove function pointers that can be resolved by analysing - const variables (i.e. can be resolved using - remove_const_function_pointers). Function pointers that cannot - be resolved will be left as function pointers. - -\*******************************************************************/ - +/// Remove function pointers that can be resolved by analysing const variables +/// (i.e. can be resolved using remove_const_function_pointers). Function +/// pointers that cannot be resolved will be left as function pointers. void goto_instrument_parse_optionst::do_remove_const_function_pointers_only() { // Don't bother if we've already done a full function pointer @@ -881,18 +837,6 @@ void goto_instrument_parse_optionst::do_remove_const_function_pointers_only() true); // abort if we can't resolve via const pointers } -/*******************************************************************\ - -Function: goto_instrument_parse_optionst::do_partial_inlining - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_instrument_parse_optionst::do_partial_inlining() { if(partial_inlining_done) @@ -908,18 +852,6 @@ void goto_instrument_parse_optionst::do_partial_inlining() } } -/*******************************************************************\ - -Function: goto_instrument_parse_optionst::do_remove_returns - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_instrument_parse_optionst::do_remove_returns() { if(remove_returns_done) @@ -931,18 +863,6 @@ void goto_instrument_parse_optionst::do_remove_returns() remove_returns(symbol_table, goto_functions); } -/*******************************************************************\ - -Function: goto_instrument_parse_optionst::get_goto_program - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_instrument_parse_optionst::get_goto_program() { status() << "Reading GOTO program from `" << cmdline.args[0] << "'" << eom; @@ -955,18 +875,6 @@ void goto_instrument_parse_optionst::get_goto_program() config.set_from_symbol_table(symbol_table); } -/*******************************************************************\ - -Function: goto_instrument_parse_optionst::instrument_goto_program - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_instrument_parse_optionst::instrument_goto_program() { optionst options; @@ -1529,18 +1437,7 @@ void goto_instrument_parse_optionst::instrument_goto_program() goto_functions.update(); } -/*******************************************************************\ - -Function: goto_instrument_parse_optionst::help - - Inputs: - - Outputs: - - Purpose: display command line help - -\*******************************************************************/ - +/// display command line help void goto_instrument_parse_optionst::help() { std::cout << diff --git a/src/goto-instrument/goto_instrument_parse_options.h b/src/goto-instrument/goto_instrument_parse_options.h index 788bf543953..5d695c202e0 100644 --- a/src/goto-instrument/goto_instrument_parse_options.h +++ b/src/goto-instrument/goto_instrument_parse_options.h @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Command Line Parsing + #ifndef CPROVER_GOTO_INSTRUMENT_GOTO_INSTRUMENT_PARSE_OPTIONS_H #define CPROVER_GOTO_INSTRUMENT_GOTO_INSTRUMENT_PARSE_OPTIONS_H diff --git a/src/goto-instrument/goto_program2code.cpp b/src/goto-instrument/goto_program2code.cpp index 400aca3b407..8bb99be23c4 100644 --- a/src/goto-instrument/goto_program2code.cpp +++ b/src/goto-instrument/goto_program2code.cpp @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Dump Goto-Program as C/C++ Source + #include #include @@ -17,18 +20,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "goto_program2code.h" -/*******************************************************************\ - -Function: skip_typecast - -Inputs: - -Outputs: - -Purpose: - -\*******************************************************************/ - static const exprt &skip_typecast(const exprt &expr) { if(expr.id()!=ID_typecast) @@ -37,18 +28,6 @@ static const exprt &skip_typecast(const exprt &expr) return skip_typecast(to_typecast_expr(expr).op()); } -/*******************************************************************\ - -Function: goto_program2codet::operator() - -Inputs: - -Outputs: - -Purpose: - -\*******************************************************************/ - void goto_program2codet::operator()() { // labels stored for cleanup @@ -76,18 +55,6 @@ void goto_program2codet::operator()() cleanup_code(toplevel_block, ID_nil); } -/*******************************************************************\ - -Function: goto_program2codet::build_loop_map - -Inputs: - -Outputs: - -Purpose: - -\*******************************************************************/ - void goto_program2codet::build_loop_map() { loop_map.clear(); @@ -124,18 +91,6 @@ void goto_program2codet::build_loop_map() } } -/*******************************************************************\ - -Function: goto_program2codet::build_dead_map - -Inputs: - -Outputs: - -Purpose: - -\*******************************************************************/ - void goto_program2codet::build_dead_map() { dead_map.clear(); @@ -147,18 +102,6 @@ void goto_program2codet::build_dead_map() target->location_number; } -/*******************************************************************\ - -Function: goto_program2codet::scan_for_varargs - -Inputs: - -Outputs: - -Purpose: - -\*******************************************************************/ - void goto_program2codet::scan_for_varargs() { va_list_expr.clear(); @@ -200,18 +143,6 @@ void goto_program2codet::scan_for_varargs() } } -/*******************************************************************\ - -Function: goto_program2codet::convert_instruction - -Inputs: - -Outputs: - -Purpose: - -\*******************************************************************/ - goto_programt::const_targett goto_program2codet::convert_instruction( goto_programt::const_targett target, goto_programt::const_targett upper_bound, @@ -316,18 +247,6 @@ goto_programt::const_targett goto_program2codet::convert_instruction( return target; } -/*******************************************************************\ - -Function: goto_program2codet::convert_labels - -Inputs: - -Outputs: - -Purpose: - -\*******************************************************************/ - void goto_program2codet::convert_labels( goto_programt::const_targett target, codet &dest) @@ -370,18 +289,6 @@ void goto_program2codet::convert_labels( latest_block->copy_to_operands(code_skipt()); } -/*******************************************************************\ - -Function: goto_program2codet::convert_assign - -Inputs: - -Outputs: - -Purpose: - -\*******************************************************************/ - goto_programt::const_targett goto_program2codet::convert_assign( goto_programt::const_targett target, goto_programt::const_targett upper_bound, @@ -397,18 +304,6 @@ goto_programt::const_targett goto_program2codet::convert_assign( return target; } -/*******************************************************************\ - -Function: goto_program2codet::convert_assign_varargs - -Inputs: - -Outputs: - -Purpose: - -\*******************************************************************/ - goto_programt::const_targett goto_program2codet::convert_assign_varargs( goto_programt::const_targett target, goto_programt::const_targett upper_bound, @@ -504,18 +399,6 @@ goto_programt::const_targett goto_program2codet::convert_assign_varargs( return target; } -/*******************************************************************\ - -Function: goto_program2codet::convert_assign_rec - -Inputs: - -Outputs: - -Purpose: - -\*******************************************************************/ - void goto_program2codet::convert_assign_rec( const code_assignt &assign, codet &dest) @@ -539,18 +422,6 @@ void goto_program2codet::convert_assign_rec( dest.copy_to_operands(assign); } -/*******************************************************************\ - -Function: goto_program2codet::convert_return - -Inputs: - -Outputs: - -Purpose: - -\*******************************************************************/ - goto_programt::const_targett goto_program2codet::convert_return( goto_programt::const_targett target, goto_programt::const_targett upper_bound, @@ -581,18 +452,6 @@ goto_programt::const_targett goto_program2codet::convert_return( return target; } -/*******************************************************************\ - -Function: goto_program2codet::convert_decl - -Inputs: - -Outputs: - -Purpose: - -\*******************************************************************/ - goto_programt::const_targett goto_program2codet::convert_decl( goto_programt::const_targett target, goto_programt::const_targett upper_bound, @@ -655,18 +514,6 @@ goto_programt::const_targett goto_program2codet::convert_decl( return target; } -/*******************************************************************\ - -Function: goto_program2codet::convert_do_while - -Inputs: - -Outputs: - -Purpose: - -\*******************************************************************/ - goto_programt::const_targett goto_program2codet::convert_do_while( goto_programt::const_targett target, goto_programt::const_targett loop_end, @@ -692,18 +539,6 @@ goto_programt::const_targett goto_program2codet::convert_do_while( return target; } -/*******************************************************************\ - -Function: goto_program2codet::convert_goto - -Inputs: - -Outputs: - -Purpose: - -\*******************************************************************/ - goto_programt::const_targett goto_program2codet::convert_goto( goto_programt::const_targett target, goto_programt::const_targett upper_bound, @@ -727,18 +562,6 @@ goto_programt::const_targett goto_program2codet::convert_goto( return convert_goto_goto(target, dest); } -/*******************************************************************\ - -Function: goto_program2codet::convert_goto_while - -Inputs: - -Outputs: - -Purpose: - -\*******************************************************************/ - goto_programt::const_targett goto_program2codet::convert_goto_while( goto_programt::const_targett target, goto_programt::const_targett loop_end, @@ -838,18 +661,6 @@ goto_programt::const_targett goto_program2codet::convert_goto_while( return target; } -/*******************************************************************\ - -Function: goto_program2codet::get_cases - -Inputs: - -Outputs: - -Purpose: - -\*******************************************************************/ - goto_programt::const_targett goto_program2codet::get_cases( goto_programt::const_targett target, goto_programt::const_targett upper_bound, @@ -952,18 +763,6 @@ goto_programt::const_targett goto_program2codet::get_cases( return cases_it; } -/*******************************************************************\ - -Function: goto_program2codet::set_block_end_points - -Inputs: - -Outputs: - -Purpose: - -\*******************************************************************/ - bool goto_program2codet::set_block_end_points( goto_programt::const_targett upper_bound, const cfg_dominatorst &dominators, @@ -1014,18 +813,6 @@ bool goto_program2codet::set_block_end_points( return false; } -/*******************************************************************\ - -Function: goto_program2codet::remove_default - -Inputs: - -Outputs: - -Purpose: - -\*******************************************************************/ - bool goto_program2codet::remove_default( const cfg_dominatorst &dominators, const cases_listt &cases, @@ -1088,18 +875,6 @@ bool goto_program2codet::remove_default( return false; } -/*******************************************************************\ - -Function: goto_program2codet::convert_goto_switch - -Inputs: - -Outputs: - -Purpose: - -\*******************************************************************/ - goto_programt::const_targett goto_program2codet::convert_goto_switch( goto_programt::const_targett target, goto_programt::const_targett upper_bound, @@ -1279,18 +1054,6 @@ goto_programt::const_targett goto_program2codet::convert_goto_switch( return max_target; } -/*******************************************************************\ - -Function: goto_program2codet::convert_goto_if - -Inputs: - -Outputs: - -Purpose: - -\*******************************************************************/ - goto_programt::const_targett goto_program2codet::convert_goto_if( goto_programt::const_targett target, goto_programt::const_targett upper_bound, @@ -1367,18 +1130,6 @@ goto_programt::const_targett goto_program2codet::convert_goto_if( return --target; } -/*******************************************************************\ - -Function: goto_program2codet::convert_goto_break_continue - -Inputs: - -Outputs: - -Purpose: - -\*******************************************************************/ - goto_programt::const_targett goto_program2codet::convert_goto_break_continue( goto_programt::const_targett target, codet &dest) @@ -1467,18 +1218,6 @@ goto_programt::const_targett goto_program2codet::convert_goto_break_continue( return convert_goto_goto(target, dest); } -/*******************************************************************\ - -Function: goto_program2codet::convert_goto_goto - -Inputs: - -Outputs: - -Purpose: - -\*******************************************************************/ - goto_programt::const_targett goto_program2codet::convert_goto_goto( goto_programt::const_targett target, codet &dest) @@ -1538,18 +1277,6 @@ goto_programt::const_targett goto_program2codet::convert_goto_goto( return target; } -/*******************************************************************\ - -Function: goto_program2codet::convert_start_thread - -Inputs: - -Outputs: - -Purpose: - -\*******************************************************************/ - goto_programt::const_targett goto_program2codet::convert_start_thread( goto_programt::const_targett target, goto_programt::const_targett upper_bound, @@ -1668,18 +1395,6 @@ goto_programt::const_targett goto_program2codet::convert_start_thread( return thread_end; } -/*******************************************************************\ - -Function: goto_program2codet::convert_throw - -Inputs: - -Outputs: - -Purpose: - -\*******************************************************************/ - goto_programt::const_targett goto_program2codet::convert_throw( goto_programt::const_targett target, codet &dest) @@ -1689,18 +1404,6 @@ goto_programt::const_targett goto_program2codet::convert_throw( return target; } -/*******************************************************************\ - -Function: goto_program2codet::convert_catch - -Inputs: - -Outputs: - -Purpose: - -\*******************************************************************/ - goto_programt::const_targett goto_program2codet::convert_catch( goto_programt::const_targett target, goto_programt::const_targett upper_bound, @@ -1711,18 +1414,6 @@ goto_programt::const_targett goto_program2codet::convert_catch( return target; } -/*******************************************************************\ - -Function: goto_program2codet::add_local_types - -Inputs: - -Outputs: - -Purpose: - -\*******************************************************************/ - void goto_program2codet::add_local_types(const typet &type) { if(type.id()==ID_symbol) @@ -1778,18 +1469,6 @@ void goto_program2codet::add_local_types(const typet &type) } } -/*******************************************************************\ - -Function: goto_program2codet::cleanup_code - -Inputs: - -Outputs: - -Purpose: - -\*******************************************************************/ - void goto_program2codet::cleanup_code( codet &code, const irep_idt parent_stmt) @@ -1877,18 +1556,6 @@ void goto_program2codet::cleanup_code( } } -/*******************************************************************\ - -Function: goto_program2codet::cleanup_function_call - -Inputs: - -Outputs: - -Purpose: - -\*******************************************************************/ - void goto_program2codet::cleanup_function_call( const exprt &function, code_function_callt::argumentst &arguments) @@ -1919,18 +1586,6 @@ void goto_program2codet::cleanup_function_call( } } -/*******************************************************************\ - -Function: goto_program2codet::cleanup_code_block - -Inputs: - -Outputs: - -Purpose: - -\*******************************************************************/ - void goto_program2codet::cleanup_code_block( codet &code, const irep_idt parent_stmt) @@ -1984,18 +1639,6 @@ void goto_program2codet::cleanup_code_block( } } -/*******************************************************************\ - -Function: goto_program2codet::remove_const - -Inputs: - -Outputs: - -Purpose: - -\*******************************************************************/ - void goto_program2codet::remove_const(typet &type) { if(type.get_bool(ID_C_constant)) @@ -2030,18 +1673,6 @@ void goto_program2codet::remove_const(typet &type) } } -/*******************************************************************\ - -Function: has_labels - -Inputs: - -Outputs: - -Purpose: - -\*******************************************************************/ - static bool has_labels(const codet &code) { if(code.get_statement()==ID_label) @@ -2054,18 +1685,6 @@ static bool has_labels(const codet &code) return false; } -/*******************************************************************\ - -Function: move_label_ifthenelse - -Inputs: - -Outputs: - -Purpose: - -\*******************************************************************/ - static bool move_label_ifthenelse( exprt &expr, exprt &label_dest) @@ -2091,18 +1710,6 @@ static bool move_label_ifthenelse( return true; } -/*******************************************************************\ - -Function: goto_program2codet::cleanup_code_ifthenelse - -Inputs: - -Outputs: - -Purpose: - -\*******************************************************************/ - void goto_program2codet::cleanup_code_ifthenelse( codet &code, const irep_idt parent_stmt) @@ -2199,18 +1806,6 @@ void goto_program2codet::cleanup_code_ifthenelse( code=code_skipt(); } -/*******************************************************************\ - -Function: goto_program2codet::cleanup_expr - -Inputs: - -Outputs: - -Purpose: - -\*******************************************************************/ - void goto_program2codet::cleanup_expr(exprt &expr, bool no_typecast) { // we might have to do array -> pointer conversions diff --git a/src/goto-instrument/goto_program2code.h b/src/goto-instrument/goto_program2code.h index d39dfc4e5d1..f8aa1eed53f 100644 --- a/src/goto-instrument/goto_program2code.h +++ b/src/goto-instrument/goto_program2code.h @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Dump Goto-Program as C/C++ Source + #ifndef CPROVER_GOTO_INSTRUMENT_GOTO_PROGRAM2CODE_H #define CPROVER_GOTO_INSTRUMENT_GOTO_PROGRAM2CODE_H diff --git a/src/goto-instrument/havoc_loops.cpp b/src/goto-instrument/havoc_loops.cpp index 88cb37075ad..e1213ec1831 100644 --- a/src/goto-instrument/havoc_loops.cpp +++ b/src/goto-instrument/havoc_loops.cpp @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Havoc Loops + #include #include @@ -59,18 +62,6 @@ class havoc_loopst goto_programt::targett get_loop_exit(const loopt &); }; -/*******************************************************************\ - -Function: havoc_loopst::get_loop_exit - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - goto_programt::targett havoc_loopst::get_loop_exit(const loopt &loop) { assert(!loop.empty()); @@ -89,18 +80,6 @@ goto_programt::targett havoc_loopst::get_loop_exit(const loopt &loop) return ++last; } -/*******************************************************************\ - -Function: havoc_loopst::build_havoc_code - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void havoc_loopst::build_havoc_code( const goto_programt::targett loop_head, const modifiest &modifies, @@ -122,18 +101,6 @@ void havoc_loopst::build_havoc_code( } } -/*******************************************************************\ - -Function: havoc_loopst::havoc_loop - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void havoc_loopst::havoc_loop( const goto_programt::targett loop_head, const loopt &loop) @@ -178,18 +145,6 @@ void havoc_loopst::havoc_loop( remove_skip(goto_function.body); } -/*******************************************************************\ - -Function: havoc_loopst::get_modifies - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void havoc_loopst::get_modifies( const loopt &loop, modifiest &modifies) @@ -220,18 +175,6 @@ void havoc_loopst::get_modifies( } } -/*******************************************************************\ - -Function: havoc_loopst::havoc_loops - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void havoc_loopst::havoc_loops() { // iterate over the (natural) loops in the function @@ -240,18 +183,6 @@ void havoc_loopst::havoc_loops() havoc_loop(loop.first, loop.second); } -/*******************************************************************\ - -Function: havoc_loops - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void havoc_loops(goto_functionst &goto_functions) { function_modifiest function_modifies(goto_functions); diff --git a/src/goto-instrument/havoc_loops.h b/src/goto-instrument/havoc_loops.h index 901e75d4fe5..dc3245a1162 100644 --- a/src/goto-instrument/havoc_loops.h +++ b/src/goto-instrument/havoc_loops.h @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Havoc Loops + #ifndef CPROVER_GOTO_INSTRUMENT_HAVOC_LOOPS_H #define CPROVER_GOTO_INSTRUMENT_HAVOC_LOOPS_H diff --git a/src/goto-instrument/horn_encoding.cpp b/src/goto-instrument/horn_encoding.cpp index c72f5db9af8..a1842b28a92 100644 --- a/src/goto-instrument/horn_encoding.cpp +++ b/src/goto-instrument/horn_encoding.cpp @@ -8,22 +8,13 @@ Date: June 2015 \*******************************************************************/ +/// \file +/// Horn-clause Encoding + #include #include "horn_encoding.h" -/*******************************************************************\ - -Function: horn_encoding - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void horn_encoding( const goto_functionst &, const namespacet &, diff --git a/src/goto-instrument/horn_encoding.h b/src/goto-instrument/horn_encoding.h index e6db93159be..44160c35ceb 100644 --- a/src/goto-instrument/horn_encoding.h +++ b/src/goto-instrument/horn_encoding.h @@ -6,6 +6,9 @@ Module: Horn-clause Encoding \*******************************************************************/ +/// \file +/// Horn-clause Encoding + #ifndef CPROVER_GOTO_INSTRUMENT_HORN_ENCODING_H #define CPROVER_GOTO_INSTRUMENT_HORN_ENCODING_H diff --git a/src/goto-instrument/interrupt.cpp b/src/goto-instrument/interrupt.cpp index 8fa40380617..93b11352792 100644 --- a/src/goto-instrument/interrupt.cpp +++ b/src/goto-instrument/interrupt.cpp @@ -8,6 +8,9 @@ Date: September 2011 \*******************************************************************/ +/// \file +/// Interrupt Instrumentation + #include #include #include @@ -23,18 +26,6 @@ Date: September 2011 #include #endif -/*******************************************************************\ - -Function: poential_race_on_read - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool potential_race_on_read( const rw_set_baset &code_rw_set, const rw_set_baset &isr_rw_set) @@ -49,18 +40,6 @@ bool potential_race_on_read( return false; } -/*******************************************************************\ - -Function: poential_race_on_write - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool potential_race_on_write( const rw_set_baset &code_rw_set, const rw_set_baset &isr_rw_set) @@ -78,18 +57,6 @@ bool potential_race_on_write( return false; } -/*******************************************************************\ - -Function: interrupt - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void interrupt( value_setst &value_sets, const symbol_tablet &symbol_table, @@ -185,18 +152,6 @@ void interrupt( } } -/*******************************************************************\ - -Function: get_isr - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - symbol_exprt get_isr( const symbol_tablet &symbol_table, const irep_idt &interrupt_handler) @@ -231,18 +186,6 @@ symbol_exprt get_isr( return isr; } -/*******************************************************************\ - -Function: interrupt - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void interrupt( value_setst &value_sets, const symbol_tablet &symbol_table, diff --git a/src/goto-instrument/interrupt.h b/src/goto-instrument/interrupt.h index b37cfcf8854..711c4fa32df 100644 --- a/src/goto-instrument/interrupt.h +++ b/src/goto-instrument/interrupt.h @@ -8,6 +8,9 @@ Date: September 2011 \*******************************************************************/ +/// \file +/// Interrupt Instrumentation for Goto Programs + #ifndef CPROVER_GOTO_INSTRUMENT_INTERRUPT_H #define CPROVER_GOTO_INSTRUMENT_INTERRUPT_H diff --git a/src/goto-instrument/k_induction.cpp b/src/goto-instrument/k_induction.cpp index 50abfe492f4..fcedf66e412 100644 --- a/src/goto-instrument/k_induction.cpp +++ b/src/goto-instrument/k_induction.cpp @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// k-induction + #include #include @@ -49,18 +52,6 @@ class k_inductiont const loopt &); }; -/*******************************************************************\ - -Function: k_inductiont::process_loop - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void k_inductiont::process_loop( const goto_programt::targett loop_head, const loopt &loop) @@ -146,18 +137,6 @@ void k_inductiont::process_loop( remove_skip(goto_function.body); } -/*******************************************************************\ - -Function: k_inductiont::k_induction - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void k_inductiont::k_induction() { // iterate over the (natural) loops in the function @@ -169,18 +148,6 @@ void k_inductiont::k_induction() process_loop(l_it->first, l_it->second); } -/*******************************************************************\ - -Function: k_induction - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void k_induction( goto_functionst &goto_functions, bool base_case, bool step_case, diff --git a/src/goto-instrument/k_induction.h b/src/goto-instrument/k_induction.h index 5c5918f923a..e5af8b0c43f 100644 --- a/src/goto-instrument/k_induction.h +++ b/src/goto-instrument/k_induction.h @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// k-induction + #ifndef CPROVER_GOTO_INSTRUMENT_K_INDUCTION_H #define CPROVER_GOTO_INSTRUMENT_K_INDUCTION_H diff --git a/src/goto-instrument/loop_utils.cpp b/src/goto-instrument/loop_utils.cpp index 90981198321..27e27979585 100644 --- a/src/goto-instrument/loop_utils.cpp +++ b/src/goto-instrument/loop_utils.cpp @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Helper functions for k-induction and loop invariants + #include #include @@ -13,18 +16,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "loop_utils.h" -/*******************************************************************\ - -Function: get_loop_exit - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - goto_programt::targett get_loop_exit(const loopt &loop) { assert(!loop.empty()); @@ -43,18 +34,6 @@ goto_programt::targett get_loop_exit(const loopt &loop) return ++last; } -/*******************************************************************\ - -Function: build_havoc_code - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void build_havoc_code( const goto_programt::targett loop_head, const modifiest &modifies, @@ -76,18 +55,6 @@ void build_havoc_code( } } -/*******************************************************************\ - -Function: get_modifies_lhs - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - static void get_modifies_lhs( const local_may_aliast &local_may_alias, goto_programt::const_targett t, @@ -118,18 +85,6 @@ static void get_modifies_lhs( } } -/*******************************************************************\ - -Function: get_modifies - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void get_modifies( const local_may_aliast &local_may_alias, const loopt &loop, diff --git a/src/goto-instrument/loop_utils.h b/src/goto-instrument/loop_utils.h index e6558291c4d..57407ecec1b 100644 --- a/src/goto-instrument/loop_utils.h +++ b/src/goto-instrument/loop_utils.h @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Helper functions for k-induction and loop invariants + #ifndef CPROVER_GOTO_INSTRUMENT_LOOP_UTILS_H #define CPROVER_GOTO_INSTRUMENT_LOOP_UTILS_H diff --git a/src/goto-instrument/mmio.cpp b/src/goto-instrument/mmio.cpp index b66633146a0..99112118d35 100644 --- a/src/goto-instrument/mmio.cpp +++ b/src/goto-instrument/mmio.cpp @@ -8,6 +8,9 @@ Date: September 2011 \*******************************************************************/ +/// \file +/// Memory-mapped I/O Instrumentation for Goto Programs + #include #include @@ -30,18 +33,6 @@ Date: September 2011 #include "mmio.h" -/*******************************************************************\ - -Function: mmio - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void mmio( value_setst &value_sets, const symbol_tablet &symbol_table, @@ -171,18 +162,6 @@ void mmio( } } -/*******************************************************************\ - -Function: mmio - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void mmio( value_setst &value_sets, class symbol_tablet &symbol_table, diff --git a/src/goto-instrument/mmio.h b/src/goto-instrument/mmio.h index bb3684c4a34..eab567f9873 100644 --- a/src/goto-instrument/mmio.h +++ b/src/goto-instrument/mmio.h @@ -8,6 +8,9 @@ Date: September 2011 \*******************************************************************/ +/// \file +/// Memory-mapped I/O Instrumentation for Goto Programs + #ifndef CPROVER_GOTO_INSTRUMENT_MMIO_H #define CPROVER_GOTO_INSTRUMENT_MMIO_H diff --git a/src/goto-instrument/model_argc_argv.cpp b/src/goto-instrument/model_argc_argv.cpp index 113c6d46a81..cc82ab8642a 100644 --- a/src/goto-instrument/model_argc_argv.cpp +++ b/src/goto-instrument/model_argc_argv.cpp @@ -8,6 +8,9 @@ Date: April 2016 \*******************************************************************/ +/// \file +/// Initialize command line arguments + #include #include @@ -26,18 +29,6 @@ Date: April 2016 #include "model_argc_argv.h" -/*******************************************************************\ - -Function: model_argc_argv - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool model_argc_argv( symbol_tablet &symbol_table, goto_functionst &goto_functions, diff --git a/src/goto-instrument/model_argc_argv.h b/src/goto-instrument/model_argc_argv.h index 0b47c68555e..08a214f6fd6 100644 --- a/src/goto-instrument/model_argc_argv.h +++ b/src/goto-instrument/model_argc_argv.h @@ -8,6 +8,9 @@ Date: April 2016 \*******************************************************************/ +/// \file +/// Initialize command line arguments + #ifndef CPROVER_GOTO_INSTRUMENT_MODEL_ARGC_ARGV_H #define CPROVER_GOTO_INSTRUMENT_MODEL_ARGC_ARGV_H diff --git a/src/goto-instrument/nondet_static.cpp b/src/goto-instrument/nondet_static.cpp index 90eb8ab3c08..db5aab9ef39 100644 --- a/src/goto-instrument/nondet_static.cpp +++ b/src/goto-instrument/nondet_static.cpp @@ -9,6 +9,9 @@ Date: November 2011 \*******************************************************************/ +/// \file +/// Nondeterministic initialization of certain global scope variables + #include #include #include @@ -18,18 +21,6 @@ Date: November 2011 #include "nondet_static.h" -/*******************************************************************\ - -Function: nondet_static - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void nondet_static( const namespacet &ns, goto_functionst &goto_functions, @@ -80,18 +71,6 @@ void nondet_static( } -/*******************************************************************\ - -Function: nondet_static - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void nondet_static( const namespacet &ns, goto_functionst &goto_functions) diff --git a/src/goto-instrument/nondet_static.h b/src/goto-instrument/nondet_static.h index 274b9cc5c91..97f3f0e683b 100644 --- a/src/goto-instrument/nondet_static.h +++ b/src/goto-instrument/nondet_static.h @@ -9,6 +9,9 @@ Date: November 2011 \*******************************************************************/ +/// \file +/// Nondeterministic initialization of certain global scope variables + #ifndef CPROVER_GOTO_INSTRUMENT_NONDET_STATIC_H #define CPROVER_GOTO_INSTRUMENT_NONDET_STATIC_H diff --git a/src/goto-instrument/nondet_volatile.cpp b/src/goto-instrument/nondet_volatile.cpp index 43969dfa9d2..d85868275d2 100644 --- a/src/goto-instrument/nondet_volatile.cpp +++ b/src/goto-instrument/nondet_volatile.cpp @@ -8,23 +8,14 @@ Date: September 2011 \*******************************************************************/ +/// \file +/// Volatile Variables + #include #include #include "nondet_volatile.h" -/*******************************************************************\ - -Function: is_volatile - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool is_volatile( const symbol_tablet &symbol_table, const typet &src) @@ -43,18 +34,6 @@ bool is_volatile( return false; } -/*******************************************************************\ - -Function: nondet_volatile_rhs - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void nondet_volatile_rhs(const symbol_tablet &symbol_table, exprt &expr) { Forall_operands(it, expr) @@ -75,18 +54,6 @@ void nondet_volatile_rhs(const symbol_tablet &symbol_table, exprt &expr) } } -/*******************************************************************\ - -Function: nondet_volatile_lhs - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void nondet_volatile_lhs(const symbol_tablet &symbol_table, exprt &expr) { if(expr.id()==ID_if) @@ -110,18 +77,6 @@ void nondet_volatile_lhs(const symbol_tablet &symbol_table, exprt &expr) } } -/*******************************************************************\ - -Function: nondet_volatile - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void nondet_volatile( symbol_tablet &symbol_table, goto_programt &goto_program) @@ -164,18 +119,6 @@ void nondet_volatile( } } -/*******************************************************************\ - -Function: nondet_volatile - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void nondet_volatile( symbol_tablet &symbol_table, goto_functionst &goto_functions) diff --git a/src/goto-instrument/nondet_volatile.h b/src/goto-instrument/nondet_volatile.h index 1a4457d6842..8cb3930fd56 100644 --- a/src/goto-instrument/nondet_volatile.h +++ b/src/goto-instrument/nondet_volatile.h @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Volatile Variables + #ifndef CPROVER_GOTO_INSTRUMENT_NONDET_VOLATILE_H #define CPROVER_GOTO_INSTRUMENT_NONDET_VOLATILE_H diff --git a/src/goto-instrument/object_id.cpp b/src/goto-instrument/object_id.cpp index 9df8b426df2..f63581bcd38 100644 --- a/src/goto-instrument/object_id.cpp +++ b/src/goto-instrument/object_id.cpp @@ -6,19 +6,10 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ -#include "object_id.h" - -/*******************************************************************\ - -Function: get_objects_rec - - Inputs: - - Outputs: - - Purpose: +/// \file +/// Object Identifiers -\*******************************************************************/ +#include "object_id.h" enum class get_modet { LHS_R, LHS_W, READ }; @@ -78,87 +69,27 @@ void get_objects_rec( } } -/*******************************************************************\ - -Function: get_objects - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void get_objects(const exprt &expr, object_id_sett &dest) { get_objects_rec(get_modet::READ, expr, dest, ""); } -/*******************************************************************\ - -Function: get_objects_r - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void get_objects_r(const code_assignt &assign, object_id_sett &dest) { get_objects_rec(get_modet::LHS_R, assign.lhs(), dest, ""); get_objects_rec(get_modet::READ, assign.rhs(), dest, ""); } -/*******************************************************************\ - -Function: get_objects_w - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void get_objects_w(const code_assignt &assign, object_id_sett &dest) { get_objects_rec(get_modet::LHS_W, assign.lhs(), dest, ""); } -/*******************************************************************\ - -Function: get_objects_w_lhs - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void get_objects_w(const exprt &lhs, object_id_sett &dest) { get_objects_rec(get_modet::LHS_W, lhs, dest, ""); } -/*******************************************************************\ - -Function: get_objects_r_lhs - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void get_objects_r_lhs(const exprt &lhs, object_id_sett &dest) { get_objects_rec(get_modet::LHS_R, lhs, dest, ""); diff --git a/src/goto-instrument/object_id.h b/src/goto-instrument/object_id.h index ac928e29b5f..f7c597a798b 100644 --- a/src/goto-instrument/object_id.h +++ b/src/goto-instrument/object_id.h @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Object Identifiers + #ifndef CPROVER_GOTO_INSTRUMENT_OBJECT_ID_H #define CPROVER_GOTO_INSTRUMENT_OBJECT_ID_H diff --git a/src/goto-instrument/points_to.cpp b/src/goto-instrument/points_to.cpp index da29e800292..a7d28a06229 100644 --- a/src/goto-instrument/points_to.cpp +++ b/src/goto-instrument/points_to.cpp @@ -6,19 +6,10 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ -#include "points_to.h" - -/*******************************************************************\ - -Function: points_tot::fixedpoint - - Inputs: - - Outputs: - - Purpose: +/// \file +/// Field-sensitive, location-insensitive points-to analysis -\*******************************************************************/ +#include "points_to.h" void points_tot::fixedpoint() { @@ -42,18 +33,6 @@ void points_tot::fixedpoint() while(added); } -/*******************************************************************\ - -Function: points_tot::output - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void points_tot::output(std::ostream &out) const { for(value_mapt::const_iterator @@ -75,18 +54,6 @@ void points_tot::output(std::ostream &out) const } } -/*******************************************************************\ - -Function: points_tot::transform - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool points_tot::transform(const cfgt::nodet &e) { bool result=false; diff --git a/src/goto-instrument/points_to.h b/src/goto-instrument/points_to.h index 4805de2343c..8b4a47d980a 100644 --- a/src/goto-instrument/points_to.h +++ b/src/goto-instrument/points_to.h @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Field-sensitive, location-insensitive points-to analysis + #ifndef CPROVER_GOTO_INSTRUMENT_POINTS_TO_H #define CPROVER_GOTO_INSTRUMENT_POINTS_TO_H @@ -16,14 +19,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "object_id.h" -/*******************************************************************\ - - Class: points_tot - - Purpose: - -\*******************************************************************/ - class points_tot { public: diff --git a/src/goto-instrument/race_check.cpp b/src/goto-instrument/race_check.cpp index 8f26d89bf56..952657ff0e9 100644 --- a/src/goto-instrument/race_check.cpp +++ b/src/goto-instrument/race_check.cpp @@ -8,6 +8,9 @@ Date: February 2006 \*******************************************************************/ +/// \file +/// Race Detection for Threaded Goto Programs + #include #include #include @@ -64,18 +67,6 @@ class w_guardst symbol_tablet &symbol_table; }; -/*******************************************************************\ - -Function: w_guardst::get_guard_symbol - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - const symbolt &w_guardst::get_guard_symbol(const irep_idt &object) { const irep_idt identifier=id2string(object)+"$w_guard"; @@ -100,18 +91,6 @@ const symbolt &w_guardst::get_guard_symbol(const irep_idt &object) return *symbol_ptr; } -/*******************************************************************\ - -Function: w_guardst::add_initialization - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void w_guardst::add_initialization(goto_programt &goto_program) const { goto_programt::targett t=goto_program.instructions.begin(); @@ -132,18 +111,6 @@ void w_guardst::add_initialization(goto_programt &goto_program) const } } -/*******************************************************************\ - -Function: comment - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string comment(const rw_set_baset::entryt &entry, bool write) { std::string result; @@ -157,18 +124,6 @@ std::string comment(const rw_set_baset::entryt &entry, bool write) return result; } -/*******************************************************************\ - -Function: is_shared - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool is_shared( const namespacet &ns, const symbol_exprt &symbol_expr) @@ -189,18 +144,6 @@ bool is_shared( return symbol.is_shared(); } -/*******************************************************************\ - -Function: race_check - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool has_shared_entries( const namespacet &ns, const rw_set_baset &rw_set) @@ -222,18 +165,6 @@ bool has_shared_entries( return false; } -/*******************************************************************\ - -Function: race_check - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void race_check( value_setst &value_sets, symbol_tablet &symbol_table, @@ -339,18 +270,6 @@ void race_check( remove_skip(goto_program); } -/*******************************************************************\ - -Function: race_check - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void race_check( value_setst &value_sets, symbol_tablet &symbol_table, @@ -372,18 +291,6 @@ void race_check( goto_program.update(); } -/*******************************************************************\ - -Function: race_check - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void race_check( value_setst &value_sets, symbol_tablet &symbol_table, diff --git a/src/goto-instrument/race_check.h b/src/goto-instrument/race_check.h index 1c7cd3e5be8..442d142ddc0 100644 --- a/src/goto-instrument/race_check.h +++ b/src/goto-instrument/race_check.h @@ -8,6 +8,9 @@ Date: February 2006 \*******************************************************************/ +/// \file +/// Race Detection for Threaded Goto Programs + #ifndef CPROVER_GOTO_INSTRUMENT_RACE_CHECK_H #define CPROVER_GOTO_INSTRUMENT_RACE_CHECK_H diff --git a/src/goto-instrument/reachability_slicer.cpp b/src/goto-instrument/reachability_slicer.cpp index 073f9284add..72b63fa76c4 100644 --- a/src/goto-instrument/reachability_slicer.cpp +++ b/src/goto-instrument/reachability_slicer.cpp @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Slicer + #include @@ -17,18 +20,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "reachability_slicer.h" #include "reachability_slicer_class.h" -/*******************************************************************\ - -Function: reachability_slicert::fixedpoint_assertions - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void reachability_slicert::fixedpoint_assertions( const is_threadedt &is_threaded, slicing_criteriont &criterion) @@ -64,18 +55,6 @@ void reachability_slicert::fixedpoint_assertions( } } -/*******************************************************************\ - -Function: reachability_slicert::slice - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void reachability_slicert::slice(goto_functionst &goto_functions) { // now replace those instructions that do not reach any assertions @@ -101,18 +80,6 @@ void reachability_slicert::slice(goto_functionst &goto_functions) goto_functions.update(); } -/*******************************************************************\ - -Function: reachability_slicer - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void reachability_slicer(goto_functionst &goto_functions) { reachability_slicert s; @@ -120,18 +87,6 @@ void reachability_slicer(goto_functionst &goto_functions) s(goto_functions, a); } -/*******************************************************************\ - -Function: reachability_slicer - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void reachability_slicer( goto_functionst &goto_functions, const std::list &properties) diff --git a/src/goto-instrument/reachability_slicer.h b/src/goto-instrument/reachability_slicer.h index e45aa81f27e..4d82e4b194e 100644 --- a/src/goto-instrument/reachability_slicer.h +++ b/src/goto-instrument/reachability_slicer.h @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Slicing + #ifndef CPROVER_GOTO_INSTRUMENT_REACHABILITY_SLICER_H #define CPROVER_GOTO_INSTRUMENT_REACHABILITY_SLICER_H diff --git a/src/goto-instrument/reachability_slicer_class.h b/src/goto-instrument/reachability_slicer_class.h index 224259b57cd..4f21049892e 100644 --- a/src/goto-instrument/reachability_slicer_class.h +++ b/src/goto-instrument/reachability_slicer_class.h @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Goto Program Slicing + #ifndef CPROVER_GOTO_INSTRUMENT_REACHABILITY_SLICER_CLASS_H #define CPROVER_GOTO_INSTRUMENT_REACHABILITY_SLICER_CLASS_H @@ -16,14 +19,6 @@ Author: Daniel Kroening, kroening@kroening.com class slicing_criteriont; -/*******************************************************************\ - - Class: reachability_slicert - - Purpose: - -\*******************************************************************/ - class reachability_slicert { public: diff --git a/src/goto-instrument/rw_set.cpp b/src/goto-instrument/rw_set.cpp index 531a3ea70b4..85c13d540b2 100644 --- a/src/goto-instrument/rw_set.cpp +++ b/src/goto-instrument/rw_set.cpp @@ -8,6 +8,9 @@ Date: February 2006 \*******************************************************************/ +/// \file +/// Race Detection for Threaded Goto Programs + #include #include #include @@ -18,18 +21,6 @@ Date: February 2006 #include "rw_set.h" -/*******************************************************************\ - -Function: rw_set_baset::output - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void rw_set_baset::output(std::ostream &out) const { out << "READ:" << std::endl; @@ -53,18 +44,6 @@ void rw_set_baset::output(std::ostream &out) const } } -/*******************************************************************\ - -Function: rw_set_loct::compute - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void _rw_set_loct::compute() { if(target->is_assign()) @@ -97,36 +76,12 @@ void _rw_set_loct::compute() } } -/*******************************************************************\ - -Function: rw_set_loct::assign - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void _rw_set_loct::assign(const exprt &lhs, const exprt &rhs) { read(rhs); read_write_rec(lhs, false, true, "", guardt()); } -/*******************************************************************\ - -Function: rw_set_loct::read_write_rec - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void _rw_set_loct::read_write_rec( const exprt &expr, bool r, bool w, @@ -240,18 +195,6 @@ void _rw_set_loct::read_write_rec( } } -/*******************************************************************\ - -Function: rw_set_functiont::compute_rec - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void rw_set_functiont::compute_rec(const exprt &function) { if(function.id()==ID_symbol) diff --git a/src/goto-instrument/rw_set.h b/src/goto-instrument/rw_set.h index 9322efbfc3e..eba731d705c 100644 --- a/src/goto-instrument/rw_set.h +++ b/src/goto-instrument/rw_set.h @@ -8,6 +8,9 @@ Date: February 2006 \*******************************************************************/ +/// \file +/// Race Detection for Threaded Goto Programs + #ifndef CPROVER_GOTO_INSTRUMENT_RW_SET_H #define CPROVER_GOTO_INSTRUMENT_RW_SET_H diff --git a/src/goto-instrument/show_locations.cpp b/src/goto-instrument/show_locations.cpp index 411422e07fd..73ea3bd2f89 100644 --- a/src/goto-instrument/show_locations.cpp +++ b/src/goto-instrument/show_locations.cpp @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Show program locations + #include #include @@ -15,18 +18,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "show_locations.h" -/*******************************************************************\ - -Function: show_locations - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void show_locations( ui_message_handlert::uit ui, const irep_idt function_id, @@ -71,18 +62,6 @@ void show_locations( } } -/*******************************************************************\ - -Function: show_locations - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void show_locations( ui_message_handlert::uit ui, const goto_functionst &goto_functions) diff --git a/src/goto-instrument/show_locations.h b/src/goto-instrument/show_locations.h index 60861add675..3f71b19ca48 100644 --- a/src/goto-instrument/show_locations.h +++ b/src/goto-instrument/show_locations.h @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Show program locations + #ifndef CPROVER_GOTO_INSTRUMENT_SHOW_LOCATIONS_H #define CPROVER_GOTO_INSTRUMENT_SHOW_LOCATIONS_H diff --git a/src/goto-instrument/skip_loops.cpp b/src/goto-instrument/skip_loops.cpp index f79fae9d7b4..55a7e4cd3cc 100644 --- a/src/goto-instrument/skip_loops.cpp +++ b/src/goto-instrument/skip_loops.cpp @@ -8,6 +8,9 @@ Date: January 2016 \*******************************************************************/ +/// \file +/// Skip over selected loops by adding gotos + #include #include @@ -18,18 +21,6 @@ Date: January 2016 typedef std::set loop_idst; typedef std::map loop_mapt; -/*******************************************************************\ - -Function: skip_loops - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - static bool skip_loops( goto_programt &goto_program, const loop_idst &loop_ids, @@ -71,18 +62,6 @@ static bool skip_loops( return false; } -/*******************************************************************\ - -Function: skip_loops - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - static bool parse_loop_ids( const std::string &loop_ids, loop_mapt &loop_map) @@ -111,18 +90,6 @@ static bool parse_loop_ids( return false; } -/*******************************************************************\ - -Function: skip_loops - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool skip_loops( goto_functionst &goto_functions, const std::string &loop_ids, diff --git a/src/goto-instrument/skip_loops.h b/src/goto-instrument/skip_loops.h index d2c9af8996f..c5e84c6172c 100644 --- a/src/goto-instrument/skip_loops.h +++ b/src/goto-instrument/skip_loops.h @@ -8,6 +8,9 @@ Date: January 2016 \*******************************************************************/ +/// \file +/// Skip over selected loops by adding gotos + #ifndef CPROVER_GOTO_INSTRUMENT_SKIP_LOOPS_H #define CPROVER_GOTO_INSTRUMENT_SKIP_LOOPS_H diff --git a/src/goto-instrument/stack_depth.cpp b/src/goto-instrument/stack_depth.cpp index 0c5e0f81146..e422b54184d 100644 --- a/src/goto-instrument/stack_depth.cpp +++ b/src/goto-instrument/stack_depth.cpp @@ -8,6 +8,9 @@ Date: November 2011 \*******************************************************************/ +/// \file +/// Stack depth checks + #include #include #include @@ -18,18 +21,6 @@ Date: November 2011 #include "stack_depth.h" -/*******************************************************************\ - -Function: add_stack_depth_symbol - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - symbol_exprt add_stack_depth_symbol(symbol_tablet &symbol_table) { const irep_idt identifier="$stack_depth"; @@ -51,18 +42,6 @@ symbol_exprt add_stack_depth_symbol(symbol_tablet &symbol_table) return symbol_exprt(identifier, type); } -/*******************************************************************\ - -Function: stack_depth - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void stack_depth( goto_programt &goto_program, const symbol_exprt &symbol, @@ -103,18 +82,6 @@ void stack_depth( goto_program.insert_before_swap(last, minus_ins); } -/*******************************************************************\ - -Function: stack_depth - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void stack_depth( symbol_tablet &symbol_table, goto_functionst &goto_functions, diff --git a/src/goto-instrument/stack_depth.h b/src/goto-instrument/stack_depth.h index f24964ff611..8d0414121d7 100644 --- a/src/goto-instrument/stack_depth.h +++ b/src/goto-instrument/stack_depth.h @@ -8,6 +8,9 @@ Date: November 2011 \*******************************************************************/ +/// \file +/// Stack depth checks + #ifndef CPROVER_GOTO_INSTRUMENT_STACK_DEPTH_H #define CPROVER_GOTO_INSTRUMENT_STACK_DEPTH_H diff --git a/src/goto-instrument/thread_instrumentation.cpp b/src/goto-instrument/thread_instrumentation.cpp index 4c23234d051..8a78c2208d8 100644 --- a/src/goto-instrument/thread_instrumentation.cpp +++ b/src/goto-instrument/thread_instrumentation.cpp @@ -10,18 +10,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "thread_instrumentation.h" -/*******************************************************************\ - -Function: has_start_thread - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - static bool has_start_thread(const goto_programt &goto_program) { for(const auto &instruction : goto_program.instructions) @@ -31,18 +19,6 @@ static bool has_start_thread(const goto_programt &goto_program) return false; } -/*******************************************************************\ - -Function: thread_exit_instrumentation - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void thread_exit_instrumentation(goto_programt &goto_program) { if(goto_program.instructions.empty()) @@ -76,18 +52,6 @@ void thread_exit_instrumentation(goto_programt &goto_program) end->function=function; } -/*******************************************************************\ - -Function: thread_exit_instrumentation - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void thread_exit_instrumentation(goto_functionst &goto_functions) { // we'll look for START THREAD @@ -117,18 +81,6 @@ void thread_exit_instrumentation(goto_functionst &goto_functions) } } -/*******************************************************************\ - -Function: mutex_init_instrumentation - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void mutex_init_instrumentation( const symbol_tablet &symbol_table, goto_programt &goto_program, @@ -165,18 +117,6 @@ void mutex_init_instrumentation( } } -/*******************************************************************\ - -Function: mutex_init_instrumentation - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void mutex_init_instrumentation( const symbol_tablet &symbol_table, goto_functionst &goto_functions) diff --git a/src/goto-instrument/undefined_functions.cpp b/src/goto-instrument/undefined_functions.cpp index 53fff3ff84b..6bf53e0e5c9 100644 --- a/src/goto-instrument/undefined_functions.cpp +++ b/src/goto-instrument/undefined_functions.cpp @@ -8,24 +8,15 @@ Date: July 2016 \*******************************************************************/ +/// \file +/// Handling of functions without body + #include #include #include "undefined_functions.h" -/*******************************************************************\ - -Function: list_undefined_functions - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void list_undefined_functions( const goto_functionst &goto_functions, const namespacet &ns, @@ -37,18 +28,6 @@ void list_undefined_functions( os << it->first << std::endl; } -/*******************************************************************\ - -Function: undefined_function_abort_path - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void undefined_function_abort_path(goto_functionst &goto_functions) { Forall_goto_functions(it, goto_functions) diff --git a/src/goto-instrument/undefined_functions.h b/src/goto-instrument/undefined_functions.h index 7b700c839a0..85c6ba77552 100644 --- a/src/goto-instrument/undefined_functions.h +++ b/src/goto-instrument/undefined_functions.h @@ -8,6 +8,9 @@ Date: July 2016 \*******************************************************************/ +/// \file +/// Handling of functions without body + #ifndef CPROVER_UNDEFINED_FUNCTIONS_H #define CPROVER_UNDEFINED_FUNCTIONS_H diff --git a/src/goto-instrument/uninitialized.cpp b/src/goto-instrument/uninitialized.cpp index c048a518440..74dbf389d81 100644 --- a/src/goto-instrument/uninitialized.cpp +++ b/src/goto-instrument/uninitialized.cpp @@ -8,6 +8,9 @@ Date: January 2010 \*******************************************************************/ +/// \file +/// Detection for Uninitialized Local Variables + #include #include #include @@ -16,14 +19,6 @@ Date: January 2010 #include "uninitialized.h" -/*******************************************************************\ - - Class: uninitializedt - - Purpose: - -\*******************************************************************/ - class uninitializedt { public: @@ -47,19 +42,7 @@ class uninitializedt void get_tracking(goto_programt::const_targett i_it); }; -/*******************************************************************\ - -Function: uninitializedt::get_tracking - - Inputs: - - Outputs: - - Purpose: which variables need tracking, - i.e., are uninitialized and may be read? - -\*******************************************************************/ - +/// which variables need tracking, i.e., are uninitialized and may be read? void uninitializedt::get_tracking(goto_programt::const_targett i_it) { std::list objects=objects_read(*i_it); @@ -80,18 +63,6 @@ void uninitializedt::get_tracking(goto_programt::const_targett i_it) } } -/*******************************************************************\ - -Function: uninitializedt::add_assertions - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void uninitializedt::add_assertions(goto_programt &goto_program) { uninitialized_analysis(goto_program, ns); @@ -223,18 +194,6 @@ void uninitializedt::add_assertions(goto_programt &goto_program) } } -/*******************************************************************\ - -Function: add_uninitialized_locals_assertions - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void add_uninitialized_locals_assertions( symbol_tablet &symbol_table, goto_functionst &goto_functions) @@ -247,18 +206,6 @@ void add_uninitialized_locals_assertions( } } -/*******************************************************************\ - -Function: show_uninitialized - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void show_uninitialized( const class symbol_tablet &symbol_table, const goto_functionst &goto_functions, diff --git a/src/goto-instrument/uninitialized.h b/src/goto-instrument/uninitialized.h index 1f4b27b5964..11437eee972 100644 --- a/src/goto-instrument/uninitialized.h +++ b/src/goto-instrument/uninitialized.h @@ -8,6 +8,9 @@ Date: January 2010 \*******************************************************************/ +/// \file +/// Detection for Uninitialized Local Variables + #ifndef CPROVER_GOTO_INSTRUMENT_UNINITIALIZED_H #define CPROVER_GOTO_INSTRUMENT_UNINITIALIZED_H diff --git a/src/goto-instrument/unwind.cpp b/src/goto-instrument/unwind.cpp index 1ae2451c3a6..d9ef9e1924d 100644 --- a/src/goto-instrument/unwind.cpp +++ b/src/goto-instrument/unwind.cpp @@ -7,6 +7,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Loop unwinding + #ifdef DEBUG #include #endif @@ -18,18 +21,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "unwind.h" #include "loop_utils.h" -/*******************************************************************\ - -Function: parse_unwindset - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void parse_unwindset(const std::string &us, unwind_sett &unwind_set) { assert(unwind_set.empty()); @@ -64,18 +55,6 @@ void parse_unwindset(const std::string &us, unwind_sett &unwind_set) } } -/*******************************************************************\ - -Function: copy_segment - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_unwindt::copy_segment( const goto_programt::const_targett start, const goto_programt::const_targett end, // exclusive @@ -130,18 +109,6 @@ void goto_unwindt::copy_segment( } } -/*******************************************************************\ - -Function: unwind - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_unwindt::unwind( goto_programt &goto_program, const goto_programt::const_targett loop_head, @@ -154,18 +121,6 @@ void goto_unwindt::unwind( iteration_points); } -/*******************************************************************\ - -Function: unwind - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_unwindt::unwind( goto_programt &goto_program, const goto_programt::const_targett loop_head, @@ -334,18 +289,6 @@ void goto_unwindt::unwind( goto_program.destructive_insert(loop_exit, copies); } -/*******************************************************************\ - -Function: get_k - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - int goto_unwindt::get_k( const irep_idt func, const unsigned loop_id, @@ -369,18 +312,6 @@ int goto_unwindt::get_k( return k; } -/*******************************************************************\ - -Function: unwind - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_unwindt::unwind( goto_programt &goto_program, const unwind_sett &unwind_set, @@ -430,18 +361,6 @@ void goto_unwindt::unwind( } } -/*******************************************************************\ - -Function: operator() - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_unwindt::operator()( goto_functionst &goto_functions, const unwind_sett &unwind_set, @@ -467,18 +386,6 @@ void goto_unwindt::operator()( } } -/*******************************************************************\ - -Function: show_log_json - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - // call after calling goto_functions.update()! jsont goto_unwindt::unwind_logt::output_log_json() const { diff --git a/src/goto-instrument/unwind.h b/src/goto-instrument/unwind.h index 99719f7ddf1..16ee2cf9455 100644 --- a/src/goto-instrument/unwind.h +++ b/src/goto-instrument/unwind.h @@ -7,6 +7,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Loop unwinding + #ifndef CPROVER_GOTO_INSTRUMENT_UNWIND_H #define CPROVER_GOTO_INSTRUMENT_UNWIND_H diff --git a/src/goto-instrument/wmm/abstract_event.cpp b/src/goto-instrument/wmm/abstract_event.cpp index e080ba3ef3c..41e8efb78f2 100644 --- a/src/goto-instrument/wmm/abstract_event.cpp +++ b/src/goto-instrument/wmm/abstract_event.cpp @@ -8,19 +8,10 @@ Date: 2012 \*******************************************************************/ -#include "abstract_event.h" - -/*******************************************************************\ - -Function: abstract_eventt::unsafe_pair_lwfence_param - - Inputs: +/// \file +/// abstract events - Outputs: - - Purpose: - -\*******************************************************************/ +#include "abstract_event.h" bool abstract_eventt::unsafe_pair_lwfence_param(const abstract_eventt &next, memory_modelt model, @@ -107,18 +98,6 @@ bool abstract_eventt::unsafe_pair_lwfence_param(const abstract_eventt &next, return true; } -/*******************************************************************\ - -Function: abstract_eventt::unsafe_pair_asm - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool abstract_eventt::unsafe_pair_asm(const abstract_eventt &next, memory_modelt model, unsigned char met) const diff --git a/src/goto-instrument/wmm/abstract_event.h b/src/goto-instrument/wmm/abstract_event.h index ba0c0f5f1ff..a271c709ea1 100644 --- a/src/goto-instrument/wmm/abstract_event.h +++ b/src/goto-instrument/wmm/abstract_event.h @@ -8,6 +8,9 @@ Date: 2012 \*******************************************************************/ +/// \file +/// abstract events + #ifndef CPROVER_GOTO_INSTRUMENT_WMM_ABSTRACT_EVENT_H #define CPROVER_GOTO_INSTRUMENT_WMM_ABSTRACT_EVENT_H @@ -16,10 +19,6 @@ Date: 2012 #include "wmm.h" -/*******************************************************************\ - abstract event -\*******************************************************************/ - class abstract_eventt:public graph_nodet { protected: diff --git a/src/goto-instrument/wmm/cycle_collection.cpp b/src/goto-instrument/wmm/cycle_collection.cpp index c8110665ead..1012ae40cdc 100644 --- a/src/goto-instrument/wmm/cycle_collection.cpp +++ b/src/goto-instrument/wmm/cycle_collection.cpp @@ -8,22 +8,15 @@ Date: 2012 \*******************************************************************/ +/// \file +/// collection of cycles in graph of abstract events + #include #include "event_graph.h" -/*******************************************************************\ - -Function: event_grapht::graph_explorert::filter_thin_air - - Inputs: - - Outputs: - - Purpose: after the collection, eliminates the executions forbidden - by an indirect thin-air - -\*******************************************************************/ +/// after the collection, eliminates the executions forbidden by an indirect +/// thin-air void event_grapht::graph_explorert::filter_thin_air( std::set &set_of_cycles) { @@ -54,18 +47,7 @@ void event_grapht::graph_explorert::filter_thin_air( #endif } -/*******************************************************************\ - -Function: event_grapht::graph_explorert::collect_cycles - - Inputs: - - Outputs: - - Purpose: Tarjan 1972 adapted and modified for events - -\*******************************************************************/ - +/// Tarjan 1972 adapted and modified for events void event_grapht::graph_explorert::collect_cycles( std::set &set_of_cycles, memory_modelt model) @@ -123,20 +105,8 @@ void event_grapht::graph_explorert::collect_cycles( filter_thin_air(set_of_cycles); } -/*******************************************************************\ - -Function: event_grapht::graph_explorert::extract_cycle - - Inputs: - - Outputs: - - Purpose: extracts a (whole, unreduced) cycle from the stack. - Note: it may not be a real cycle yet -- we cannot check - the size before a call to this function. - -\*******************************************************************/ - +/// extracts a (whole, unreduced) cycle from the stack. Note: it may not be a +/// real cycle yet -- we cannot check the size before a call to this function. event_grapht::critical_cyclet event_grapht::graph_explorert::extract_cycle( event_idt vertex, event_idt source, @@ -176,18 +146,8 @@ event_grapht::critical_cyclet event_grapht::graph_explorert::extract_cycle( return new_cycle; } -/*******************************************************************\ - -Function: event_grapht::graph_explorert::backtrack - - Inputs: get_po_only: used for po-transitivity - - Outputs: - - Purpose: see event_grapht::collect_cycles - -\*******************************************************************/ - +/// see event_grapht::collect_cycles +/// \param get_po_only: used for po-transitivity bool event_grapht::graph_explorert::backtrack( std::set &set_of_cycles, event_idt source, diff --git a/src/goto-instrument/wmm/data_dp.cpp b/src/goto-instrument/wmm/data_dp.cpp index ce700dc1f8a..d220174c422 100644 --- a/src/goto-instrument/wmm/data_dp.cpp +++ b/src/goto-instrument/wmm/data_dp.cpp @@ -8,23 +8,15 @@ Date: 2012 \*******************************************************************/ +/// \file +/// data dependencies + #include #include "data_dp.h" #include "abstract_event.h" -/*******************************************************************\ - -Function: data_dpt::dp_analysis - - Inputs: - - Outputs: - - Purpose: insertion - -\*******************************************************************/ - +/// insertion void data_dpt::dp_analysis( const datat &read, bool local_read, @@ -66,18 +58,6 @@ void data_dpt::dp_analysis( } } -/*******************************************************************\ - -Function: data_dpt::dp_analysis - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void data_dpt::dp_analysis( const abstract_eventt &read, const abstract_eventt &write) @@ -87,18 +67,7 @@ void data_dpt::dp_analysis( dp_analysis(d_read, read.local, d_write, write.local); } -/*******************************************************************\ - -Function: data_dpt::dp - - Inputs: - - Outputs: - - Purpose: search in N^2 - -\*******************************************************************/ - +/// search in N^2 bool data_dpt::dp(const abstract_eventt &e1, const abstract_eventt &e2) const { for(const_iterator it1=begin(); it1!=end(); ++it1) @@ -143,18 +112,7 @@ bool data_dpt::dp(const abstract_eventt &e1, const abstract_eventt &e2) const return false; } -/*******************************************************************\ - -Function: data_dpt::dp_merge - - Inputs: - - Outputs: - - Purpose: merge in N^3 - -\*******************************************************************/ - +/// merge in N^3 void data_dpt::dp_merge() { if(size()<2) @@ -198,18 +156,6 @@ void data_dpt::dp_merge() dp_merge(); } -/*******************************************************************\ - -Function: data_dpt::print - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void data_dpt::print(messaget &message) { #ifdef DEBUG diff --git a/src/goto-instrument/wmm/data_dp.h b/src/goto-instrument/wmm/data_dp.h index 6b352acccfd..abd7641fb9c 100644 --- a/src/goto-instrument/wmm/data_dp.h +++ b/src/goto-instrument/wmm/data_dp.h @@ -8,6 +8,9 @@ Date: 2012 \*******************************************************************/ +/// \file +/// data dependencies + #ifndef CPROVER_GOTO_INSTRUMENT_WMM_DATA_DP_H #define CPROVER_GOTO_INSTRUMENT_WMM_DATA_DP_H @@ -18,10 +21,6 @@ Date: 2012 class abstract_eventt; class messaget; -/*******************************************************************\ - data dependencies -\*******************************************************************/ - struct datat { irep_idt id; diff --git a/src/goto-instrument/wmm/event_graph.cpp b/src/goto-instrument/wmm/event_graph.cpp index dce7b3de474..8a73a6560e4 100644 --- a/src/goto-instrument/wmm/event_graph.cpp +++ b/src/goto-instrument/wmm/event_graph.cpp @@ -8,6 +8,9 @@ Date: 2012 \*******************************************************************/ +/// \file +/// graph of abstract events + #include "event_graph.h" #include @@ -22,18 +25,6 @@ static const char *colour_map[NB_COLOURS]= "deeppink", "indigo", "olivedrab"}; #define print_colour(u) colour_map[u%NB_COLOURS] -/*******************************************************************\ - -Function: event_grapht::print_rec_graph - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void event_grapht::print_rec_graph(std::ofstream &file, event_idt node_id, std::set &visited) { @@ -62,18 +53,6 @@ void event_grapht::print_rec_graph(std::ofstream &file, event_idt node_id, } } -/*******************************************************************\ - -Function: event_grapht::print_graph - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void event_grapht::print_graph() { assert(po_order.size()>0); @@ -87,19 +66,9 @@ void event_grapht::print_graph() file << "}" << std::endl; } -/*******************************************************************\ - -Function: event_grapht::copy_segment - - Inputs: begin: top of the subgraph - end: bottom of the subgraph - - Outputs: - - Purpose: copies the segment - -\*******************************************************************/ - +/// copies the segment +/// \param begin: top of the subgraph +/// \param end: bottom of the subgraph void event_grapht::explore_copy_segment(std::set &explored, event_idt begin, event_idt end) const { @@ -214,18 +183,6 @@ event_idt event_grapht::copy_segment(event_idt begin, event_idt end) return orig2copy[end]; } -/*******************************************************************\ - -Function: event_grapht::critical_cyclet::check_AC - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool event_grapht::critical_cyclet::check_AC( const_iterator s_it, const abstract_eventt &first, @@ -267,18 +224,6 @@ bool event_grapht::critical_cyclet::check_AC( return AC; } -/*******************************************************************\ - -Function: event_grapht::critical_cyclet::check_BC - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool event_grapht::critical_cyclet::check_BC( const_iterator it, const abstract_eventt &first, @@ -332,18 +277,6 @@ bool event_grapht::critical_cyclet::check_BC( return BC; } -/*******************************************************************\ - -Function: event_grapht::critical_cyclet::is_unsafe - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool event_grapht::critical_cyclet::is_unsafe(memory_modelt model, bool fast) { egraph.message.debug() << "cycle is safe?" << messaget::eom; @@ -625,18 +558,7 @@ bool event_grapht::critical_cyclet::is_unsafe(memory_modelt model, bool fast) return unsafe_met; } -/*******************************************************************\ - -Function: event_grapht::critical_cyclet::is_unsafe_asm - - Inputs: - - Outputs: - - Purpose: same as is_unsafe, but with ASM fences - -\*******************************************************************/ - +/// same as is_unsafe, but with ASM fences bool event_grapht::critical_cyclet::is_unsafe_asm( memory_modelt model, bool fast) @@ -970,18 +892,6 @@ bool event_grapht::critical_cyclet::is_unsafe_asm( return unsafe_met; } -/*******************************************************************\ - -Function: event_grapht::critical_cyclet::is_not_uniproc - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool event_grapht::critical_cyclet::is_not_uniproc() const { const_iterator it=begin(); @@ -1020,18 +930,6 @@ bool event_grapht::critical_cyclet::is_not_uniproc() const return (it!=end()); } -/*******************************************************************\ - -Function: event_grapht::critical_cyclet::is_not_weak_uniproc - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool event_grapht::critical_cyclet::is_not_weak_uniproc() const { const_iterator it=begin(); @@ -1069,18 +967,6 @@ bool event_grapht::critical_cyclet::is_not_weak_uniproc() const return (it!=end()); } -/*******************************************************************\ - -Function: event_grapht::critical_cyclet::is_not_thin_air - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool event_grapht::critical_cyclet::is_not_thin_air() const { // assert(size()>2); @@ -1129,18 +1015,6 @@ bool event_grapht::critical_cyclet::is_not_thin_air() const return true; } -/*******************************************************************\ - -Function: event_grapht::critical_cyclet::print - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string event_grapht::critical_cyclet::print() const { std::string cycle="Cycle: "; @@ -1149,18 +1023,6 @@ std::string event_grapht::critical_cyclet::print() const return cycle + " End of cycle."; } -/*******************************************************************\ - -Function: event_grapht::critical_cyclet::print_unsafes - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string event_grapht::critical_cyclet::print_unsafes() const { std::string name="Unsafe pairs: "; @@ -1208,18 +1070,6 @@ std::string event_grapht::critical_cyclet::print_unsafes() const return name; } -/*******************************************************************\ - -Function: event_grapht::critical_cyclet::print_events - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string event_grapht::critical_cyclet::print_events() const { std::string cycle="Cycle: "; @@ -1232,18 +1082,6 @@ std::string event_grapht::critical_cyclet::print_events() const return cycle+" End of cycle."; } -/*******************************************************************\ - -Function: event_grapht::critical_cyclet::print_output - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string event_grapht::critical_cyclet::print_output() const { std::string cycle; @@ -1257,18 +1095,6 @@ std::string event_grapht::critical_cyclet::print_output() const return cycle; } -/*******************************************************************\ - -Function: event_grapht::critical_cyclet::print_detail - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string event_grapht::critical_cyclet::print_detail( const critical_cyclet &reduced, std::map &map_id2var, @@ -1298,18 +1124,6 @@ std::string event_grapht::critical_cyclet::print_detail( return cycle; } -/*******************************************************************\ - -Function: event_grapht::critical_cyclet::print_all - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string event_grapht::critical_cyclet::print_all( memory_modelt model, std::map &map_id2var, @@ -1340,18 +1154,6 @@ std::string event_grapht::critical_cyclet::print_all( return cycle; } -/*******************************************************************\ - -Function: event_grapht::critical_cyclet::hide_internals - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void event_grapht::critical_cyclet::hide_internals( critical_cyclet &reduced) const { @@ -1428,18 +1230,6 @@ void event_grapht::critical_cyclet::hide_internals( } } -/*******************************************************************\ - -Function: event_grapht::critical_cyclet::print_name - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string event_grapht::critical_cyclet::print_name( const critical_cyclet &reduced, memory_modelt model) const @@ -1745,18 +1535,6 @@ std::string event_grapht::critical_cyclet::print_name( return name; } -/*******************************************************************\ - -Function: event_grapht::critical_cyclet::print_dot - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void event_grapht::critical_cyclet::print_dot( std::ostream &str, unsigned colour, diff --git a/src/goto-instrument/wmm/event_graph.h b/src/goto-instrument/wmm/event_graph.h index 4ae9c067264..7670059ed43 100644 --- a/src/goto-instrument/wmm/event_graph.h +++ b/src/goto-instrument/wmm/event_graph.h @@ -8,6 +8,9 @@ Date: 2012 \*******************************************************************/ +/// \file +/// graph of abstract events + #ifndef CPROVER_GOTO_INSTRUMENT_WMM_EVENT_GRAPH_H #define CPROVER_GOTO_INSTRUMENT_WMM_EVENT_GRAPH_H @@ -25,10 +28,6 @@ Date: 2012 class messaget; class namespacet; -/*******************************************************************\ - graph of abstract events -\*******************************************************************/ - typedef grapht wmm_grapht; typedef wmm_grapht::node_indext event_idt; diff --git a/src/goto-instrument/wmm/fence.cpp b/src/goto-instrument/wmm/fence.cpp index 34c0c387ac5..7c820f238f9 100644 --- a/src/goto-instrument/wmm/fence.cpp +++ b/src/goto-instrument/wmm/fence.cpp @@ -8,6 +8,9 @@ Date: February 2012 \*******************************************************************/ +/// \file +/// Fences for instrumentation + #include #include "fence.h" diff --git a/src/goto-instrument/wmm/fence.h b/src/goto-instrument/wmm/fence.h index 5d14c2cc7a3..0e08d23be28 100644 --- a/src/goto-instrument/wmm/fence.h +++ b/src/goto-instrument/wmm/fence.h @@ -8,6 +8,9 @@ Date: February 2012 \*******************************************************************/ +/// \file +/// Fences for instrumentation + #ifndef CPROVER_GOTO_INSTRUMENT_WMM_FENCE_H #define CPROVER_GOTO_INSTRUMENT_WMM_FENCE_H diff --git a/src/goto-instrument/wmm/goto2graph.cpp b/src/goto-instrument/wmm/goto2graph.cpp index efcd626cb10..9907a47d9ab 100644 --- a/src/goto-instrument/wmm/goto2graph.cpp +++ b/src/goto-instrument/wmm/goto2graph.cpp @@ -8,6 +8,9 @@ Date: 2012 \*******************************************************************/ +/// \file +/// Turns a goto-program into an abstract event graph + #include #include #include @@ -30,18 +33,7 @@ Date: 2012 // #define PRINT_UNSAFES -/*******************************************************************\ - -Function: instrumentert::local - - Inputs: - - Outputs: - - Purpose: is local variable? - -\*******************************************************************/ - +/// is local variable? bool inline instrumentert::local(const irep_idt &id) { std::string identifier=id2string(id); @@ -95,20 +87,8 @@ bool inline instrumentert::cfg_visitort::local(const irep_idt &i) return instrumenter.local(i); } -/*******************************************************************\ - -Function: instrumentert::goto2graph_cfg - - Inputs: - - Outputs: - - Purpose: goes through CFG and build a static abstract event - graph overapproximating the read/write relations for any - executions - -\*******************************************************************/ - +/// goes through CFG and build a static abstract event graph overapproximating +/// the read/write relations for any executions unsigned instrumentert::goto2graph_cfg( value_setst &value_sets, memory_modelt model, @@ -169,18 +149,6 @@ unsigned instrumentert::goto2graph_cfg( return visitor.max_thread; } -/*******************************************************************\ - -Function: instrumentert::cfg_visitort::visit_cfg_function - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void instrumentert::cfg_visitort::visit_cfg_function( /* value_sets and options */ value_setst &value_sets, @@ -319,18 +287,6 @@ void instrumentert::cfg_visitort::visit_cfg_function( } } -/*******************************************************************\ - -Function: instrumentert::visit_cfg_propagate - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void inline instrumentert::cfg_visitort::visit_cfg_propagate( goto_programt::instructionst::iterator i_it) { @@ -343,34 +299,11 @@ void inline instrumentert::cfg_visitort::visit_cfg_propagate( in_pos[i_it].insert(node); } -/*******************************************************************\ - -Function: instrumentert::visit_cfg_thread - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void instrumentert::cfg_visitort::visit_cfg_thread() const { } -/*******************************************************************\ - -Function: instrumentert::visit_cfg_reference_function - - Inputs: - - Outputs: - - Purpose: references the first and last edges of the function - -\*******************************************************************/ - +/// references the first and last edges of the function /* OBSOLETE */ /* Note: can be merged with visit_cfg_body */ /* Warning: we iterate here over the successive instructions of the @@ -459,18 +392,6 @@ void inline instrumentert::cfg_visitort::visit_cfg_reference_function( std::make_pair(in_nodes, out_nodes); } -/*******************************************************************\ - -Function: alt_copy_segment - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - event_idt alt_copy_segment(wmm_grapht &alt_egraph, event_idt begin, event_idt end) { @@ -480,18 +401,6 @@ event_idt alt_copy_segment(wmm_grapht &alt_egraph, return end; } -/*******************************************************************\ - -Function: instrumentert::visit_cfg_visitort::contains_shared_array - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool instrumentert::cfg_visitort::contains_shared_array( goto_programt::const_targett targ, goto_programt::const_targett i_it, @@ -540,18 +449,7 @@ bool instrumentert::cfg_visitort::contains_shared_array( } -/*******************************************************************\ - -Function: instrumentert::visit_cfg_visitort::visit_cfg_body - - Inputs: - - Outputs: - - Purpose: strategy: fwd/bwd alternation - -\*******************************************************************/ - +/// strategy: fwd/bwd alternation void inline instrumentert::cfg_visitort::visit_cfg_body( goto_programt::const_targett i_it, loop_strategyt replicate_body, @@ -597,18 +495,6 @@ void inline instrumentert::cfg_visitort::visit_cfg_body( } } -/*******************************************************************\ - -Function: instrumentert::visit_cfg_visitort::visit_cfg_duplicate - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void inline instrumentert::cfg_visitort::visit_cfg_duplicate( goto_programt::const_targett targ, goto_programt::const_targett i_it) @@ -672,18 +558,7 @@ void inline instrumentert::cfg_visitort::visit_cfg_duplicate( } } -/*******************************************************************\ - -Function: instrumentert::visit_cfg_visitort::visit_cfg_backedge - - Inputs: - - Outputs: - - Purpose: strategy: fwd/bwd alternation - -\*******************************************************************/ - +/// strategy: fwd/bwd alternation void inline instrumentert::cfg_visitort::visit_cfg_backedge( goto_programt::const_targett targ, goto_programt::const_targett i_it) @@ -750,18 +625,6 @@ void inline instrumentert::cfg_visitort::visit_cfg_backedge( } } -/*******************************************************************\ - -Function: instrumentert::visit_cfg_goto - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void instrumentert::cfg_visitort::visit_cfg_goto( goto_programt::instructionst::iterator i_it, loop_strategyt replicate_body, @@ -791,18 +654,6 @@ void instrumentert::cfg_visitort::visit_cfg_goto( } } -/*******************************************************************\ - -Function: intrumentert::visit_cfg_function_call - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void instrumentert::cfg_visitort::visit_cfg_function_call( value_setst &value_sets, goto_programt::instructionst::iterator i_it, @@ -870,18 +721,6 @@ void instrumentert::cfg_visitort::visit_cfg_function_call( } } -/*******************************************************************\ - -Function: instrumentert::visit_cfg_lwfence - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void instrumentert::cfg_visitort::visit_cfg_lwfence( goto_programt::instructionst::iterator i_it) { @@ -914,18 +753,6 @@ void instrumentert::cfg_visitort::visit_cfg_lwfence( updated.insert(i_it); } -/*******************************************************************\ - -Function: instrumentert::visit_cfg_lwfence - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void instrumentert::cfg_visitort::visit_cfg_asm_fence( goto_programt::instructionst::iterator i_it) { @@ -966,18 +793,6 @@ void instrumentert::cfg_visitort::visit_cfg_asm_fence( updated.insert(i_it); } -/*******************************************************************\ - -Function: instrumentert::visit_cfg_assign - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void instrumentert::cfg_visitort::visit_cfg_assign( value_setst &value_sets, namespacet &ns, @@ -1295,18 +1110,6 @@ void instrumentert::cfg_visitort::visit_cfg_assign( } } -/*******************************************************************\ - -Function: instrumentert::visit_cfg_fence - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void instrumentert::cfg_visitort::visit_cfg_fence( goto_programt::instructionst::iterator i_it) { @@ -1342,36 +1145,12 @@ void instrumentert::cfg_visitort::visit_cfg_fence( updated.insert(i_it); } -/*******************************************************************\ - -Function: intrumentert::visit_cfg_skip - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void instrumentert::cfg_visitort::visit_cfg_skip( goto_programt::instructionst::iterator i_it) { visit_cfg_propagate(i_it); } -/*******************************************************************\ - -Function: intrumentert::add_instr_to_interleaving - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void inline instrumentert::add_instr_to_interleaving( goto_programt::instructionst::iterator it, goto_programt &interleaving) @@ -1404,18 +1183,6 @@ void inline instrumentert::add_instr_to_interleaving( current_instruction->swap(new_instruction); } -/*******************************************************************\ - -Function: instrumentert::is_cfg_spurious - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool instrumentert::is_cfg_spurious(const event_grapht::critical_cyclet &cyc) { message.debug() << "spurious by CFG? " << messaget::eom; @@ -1557,18 +1324,6 @@ bool instrumentert::is_cfg_spurious(const event_grapht::critical_cyclet &cyc) #endif } -/*******************************************************************\ - -Function: instrumentert::cfg_cycles_filter - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void instrumentert::cfg_cycles_filter() { if(!set_of_cycles.empty()) @@ -1616,18 +1371,6 @@ void instrumentert::cfg_cycles_filter() message.status() << "No cycle to filter" << messaget::eom; } -/*******************************************************************\ - -Function: instrumentert::print_outputs - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void inline instrumentert::print_outputs_local( const std::set &set, std::ofstream &dot, @@ -1787,18 +1530,7 @@ void instrumentert::print_outputs(memory_modelt model, bool hide_internals) table.close(); } -/*******************************************************************\ - -Function: instrumentert::collect_cycles_by_SCCs - - Inputs: - - Outputs: - - Purpose: Note: can be distributed (#define DISTRIBUTED) - -\*******************************************************************/ - +/// Note: can be distributed (#define DISTRIBUTED) #if 1 // #ifdef _WIN32 void instrumentert::collect_cycles_by_SCCs(memory_modelt model) diff --git a/src/goto-instrument/wmm/goto2graph.h b/src/goto-instrument/wmm/goto2graph.h index 46193c5239a..49adbfdb640 100644 --- a/src/goto-instrument/wmm/goto2graph.h +++ b/src/goto-instrument/wmm/goto2graph.h @@ -8,6 +8,9 @@ Date: 2012 \*******************************************************************/ +/// \file +/// Instrumenter + #ifndef CPROVER_GOTO_INSTRUMENT_WMM_GOTO2GRAPH_H #define CPROVER_GOTO_INSTRUMENT_WMM_GOTO2GRAPH_H diff --git a/src/goto-instrument/wmm/instrumenter_pensieve.h b/src/goto-instrument/wmm/instrumenter_pensieve.h index 7a5210448fe..1e954344322 100644 --- a/src/goto-instrument/wmm/instrumenter_pensieve.h +++ b/src/goto-instrument/wmm/instrumenter_pensieve.h @@ -6,6 +6,9 @@ Module: Instrumenter \*******************************************************************/ +/// \file +/// Instrumenter + #ifndef CPROVER_GOTO_INSTRUMENT_WMM_INSTRUMENTER_PENSIEVE_H #define CPROVER_GOTO_INSTRUMENT_WMM_INSTRUMENTER_PENSIEVE_H diff --git a/src/goto-instrument/wmm/instrumenter_strategies.cpp b/src/goto-instrument/wmm/instrumenter_strategies.cpp index f06ed867ab5..258eec8df0b 100644 --- a/src/goto-instrument/wmm/instrumenter_strategies.cpp +++ b/src/goto-instrument/wmm/instrumenter_strategies.cpp @@ -8,6 +8,9 @@ Date: 2012 \*******************************************************************/ +/// \file +/// Strategies for picking the abstract events to instrument + #include #include @@ -19,18 +22,6 @@ Date: 2012 #include #endif -/*******************************************************************\ - -Function: instrumentert::instrument_with_strategy - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void instrumentert::instrument_with_strategy(instrumentation_strategyt strategy) { var_to_instr.clear(); @@ -90,18 +81,6 @@ void instrumentert::instrument_with_strategy(instrumentation_strategyt strategy) message.debug() << "no cycles to instrument" << messaget::eom; } -/*******************************************************************\ - -Function: instrumentert::instrument_all_inserter - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void inline instrumentert::instrument_all_inserter( const std::set &set_of_cycles) { @@ -130,18 +109,6 @@ void inline instrumentert::instrument_all_inserter( } } -/*******************************************************************\ - -Function: instrumentert::instrument_one_event_per_cycle - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void inline instrumentert::instrument_one_event_per_cycle_inserter( const std::set &set_of_cycles) { @@ -193,18 +160,6 @@ void inline instrumentert::instrument_one_event_per_cycle_inserter( } } -/*******************************************************************\ - -Function: instrumentert::instrument_one_read_per_cycle - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void inline instrumentert::instrument_one_read_per_cycle_inserter( const std::set &set_of_cycles) { @@ -212,18 +167,6 @@ void inline instrumentert::instrument_one_read_per_cycle_inserter( throw "read first strategy not implemented yet"; } -/*******************************************************************\ - -Function: instrumentert::instrument_one_write_per_cycle - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void inline instrumentert::instrument_one_write_per_cycle_inserter( const std::set &set_of_cycles) { @@ -231,18 +174,7 @@ void inline instrumentert::instrument_one_write_per_cycle_inserter( throw "write first strategy not implemented yet"; } -/*******************************************************************\ - -Function: instrumentert::cost - - Inputs: - - Outputs: - - Purpose: cost function - -\*******************************************************************/ - +/// cost function unsigned inline instrumentert::cost( const event_grapht::critical_cyclet::delayt &e) { @@ -258,18 +190,6 @@ unsigned inline instrumentert::cost( return 3; } -/*******************************************************************\ - -Function: instrumentert::instrument_minimum_interference - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void inline instrumentert::instrument_minimum_interference_inserter( const std::set &set_of_cycles) { @@ -434,18 +354,6 @@ void inline instrumentert::instrument_minimum_interference_inserter( #endif } -/*******************************************************************\ - -Function: instrumentert::instrument_my_events_inserter - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void inline instrumentert::instrument_my_events_inserter( const std::set &set, const std::set &my_events) @@ -478,18 +386,6 @@ void inline instrumentert::instrument_my_events_inserter( } } -/*******************************************************************\ - -Function: instrumentert::instrument_my_events - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void instrumentert::instrument_my_events( const std::set &my_events) { @@ -508,18 +404,6 @@ void instrumentert::instrument_my_events( message.debug() << "no cycles to instrument" << messaget::eom; } -/*******************************************************************\ - -Function: extract_my_events - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::set instrumentert::extract_my_events() { std::ifstream file; diff --git a/src/goto-instrument/wmm/pair_collection.cpp b/src/goto-instrument/wmm/pair_collection.cpp index 4748ac2d2e7..9226226fccd 100644 --- a/src/goto-instrument/wmm/pair_collection.cpp +++ b/src/goto-instrument/wmm/pair_collection.cpp @@ -9,6 +9,10 @@ Date: 2013 \*******************************************************************/ +/// \file +/// collection of pairs (for Pensieve's static delay-set analysis) in graph of +/// abstract events + #include #include @@ -18,18 +22,6 @@ Date: 2013 #define OUTPUT(s, fence, file, line, id, type) \ s< #include @@ -30,18 +33,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "goto_convert_class.h" #include "format_strings.h" -/*******************************************************************\ - -Function: goto_convertt::do_prob_uniform - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_convertt::do_prob_uniform( const exprt &lhs, const exprt &function, @@ -120,18 +111,6 @@ void goto_convertt::do_prob_uniform( copy(assignment, ASSIGN, dest); } -/*******************************************************************\ - -Function: goto_convertt::do_prob_coin - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_convertt::do_prob_coin( const exprt &lhs, const exprt &function, @@ -209,18 +188,6 @@ void goto_convertt::do_prob_coin( copy(assignment, ASSIGN, dest); } -/*******************************************************************\ - -Function: goto_convertt::do_printf - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_convertt::do_printf( const exprt &lhs, const exprt &function, @@ -256,18 +223,6 @@ void goto_convertt::do_printf( assert(false); } -/*******************************************************************\ - -Function: goto_convertt::do_scanf - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_convertt::do_scanf( const exprt &lhs, const exprt &function, @@ -371,18 +326,6 @@ void goto_convertt::do_scanf( assert(false); } -/*******************************************************************\ - -Function: goto_convertt::do_input - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_convertt::do_input( const exprt &lhs, const exprt &function, @@ -404,18 +347,6 @@ void goto_convertt::do_input( copy(input_code, OTHER, dest); } -/*******************************************************************\ - -Function: goto_convertt::do_output - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_convertt::do_output( const exprt &lhs, const exprt &function, @@ -437,18 +368,6 @@ void goto_convertt::do_output( copy(output_code, OTHER, dest); } -/*******************************************************************\ - -Function: goto_convertt::do_atomic_begin - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_convertt::do_atomic_begin( const exprt &lhs, const exprt &function, @@ -473,18 +392,6 @@ void goto_convertt::do_atomic_begin( t->source_location=function.source_location(); } -/*******************************************************************\ - -Function: goto_convertt::do_atomic_end - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_convertt::do_atomic_end( const exprt &lhs, const exprt &function, @@ -509,18 +416,6 @@ void goto_convertt::do_atomic_end( t->source_location=function.source_location(); } -/*******************************************************************\ - -Function: goto_convertt::do_cpp_new - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_convertt::do_cpp_new( const exprt &lhs, const side_effect_exprt &rhs, @@ -641,18 +536,6 @@ void goto_convertt::do_cpp_new( dest.destructive_append(tmp_initializer); } -/*******************************************************************\ - -Function: set_class_identifier - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void set_class_identifier( struct_exprt &expr, const namespacet &ns, @@ -678,18 +561,6 @@ void set_class_identifier( } } -/*******************************************************************\ - -Function: goto_convertt::do_java_new - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_convertt::do_java_new( const exprt &lhs, const side_effect_exprt &rhs, @@ -745,18 +616,6 @@ void goto_convertt::do_java_new( t_i->source_location=location; } -/*******************************************************************\ - -Function: goto_convertt::do_java_new_array - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_convertt::do_java_new_array( const exprt &lhs, const side_effect_exprt &rhs, @@ -936,19 +795,7 @@ void goto_convertt::do_java_new_array( } } -/*******************************************************************\ - -Function: goto_convertt::cpp_new_initializer - - Inputs: - - Outputs: - - Purpose: builds a goto program for object initialization - after new - -\*******************************************************************/ - +/// builds a goto program for object initialization after new void goto_convertt::cpp_new_initializer( const exprt &lhs, const side_effect_exprt &rhs, @@ -977,18 +824,6 @@ void goto_convertt::cpp_new_initializer( } } -/*******************************************************************\ - -Function: goto_convertt::get_array_argument - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - exprt goto_convertt::get_array_argument(const exprt &src) { if(src.id()==ID_typecast) @@ -1025,18 +860,6 @@ exprt goto_convertt::get_array_argument(const exprt &src) return src.op0().op0(); } -/*******************************************************************\ - -Function: goto_convertt::do_array_set - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_convertt::do_array_set( const exprt &lhs, const exprt &function, @@ -1057,18 +880,6 @@ void goto_convertt::do_array_set( copy(array_set_statement, OTHER, dest); } -/*******************************************************************\ - -Function: goto_convertt::do_array_copy - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_convertt::do_array_copy( const exprt &lhs, const exprt &function, @@ -1089,18 +900,6 @@ void goto_convertt::do_array_copy( copy(array_copy_statement, OTHER, dest); } -/*******************************************************************\ - -Function: goto_convertt::do_array_equal - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_convertt::do_array_equal( const exprt &lhs, const exprt &function, @@ -1144,18 +943,6 @@ void goto_convertt::do_array_equal( } } -/*******************************************************************\ - -Function: is_lvalue - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool is_lvalue(const exprt &expr) { if(expr.id()==ID_index) @@ -1170,18 +957,6 @@ bool is_lvalue(const exprt &expr) return false; } -/*******************************************************************\ - -Function: make_va_list - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - exprt make_va_list(const exprt &expr) { // we first strip any typecast @@ -1197,19 +972,7 @@ exprt make_va_list(const exprt &expr) return expr; } -/*******************************************************************\ - -Function: goto_convertt::do_function_call_symbol - - Inputs: - - Outputs: - - Purpose: add function calls to function queue for later - processing - -\*******************************************************************/ - +/// add function calls to function queue for later processing void goto_convertt::do_function_call_symbol( const exprt &lhs, const symbol_exprt &function, diff --git a/src/goto-programs/cfg.h b/src/goto-programs/cfg.h index 2fc7522a67d..364e13b7b74 100644 --- a/src/goto-programs/cfg.h +++ b/src/goto-programs/cfg.h @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Control Flow Graph + #ifndef CPROVER_GOTO_PROGRAMS_CFG_H #define CPROVER_GOTO_PROGRAMS_CFG_H @@ -14,14 +17,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "goto_functions.h" -/*******************************************************************\ - - Class: cfg_baset - - Purpose: - -\*******************************************************************/ - class empty_cfg_nodet { }; @@ -136,14 +131,6 @@ class cfg_baset:public grapht< cfg_base_nodet > bool nodes_empty(P &program) const { return program.instructions.empty(); } }; -/*******************************************************************\ - - Class: concurrent_cfg_baset - - Purpose: - -\*******************************************************************/ - template @@ -157,14 +144,6 @@ class concurrent_cfg_baset:public virtual cfg_baset typename cfg_baset::entryt &entry); }; -/*******************************************************************\ - - Class: procedure_local_cfg_baset - - Purpose: - -\*******************************************************************/ - template @@ -179,14 +158,6 @@ class procedure_local_cfg_baset:public virtual cfg_baset typename cfg_baset::entryt &entry); }; -/*******************************************************************\ - - Class: procedure_local_concurrent_cfg_baset - - Purpose: - -\*******************************************************************/ - template @@ -196,18 +167,6 @@ class procedure_local_concurrent_cfg_baset: { }; -/*******************************************************************\ - -Function: cfg_baset::compute_edges_goto - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - template void cfg_baset::compute_edges_goto( const goto_programt &goto_program, @@ -224,18 +183,6 @@ void cfg_baset::compute_edges_goto( this->add_edge(entry, entry_map[t]); } -/*******************************************************************\ - -Function: cfg_baset::compute_edges_catch - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - template void cfg_baset::compute_edges_catch( const goto_programt &goto_program, @@ -254,18 +201,6 @@ void cfg_baset::compute_edges_catch( this->add_edge(entry, entry_map[t]); } -/*******************************************************************\ - -Function: cfg_baset::compute_edges_throw - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - template void cfg_baset::compute_edges_throw( const goto_programt &goto_program, @@ -276,18 +211,6 @@ void cfg_baset::compute_edges_throw( // no (trivial) successors } -/*******************************************************************\ - -Function: cfg_baset::compute_edges_start_thread - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - template void cfg_baset::compute_edges_start_thread( const goto_programt &goto_program, @@ -299,18 +222,6 @@ void cfg_baset::compute_edges_start_thread( this->add_edge(entry, entry_map[next_PC]); } -/*******************************************************************\ - -Function: concurrent_cfg_baset::compute_edges_start_thread - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - template void concurrent_cfg_baset::compute_edges_start_thread( const goto_programt &goto_program, @@ -329,18 +240,6 @@ void concurrent_cfg_baset::compute_edges_start_thread( this->add_edge(entry, this->entry_map[t]); } -/*******************************************************************\ - -Function: cfg_baset::compute_edges_function_call - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - template void cfg_baset::compute_edges_function_call( const goto_functionst &goto_functions, @@ -392,18 +291,6 @@ void cfg_baset::compute_edges_function_call( this->add_edge(entry, entry_map[next_PC]); } -/*******************************************************************\ - -Function: procedure_local_cfg_baset::compute_edges_function_call - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - template void procedure_local_cfg_baset::compute_edges_function_call( const goto_functionst &goto_functions, @@ -422,18 +309,6 @@ void procedure_local_cfg_baset::compute_edges_function_call( this->add_edge(entry, this->entry_map[next_PC]); } -/*******************************************************************\ - -Function: cfg_baset::compute_edges - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - template void cfg_baset::compute_edges( const goto_functionst &goto_functions, @@ -508,18 +383,6 @@ void cfg_baset::compute_edges( } } -/*******************************************************************\ - -Function: cfg_baset::compute_edges - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - template void cfg_baset::compute_edges( const goto_functionst &goto_functions, @@ -531,18 +394,6 @@ void cfg_baset::compute_edges( compute_edges(goto_functions, goto_program, it); } -/*******************************************************************\ - -Function: cfg_baset::compute_edges - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - template void cfg_baset::compute_edges( const goto_functionst &goto_functions) diff --git a/src/goto-programs/class_hierarchy.cpp b/src/goto-programs/class_hierarchy.cpp index 1311a3e7fdc..10a16760b98 100644 --- a/src/goto-programs/class_hierarchy.cpp +++ b/src/goto-programs/class_hierarchy.cpp @@ -8,6 +8,9 @@ Date: April 2016 \*******************************************************************/ +/// \file +/// Class Hierarchy + #include #include @@ -15,18 +18,6 @@ Date: April 2016 #include "class_hierarchy.h" -/*******************************************************************\ - -Function: class_hierarchyt::operator() - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void class_hierarchyt::operator()(const symbol_tablet &symbol_table) { forall_symbols(it, symbol_table.symbols) @@ -52,18 +43,6 @@ void class_hierarchyt::operator()(const symbol_tablet &symbol_table) } } -/*******************************************************************\ - -Function: class_hierarchyt::get_children_trans_rec - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void class_hierarchyt::get_children_trans_rec( const irep_idt &c, idst &dest) const @@ -81,18 +60,6 @@ void class_hierarchyt::get_children_trans_rec( get_children_trans_rec(child, dest); } -/*******************************************************************\ - -Function: class_hierarchyt::get_parents_trans_rec - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void class_hierarchyt::get_parents_trans_rec( const irep_idt &c, idst &dest) const @@ -110,18 +77,6 @@ void class_hierarchyt::get_parents_trans_rec( get_parents_trans_rec(child, dest); } -/*******************************************************************\ - -Function: class_hierarchyt::output - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void class_hierarchyt::output(std::ostream &out) const { for(const auto &c : class_map) diff --git a/src/goto-programs/class_hierarchy.h b/src/goto-programs/class_hierarchy.h index bef2c7ec7eb..5cd33b4d864 100644 --- a/src/goto-programs/class_hierarchy.h +++ b/src/goto-programs/class_hierarchy.h @@ -8,6 +8,9 @@ Date: April 2016 \*******************************************************************/ +/// \file +/// Class Hierarchy + #ifndef CPROVER_GOTO_PROGRAMS_CLASS_HIERARCHY_H #define CPROVER_GOTO_PROGRAMS_CLASS_HIERARCHY_H diff --git a/src/goto-programs/class_identifier.cpp b/src/goto-programs/class_identifier.cpp index 6e814174e51..bbdc94c8533 100644 --- a/src/goto-programs/class_identifier.cpp +++ b/src/goto-programs/class_identifier.cpp @@ -6,24 +6,17 @@ Author: Chris Smowton, chris.smowton@diffblue.com \*******************************************************************/ +/// \file +/// Extract class identifier + #include "class_identifier.h" #include #include -/*******************************************************************\ - -Function: build_class_identifier - - Inputs: Struct expression - - Outputs: Member expression giving the clsid field of the input, - or its parent, grandparent, etc. - - Purpose: - -\*******************************************************************/ - +/// \par parameters: Struct expression +/// \return Member expression giving the clsid field of the input, or its +/// parent, grandparent, etc. static exprt build_class_identifier( const exprt &src, const namespacet &ns) @@ -56,19 +49,9 @@ static exprt build_class_identifier( } } -/*******************************************************************\ - -Function: get_class_identifier_field - - Inputs: Pointer expression of any pointer type, including void*, - and a recommended access type if the pointer is void-typed. - - Outputs: Member expression to access a class identifier, as above. - - Purpose: - -\*******************************************************************/ - +/// \par parameters: Pointer expression of any pointer type, including void*, +/// and a recommended access type if the pointer is void-typed. +/// \return Member expression to access a class identifier, as above. exprt get_class_identifier_field( const exprt &this_expr_in, const symbol_typet &suggested_type, diff --git a/src/goto-programs/class_identifier.h b/src/goto-programs/class_identifier.h index 8ae6dc4ce71..ccc679b8e1f 100644 --- a/src/goto-programs/class_identifier.h +++ b/src/goto-programs/class_identifier.h @@ -6,6 +6,9 @@ Author: Chris Smowton, chris.smowton@diffblue.com \*******************************************************************/ +/// \file +/// Extract class identifier + #ifndef CPROVER_GOTO_PROGRAMS_CLASS_IDENTIFIER_H #define CPROVER_GOTO_PROGRAMS_CLASS_IDENTIFIER_H diff --git a/src/goto-programs/compute_called_functions.cpp b/src/goto-programs/compute_called_functions.cpp index 0c1acc08d22..251a89c5054 100644 --- a/src/goto-programs/compute_called_functions.cpp +++ b/src/goto-programs/compute_called_functions.cpp @@ -6,22 +6,14 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Query Called Functions + #include #include "compute_called_functions.h" -/*******************************************************************\ - -Function: compute_address_taken_functions - - Inputs: - - Outputs: - - Purpose: get all functions whose address is taken - -\*******************************************************************/ - +/// get all functions whose address is taken void compute_address_taken_functions( const exprt &src, std::set &address_taken) @@ -40,18 +32,7 @@ void compute_address_taken_functions( } } -/*******************************************************************\ - -Function: compute_functions - - Inputs: - - Outputs: - - Purpose: get all functions in the expression - -\*******************************************************************/ - +/// get all functions in the expression void compute_functions( const exprt &src, std::set &address_taken) @@ -64,18 +45,7 @@ void compute_functions( address_taken.insert(to_symbol_expr(src).get_identifier()); } -/*******************************************************************\ - -Function: compute_address_taken_functions - - Inputs: - - Outputs: - - Purpose: get all functions whose address is taken - -\*******************************************************************/ - +/// get all functions whose address is taken void compute_address_taken_functions( const goto_programt &goto_program, std::set &address_taken) @@ -87,18 +57,7 @@ void compute_address_taken_functions( } } -/*******************************************************************\ - -Function: compute_address_taken_functions - - Inputs: - - Outputs: - - Purpose: get all functions whose address is taken - -\*******************************************************************/ - +/// get all functions whose address is taken void compute_address_taken_functions( const goto_functionst &goto_functions, std::set &address_taken) @@ -107,18 +66,7 @@ void compute_address_taken_functions( compute_address_taken_functions(it->second.body, address_taken); } -/*******************************************************************\ - -Function: compute_called_functions - - Inputs: - - Outputs: - - Purpose: computes the functions that are (potentially) called - -\*******************************************************************/ - +/// computes the functions that are (potentially) called void compute_called_functions( const goto_functionst &goto_functions, std::set &functions) @@ -163,18 +111,7 @@ void compute_called_functions( } } -/*******************************************************************\ - -Function: compute_called_functions - - Inputs: - - Outputs: - - Purpose: computes the functions that are (potentially) called - -\*******************************************************************/ - +/// computes the functions that are (potentially) called void compute_called_functions( const goto_modelt &goto_model, std::set &functions) diff --git a/src/goto-programs/compute_called_functions.h b/src/goto-programs/compute_called_functions.h index 40dba2b894e..6f92b420b37 100644 --- a/src/goto-programs/compute_called_functions.h +++ b/src/goto-programs/compute_called_functions.h @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Query Called Functions + #ifndef CPROVER_GOTO_PROGRAMS_COMPUTE_CALLED_FUNCTIONS_H #define CPROVER_GOTO_PROGRAMS_COMPUTE_CALLED_FUNCTIONS_H diff --git a/src/goto-programs/convert_nondet.cpp b/src/goto-programs/convert_nondet.cpp index 7762b13a9f3..9e1a6d388c5 100644 --- a/src/goto-programs/convert_nondet.cpp +++ b/src/goto-programs/convert_nondet.cpp @@ -6,6 +6,9 @@ Author: Reuben Thomas, reuben.thomas@diffblue.com \*******************************************************************/ +/// \file +/// Convert side_effect_expr_nondett expressions + #include "goto-programs/convert_nondet.h" #include "goto-programs/goto_convert.h" #include "goto-programs/goto_model.h" @@ -15,26 +18,15 @@ Author: Reuben Thomas, reuben.thomas@diffblue.com #include "util/irep_ids.h" -/*******************************************************************\ - -Function: insert_nondet_init_code - - Inputs: - goto_program: The goto program to modify. - target: One of the steps in that goto program. - symbol_table: The global symbol table. - message_handler: Handles logging. - max_nondet_array_length: Maximum size of new nondet arrays. - - Outputs: The next instruction to process with this function. - - Purpose: Checks an instruction to see whether it contains an assignment - from side_effect_expr_nondet. If so, replaces the instruction - with a range of instructions to properly nondet-initialize - the lhs. - -\*******************************************************************/ - +/// Checks an instruction to see whether it contains an assignment from +/// side_effect_expr_nondet. If so, replaces the instruction with a range of +/// instructions to properly nondet-initialize the lhs. +/// \param goto_program: The goto program to modify. +/// \param target: One of the steps in that goto program. +/// \param symbol_table: The global symbol table. +/// \param message_handler: Handles logging. +/// \param max_nondet_array_length: Maximum size of new nondet arrays. +/// \return The next instruction to process with this function. static goto_programt::targett insert_nondet_init_code( goto_programt &goto_program, const goto_programt::targett &target, @@ -108,22 +100,13 @@ static goto_programt::targett insert_nondet_init_code( return next_instr; } -/*******************************************************************\ - -Function: convert_nondet - - Inputs: - goto_program: The goto program to modify. - symbol_table: The global symbol table. - message_handler: Handles logging. - max_nondet_array_length: Maximum size of new nondet arrays. - - Purpose: For each instruction in the goto program, checks if it is - an assignment from nondet and replaces it with the appropriate - composite initialization code if so. - -\*******************************************************************/ - +/// For each instruction in the goto program, checks if it is an assignment from +/// nondet and replaces it with the appropriate composite initialization code if +/// so. +/// \param goto_program: The goto program to modify. +/// \param symbol_table: The global symbol table. +/// \param message_handler: Handles logging. +/// \param max_nondet_array_length: Maximum size of new nondet arrays. static void convert_nondet( goto_programt &goto_program, symbol_tablet &symbol_table, diff --git a/src/goto-programs/convert_nondet.h b/src/goto-programs/convert_nondet.h index 919d977a94e..2d083c58bf7 100644 --- a/src/goto-programs/convert_nondet.h +++ b/src/goto-programs/convert_nondet.h @@ -6,6 +6,9 @@ Author: Reuben Thomas, reuben.thomas@diffblue.com \*******************************************************************/ +/// \file +/// Convert side_effect_expr_nondett expressions + #ifndef CPROVER_GOTO_PROGRAMS_CONVERT_NONDET_H #define CPROVER_GOTO_PROGRAMS_CONVERT_NONDET_H @@ -15,21 +18,12 @@ class goto_functionst; class symbol_tablet; class message_handlert; -/*******************************************************************\ - -Function: convert_nondet - - Inputs: - goto_functions: The set of goto programs to modify. - symbol_table: The symbol table to query/update. - message_handler: For error logging. - max_nondet_array_length: The maximum length of any new arrays. - - Purpose: Replace calls to nondet library functions with an internal - nondet representation. - -\*******************************************************************/ - +/// Replace calls to nondet library functions with an internal nondet +/// representation. +/// \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 max_nondet_array_length: The maximum length of any new arrays. void convert_nondet( goto_functionst &goto_functions, symbol_tablet &symbol_table, diff --git a/src/goto-programs/destructor.cpp b/src/goto-programs/destructor.cpp index ba1fe127a5f..956734ddee2 100644 --- a/src/goto-programs/destructor.cpp +++ b/src/goto-programs/destructor.cpp @@ -6,23 +6,14 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Destructor Calls + #include #include #include "destructor.h" -/*******************************************************************\ - -Function: get_destructor - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - code_function_callt get_destructor( const namespacet &ns, const typet &type) diff --git a/src/goto-programs/destructor.h b/src/goto-programs/destructor.h index 2ea310361f3..3fd62efb0c4 100644 --- a/src/goto-programs/destructor.h +++ b/src/goto-programs/destructor.h @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Destructor Calls + #ifndef CPROVER_GOTO_PROGRAMS_DESTRUCTOR_H #define CPROVER_GOTO_PROGRAMS_DESTRUCTOR_H diff --git a/src/goto-programs/elf_reader.cpp b/src/goto-programs/elf_reader.cpp index 9a2212bfbfc..1668a88c8b5 100644 --- a/src/goto-programs/elf_reader.cpp +++ b/src/goto-programs/elf_reader.cpp @@ -6,22 +6,13 @@ Module: Read ELF \*******************************************************************/ +/// \file +/// Read ELF + #include #include "elf_reader.h" -/*******************************************************************\ - -Function: elf_readert::elf_readert - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - elf_readert::elf_readert(std::istream &_in):in(_in) { // read 32-bit header @@ -130,18 +121,6 @@ elf_readert::elf_readert(std::istream &_in):in(_in) } } -/*******************************************************************\ - -Function: elf_readert::get_string - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string elf_readert::get_string(std::streampos index) const { in.seekg(string_table_offset+index); @@ -160,18 +139,6 @@ std::string elf_readert::get_string(std::streampos index) const return result; } -/*******************************************************************\ - -Function: elf_readert::has_section - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool elf_readert::has_section(const std::string &name) const { for(unsigned i=0; i #include @@ -15,18 +18,6 @@ Author: CM Wintersteiger #include "format_strings.h" -/*******************************************************************\ - -Function: parse_flags - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void parse_flags( std::string::const_iterator &it, format_tokent &curtok) @@ -52,18 +43,6 @@ void parse_flags( } } -/*******************************************************************\ - -Function: parse_field_width - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void parse_field_width( std::string::const_iterator &it, format_tokent &curtok) @@ -79,18 +58,6 @@ void parse_field_width( curtok.field_width=string2integer(tmp); } -/*******************************************************************\ - -Function: parse_precision - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void parse_precision( std::string::const_iterator &it, format_tokent &curtok) @@ -113,18 +80,6 @@ void parse_precision( } } -/*******************************************************************\ - -Function: parse_length_modifier - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void parse_length_modifier( std::string::const_iterator &it, format_tokent &curtok) @@ -160,18 +115,6 @@ void parse_length_modifier( } } -/*******************************************************************\ - -Function: parse_conversion_specifier - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void parse_conversion_specifier( const std::string &arg_string, std::string::const_iterator &it, @@ -237,18 +180,6 @@ void parse_conversion_specifier( it++; } -/*******************************************************************\ - -Function: parse_format_string - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - format_token_listt parse_format_string(const std::string &arg_string) { format_token_listt token_list; @@ -287,18 +218,6 @@ format_token_listt parse_format_string(const std::string &arg_string) return token_list; } -/*******************************************************************\ - -Function: get_type - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - typet get_type(const format_tokent &token) { switch(token.type) diff --git a/src/goto-programs/format_strings.h b/src/goto-programs/format_strings.h index 6283b77f19b..8c233324ecf 100644 --- a/src/goto-programs/format_strings.h +++ b/src/goto-programs/format_strings.h @@ -6,6 +6,9 @@ Author: CM Wintersteiger \*******************************************************************/ +/// \file +/// Format String Parser + #ifndef CPROVER_GOTO_PROGRAMS_FORMAT_STRINGS_H #define CPROVER_GOTO_PROGRAMS_FORMAT_STRINGS_H diff --git a/src/goto-programs/goto_asm.cpp b/src/goto-programs/goto_asm.cpp index 782d601a29e..63492b5d9ce 100644 --- a/src/goto-programs/goto_asm.cpp +++ b/src/goto-programs/goto_asm.cpp @@ -6,19 +6,10 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ -#include "goto_convert_class.h" - -/*******************************************************************\ - -Function: goto_convertt::convert_asm - - Inputs: +/// \file +/// Assembler -> Goto - Outputs: - - Purpose: - -\*******************************************************************/ +#include "goto_convert_class.h" void goto_convertt::convert_asm( const code_asmt &code, diff --git a/src/goto-programs/goto_clean_expr.cpp b/src/goto-programs/goto_clean_expr.cpp index c7fa8637194..eae048c62a4 100644 --- a/src/goto-programs/goto_clean_expr.cpp +++ b/src/goto-programs/goto_clean_expr.cpp @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Program Transformation + #include #include #include @@ -16,18 +19,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "goto_convert_class.h" -/*******************************************************************\ - -Function: goto_convertt::make_compound_literal - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - symbol_exprt goto_convertt::make_compound_literal( const exprt &expr, goto_programt &dest) @@ -69,18 +60,6 @@ symbol_exprt goto_convertt::make_compound_literal( return result; } -/*******************************************************************\ - -Function: goto_convertt::needs_cleaning - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool goto_convertt::needs_cleaning(const exprt &expr) { if(expr.id()==ID_dereference || @@ -125,18 +104,7 @@ bool goto_convertt::needs_cleaning(const exprt &expr) return false; } -/*******************************************************************\ - -Function: goto_convertt::rewrite_boolean - - Inputs: - - Outputs: - - Purpose: re-write boolean operators into ?: - -\*******************************************************************/ - +/// re-write boolean operators into ?: void goto_convertt::rewrite_boolean(exprt &expr) { assert(expr.id()==ID_and || expr.id()==ID_or); @@ -192,18 +160,6 @@ void goto_convertt::rewrite_boolean(exprt &expr) expr.swap(tmp); } -/*******************************************************************\ - -Function: goto_convertt::clean_expr - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_convertt::clean_expr( exprt &expr, goto_programt &dest, @@ -481,18 +437,6 @@ void goto_convertt::clean_expr( } } -/*******************************************************************\ - -Function: goto_convertt::clean_expr_address_of - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_convertt::clean_expr_address_of( exprt &expr, goto_programt &dest) @@ -556,18 +500,6 @@ void goto_convertt::clean_expr_address_of( clean_expr_address_of(*it, dest); } -/*******************************************************************\ - -Function: goto_convertt::remove_gcc_conditional_expression - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_convertt::remove_gcc_conditional_expression( exprt &expr, goto_programt &dest) diff --git a/src/goto-programs/goto_convert.cpp b/src/goto-programs/goto_convert.cpp index 25118d0b223..6aec28ea24f 100644 --- a/src/goto-programs/goto_convert.cpp +++ b/src/goto-programs/goto_convert.cpp @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Program Transformation + #include #include @@ -23,18 +26,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "goto_convert_class.h" #include "destructor.h" -/*******************************************************************\ - -Function: is_empty - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - static bool is_empty(const goto_programt &goto_program) { forall_goto_program_instructions(it, goto_program) @@ -46,19 +37,8 @@ static bool is_empty(const goto_programt &goto_program) return true; } -/*******************************************************************\ - -Function: finish_catch_push_targets - - Inputs: - - Outputs: - - Purpose: Populate the CATCH instructions with the targets - corresponding to their associated labels - -\*******************************************************************/ - +/// Populate the CATCH instructions with the targets corresponding to their +/// associated labels static void finish_catch_push_targets(goto_programt &dest) { std::map label_targets; @@ -249,18 +229,6 @@ void goto_convertt::finish_gotos(goto_programt &dest) targets.gotos.clear(); } -/*******************************************************************\ - -Function: goto_convertt::finish_computed_gotos - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_convertt::finish_computed_gotos(goto_programt &goto_program) { for(auto &g_it : targets.computed_gotos) @@ -300,21 +268,9 @@ void goto_convertt::finish_computed_gotos(goto_programt &goto_program) targets.computed_gotos.clear(); } -/*******************************************************************\ - -Function: goto_convertt::finish_guarded_gotos - - Inputs: Destination goto program - - Outputs: - - Purpose: For each if(x) goto z; goto y; z: emitted, - see if any destructor statements were inserted - between goto z and z, and if not, simplify into - if(!x) goto y; - -\*******************************************************************/ - +/// For each if(x) goto z; goto y; z: emitted, see if any destructor statements +/// were inserted between goto z and z, and if not, simplify into if(!x) goto y; +/// \par parameters: Destination goto program void goto_convertt::finish_guarded_gotos(goto_programt &dest) { for(auto &gg : guarded_gotos) @@ -344,35 +300,11 @@ void goto_convertt::finish_guarded_gotos(goto_programt &dest) } } -/*******************************************************************\ - -Function: goto_convertt::goto_convert - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_convertt::goto_convert(const codet &code, goto_programt &dest) { goto_convert_rec(code, dest); } -/*******************************************************************\ - -Function: goto_convertt::goto_convert_rec - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_convertt::goto_convert_rec( const codet &code, goto_programt &dest) @@ -385,18 +317,6 @@ void goto_convertt::goto_convert_rec( finish_catch_push_targets(dest); } -/*******************************************************************\ - -Function: goto_convertt::copy - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_convertt::copy( const codet &code, goto_program_instruction_typet type, @@ -407,18 +327,6 @@ void goto_convertt::copy( t->source_location=code.source_location(); } -/*******************************************************************\ - -Function: goto_convert::convert_label - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_convertt::convert_label( const code_labelt &code, goto_programt &dest) @@ -454,18 +362,6 @@ void goto_convertt::convert_label( target->labels.push_front(label); } -/*******************************************************************\ - -Function: goto_convert::convert_gcc_local_label - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_convertt::convert_gcc_local_label( const codet &code, goto_programt &dest) @@ -473,18 +369,6 @@ void goto_convertt::convert_gcc_local_label( // ignore for now } -/*******************************************************************\ - -Function: goto_convert::convert_switch_case - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_convertt::convert_switch_case( const code_switch_caset &code, goto_programt &dest) @@ -524,18 +408,6 @@ void goto_convertt::convert_switch_case( } } -/*******************************************************************\ - -Function: goto_convert::convert_gcc_switch_case_range - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_convertt::convert_gcc_switch_case_range( const codet &code, goto_programt &dest) @@ -569,18 +441,7 @@ void goto_convertt::convert_gcc_switch_case_range( #endif } -/*******************************************************************\ - -Function: goto_convertt::convert - - Inputs: - - Outputs: - - Purpose: converts 'code' and appends the result to 'dest' - -\*******************************************************************/ - +/// converts 'code' and appends the result to 'dest' void goto_convertt::convert( const codet &code, goto_programt &dest) @@ -714,18 +575,6 @@ void goto_convertt::convert( } } -/*******************************************************************\ - -Function: goto_convertt::convert_block - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_convertt::convert_block( const code_blockt &code, goto_programt &dest) @@ -757,18 +606,6 @@ void goto_convertt::convert_block( targets.destructor_stack.resize(old_stack_size); } -/*******************************************************************\ - -Function: goto_convertt::convert_expression - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_convertt::convert_expression( const code_expressiont &code, goto_programt &dest) @@ -812,18 +649,6 @@ void goto_convertt::convert_expression( } } -/*******************************************************************\ - -Function: goto_convertt::convert_decl - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_convertt::convert_decl( const code_declt &code, goto_programt &dest) @@ -893,18 +718,6 @@ void goto_convertt::convert_decl( } } -/*******************************************************************\ - -Function: goto_convertt::convert_decl_type - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_convertt::convert_decl_type( const codet &code, goto_programt &dest) @@ -912,18 +725,6 @@ void goto_convertt::convert_decl_type( // we remove these } -/*******************************************************************\ - -Function: goto_convertt::convert_assign - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_convertt::convert_assign( const code_assignt &code, goto_programt &dest) @@ -1011,18 +812,6 @@ void goto_convertt::convert_assign( } } -/*******************************************************************\ - -Function: goto_convertt::convert_init - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_convertt::convert_init( const codet &code, goto_programt &dest) @@ -1041,18 +830,6 @@ void goto_convertt::convert_init( convert(to_code_assign(assignment), dest); } -/*******************************************************************\ - -Function: goto_convertt::convert_cpp_delete - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_convertt::convert_cpp_delete( const codet &code, goto_programt &dest) @@ -1118,18 +895,6 @@ void goto_convertt::convert_cpp_delete( convert(delete_call, dest); } -/*******************************************************************\ - -Function: goto_convertt::convert_assert - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_convertt::convert_assert( const code_assertt &code, goto_programt &dest) @@ -1145,18 +910,6 @@ void goto_convertt::convert_assert( t->source_location.set("user-provided", true); } -/*******************************************************************\ - -Function: goto_convertt::convert_skip - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_convertt::convert_skip( const codet &code, goto_programt &dest) @@ -1166,18 +919,6 @@ void goto_convertt::convert_skip( t->code=code; } -/*******************************************************************\ - -Function: goto_convertt::convert_assume - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_convertt::convert_assume( const code_assumet &code, goto_programt &dest) @@ -1191,18 +932,6 @@ void goto_convertt::convert_assume( t->source_location=code.source_location(); } -/*******************************************************************\ - -Function: goto_convertt::convert_loop_invariant - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_convertt::convert_loop_invariant( const codet &code, goto_programt::targett loop) @@ -1226,18 +955,6 @@ void goto_convertt::convert_loop_invariant( loop->guard.add(ID_C_spec_loop_invariant).swap(invariant); } -/*******************************************************************\ - -Function: goto_convertt::convert_for - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_convertt::convert_for( const code_fort &code, goto_programt &dest) @@ -1337,18 +1054,6 @@ void goto_convertt::convert_for( old_targets.restore(targets); } -/*******************************************************************\ - -Function: goto_convertt::convert_while - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_convertt::convert_while( const code_whilet &code, goto_programt &dest) @@ -1409,18 +1114,6 @@ void goto_convertt::convert_while( old_targets.restore(targets); } -/*******************************************************************\ - -Function: goto_convertt::convert_dowhile - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_convertt::convert_dowhile( const codet &code, goto_programt &dest) @@ -1493,18 +1186,6 @@ void goto_convertt::convert_dowhile( old_targets.restore(targets); } -/*******************************************************************\ - -Function: goto_convertt::case_guard - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - exprt goto_convertt::case_guard( const exprt &value, const exprt::operandst &case_op) @@ -1532,18 +1213,6 @@ exprt goto_convertt::case_guard( return dest; } -/*******************************************************************\ - -Function: goto_convertt::convert_switch - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_convertt::convert_switch( const code_switcht &code, goto_programt &dest) @@ -1627,18 +1296,6 @@ void goto_convertt::convert_switch( old_targets.restore(targets); } -/*******************************************************************\ - -Function: goto_convertt::convert_break - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_convertt::convert_break( const code_breakt &code, goto_programt &dest) @@ -1660,18 +1317,6 @@ void goto_convertt::convert_break( t->source_location=code.source_location(); } -/*******************************************************************\ - -Function: goto_convertt::convert_return - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_convertt::convert_return( const code_returnt &code, goto_programt &dest) @@ -1742,18 +1387,6 @@ void goto_convertt::convert_return( t->source_location=new_code.source_location(); } -/*******************************************************************\ - -Function: goto_convertt::convert_continue - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_convertt::convert_continue( const code_continuet &code, goto_programt &dest) @@ -1775,18 +1408,6 @@ void goto_convertt::convert_continue( t->source_location=code.source_location(); } -/*******************************************************************\ - -Function: goto_convertt::convert_goto - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_convertt::convert_goto( const codet &code, goto_programt &dest) @@ -1800,18 +1421,6 @@ void goto_convertt::convert_goto( targets.gotos.push_back(std::make_pair(t, targets.destructor_stack)); } -/*******************************************************************\ - -Function: goto_convertt::convert_gcc_computed_goto - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_convertt::convert_gcc_computed_goto( const codet &code, goto_programt &dest) @@ -1825,18 +1434,6 @@ void goto_convertt::convert_gcc_computed_goto( targets.computed_gotos.push_back(t); } -/*******************************************************************\ - -Function: goto_convertt::convert_non_deterministic_goto - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_convertt::convert_non_deterministic_goto( const codet &code, goto_programt &dest) @@ -1844,18 +1441,6 @@ void goto_convertt::convert_non_deterministic_goto( convert_goto(code, dest); } -/*******************************************************************\ - -Function: goto_convertt::convert_specc_notify - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_convertt::convert_specc_notify( const codet &code, goto_programt &dest) @@ -1873,18 +1458,6 @@ void goto_convertt::convert_specc_notify( copy(code, OTHER, dest); } -/*******************************************************************\ - -Function: goto_convertt::convert_specc_event - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_convertt::convert_specc_event( const exprt &op, std::set &events) @@ -1911,18 +1484,6 @@ void goto_convertt::convert_specc_event( } } -/*******************************************************************\ - -Function: goto_convertt::convert_specc_wait - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_convertt::convert_specc_wait( const codet &code, goto_programt &dest) @@ -1951,18 +1512,6 @@ void goto_convertt::convert_specc_wait( copy(code, OTHER, dest); } -/*******************************************************************\ - -Function: goto_convertt::convert_specc_par - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_convertt::convert_specc_par( const codet &code, goto_programt &dest) @@ -1970,18 +1519,6 @@ void goto_convertt::convert_specc_par( copy(code, OTHER, dest); } -/*******************************************************************\ - -Function: goto_convertt::convert_start_thread - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_convertt::convert_start_thread( const codet &code, goto_programt &dest) @@ -2021,18 +1558,6 @@ void goto_convertt::convert_start_thread( } } -/*******************************************************************\ - -Function: goto_convertt::convert_end_thread - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_convertt::convert_end_thread( const codet &code, goto_programt &dest) @@ -2047,18 +1572,6 @@ void goto_convertt::convert_end_thread( copy(code, END_THREAD, dest); } -/*******************************************************************\ - -Function: goto_convertt::convert_atomic_begin - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_convertt::convert_atomic_begin( const codet &code, goto_programt &dest) @@ -2073,18 +1586,6 @@ void goto_convertt::convert_atomic_begin( copy(code, ATOMIC_BEGIN, dest); } -/*******************************************************************\ - -Function: goto_convertt::convert_atomic_end - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_convertt::convert_atomic_end( const codet &code, goto_programt &dest) @@ -2099,18 +1600,6 @@ void goto_convertt::convert_atomic_end( copy(code, ATOMIC_END, dest); } -/*******************************************************************\ - -Function: goto_convertt::convert_bp_enforce - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_convertt::convert_bp_enforce( const codet &code, goto_programt &dest) @@ -2170,18 +1659,6 @@ void goto_convertt::convert_bp_enforce( dest.destructive_append(tmp); } -/*******************************************************************\ - -Function: goto_convertt::convert_bp_abortif - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_convertt::convert_bp_abortif( const codet &code, goto_programt &dest) @@ -2205,18 +1682,6 @@ void goto_convertt::convert_bp_abortif( t->source_location=code.source_location(); } -/*******************************************************************\ - -Function: goto_convertt::convert_ifthenelse - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_convertt::convert_ifthenelse( const code_ifthenelset &code, goto_programt &dest) @@ -2268,18 +1733,6 @@ void goto_convertt::convert_ifthenelse( generate_ifthenelse(tmp_guard, tmp_then, tmp_else, source_location, dest); } -/*******************************************************************\ - -Function: goto_convertt::collect_operands - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_convertt::collect_operands( const exprt &expr, const irep_idt &id, @@ -2297,36 +1750,16 @@ void goto_convertt::collect_operands( } } -/*******************************************************************\ - -Function: is_size_one - - Inputs: Goto program 'g' - - Outputs: True if 'g' has one instruction - - Purpose: This is (believed to be) faster than using std::list.size - -\*******************************************************************/ - +/// This is (believed to be) faster than using std::list.size +/// \par parameters: Goto program 'g' +/// \return True if 'g' has one instruction static inline bool is_size_one(const goto_programt &g) { return (!g.instructions.empty()) && ++g.instructions.begin()==g.instructions.end(); } -/*******************************************************************\ - -Function: goto_convertt::generate_ifthenelse - - Inputs: - - Outputs: - - Purpose: if(guard) true_case; else false_case; - -\*******************************************************************/ - +/// if(guard) true_case; else false_case; void goto_convertt::generate_ifthenelse( const exprt &guard, goto_programt &true_case, @@ -2467,18 +1900,7 @@ void goto_convertt::generate_ifthenelse( dest.destructive_append(tmp_z); } -/*******************************************************************\ - -Function: goto_convertt::generate_conditional_branch - - Inputs: - - Outputs: - - Purpose: if(guard) goto target; - -\*******************************************************************/ - +/// if(guard) goto target; static bool has_and_or(const exprt &expr) { forall_operands(it, expr) @@ -2529,18 +1951,7 @@ void goto_convertt::generate_conditional_branch( } } -/*******************************************************************\ - -Function: goto_convertt::generate_conditional_branch - - Inputs: - - Outputs: - - Purpose: if(guard) goto target_true; else goto target_false; - -\*******************************************************************/ - +/// if(guard) goto target_true; else goto target_false; void goto_convertt::generate_conditional_branch( const exprt &guard, goto_programt::targett target_true, @@ -2618,18 +2029,6 @@ void goto_convertt::generate_conditional_branch( t_false->source_location=source_location; } -/*******************************************************************\ - -Function: goto_convertt::get_string_constant - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool goto_convertt::get_string_constant( const exprt &expr, irep_idt &value) @@ -2671,18 +2070,6 @@ bool goto_convertt::get_string_constant( return true; } -/*******************************************************************\ - -Function: goto_convertt::get_string_constant - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - irep_idt goto_convertt::get_string_constant(const exprt &expr) { irep_idt result; @@ -2699,18 +2086,6 @@ irep_idt goto_convertt::get_string_constant(const exprt &expr) return result; } -/*******************************************************************\ - -Function: goto_convertt::get_constant - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - exprt goto_convertt::get_constant(const exprt &expr) { if(expr.id()==ID_symbol) @@ -2737,18 +2112,6 @@ exprt goto_convertt::get_constant(const exprt &expr) return expr; } -/*******************************************************************\ - -Function: goto_convertt::new_tmp_symbol - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - symbolt &goto_convertt::new_tmp_symbol( const typet &type, const std::string &suffix, @@ -2772,18 +2135,6 @@ symbolt &goto_convertt::new_tmp_symbol( return new_symbol; } -/*******************************************************************\ - -Function: goto_convertt::make_temp_symbol - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_convertt::make_temp_symbol( exprt &expr, const std::string &suffix, @@ -2804,18 +2155,6 @@ void goto_convertt::make_temp_symbol( expr=new_symbol.symbol_expr(); } -/*******************************************************************\ - -Function: goto_convertt::new_name - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_convertt::new_name(symbolt &symbol) { // rename it @@ -2825,18 +2164,6 @@ void goto_convertt::new_name(symbolt &symbol) symbol_table.add(symbol); } -/*******************************************************************\ - -Function: goto_convertt::lookup - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - const symbolt &goto_convertt::lookup(const irep_idt &identifier) { const symbolt *symbol; @@ -2848,18 +2175,6 @@ const symbolt &goto_convertt::lookup(const irep_idt &identifier) return *symbol; } -/*******************************************************************\ - -Function: goto_convert - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_convert( const codet &code, symbol_tablet &symbol_table, @@ -2892,18 +2207,6 @@ void goto_convert( } } -/*******************************************************************\ - -Function: goto_convert - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_convert( symbol_tablet &symbol_table, goto_programt &dest, diff --git a/src/goto-programs/goto_convert.h b/src/goto-programs/goto_convert.h index 499c24aa572..c0196486ae4 100644 --- a/src/goto-programs/goto_convert.h +++ b/src/goto-programs/goto_convert.h @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Program Transformation + #ifndef CPROVER_GOTO_PROGRAMS_GOTO_CONVERT_H #define CPROVER_GOTO_PROGRAMS_GOTO_CONVERT_H diff --git a/src/goto-programs/goto_convert_class.h b/src/goto-programs/goto_convert_class.h index b018810e76e..c765109a75e 100644 --- a/src/goto-programs/goto_convert_class.h +++ b/src/goto-programs/goto_convert_class.h @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Program Transformation + #ifndef CPROVER_GOTO_PROGRAMS_GOTO_CONVERT_CLASS_H #define CPROVER_GOTO_PROGRAMS_GOTO_CONVERT_CLASS_H diff --git a/src/goto-programs/goto_convert_exceptions.cpp b/src/goto-programs/goto_convert_exceptions.cpp index 63f503e8a0b..0f17c7c011c 100644 --- a/src/goto-programs/goto_convert_exceptions.cpp +++ b/src/goto-programs/goto_convert_exceptions.cpp @@ -6,22 +6,13 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Program Transformation + #include #include "goto_convert_class.h" -/*******************************************************************\ - -Function: goto_convertt::convert_msc_try_finally - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_convertt::convert_msc_try_finally( const codet &code, goto_programt &dest) @@ -60,18 +51,6 @@ void goto_convertt::convert_msc_try_finally( dest.destructive_append(tmp); } -/*******************************************************************\ - -Function: goto_convertt::convert_msc_try_except - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_convertt::convert_msc_try_except( const codet &code, goto_programt &dest) @@ -88,18 +67,6 @@ void goto_convertt::convert_msc_try_except( // todo: generate exception tracking } -/*******************************************************************\ - -Function: goto_convertt::convert_msc_leave - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_convertt::convert_msc_leave( const codet &code, goto_programt &dest) @@ -126,18 +93,6 @@ void goto_convertt::convert_msc_leave( t->source_location=code.source_location(); } -/*******************************************************************\ - -Function: goto_convertt::convert_java_try_catch - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_convertt::convert_java_try_catch( const codet &code, goto_programt &dest) @@ -193,18 +148,6 @@ void goto_convertt::convert_java_try_catch( dest.destructive_append(end); } -/*******************************************************************\ - -Function: goto_convertt::convert_try_catch - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_convertt::convert_try_catch( const codet &code, goto_programt &dest) @@ -258,18 +201,6 @@ void goto_convertt::convert_try_catch( dest.destructive_append(end); } -/*******************************************************************\ - -Function: goto_convertt::convert_CPROVER_try_catch - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_convertt::convert_CPROVER_try_catch( const codet &code, goto_programt &dest) @@ -307,18 +238,6 @@ void goto_convertt::convert_CPROVER_try_catch( dest.destructive_append(tmp); } -/*******************************************************************\ - -Function: goto_convertt::convert_CPROVER_throw - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_convertt::convert_CPROVER_throw( const codet &code, goto_programt &dest) @@ -356,18 +275,6 @@ void goto_convertt::convert_CPROVER_throw( } } -/*******************************************************************\ - -Function: goto_convertt::convert_CPROVER_try_finally - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_convertt::convert_CPROVER_try_finally( const codet &code, goto_programt &dest) @@ -392,18 +299,6 @@ void goto_convertt::convert_CPROVER_try_finally( convert(to_code(code.op1()), dest); } -/*******************************************************************\ - -Function: goto_convertt::exception_flag - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - symbol_exprt goto_convertt::exception_flag() { irep_idt id="$exception_flag"; @@ -426,18 +321,6 @@ symbol_exprt goto_convertt::exception_flag() return symbol_exprt(id, bool_typet()); } -/*******************************************************************\ - -Function: goto_convertt::unwind_destructor_stack - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_convertt::unwind_destructor_stack( const source_locationt &source_location, std::size_t final_stack_size, diff --git a/src/goto-programs/goto_convert_function_call.cpp b/src/goto-programs/goto_convert_function_call.cpp index 6fe2b42bbc1..0443b4536bb 100644 --- a/src/goto-programs/goto_convert_function_call.cpp +++ b/src/goto-programs/goto_convert_function_call.cpp @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Program Transformation + #include #include @@ -18,18 +21,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "goto_convert_class.h" -/*******************************************************************\ - -Function: goto_convertt::convert_function_call - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_convertt::convert_function_call( const code_function_callt &function_call, goto_programt &dest) @@ -41,18 +32,6 @@ void goto_convertt::convert_function_call( dest); } -/*******************************************************************\ - -Function: goto_convertt::do_function_call - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_convertt::do_function_call( const exprt &lhs, const exprt &function, @@ -109,18 +88,6 @@ void goto_convertt::do_function_call( } } -/*******************************************************************\ - -Function: goto_convertt::do_function_call_if - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_convertt::do_function_call_if( const exprt &lhs, const if_exprt &function, @@ -185,18 +152,6 @@ void goto_convertt::do_function_call_if( dest.destructive_append(tmp_z); } -/*******************************************************************\ - -Function: goto_convertt::do_function_call_other - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_convertt::do_function_call_other( const exprt &lhs, const exprt &function, diff --git a/src/goto-programs/goto_convert_functions.cpp b/src/goto-programs/goto_convert_functions.cpp index b25d8870f09..ba8c13aa9e4 100644 --- a/src/goto-programs/goto_convert_functions.cpp +++ b/src/goto-programs/goto_convert_functions.cpp @@ -18,18 +18,6 @@ Date: June 2003 #include "goto_convert_functions.h" #include "goto_inline.h" -/*******************************************************************\ - -Function: goto_convert_functionst::goto_convert_functionst - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - goto_convert_functionst::goto_convert_functionst( symbol_tablet &_symbol_table, goto_functionst &_functions, @@ -39,34 +27,10 @@ goto_convert_functionst::goto_convert_functionst( { } -/*******************************************************************\ - -Function: goto_convert_functionst::~goto_convert_functionst - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - goto_convert_functionst::~goto_convert_functionst() { } -/*******************************************************************\ - -Function: goto_convert_functionst::goto_convert - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_convert_functionst::goto_convert() { // warning! hash-table iterators are not stable @@ -105,18 +69,6 @@ void goto_convert_functionst::goto_convert() #endif } -/*******************************************************************\ - -Function: goto_convert_functionst::hide - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool goto_convert_functionst::hide(const goto_programt &goto_program) { forall_goto_program_instructions(i_it, goto_program) @@ -129,18 +81,6 @@ bool goto_convert_functionst::hide(const goto_programt &goto_program) return false; } -/*******************************************************************\ - -Function: goto_convert_functionst::add_return - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_convert_functionst::add_return( goto_functionst::goto_functiont &f, const source_locationt &source_location) @@ -194,18 +134,6 @@ void goto_convert_functionst::add_return( t->source_location=source_location; } -/*******************************************************************\ - -Function: goto_convert_functionst::convert_function - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_convert_functionst::convert_function(const irep_idt &identifier) { const symbolt &symbol=ns.lookup(identifier); @@ -292,18 +220,6 @@ void goto_convert_functionst::convert_function(const irep_idt &identifier) f.make_hidden(); } -/*******************************************************************\ - -Function: goto_convert - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_convert( symbol_tablet &symbol_table, goto_modelt &goto_model, @@ -313,18 +229,6 @@ void goto_convert( goto_model.symbol_table.swap(symbol_table); } -/*******************************************************************\ - -Function: goto_convert - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_convert( symbol_tablet &symbol_table, goto_functionst &functions, @@ -357,18 +261,6 @@ void goto_convert( } } -/*******************************************************************\ - -Function: goto_convert - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_convert( const irep_idt &identifier, symbol_tablet &symbol_table, diff --git a/src/goto-programs/goto_convert_functions.h b/src/goto-programs/goto_convert_functions.h index 9678c928609..2b7b128eab6 100644 --- a/src/goto-programs/goto_convert_functions.h +++ b/src/goto-programs/goto_convert_functions.h @@ -8,6 +8,9 @@ Date: June 2003 \*******************************************************************/ +/// \file +/// Goto Programs with Functions + #ifndef CPROVER_GOTO_PROGRAMS_GOTO_CONVERT_FUNCTIONS_H #define CPROVER_GOTO_PROGRAMS_GOTO_CONVERT_FUNCTIONS_H diff --git a/src/goto-programs/goto_convert_new_switch_case.cpp b/src/goto-programs/goto_convert_new_switch_case.cpp index 4a81a4176a2..3f90e14c515 100644 --- a/src/goto-programs/goto_convert_new_switch_case.cpp +++ b/src/goto-programs/goto_convert_new_switch_case.cpp @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Program Transformation + #include #include @@ -21,18 +24,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "goto_convert_class.h" #include "destructor.h" -/*******************************************************************\ - -Function: is_empty - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - static bool is_empty(const goto_programt &goto_program) { forall_goto_program_instructions(it, goto_program) @@ -44,18 +35,6 @@ static bool is_empty(const goto_programt &goto_program) return true; } -/*******************************************************************\ - -Function: goto_convertt::finish_gotos - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_convertt::finish_gotos() { for(const auto &target : targets.gotos) @@ -129,18 +108,6 @@ void goto_convertt::finish_gotos() targets.gotos.clear(); } -/*******************************************************************\ - -Function: goto_convertt::finish_computed_gotos - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_convertt::finish_computed_gotos(goto_programt &goto_program) { for(const auto &target : targets.computed_gotos) @@ -180,35 +147,11 @@ void goto_convertt::finish_computed_gotos(goto_programt &goto_program) targets.computed_gotos.clear(); } -/*******************************************************************\ - -Function: goto_convertt::goto_convert - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_convertt::goto_convert(const codet &code, goto_programt &dest) { goto_convert_rec(code, dest); } -/*******************************************************************\ - -Function: goto_convertt::goto_convert_rec - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_convertt::goto_convert_rec( const codet &code, goto_programt &dest) @@ -219,18 +162,6 @@ void goto_convertt::goto_convert_rec( finish_computed_gotos(dest); } -/*******************************************************************\ - -Function: goto_convertt::copy - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_convertt::copy( const codet &code, goto_program_instruction_typet type, @@ -241,18 +172,6 @@ void goto_convertt::copy( t->source_location=code.source_location(); } -/*******************************************************************\ - -Function: goto_convert::convert_label - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_convertt::convert_label( const code_labelt &code, goto_programt &dest) @@ -289,18 +208,6 @@ void goto_convertt::convert_label( target->labels.push_front(label); } -/*******************************************************************\ - -Function: goto_convert::convert_gcc_local_label - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_convertt::convert_gcc_local_label( const codet &code, goto_programt &dest) @@ -308,18 +215,6 @@ void goto_convertt::convert_gcc_local_label( // ignore for now } -/*******************************************************************\ - -Function: goto_convert::convert_switch_case - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_convertt::convert_switch_case( const code_switch_caset &code, goto_programt &dest) @@ -365,18 +260,6 @@ void goto_convertt::convert_switch_case( } } -/*******************************************************************\ - -Function: goto_convert::convert_gcc_switch_case_range - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_convertt::convert_gcc_switch_case_range( const codet &code, goto_programt &dest) @@ -410,18 +293,7 @@ void goto_convertt::convert_gcc_switch_case_range( #endif } -/*******************************************************************\ - -Function: goto_convertt::convert - - Inputs: - - Outputs: - - Purpose: converts 'code' and appends the result to 'dest' - -\*******************************************************************/ - +/// converts 'code' and appends the result to 'dest' void goto_convertt::convert( const codet &code, goto_programt &dest) @@ -556,18 +428,6 @@ void goto_convertt::convert( } } -/*******************************************************************\ - -Function: goto_convertt::convert_block - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_convertt::convert_block( const code_blockt &code, goto_programt &dest) @@ -591,18 +451,6 @@ void goto_convertt::convert_block( targets.destructor_stack.resize(old_stack_size); } -/*******************************************************************\ - -Function: goto_convertt::convert_expression - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_convertt::convert_expression( const code_expressiont &code, goto_programt &dest) @@ -646,18 +494,6 @@ void goto_convertt::convert_expression( } } -/*******************************************************************\ - -Function: goto_convertt::convert_decl - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_convertt::convert_decl( const code_declt &code, goto_programt &dest) @@ -727,18 +563,6 @@ void goto_convertt::convert_decl( } } -/*******************************************************************\ - -Function: goto_convertt::convert_decl_type - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_convertt::convert_decl_type( const codet &code, goto_programt &dest) @@ -746,18 +570,6 @@ void goto_convertt::convert_decl_type( // we remove these } -/*******************************************************************\ - -Function: goto_convertt::convert_assign - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_convertt::convert_assign( const code_assignt &code, goto_programt &dest) @@ -845,18 +657,6 @@ void goto_convertt::convert_assign( } } -/*******************************************************************\ - -Function: goto_convertt::convert_init - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_convertt::convert_init( const codet &code, goto_programt &dest) @@ -875,18 +675,6 @@ void goto_convertt::convert_init( convert(to_code_assign(assignment), dest); } -/*******************************************************************\ - -Function: goto_convertt::convert_cpp_delete - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_convertt::convert_cpp_delete( const codet &code, goto_programt &dest) @@ -952,18 +740,6 @@ void goto_convertt::convert_cpp_delete( convert(delete_call, dest); } -/*******************************************************************\ - -Function: goto_convertt::convert_assert - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_convertt::convert_assert( const code_assertt &code, goto_programt &dest) @@ -979,18 +755,6 @@ void goto_convertt::convert_assert( t->source_location.set("user-provided", true); } -/*******************************************************************\ - -Function: goto_convertt::convert_skip - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_convertt::convert_skip( const codet &code, goto_programt &dest) @@ -1000,18 +764,6 @@ void goto_convertt::convert_skip( t->code=code; } -/*******************************************************************\ - -Function: goto_convertt::convert_assert - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_convertt::convert_assume( const code_assumet &code, goto_programt &dest) @@ -1025,18 +777,6 @@ void goto_convertt::convert_assume( t->source_location=code.source_location(); } -/*******************************************************************\ - -Function: goto_convertt::convert_for - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_convertt::convert_for( const code_fort &code, goto_programt &dest) @@ -1133,18 +873,6 @@ void goto_convertt::convert_for( old_targets.restore(targets); } -/*******************************************************************\ - -Function: goto_convertt::convert_while - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_convertt::convert_while( const code_whilet &code, goto_programt &dest) @@ -1202,18 +930,6 @@ void goto_convertt::convert_while( old_targets.restore(targets); } -/*******************************************************************\ - -Function: goto_convertt::convert_dowhile - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_convertt::convert_dowhile( const codet &code, goto_programt &dest) @@ -1283,18 +999,6 @@ void goto_convertt::convert_dowhile( old_targets.restore(targets); } -/*******************************************************************\ - -Function: goto_convertt::case_guard - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - exprt goto_convertt::case_guard( const exprt &value, const exprt::operandst &case_op) @@ -1322,18 +1026,6 @@ exprt goto_convertt::case_guard( return dest; } -/*******************************************************************\ - -Function: goto_convertt::convert_switch - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_convertt::convert_switch( const code_switcht &code, goto_programt &dest) @@ -1432,18 +1124,6 @@ void goto_convertt::convert_switch( old_targets.restore(targets); } -/*******************************************************************\ - -Function: goto_convertt::convert_break - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_convertt::convert_break( const code_breakt &code, goto_programt &dest) @@ -1465,18 +1145,6 @@ void goto_convertt::convert_break( t->source_location=code.source_location(); } -/*******************************************************************\ - -Function: goto_convertt::convert_return - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_convertt::convert_return( const code_returnt &code, goto_programt &dest) @@ -1547,18 +1215,6 @@ void goto_convertt::convert_return( t->source_location=new_code.source_location(); } -/*******************************************************************\ - -Function: goto_convertt::convert_continue - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_convertt::convert_continue( const code_continuet &code, goto_programt &dest) @@ -1580,18 +1236,6 @@ void goto_convertt::convert_continue( t->source_location=code.source_location(); } -/*******************************************************************\ - -Function: goto_convertt::convert_goto - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_convertt::convert_goto( const codet &code, goto_programt &dest) @@ -1605,18 +1249,6 @@ void goto_convertt::convert_goto( targets.gotos.push_back(t); } -/*******************************************************************\ - -Function: goto_convertt::convert_gcc_computed_goto - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_convertt::convert_gcc_computed_goto( const codet &code, goto_programt &dest) @@ -1630,18 +1262,6 @@ void goto_convertt::convert_gcc_computed_goto( targets.computed_gotos.push_back(t); } -/*******************************************************************\ - -Function: goto_convertt::convert_non_deterministic_goto - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_convertt::convert_non_deterministic_goto( const codet &code, goto_programt &dest) @@ -1649,18 +1269,6 @@ void goto_convertt::convert_non_deterministic_goto( convert_goto(code, dest); } -/*******************************************************************\ - -Function: goto_convertt::convert_specc_notify - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_convertt::convert_specc_notify( const codet &code, goto_programt &dest) @@ -1678,18 +1286,6 @@ void goto_convertt::convert_specc_notify( copy(code, OTHER, dest); } -/*******************************************************************\ - -Function: goto_convertt::convert_specc_event - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_convertt::convert_specc_event( const exprt &op, std::set &events) @@ -1716,18 +1312,6 @@ void goto_convertt::convert_specc_event( } } -/*******************************************************************\ - -Function: goto_convertt::convert_specc_wait - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_convertt::convert_specc_wait( const codet &code, goto_programt &dest) @@ -1756,18 +1340,6 @@ void goto_convertt::convert_specc_wait( copy(code, OTHER, dest); } -/*******************************************************************\ - -Function: goto_convertt::convert_specc_par - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_convertt::convert_specc_par( const codet &code, goto_programt &dest) @@ -1775,18 +1347,6 @@ void goto_convertt::convert_specc_par( copy(code, OTHER, dest); } -/*******************************************************************\ - -Function: goto_convertt::convert_start_thread - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_convertt::convert_start_thread( const codet &code, goto_programt &dest) @@ -1826,18 +1386,6 @@ void goto_convertt::convert_start_thread( } } -/*******************************************************************\ - -Function: goto_convertt::convert_end_thread - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_convertt::convert_end_thread( const codet &code, goto_programt &dest) @@ -1852,18 +1400,6 @@ void goto_convertt::convert_end_thread( copy(code, END_THREAD, dest); } -/*******************************************************************\ - -Function: goto_convertt::convert_atomic_begin - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_convertt::convert_atomic_begin( const codet &code, goto_programt &dest) @@ -1878,18 +1414,6 @@ void goto_convertt::convert_atomic_begin( copy(code, ATOMIC_BEGIN, dest); } -/*******************************************************************\ - -Function: goto_convertt::convert_atomic_end - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_convertt::convert_atomic_end( const codet &code, goto_programt &dest) @@ -1904,18 +1428,6 @@ void goto_convertt::convert_atomic_end( copy(code, ATOMIC_END, dest); } -/*******************************************************************\ - -Function: goto_convertt::convert_bp_enforce - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_convertt::convert_bp_enforce( const codet &code, goto_programt &dest) @@ -1976,18 +1488,6 @@ void goto_convertt::convert_bp_enforce( dest.destructive_append(tmp); } -/*******************************************************************\ - -Function: goto_convertt::convert_bp_abortif - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_convertt::convert_bp_abortif( const codet &code, goto_programt &dest) @@ -2011,18 +1511,6 @@ void goto_convertt::convert_bp_abortif( t->source_location=code.source_location(); } -/*******************************************************************\ - -Function: goto_convertt::convert_ifthenelse - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_convertt::convert_ifthenelse( const code_ifthenelset &code, goto_programt &dest) @@ -2074,18 +1562,6 @@ void goto_convertt::convert_ifthenelse( generate_ifthenelse(tmp_guard, tmp_then, tmp_else, source_location, dest); } -/*******************************************************************\ - -Function: goto_convertt::collect_operands - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_convertt::collect_operands( const exprt &expr, const irep_idt &id, @@ -2103,18 +1579,7 @@ void goto_convertt::collect_operands( } } -/*******************************************************************\ - -Function: goto_convertt::generate_ifthenelse - - Inputs: - - Outputs: - - Purpose: if(guard) true_case; else false_case; - -\*******************************************************************/ - +/// if(guard) true_case; else false_case; void goto_convertt::generate_ifthenelse( const exprt &guard, goto_programt &true_case, @@ -2234,18 +1699,7 @@ void goto_convertt::generate_ifthenelse( dest.destructive_append(tmp_z); } -/*******************************************************************\ - -Function: goto_convertt::generate_conditional_branch - - Inputs: - - Outputs: - - Purpose: if(guard) goto target; - -\*******************************************************************/ - +/// if(guard) goto target; static bool has_and_or(const exprt &expr) { forall_operands(it, expr) @@ -2296,18 +1750,7 @@ void goto_convertt::generate_conditional_branch( } } -/*******************************************************************\ - -Function: goto_convertt::generate_conditional_branch - - Inputs: - - Outputs: - - Purpose: if(guard) goto target_true; else goto target_false; - -\*******************************************************************/ - +/// if(guard) goto target_true; else goto target_false; void goto_convertt::generate_conditional_branch( const exprt &guard, goto_programt::targett target_true, @@ -2385,18 +1828,6 @@ void goto_convertt::generate_conditional_branch( t_false->source_location=source_location; } -/*******************************************************************\ - -Function: goto_convertt::get_string_constant - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - const irep_idt goto_convertt::get_string_constant( const exprt &expr) { @@ -2442,18 +1873,6 @@ const irep_idt goto_convertt::get_string_constant( throw 0; } -/*******************************************************************\ - -Function: goto_convertt::get_constant - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - exprt goto_convertt::get_constant(const exprt &expr) { if(expr.id()==ID_symbol) @@ -2480,18 +1899,6 @@ exprt goto_convertt::get_constant(const exprt &expr) return expr; } -/*******************************************************************\ - -Function: goto_convertt::new_tmp_symbol - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - symbolt &goto_convertt::new_tmp_symbol( const typet &type, const std::string &suffix, @@ -2519,18 +1926,6 @@ symbolt &goto_convertt::new_tmp_symbol( return *symbol_ptr; } -/*******************************************************************\ - -Function: goto_convertt::make_temp_symbol - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_convertt::make_temp_symbol( exprt &expr, const std::string &suffix, @@ -2551,18 +1946,6 @@ void goto_convertt::make_temp_symbol( expr=new_symbol.symbol_expr(); } -/*******************************************************************\ - -Function: goto_convertt::new_name - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_convertt::new_name(symbolt &symbol) { // rename it @@ -2572,18 +1955,6 @@ void goto_convertt::new_name(symbolt &symbol) symbol_table.add(symbol); } -/*******************************************************************\ - -Function: goto_convertt::lookup - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - const symbolt &goto_convertt::lookup(const irep_idt &identifier) const { const symbolt *symbol; @@ -2595,18 +1966,6 @@ const symbolt &goto_convertt::lookup(const irep_idt &identifier) const return *symbol; } -/*******************************************************************\ - -Function: goto_convert - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_convert( const codet &code, symbol_tablet &symbol_table, @@ -2641,18 +2000,6 @@ void goto_convert( throw 0; } -/*******************************************************************\ - -Function: goto_convert - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_convert( symbol_tablet &symbol_table, goto_programt &dest, diff --git a/src/goto-programs/goto_convert_side_effect.cpp b/src/goto-programs/goto_convert_side_effect.cpp index dbebb856ec1..6d7e95e747b 100644 --- a/src/goto-programs/goto_convert_side_effect.cpp +++ b/src/goto-programs/goto_convert_side_effect.cpp @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Program Transformation + #include #include #include @@ -17,18 +20,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "goto_convert_class.h" -/*******************************************************************\ - -Function: goto_convertt::has_function_call - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool goto_convertt::has_function_call(const exprt &expr) { forall_operands(it, expr) @@ -42,18 +33,6 @@ bool goto_convertt::has_function_call(const exprt &expr) return false; } -/*******************************************************************\ - -Function: goto_convertt::remove_assignment - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_convertt::remove_assignment( side_effect_exprt &expr, goto_programt &dest, @@ -157,18 +136,6 @@ void goto_convertt::remove_assignment( expr.make_nil(); } -/*******************************************************************\ - -Function: goto_convertt::remove_pre - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_convertt::remove_pre( side_effect_exprt &expr, goto_programt &dest, @@ -256,18 +223,6 @@ void goto_convertt::remove_pre( expr.make_nil(); } -/*******************************************************************\ - -Function: goto_convertt::remove_post - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_convertt::remove_post( side_effect_exprt &expr, goto_programt &dest, @@ -374,18 +329,6 @@ void goto_convertt::remove_post( dest.destructive_append(tmp2); } -/*******************************************************************\ - -Function: goto_convertt::remove_function_call - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_convertt::remove_function_call( side_effect_exprt &expr, goto_programt &dest, @@ -466,18 +409,6 @@ void goto_convertt::remove_function_call( static_cast(expr)=new_symbol.symbol_expr(); } -/*******************************************************************\ - -Function: goto_convertt::replace_new_object - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_convertt::replace_new_object( const exprt &object, exprt &dest) @@ -489,18 +420,6 @@ void goto_convertt::replace_new_object( replace_new_object(object, *it); } -/*******************************************************************\ - -Function: goto_convertt::remove_cpp_new - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_convertt::remove_cpp_new( side_effect_exprt &expr, goto_programt &dest, @@ -531,18 +450,6 @@ void goto_convertt::remove_cpp_new( convert(call, dest); } -/*******************************************************************\ - -Function: goto_convertt::remove_cpp_delete - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_convertt::remove_cpp_delete( side_effect_exprt &expr, goto_programt &dest, @@ -562,18 +469,6 @@ void goto_convertt::remove_cpp_delete( expr.make_nil(); } -/*******************************************************************\ - -Function: goto_convertt::remove_malloc - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_convertt::remove_malloc( side_effect_exprt &expr, goto_programt &dest, @@ -611,18 +506,6 @@ void goto_convertt::remove_malloc( convert(call, dest); } -/*******************************************************************\ - -Function: goto_convertt::remove_temporary_object - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_convertt::remove_temporary_object( side_effect_exprt &expr, goto_programt &dest, @@ -663,18 +546,6 @@ void goto_convertt::remove_temporary_object( static_cast(expr)=new_symbol.symbol_expr(); } -/*******************************************************************\ - -Function: goto_convertt::remove_statement_expression - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_convertt::remove_statement_expression( side_effect_exprt &expr, goto_programt &dest, @@ -765,18 +636,6 @@ void goto_convertt::remove_statement_expression( static_cast(expr)=tmp_symbol_expr; } -/*******************************************************************\ - -Function: goto_convertt::remove_push_catch - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_convertt::remove_push_catch( side_effect_exprt &expr, goto_programt &dest) @@ -788,18 +647,6 @@ void goto_convertt::remove_push_catch( expr.make_nil(); } -/*******************************************************************\ - -Function: goto_convertt::remove_side_effect - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_convertt::remove_side_effect( side_effect_exprt &expr, goto_programt &dest, diff --git a/src/goto-programs/goto_functions.cpp b/src/goto-programs/goto_functions.cpp index d11868339b3..9c14c8bc6bc 100644 --- a/src/goto-programs/goto_functions.cpp +++ b/src/goto-programs/goto_functions.cpp @@ -8,19 +8,10 @@ Date: June 2003 \*******************************************************************/ -#include "goto_functions.h" - -/*******************************************************************\ - -Function: get_local_identifiers - - Inputs: +/// \file +/// Goto Programs with Functions - Outputs: - - Purpose: - -\*******************************************************************/ +#include "goto_functions.h" void get_local_identifiers( const goto_function_templatet &goto_function, diff --git a/src/goto-programs/goto_functions.h b/src/goto-programs/goto_functions.h index 096fab391ec..7fc9f70628a 100644 --- a/src/goto-programs/goto_functions.h +++ b/src/goto-programs/goto_functions.h @@ -8,6 +8,9 @@ Date: June 2003 \*******************************************************************/ +/// \file +/// Goto Programs with Functions + #ifndef CPROVER_GOTO_PROGRAMS_GOTO_FUNCTIONS_H #define CPROVER_GOTO_PROGRAMS_GOTO_FUNCTIONS_H diff --git a/src/goto-programs/goto_functions_template.h b/src/goto-programs/goto_functions_template.h index 9333cce06b3..3ea7a7bad83 100644 --- a/src/goto-programs/goto_functions_template.h +++ b/src/goto-programs/goto_functions_template.h @@ -8,6 +8,9 @@ Date: June 2003 \*******************************************************************/ +/// \file +/// Goto Programs with Functions + #ifndef CPROVER_GOTO_PROGRAMS_GOTO_FUNCTIONS_TEMPLATE_H #define CPROVER_GOTO_PROGRAMS_GOTO_FUNCTIONS_TEMPLATE_H @@ -158,18 +161,6 @@ class goto_functions_templatet } }; -/*******************************************************************\ - -Function: goto_functions_templatet::output - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - template void goto_functions_templatet::output( const namespacet &ns, @@ -190,18 +181,6 @@ void goto_functions_templatet::output( } } -/*******************************************************************\ - -Function: goto_functions_templatet::compute_location_numbers - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - template void goto_functions_templatet::compute_location_numbers() { @@ -214,18 +193,6 @@ void goto_functions_templatet::compute_location_numbers() it->second.body.compute_location_numbers(nr); } -/*******************************************************************\ - -Function: goto_functions_templatet::compute_incoming_edges - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - template void goto_functions_templatet::compute_incoming_edges() { @@ -236,18 +203,6 @@ void goto_functions_templatet::compute_incoming_edges() it->second.body.compute_incoming_edges(); } -/*******************************************************************\ - -Function: goto_functions_templatet::compute_target_numbers - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - template void goto_functions_templatet::compute_target_numbers() { @@ -258,18 +213,6 @@ void goto_functions_templatet::compute_target_numbers() it->second.body.compute_target_numbers(); } -/*******************************************************************\ - -Function: goto_functions_templatet::compute_loop_numbers - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - template void goto_functions_templatet::compute_loop_numbers() { diff --git a/src/goto-programs/goto_inline.cpp b/src/goto-programs/goto_inline.cpp index 01c0f1bf392..58db12c1838 100644 --- a/src/goto-programs/goto_inline.cpp +++ b/src/goto-programs/goto_inline.cpp @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Function Inlining + #include #include @@ -18,18 +21,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "goto_inline.h" #include "goto_inline_class.h" -/*******************************************************************\ - -Function: goto_inline - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_inline( goto_modelt &goto_model, message_handlert &message_handler, @@ -43,18 +34,6 @@ void goto_inline( adjust_function); } -/*******************************************************************\ - -Function: goto_inline - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_inline( goto_functionst &goto_functions, const namespacet &ns, @@ -118,28 +97,13 @@ void goto_inline( } } -/*******************************************************************\ - -Function: goto_partial_inline - - Inputs: - goto_model: - Source of the symbol table and function map to use. - message_handler: - Message handler used by goto_inlinet. - smallfunc_limit: - The maximum number of instructions in functions to be inlined. - adjust_function: - Tell goto_inlinet to adjust function. - - Outputs: - - Purpose: - Inline all function calls to functions either marked as "inlined" or - smaller than smallfunc_limit (by instruction count). - -\*******************************************************************/ - +/// Inline all function calls to functions either marked as "inlined" or +/// smaller than smallfunc_limit (by instruction count). +/// \param goto_model: Source of the symbol table and function map to use. +/// \param message_handler: Message handler used by goto_inlinet. +/// \param smallfunc_limit: The maximum number of instructions in functions to +/// be inlined. +/// \param adjust_function: Tell goto_inlinet to adjust function. void goto_partial_inline( goto_modelt &goto_model, message_handlert &message_handler, @@ -155,31 +119,15 @@ void goto_partial_inline( adjust_function); } -/*******************************************************************\ - -Function: goto_partial_inline - - Inputs: - goto_functions: - The function map to use to find functions containing calls and function - bodies. - ns: - Namespace used by goto_inlinet. - message_handler: - Message handler used by goto_inlinet. - smallfunc_limit: - The maximum number of instructions in functions to be inlined. - adjust_function: - Tell goto_inlinet to adjust function. - - Outputs: - - Purpose: - Inline all function calls to functions either marked as "inlined" or - smaller than smallfunc_limit (by instruction count). - -\*******************************************************************/ - +/// Inline all function calls to functions either marked as "inlined" or +/// smaller than smallfunc_limit (by instruction count). +/// \param goto_functions: The function map to use to find functions containing +/// calls and function bodies. +/// \param ns: Namespace used by goto_inlinet. +/// \param message_handler: Message handler used by goto_inlinet. +/// \param smallfunc_limit: The maximum number of instructions in functions to +/// be inlined. +/// \param adjust_function: Tell goto_inlinet to adjust function. void goto_partial_inline( goto_functionst &goto_functions, const namespacet &ns, @@ -259,24 +207,12 @@ void goto_partial_inline( goto_inline.goto_inline(inline_map, false); } -/*******************************************************************\ - -Function: goto_function_inline - - Inputs: - goto_model: Source of the symbol table and function map to use. - function: The function whose calls to inline. - message_handler: Message handler used by goto_inlinet. - adjust_function: Tell goto_inlinet to adjust function. - caching: Tell goto_inlinet to cache. - - Outputs: - - Purpose: - Inline all function calls made from a particular function - -\*******************************************************************/ - +/// Inline all function calls made from a particular function +/// \param goto_model: Source of the symbol table and function map to use. +/// \param function: The function whose calls to inline. +/// \param message_handler: Message handler used by goto_inlinet. +/// \param adjust_function: Tell goto_inlinet to adjust function. +/// \param caching: Tell goto_inlinet to cache. void goto_function_inline( goto_modelt &goto_model, const irep_idt function, @@ -294,25 +230,13 @@ void goto_function_inline( caching); } -/*******************************************************************\ - -Function: goto_function_inline - - Inputs: - goto_functions: The function map to use to find function bodies. - function: The function whose calls to inline. - ns: Namespace used by goto_inlinet. - message_handler: Message handler used by goto_inlinet. - adjust_function: Tell goto_inlinet to adjust function. - caching: Tell goto_inlinet to cache. - - Outputs: - - Purpose: - Inline all function calls made from a particular function - -\*******************************************************************/ - +/// Inline all function calls made from a particular function +/// \param goto_functions: The function map to use to find function bodies. +/// \param function: The function whose calls to inline. +/// \param ns: Namespace used by goto_inlinet. +/// \param message_handler: Message handler used by goto_inlinet. +/// \param adjust_function: Tell goto_inlinet to adjust function. +/// \param caching: Tell goto_inlinet to cache. void goto_function_inline( goto_functionst &goto_functions, const irep_idt function, @@ -357,18 +281,6 @@ void goto_function_inline( goto_inline.goto_inline(function, goto_function, inline_map, true); } -/*******************************************************************\ - -Function: goto_function_inline_and_log - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - jsont goto_function_inline_and_log( goto_functionst &goto_functions, const irep_idt function, diff --git a/src/goto-programs/goto_inline.h b/src/goto-programs/goto_inline.h index 5d3dd54fa6d..3319aa36172 100644 --- a/src/goto-programs/goto_inline.h +++ b/src/goto-programs/goto_inline.h @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Function Inlining + #ifndef CPROVER_GOTO_PROGRAMS_GOTO_INLINE_H #define CPROVER_GOTO_PROGRAMS_GOTO_INLINE_H diff --git a/src/goto-programs/goto_inline_class.cpp b/src/goto-programs/goto_inline_class.cpp index f7c8e4509af..5536da22378 100644 --- a/src/goto-programs/goto_inline_class.cpp +++ b/src/goto-programs/goto_inline_class.cpp @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Function Inlining + #ifdef DEBUG #include #endif @@ -23,18 +26,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "goto_inline.h" #include "goto_inline_class.h" -/*******************************************************************\ - -Function: goto_inlinet::parameter_assignments - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_inlinet::parameter_assignments( const goto_programt::targett target, const irep_idt &function_name, // name of called function @@ -167,18 +158,6 @@ void goto_inlinet::parameter_assignments( } } -/*******************************************************************\ - -Function: goto_inlinet::parameter_destruction - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_inlinet::parameter_destruction( const goto_programt::targett target, const irep_idt &function_name, // name of called function @@ -223,18 +202,6 @@ void goto_inlinet::parameter_destruction( } } -/*******************************************************************\ - -Function: goto_inlinet::replace_return - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_inlinet::replace_return( goto_programt &dest, // inlining this const exprt &lhs, // lhs in caller @@ -348,18 +315,6 @@ void goto_inlinet::replace_return( } } -/*******************************************************************\ - -Function: replace_location - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void replace_location( source_locationt &dest, const source_locationt &new_location) @@ -383,18 +338,6 @@ void replace_location( dest.set_property_id(property_id); } -/*******************************************************************\ - -Function: replace_location - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void replace_location( exprt &dest, const source_locationt &new_location) @@ -406,18 +349,6 @@ void replace_location( replace_location(dest.add_source_location(), new_location); } -/*******************************************************************\ - -Function: goto_inlinet::insert_function_body - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_inlinet::insert_function_body( const goto_functiont &goto_function, goto_programt &dest, @@ -519,18 +450,6 @@ void goto_inlinet::insert_function_body( dest.destructive_insert(target, tmp); } -/*******************************************************************\ - -Function: goto_inlinet::insert_function_nobody - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_inlinet::insert_function_nobody( goto_programt &dest, const exprt &lhs, @@ -584,18 +503,6 @@ void goto_inlinet::insert_function_nobody( dest.destructive_insert(target, tmp); } -/*******************************************************************\ - -Function: goto_inlinet::expand_function_call - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_inlinet::expand_function_call( goto_programt &dest, const inline_mapt &inline_map, @@ -721,18 +628,6 @@ void goto_inlinet::expand_function_call( } } -/*******************************************************************\ - -Function: goto_inlinet::get_call - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_inlinet::get_call( goto_programt::const_targett it, exprt &lhs, @@ -762,35 +657,11 @@ void goto_inlinet::get_call( } } -/*******************************************************************\ - -Function: goto_inlinet::is_call - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool goto_inlinet::is_call(goto_programt::const_targett it) { return it->is_function_call() || is_bp_call(it); } -/*******************************************************************\ - -Function: goto_inlinet::is_bp_call - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool goto_inlinet::is_bp_call(goto_programt::const_targett it) { if(!it->is_other()) @@ -802,18 +673,6 @@ bool goto_inlinet::is_bp_call(goto_programt::const_targett it) it->code.op0().op1().get(ID_statement)==ID_function_call; } -/*******************************************************************\ - -Function: goto_inline - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_inlinet::goto_inline( const inline_mapt &inline_map, const bool force_full) @@ -833,18 +692,6 @@ void goto_inlinet::goto_inline( } } -/*******************************************************************\ - -Function: goto_inline - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_inlinet::goto_inline( const irep_idt identifier, goto_functiont &goto_function, @@ -860,18 +707,6 @@ void goto_inlinet::goto_inline( force_full); } -/*******************************************************************\ - -Function: goto_inline - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_inlinet::goto_inline_nontransitive( const irep_idt identifier, goto_functiont &goto_function, @@ -926,18 +761,6 @@ void goto_inlinet::goto_inline_nontransitive( finished_set.insert(identifier); } -/*******************************************************************\ - -Function: goto_inline_transitive - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - const goto_inlinet::goto_functiont &goto_inlinet::goto_inline_transitive( const irep_idt identifier, const goto_functiont &goto_function, @@ -999,18 +822,6 @@ const goto_inlinet::goto_functiont &goto_inlinet::goto_inline_transitive( return cached; } -/*******************************************************************\ - -Function: is_ignored - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool goto_inlinet::is_ignored(const irep_idt id) const { return @@ -1022,18 +833,6 @@ bool goto_inlinet::is_ignored(const irep_idt id) const id=="__CPROVER_cover"; } -/*******************************************************************\ - -Function: check_inline_map - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool goto_inlinet::check_inline_map( const irep_idt identifier, const inline_mapt &inline_map) const @@ -1080,18 +879,6 @@ bool goto_inlinet::check_inline_map( return true; } -/*******************************************************************\ - -Function: check_inline_map - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool goto_inlinet::check_inline_map(const inline_mapt &inline_map) const { forall_goto_functions(f_it, goto_functions) @@ -1103,18 +890,6 @@ bool goto_inlinet::check_inline_map(const inline_mapt &inline_map) const return true; } -/*******************************************************************\ - -Function: output_inline_map - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_inlinet::output_inline_map( std::ostream &out, const inline_mapt &inline_map) @@ -1161,18 +936,6 @@ void goto_inlinet::output_inline_map( } } -/*******************************************************************\ - -Function: output_cache - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_inlinet::output_cache(std::ostream &out) const { for(auto it=cache.begin(); it!=cache.end(); it++) @@ -1184,18 +947,6 @@ void goto_inlinet::output_cache(std::ostream &out) const } } -/*******************************************************************\ - -Function: cleanup - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - // remove segment that refer to the given goto program void goto_inlinet::goto_inline_logt::cleanup( const goto_programt &goto_program) @@ -1204,18 +955,6 @@ void goto_inlinet::goto_inline_logt::cleanup( log_map.erase(it); } -/*******************************************************************\ - -Function: cleanup - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_inlinet::goto_inline_logt::cleanup( const goto_functionst::function_mapt &function_map) { @@ -1231,18 +970,6 @@ void goto_inlinet::goto_inline_logt::cleanup( } } -/*******************************************************************\ - -Function: add_segment - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_inlinet::goto_inline_logt::add_segment( const goto_programt &goto_program, const unsigned begin_location_number, @@ -1270,18 +997,6 @@ void goto_inlinet::goto_inline_logt::add_segment( log_map[start]=info; } -/*******************************************************************\ - -Function: copy_from - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_inlinet::goto_inline_logt::copy_from( const goto_programt &from, const goto_programt &to) @@ -1321,18 +1036,6 @@ void goto_inlinet::goto_inline_logt::copy_from( } } -/*******************************************************************\ - -Function: output_inline_log_json - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - // call after goto_functions.update()! jsont goto_inlinet::goto_inline_logt::output_inline_log_json() const { diff --git a/src/goto-programs/goto_model.h b/src/goto-programs/goto_model.h index 37b491dc996..6e9ebbc6f37 100644 --- a/src/goto-programs/goto_model.h +++ b/src/goto-programs/goto_model.h @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Symbol Table + CFG + #ifndef CPROVER_GOTO_PROGRAMS_GOTO_MODEL_H #define CPROVER_GOTO_PROGRAMS_GOTO_MODEL_H diff --git a/src/goto-programs/goto_program.cpp b/src/goto-programs/goto_program.cpp index c1b72dc7bbf..be564d3715d 100644 --- a/src/goto-programs/goto_program.cpp +++ b/src/goto-programs/goto_program.cpp @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Program Transformation + #include #include @@ -14,23 +17,13 @@ Author: Daniel Kroening, kroening@kroening.com #include "goto_program.h" -/*******************************************************************\ - -Function: goto_programt::output_instruction - - Inputs: - ns - the namespace to resolve the expressions in - identifier - the identifier used to find a symbol to identify the - source language - out - the stream to write the goto string to - it - an iterator pointing to the instruction to convert - - Outputs: See below. - - Purpose: See below. - -\*******************************************************************/ - +/// See below. +/// \param ns: the namespace to resolve the expressions in +/// \param identifier: the identifier used to find a symbol to identify the +/// source language +/// \param out: the stream to write the goto string to +/// \param it: an iterator pointing to the instruction to convert +/// \return See below. std::ostream &goto_programt::output_instruction( const class namespacet &ns, const irep_idt &identifier, @@ -40,26 +33,15 @@ std::ostream &goto_programt::output_instruction( return output_instruction(ns, identifier, out, *it); } -/*******************************************************************\ - -Function: goto_programt::output_instruction - - Inputs: - ns - the namespace to resolve the expressions in - identifier - the identifier used to find a symbol to identify the - source language - out - the stream to write the goto string to - instruction - the instruction to convert - - Outputs: Appends to out a two line representation of the instruction - - Purpose: Writes to out a two line string representation of the specific - instruction. It is of the format: - // {location} file {source file} line {line in source file} - {representation of the instruction} - -\*******************************************************************/ - +/// Writes to out a two line string representation of the specific instruction. +/// It is of the format: // {location} file {source file} line {line in source +/// file} {representation of the instruction} +/// \param ns: the namespace to resolve the expressions in +/// \param identifier: the identifier used to find a symbol to identify the +/// source language +/// \param out: the stream to write the goto string to +/// \param instruction: the instruction to convert +/// \return Appends to out a two line representation of the instruction std::ostream &goto_programt::output_instruction( const namespacet &ns, const irep_idt &identifier, @@ -229,18 +211,6 @@ std::ostream &goto_programt::output_instruction( return out; } -/*******************************************************************\ - -Function: goto_programt::get_decl_identifiers - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_programt::get_decl_identifiers( decl_identifierst &decl_identifiers) const { @@ -256,18 +226,6 @@ void goto_programt::get_decl_identifiers( } } -/*******************************************************************\ - -Function: parse_lhs_read - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void parse_lhs_read(const exprt &src, std::list &dest) { if(src.id()==ID_dereference) @@ -295,18 +253,6 @@ void parse_lhs_read(const exprt &src, std::list &dest) } } -/*******************************************************************\ - -Function: expressions_read - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::list expressions_read( const goto_programt::instructiont &instruction) { @@ -352,18 +298,6 @@ std::list expressions_read( return dest; } -/*******************************************************************\ - -Function: expressions_written - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::list expressions_written( const goto_programt::instructiont &instruction) { @@ -392,18 +326,6 @@ std::list expressions_written( return dest; } -/*******************************************************************\ - -Function: get_objects_read - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void objects_read( const exprt &src, std::list &dest) @@ -428,18 +350,6 @@ void objects_read( } } -/*******************************************************************\ - -Function: objects_read - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::list objects_read( const goto_programt::instructiont &instruction) { @@ -453,18 +363,6 @@ std::list objects_read( return dest; } -/*******************************************************************\ - -Function: objects_written - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void objects_written( const exprt &src, std::list &dest) @@ -479,18 +377,6 @@ void objects_written( dest.push_back(src); } -/*******************************************************************\ - -Function: objects_written - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::list objects_written( const goto_programt::instructiont &instruction) { @@ -504,18 +390,6 @@ std::list objects_written( return dest; } -/*******************************************************************\ - -Function: as_string - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string as_string( const class namespacet &ns, const goto_programt::instructiont &i) diff --git a/src/goto-programs/goto_program.h b/src/goto-programs/goto_program.h index 83fb020c096..8e966283953 100644 --- a/src/goto-programs/goto_program.h +++ b/src/goto-programs/goto_program.h @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Concrete Goto Program + #ifndef CPROVER_GOTO_PROGRAMS_GOTO_PROGRAM_H #define CPROVER_GOTO_PROGRAMS_GOTO_PROGRAM_H diff --git a/src/goto-programs/goto_program_irep.cpp b/src/goto-programs/goto_program_irep.cpp index 3ddc09e27a3..c93484fa644 100644 --- a/src/goto-programs/goto_program_irep.cpp +++ b/src/goto-programs/goto_program_irep.cpp @@ -8,24 +8,15 @@ Date: May 2007 \*******************************************************************/ +/// \file +/// goto_programt -> irep conversion + #include #include #include "goto_program_irep.h" -/*******************************************************************\ - -Function: convert - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void convert(const goto_programt::instructiont &instruction, irept &irep) { irep.set(ID_code, instruction.code); @@ -62,18 +53,6 @@ void convert(const goto_programt::instructiont &instruction, irept &irep) } } -/*******************************************************************\ - -Function: convert - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void convert( const irept &irep, goto_programt::instructiont &instruction) @@ -94,18 +73,6 @@ void convert( instruction.labels.push_back(lsub.id()); } -/*******************************************************************\ - -Function: convert - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void convert(const goto_programt &program, irept &irep) { irep.id("goto-program"); @@ -117,18 +84,6 @@ void convert(const goto_programt &program, irept &irep) } } -/*******************************************************************\ - -Function: convert - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void convert(const irept &irep, goto_programt &program) { assert(irep.id()=="goto-program"); diff --git a/src/goto-programs/goto_program_irep.h b/src/goto-programs/goto_program_irep.h index aef5c1f9f0a..4659e62f9d4 100644 --- a/src/goto-programs/goto_program_irep.h +++ b/src/goto-programs/goto_program_irep.h @@ -8,6 +8,9 @@ Date: May 2007 \*******************************************************************/ +/// \file +/// goto_programt -> irep conversion + #ifndef CPROVER_GOTO_PROGRAMS_GOTO_PROGRAM_IREP_H #define CPROVER_GOTO_PROGRAMS_GOTO_PROGRAM_IREP_H diff --git a/src/goto-programs/goto_program_template.cpp b/src/goto-programs/goto_program_template.cpp index 80fc9089c74..bc4522a6841 100644 --- a/src/goto-programs/goto_program_template.cpp +++ b/src/goto-programs/goto_program_template.cpp @@ -6,22 +6,13 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Goto Program Template + #include #include "goto_program_template.h" -/*******************************************************************\ - -Function: operator<< - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::ostream &operator<<(std::ostream &out, goto_program_instruction_typet t) { switch(t) diff --git a/src/goto-programs/goto_program_template.h b/src/goto-programs/goto_program_template.h index fc36d573ef9..af121f78444 100644 --- a/src/goto-programs/goto_program_template.h +++ b/src/goto-programs/goto_program_template.h @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Goto Program Template + #ifndef CPROVER_GOTO_PROGRAMS_GOTO_PROGRAM_TEMPLATE_H #define CPROVER_GOTO_PROGRAMS_GOTO_PROGRAM_TEMPLATE_H diff --git a/src/goto-programs/goto_trace.cpp b/src/goto-programs/goto_trace.cpp index d3ddb767d0c..aa55b2643f4 100644 --- a/src/goto-programs/goto_trace.cpp +++ b/src/goto-programs/goto_trace.cpp @@ -8,6 +8,9 @@ Author: Daniel Kroening \*******************************************************************/ +/// \file +/// Traces of GOTO Programs + #include #include @@ -19,18 +22,6 @@ Author: Daniel Kroening #include "goto_trace.h" -/*******************************************************************\ - -Function: goto_tracet::output - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_tracet::output( const class namespacet &ns, std::ostream &out) const @@ -39,18 +30,6 @@ void goto_tracet::output( step.output(ns, out); } -/*******************************************************************\ - -Function: goto_tracet::output - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_trace_stept::output( const namespacet &ns, std::ostream &out) const @@ -137,18 +116,6 @@ void goto_trace_stept::output( out << "\n"; } -/*******************************************************************\ - -Function: trace_value_binary - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string trace_value_binary( const exprt &expr, const namespacet &ns) @@ -212,18 +179,6 @@ std::string trace_value_binary( return "?"; } -/*******************************************************************\ - -Function: trace_value - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void trace_value( std::ostream &out, const namespacet &ns, @@ -254,18 +209,6 @@ void trace_value( << "\n"; } -/*******************************************************************\ - -Function: show_state_header - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void show_state_header( std::ostream &out, const goto_trace_stept &state, @@ -284,18 +227,6 @@ void show_state_header( out << "----------------------------------------------------" << "\n"; } -/*******************************************************************\ - -Function: is_index_member_symbol - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool is_index_member_symbol(const exprt &src) { if(src.id()==ID_index) @@ -308,18 +239,6 @@ bool is_index_member_symbol(const exprt &src) return false; } -/*******************************************************************\ - -Function: show_goto_trace - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void show_goto_trace( std::ostream &out, const namespacet &ns, diff --git a/src/goto-programs/goto_trace.h b/src/goto-programs/goto_trace.h index 7bcbc1077b8..02f230e8943 100644 --- a/src/goto-programs/goto_trace.h +++ b/src/goto-programs/goto_trace.h @@ -8,6 +8,9 @@ Date: July 2005 \*******************************************************************/ +/// \file +/// Traces of GOTO Programs + #ifndef CPROVER_GOTO_PROGRAMS_GOTO_TRACE_H #define CPROVER_GOTO_PROGRAMS_GOTO_TRACE_H diff --git a/src/goto-programs/graphml_witness.cpp b/src/goto-programs/graphml_witness.cpp index ae10705e232..791e7574987 100644 --- a/src/goto-programs/graphml_witness.cpp +++ b/src/goto-programs/graphml_witness.cpp @@ -6,6 +6,9 @@ Author: Daniel Kroening \*******************************************************************/ +/// \file +/// Witnesses for Traces and Proofs + #include #include #include @@ -15,18 +18,6 @@ Author: Daniel Kroening #include "graphml_witness.h" -/*******************************************************************\ - -Function: graphml_witnesst::remove_l0_l1 - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void graphml_witnesst::remove_l0_l1(exprt &expr) { if(expr.id()==ID_symbol) @@ -53,18 +44,6 @@ void graphml_witnesst::remove_l0_l1(exprt &expr) remove_l0_l1(*it); } -/*******************************************************************\ - -Function: graphml_witnesst::convert_assign_rec - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string graphml_witnesst::convert_assign_rec( const irep_idt &identifier, const code_assignt &assign) @@ -156,18 +135,6 @@ std::string graphml_witnesst::convert_assign_rec( return result; } -/*******************************************************************\ - -Function: filter_out - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - static bool filter_out( const goto_tracet &goto_trace, const goto_tracet::stepst::const_iterator &prev_it, @@ -203,18 +170,7 @@ static bool filter_out( return false; } -/*******************************************************************\ - -Function: graphml_witnesst::operator() - - Inputs: - - Outputs: - - Purpose: counterexample witness - -\*******************************************************************/ - +/// counterexample witness void graphml_witnesst::operator()(const goto_tracet &goto_trace) { graphml.key_values["sourcecodelang"]="C"; @@ -398,18 +354,7 @@ void graphml_witnesst::operator()(const goto_tracet &goto_trace) } } -/*******************************************************************\ - -Function: graphml_witnesst::operator() - - Inputs: - - Outputs: - - Purpose: proof witness - -\*******************************************************************/ - +/// proof witness void graphml_witnesst::operator()(const symex_target_equationt &equation) { graphml.key_values["sourcecodelang"]="C"; diff --git a/src/goto-programs/graphml_witness.h b/src/goto-programs/graphml_witness.h index 65a6b8e5406..053eb801146 100644 --- a/src/goto-programs/graphml_witness.h +++ b/src/goto-programs/graphml_witness.h @@ -6,6 +6,9 @@ Author: Daniel Kroening \*******************************************************************/ +/// \file +/// Witnesses for Traces and Proofs + #ifndef CPROVER_GOTO_PROGRAMS_GRAPHML_WITNESS_H #define CPROVER_GOTO_PROGRAMS_GRAPHML_WITNESS_H diff --git a/src/goto-programs/initialize_goto_model.cpp b/src/goto-programs/initialize_goto_model.cpp index 52a6caeeba2..faff5da8a38 100644 --- a/src/goto-programs/initialize_goto_model.cpp +++ b/src/goto-programs/initialize_goto_model.cpp @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Get a Goto Program + #include #include @@ -20,18 +23,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "read_goto_binary.h" #include "initialize_goto_model.h" -/*******************************************************************\ - -Function: initialize_goto_model - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool initialize_goto_model( goto_modelt &goto_model, const cmdlinet &cmdline, diff --git a/src/goto-programs/initialize_goto_model.h b/src/goto-programs/initialize_goto_model.h index 2b4b03615ca..9aa1c8ef126 100644 --- a/src/goto-programs/initialize_goto_model.h +++ b/src/goto-programs/initialize_goto_model.h @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Initialize a Goto Program + #ifndef CPROVER_GOTO_PROGRAMS_INITIALIZE_GOTO_MODEL_H #define CPROVER_GOTO_PROGRAMS_INITIALIZE_GOTO_MODEL_H diff --git a/src/goto-programs/interpreter.cpp b/src/goto-programs/interpreter.cpp index 149f4002651..aca343b4cfb 100644 --- a/src/goto-programs/interpreter.cpp +++ b/src/goto-programs/interpreter.cpp @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Interpreter for GOTO Programs + #include #include #include @@ -27,18 +30,6 @@ Author: Daniel Kroening, kroening@kroening.com const size_t interpretert::npos=std::numeric_limits::max(); -/*******************************************************************\ - -Function: interpretert::operator() - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void interpretert::operator()() { status() << "0- Initialize:" << eom; @@ -61,20 +52,8 @@ void interpretert::operator()() command(); } -/*******************************************************************\ - -Function: interpretert::initialize - - Inputs: - - Outputs: - - Purpose: Initializes the memory map of the interpreter and - [optionally] runs up to the entry point (thus doing - the cprover initialization) - -\*******************************************************************/ - +/// Initializes the memory map of the interpreter and [optionally] runs up to +/// the entry point (thus doing the cprover initialization) void interpretert::initialize(bool init) { build_memory_map(); @@ -115,19 +94,7 @@ void interpretert::initialize(bool init) } } -/*******************************************************************\ - -Function: interpretert::show_state - - Inputs: - - Outputs: - - Purpose: displays the current position of the pc and corresponding - code - -\*******************************************************************/ - +/// displays the current position of the pc and corresponding code void interpretert::show_state() { if(!show) @@ -150,18 +117,7 @@ void interpretert::show_state() status() << eom; } -/*******************************************************************\ - -Function: interpretert::command - - Inputs: - - Outputs: - - Purpose: reads a user command and executes it. - -\*******************************************************************/ - +/// reads a user command and executes it. void interpretert::command() { #define BUFSIZE 100 @@ -266,18 +222,7 @@ void interpretert::command() show_state(); } -/*******************************************************************\ - -Function: interpretert::step - - Inputs: - - Outputs: - - Purpose: executes a single step and updates the program counter - -\*******************************************************************/ - +/// executes a single step and updates the program counter void interpretert::step() { total_steps++; @@ -413,18 +358,7 @@ void interpretert::step() pc=next_pc; } -/*******************************************************************\ - -Function: interpretert::execute_goto - - Inputs: - - Outputs: - - Purpose: executes a goto instruction - -\*******************************************************************/ - +/// executes a goto instruction void interpretert::execute_goto() { if(evaluate_boolean(pc->guard)) @@ -439,18 +373,7 @@ void interpretert::execute_goto() } } -/*******************************************************************\ - -Function: interpretert::execute_other - - Inputs: - - Outputs: - - Purpose: executes side effects of 'other' instructions - -\*******************************************************************/ - +/// executes side effects of 'other' instructions void interpretert::execute_other() { const irep_idt &statement=pc->code.get_statement(); @@ -483,35 +406,13 @@ void interpretert::execute_other() throw "unexpected OTHER statement: "+id2string(statement); } -/*******************************************************************\ - -Function: interpretert::execute_decl - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void interpretert::execute_decl() { assert(pc->code.get_statement()==ID_decl); } -/*******************************************************************\ - -Function: interpretert::get_component_id - - Inputs: an object and a memory offset - - Outputs: - - Purpose: retrieves the member at offset - -\*******************************************************************/ - +/// retrieves the member at offset +/// \par parameters: an object and a memory offset irep_idt interpretert::get_component_id( const irep_idt &object, unsigned offset) @@ -534,18 +435,7 @@ irep_idt interpretert::get_component_id( return object; } -/*******************************************************************\ - -Function: interpretert::get_type - - Inputs: - - Outputs: - - Purpose: returns the type object corresponding to id - -\*******************************************************************/ - +/// returns the type object corresponding to id typet interpretert::get_type(const irep_idt &id) const { dynamic_typest::const_iterator it=dynamic_types.find(id); @@ -554,19 +444,8 @@ typet interpretert::get_type(const irep_idt &id) const return it->second; } -/*******************************************************************\ - -Function: interpretert::get_value - - Inputs: - - Outputs: - - Purpose: retrives the constant value at memory location offset - as an object of type type - -\*******************************************************************/ - +/// retrives the constant value at memory location offset as an object of type +/// type exprt interpretert::get_value( const typet &type, std::size_t offset, @@ -627,19 +506,8 @@ exprt interpretert::get_value( return get_value(type, rhs); } -/*******************************************************************\ - - Function: interpretert::get_value - - Inputs: - - Outputs: - - Purpose: returns the value at offset in the form of type given a - memory buffer rhs which is typically a structured type - -\*******************************************************************/ - +/// returns the value at offset in the form of type given a memory buffer rhs +/// which is typically a structured type exprt interpretert::get_value( const typet &type, mp_vectort &rhs, @@ -765,18 +633,7 @@ exprt interpretert::get_value( return from_integer(rhs[offset], type); } -/*******************************************************************\ - -Function: interpretert::execute_assign - - Inputs: - - Outputs: - - Purpose: executes the assign statement at the current pc value - -\*******************************************************************/ - +/// executes the assign statement at the current pc value void interpretert::execute_assign() { const code_assignt &code_assign= @@ -826,19 +683,7 @@ void interpretert::execute_assign() } } -/*******************************************************************\ - -Function: interpretert::assign - - Inputs: - - Outputs: - - Purpose: sets the memory at address with the given rhs value - (up to sizeof(rhs)) - -\*******************************************************************/ - +/// sets the memory at address with the given rhs value (up to sizeof(rhs)) void interpretert::assign( mp_integer address, const mp_vectort &rhs) @@ -863,36 +708,12 @@ void interpretert::assign( } } -/*******************************************************************\ - -Function: interpretert::execute_assume - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void interpretert::execute_assume() { if(!evaluate_boolean(pc->guard)) throw "assumption failed"; } -/*******************************************************************\ - -Function: interpretert::execute_assert - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void interpretert::execute_assert() { if(!evaluate_boolean(pc->guard)) @@ -905,18 +726,6 @@ void interpretert::execute_assert() } } -/*******************************************************************\ - -Function: interpretert::execute_function_call - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void interpretert::execute_function_call() { const code_function_callt &function_call= @@ -1027,18 +836,7 @@ void interpretert::execute_function_call() } } -/*******************************************************************\ - -Function: interpretert::build_memory_map - - Inputs: - - Outputs: - - Purpose: Creates a memory map of all static symbols in the program - -\*******************************************************************/ - +/// Creates a memory map of all static symbols in the program void interpretert::build_memory_map() { // put in a dummy for NULL @@ -1056,18 +854,6 @@ void interpretert::build_memory_map() stack_pointer=memory.size(); } -/*******************************************************************\ - -Function: interpretert::build_memory_map - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void interpretert::build_memory_map(const symbolt &symbol) { size_t size=0; @@ -1090,18 +876,7 @@ void interpretert::build_memory_map(const symbolt &symbol) } } -/*******************************************************************\ - -Function: interpretert::concretize_type - - Inputs: - - Outputs: - - Purpose: turns a variable length array type into a fixed array type - -\*******************************************************************/ - +/// turns a variable length array type into a fixed array type typet interpretert::concretize_type(const typet &type) { if(type.id()==ID_array) @@ -1126,19 +901,8 @@ typet interpretert::concretize_type(const typet &type) return type; } -/*******************************************************************\ - -Function: interpretert::build_memory_map - - Inputs: - - Outputs: Updates the memory map to include variable id if it does - not exist - - Purpose: Populates dynamic entries of the memory map - -\*******************************************************************/ - +/// Populates dynamic entries of the memory map +/// \return Updates the memory map to include variable id if it does not exist mp_integer interpretert::build_memory_map( const irep_idt &id, const typet &type) @@ -1190,21 +954,10 @@ bool interpretert::unbounded_size(const typet &type) return false; } -/*******************************************************************\ - -Function: interpretert::get_size - - Inputs: - type - a structured type - - Outputs: Size of the given type - - Purpose: Retrieves the actual size of the provided structured type. - Unbounded objects get allocated 2^32 address space each - (of a 2^64 sized space). - -\*******************************************************************/ - +/// Retrieves the actual size of the provided structured type. Unbounded objects +/// get allocated 2^32 address space each (of a 2^64 sized space). +/// \param type: a structured type +/// \return Size of the given type size_t interpretert::get_size(const typet &type) { if(unbounded_size(type)) @@ -1300,18 +1053,6 @@ exprt interpretert::get_value(const irep_idt &id) return get_value(get_type, integer2size_t(whole_lhs_object_address)); } -/*******************************************************************\ - -Function: interpreter - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void interpreter( const symbol_tablet &symbol_table, const goto_functionst &goto_functions, @@ -1324,19 +1065,8 @@ void interpreter( interpreter(); } -/*******************************************************************\ - -Function: interpretert::print_memory - - Inputs: - - Outputs: - - Purpose: Prints the current state of the memory map - Since messaget mdofifies class members, print functions are nonconst - -\*******************************************************************/ - +/// Prints the current state of the memory map Since messaget mdofifies class +/// members, print functions are nonconst void interpretert::print_memory(bool input_flags) { for(const auto &cell_address : memory) diff --git a/src/goto-programs/interpreter.h b/src/goto-programs/interpreter.h index 1888a009969..8d598852b1a 100644 --- a/src/goto-programs/interpreter.h +++ b/src/goto-programs/interpreter.h @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Interpreter for GOTO Programs + #ifndef CPROVER_GOTO_PROGRAMS_INTERPRETER_H #define CPROVER_GOTO_PROGRAMS_INTERPRETER_H diff --git a/src/goto-programs/interpreter_class.h b/src/goto-programs/interpreter_class.h index d1051eeb93f..9456037a474 100644 --- a/src/goto-programs/interpreter_class.h +++ b/src/goto-programs/interpreter_class.h @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Interpreter for GOTO Programs + #ifndef CPROVER_GOTO_PROGRAMS_INTERPRETER_CLASS_H #define CPROVER_GOTO_PROGRAMS_INTERPRETER_CLASS_H diff --git a/src/goto-programs/interpreter_evaluate.cpp b/src/goto-programs/interpreter_evaluate.cpp index b711be84ba2..12aca4b57b5 100644 --- a/src/goto-programs/interpreter_evaluate.cpp +++ b/src/goto-programs/interpreter_evaluate.cpp @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Interpreter for GOTO Programs + #include #include #include @@ -18,19 +21,8 @@ Author: Daniel Kroening, kroening@kroening.com #include "interpreter_class.h" -/*******************************************************************\ - -Function: interpretert::read - - Inputs: - - Outputs: - - Purpose: reads a memory address and loads it into the dest variable - marks cell as read before written if cell has never been written - -\*******************************************************************/ - +/// reads a memory address and loads it into the dest variable marks cell as +/// read before written if cell has never been written void interpretert::read( mp_integer address, mp_vectort &dest) const @@ -82,18 +74,7 @@ void interpretert::read_unbounded( } } -/*******************************************************************\ - -Function: interpretert::allocate - - Inputs: - - Outputs: - - Purpose: reserves memory block of size at address - -\*******************************************************************/ - +/// reserves memory block of size at address void interpretert::allocate( mp_integer address, size_t size) @@ -110,18 +91,7 @@ void interpretert::allocate( } } -/*******************************************************************\ - -Function: interpretert::clear_input_flags - - Inputs: - - Outputs: - - Purpose: Clears memoy r/w flag initialization - -\*******************************************************************/ - +/// Clears memoy r/w flag initialization void interpretert::clear_input_flags() { for(auto &cell : memory) @@ -131,18 +101,7 @@ void interpretert::clear_input_flags() } } -/*******************************************************************\ - -Function: interpretert::count_type_leaves - - Inputs: Type - - Outputs: Number of leaf primitive types; returns true on error - - Purpose: - -\*******************************************************************/ - +/// \return Number of leaf primitive types; returns true on error bool interpretert::count_type_leaves(const typet &ty, mp_integer &result) { if(ty.id()==ID_struct) @@ -177,25 +136,15 @@ bool interpretert::count_type_leaves(const typet &ty, mp_integer &result) } } -/*******************************************************************\ - -Function: interpretert::byte_offset_to_memory_offset - - Inputs: 'source_type', 'offset' (unit: bytes), - - Outputs: Offset into a vector of interpreter values; returns true on error - - Purpose: Supposing the caller has an mp_vector representing - a value with type 'source_type', this yields the offset into that - vector at which to find a value at *byte* address 'offset'. - We need this because the interpreter's memory map uses unlabelled - variable-width values -- for example, a C value { { 1, 2 }, 3, 4 } - of type struct { int x[2]; char y; unsigned long z; } - would be represented [1,2,3,4], with the source type needed alongside - to figure out which member is targeted by a byte-extract operation. - -\*******************************************************************/ - +/// Supposing the caller has an mp_vector representing a value with type +/// 'source_type', this yields the offset into that vector at which to find a +/// value at *byte* address 'offset'. We need this because the interpreter's +/// memory map uses unlabelled variable-width values -- for example, a C value { +/// { 1, 2 }, 3, 4 } of type struct { int x[2]; char y; unsigned long z; } would +/// be represented [1,2,3,4], with the source type needed alongside to figure +/// out which member is targeted by a byte-extract operation. +/// \par parameters: 'source_type', 'offset' (unit: bytes), +/// \return Offset into a vector of interpreter values; returns true on error bool interpretert::byte_offset_to_memory_offset( const typet &source_type, mp_integer offset, @@ -270,21 +219,12 @@ bool interpretert::byte_offset_to_memory_offset( } } -/*******************************************************************\ - -Function: interpretert::memory_offset_to_byte_offset - - Inputs: An interpreter memory offset and the type to interpret that memory - - Outputs: The corresponding byte offset. Returns true on error - - Purpose: Similarly to the above, the interpreter's memory objects contain - mp_integers that represent variable-sized struct members. This - counts the size of type leaves to determine the byte offset - corresponding to a memory offset. - -\*******************************************************************/ - +/// Similarly to the above, the interpreter's memory objects contain mp_integers +/// that represent variable-sized struct members. This counts the size of type +/// leaves to determine the byte offset corresponding to a memory offset. +/// \par parameters: An interpreter memory offset and the type to interpret that +/// memory +/// \return The corresponding byte offset. Returns true on error bool interpretert::memory_offset_to_byte_offset( const typet &source_type, mp_integer cell_offset, @@ -356,18 +296,6 @@ bool interpretert::memory_offset_to_byte_offset( } } -/*******************************************************************\ - -Function: interpretert::evaluate - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void interpretert::evaluate( const exprt &expr, mp_vectort &dest) @@ -1136,18 +1064,6 @@ void interpretert::evaluate( << eom; } -/*******************************************************************\ - -Function: interpretert::evaluate_address - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - mp_integer interpretert::evaluate_address( const exprt &expr, bool fail_quietly) diff --git a/src/goto-programs/json_goto_trace.cpp b/src/goto-programs/json_goto_trace.cpp index 694466aec2b..eaa84f6654b 100644 --- a/src/goto-programs/json_goto_trace.cpp +++ b/src/goto-programs/json_goto_trace.cpp @@ -8,6 +8,9 @@ Author: Daniel Kroening \*******************************************************************/ +/// \file +/// Traces of GOTO Programs + #include #include @@ -16,18 +19,6 @@ Author: Daniel Kroening #include "json_goto_trace.h" -/*******************************************************************\ - -Function: convert - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void convert( const namespacet &ns, const goto_tracet &goto_trace, diff --git a/src/goto-programs/json_goto_trace.h b/src/goto-programs/json_goto_trace.h index a4a3f2757fe..102569b50e6 100644 --- a/src/goto-programs/json_goto_trace.h +++ b/src/goto-programs/json_goto_trace.h @@ -8,6 +8,9 @@ Date: November 2005 \*******************************************************************/ +/// \file +/// Traces of GOTO Programs + #ifndef CPROVER_GOTO_PROGRAMS_JSON_GOTO_TRACE_H #define CPROVER_GOTO_PROGRAMS_JSON_GOTO_TRACE_H diff --git a/src/goto-programs/link_to_library.cpp b/src/goto-programs/link_to_library.cpp index c3ead7e6ecb..f78abb5dc39 100644 --- a/src/goto-programs/link_to_library.cpp +++ b/src/goto-programs/link_to_library.cpp @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Library Linking + #include #include @@ -14,18 +17,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "compute_called_functions.h" #include "goto_convert_functions.h" -/*******************************************************************\ - -Function: link_to_library - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void link_to_library( goto_modelt &goto_model, message_handlert &message_handler) @@ -36,18 +27,6 @@ void link_to_library( message_handler); } -/*******************************************************************\ - -Function: link_to_library - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void link_to_library( symbol_tablet &symbol_table, goto_functionst &goto_functions, diff --git a/src/goto-programs/link_to_library.h b/src/goto-programs/link_to_library.h index cb266e5d8fa..c45c5efbfa2 100644 --- a/src/goto-programs/link_to_library.h +++ b/src/goto-programs/link_to_library.h @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Library Linking + #ifndef CPROVER_GOTO_PROGRAMS_LINK_TO_LIBRARY_H #define CPROVER_GOTO_PROGRAMS_LINK_TO_LIBRARY_H diff --git a/src/goto-programs/loop_ids.cpp b/src/goto-programs/loop_ids.cpp index 723ffe329aa..46ca3ad3e8e 100644 --- a/src/goto-programs/loop_ids.cpp +++ b/src/goto-programs/loop_ids.cpp @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Loop IDs + #include #include @@ -15,18 +18,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "loop_ids.h" -/*******************************************************************\ - -Function: show_loop_ids - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void show_loop_ids( ui_message_handlert::uit ui, const goto_modelt &goto_model) @@ -34,18 +25,6 @@ void show_loop_ids( show_loop_ids(ui, goto_model.goto_functions); } -/*******************************************************************\ - -Function: show_loop_ids - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void show_loop_ids( ui_message_handlert::uit ui, const goto_programt &goto_program) @@ -113,18 +92,6 @@ void show_loop_ids_json( } } -/*******************************************************************\ - -Function: show_loop_ids - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void show_loop_ids( ui_message_handlert::uit ui, const goto_functionst &goto_functions) diff --git a/src/goto-programs/loop_ids.h b/src/goto-programs/loop_ids.h index da17118698c..a9f439286d7 100644 --- a/src/goto-programs/loop_ids.h +++ b/src/goto-programs/loop_ids.h @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Loop IDs + #ifndef CPROVER_GOTO_PROGRAMS_LOOP_IDS_H #define CPROVER_GOTO_PROGRAMS_LOOP_IDS_H diff --git a/src/goto-programs/osx_fat_reader.cpp b/src/goto-programs/osx_fat_reader.cpp index aa9594ec203..93bc0f93dbc 100644 --- a/src/goto-programs/osx_fat_reader.cpp +++ b/src/goto-programs/osx_fat_reader.cpp @@ -6,6 +6,9 @@ Module: Read Mach-O \*******************************************************************/ +/// \file +/// Read Mach-O + #include #include @@ -15,18 +18,6 @@ Module: Read Mach-O #include #endif -/*******************************************************************\ - -Function: is_osx_fat_magic - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool is_osx_fat_magic(char hdr[4]) { #ifdef __APPLE__ @@ -43,18 +34,6 @@ bool is_osx_fat_magic(char hdr[4]) return false; } -/*******************************************************************\ - -Function: osx_fat_readert::osx_fat_readert - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - osx_fat_readert::osx_fat_readert(std::ifstream &in) : has_gb_arch(false) { @@ -94,18 +73,6 @@ osx_fat_readert::osx_fat_readert(std::ifstream &in) : #endif } -/*******************************************************************\ - -Function: osx_fat_readert::extract_gb - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool osx_fat_readert::extract_gb( const std::string &source, const std::string &dest) const diff --git a/src/goto-programs/osx_fat_reader.h b/src/goto-programs/osx_fat_reader.h index e164548607b..715fc9f1eec 100644 --- a/src/goto-programs/osx_fat_reader.h +++ b/src/goto-programs/osx_fat_reader.h @@ -6,6 +6,9 @@ Module: Read OS X Fat Binaries \*******************************************************************/ +/// \file +/// Read OS X Fat Binaries + #ifndef CPROVER_GOTO_PROGRAMS_OSX_FAT_READER_H #define CPROVER_GOTO_PROGRAMS_OSX_FAT_READER_H diff --git a/src/goto-programs/parameter_assignments.cpp b/src/goto-programs/parameter_assignments.cpp index 2052bdb09d8..98d9f80a1c3 100644 --- a/src/goto-programs/parameter_assignments.cpp +++ b/src/goto-programs/parameter_assignments.cpp @@ -8,6 +8,9 @@ Date: September 2015 \*******************************************************************/ +/// \file +/// Add parameter assignments + #include #include @@ -32,18 +35,7 @@ class parameter_assignmentst goto_programt &goto_program); }; -/*******************************************************************\ - -Function: parameter_assignmentst::do_function_calls - -Inputs: - -Outputs: - -Purpose: turns x=f(...) into f(...); lhs=f#return_value; - -\*******************************************************************/ - +/// turns x=f(...) into f(...); lhs=f#return_value; void parameter_assignmentst::do_function_calls( goto_functionst &goto_functions, goto_programt &goto_program) @@ -98,36 +90,13 @@ void parameter_assignmentst::do_function_calls( } } -/*******************************************************************\ - -Function: parameter_assignmentst::operator() - -Inputs: - -Outputs: - -Purpose: - -\*******************************************************************/ - void parameter_assignmentst::operator()(goto_functionst &goto_functions) { Forall_goto_functions(it, goto_functions) do_function_calls(goto_functions, it->second.body); } -/*******************************************************************\ - -Function: parameter_assignments - -Inputs: - -Outputs: - -Purpose: removes returns - -\*******************************************************************/ - +/// removes returns void parameter_assignments( symbol_tablet &symbol_table, goto_functionst &goto_functions) @@ -136,18 +105,7 @@ void parameter_assignments( rr(goto_functions); } -/*******************************************************************\ - -Function: parameter_assignments - -Inputs: - -Outputs: - -Purpose: removes returns - -\*******************************************************************/ - +/// removes returns void parameter_assignments(goto_modelt &goto_model) { parameter_assignmentst rr(goto_model.symbol_table); diff --git a/src/goto-programs/parameter_assignments.h b/src/goto-programs/parameter_assignments.h index b9cafe8f932..61eb180d7cd 100644 --- a/src/goto-programs/parameter_assignments.h +++ b/src/goto-programs/parameter_assignments.h @@ -8,6 +8,9 @@ Date: September 2015 \*******************************************************************/ +/// \file +/// Add parameter assignments + #ifndef CPROVER_GOTO_PROGRAMS_PARAMETER_ASSIGNMENTS_H #define CPROVER_GOTO_PROGRAMS_PARAMETER_ASSIGNMENTS_H diff --git a/src/goto-programs/pointer_arithmetic.cpp b/src/goto-programs/pointer_arithmetic.cpp index 0639a0dbca4..f396f1b1e06 100644 --- a/src/goto-programs/pointer_arithmetic.cpp +++ b/src/goto-programs/pointer_arithmetic.cpp @@ -11,18 +11,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "pointer_arithmetic.h" -/*******************************************************************\ - -Function: pointer_arithmetict::pointer_arithmetict - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - pointer_arithmetict::pointer_arithmetict(const exprt &src) { pointer.make_nil(); @@ -30,18 +18,6 @@ pointer_arithmetict::pointer_arithmetict(const exprt &src) read(src); } -/*******************************************************************\ - -Function: pointer_arithmetict::read - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void pointer_arithmetict::read(const exprt &src) { if(src.id()==ID_plus) @@ -87,18 +63,6 @@ void pointer_arithmetict::read(const exprt &src) make_pointer(src); } -/*******************************************************************\ - -Function: pointer_arithmetict::add_to_offset - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void pointer_arithmetict::add_to_offset(const exprt &src) { if(offset.is_nil()) @@ -116,18 +80,6 @@ void pointer_arithmetict::add_to_offset(const exprt &src) } } -/*******************************************************************\ - -Function: pointer_arithmetict::make_pointer - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void pointer_arithmetict::make_pointer(const exprt &src) { if(pointer.is_nil()) diff --git a/src/goto-programs/property_checker.cpp b/src/goto-programs/property_checker.cpp index de790db2dd4..7c39bc34e06 100644 --- a/src/goto-programs/property_checker.cpp +++ b/src/goto-programs/property_checker.cpp @@ -6,19 +6,10 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ -#include "property_checker.h" - -/*******************************************************************\ - -Function: property_checkert::as_string - - Inputs: - - Outputs: - - Purpose: +/// \file +/// Property Checker Interface -\*******************************************************************/ +#include "property_checker.h" std::string property_checkert::as_string(resultt result) { @@ -33,36 +24,12 @@ std::string property_checkert::as_string(resultt result) return ""; } -/*******************************************************************\ - -Function: property_checkert::property_checkert - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - property_checkert::property_checkert( message_handlert &_message_handler): messaget(_message_handler) { } -/*******************************************************************\ - -Function: property_checkert::initialize_property_map - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void property_checkert::initialize_property_map( const goto_functionst &goto_functions) { diff --git a/src/goto-programs/property_checker.h b/src/goto-programs/property_checker.h index c6a4dbe40b5..fd89606a752 100644 --- a/src/goto-programs/property_checker.h +++ b/src/goto-programs/property_checker.h @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Property Checker Interface + #ifndef CPROVER_GOTO_PROGRAMS_PROPERTY_CHECKER_H #define CPROVER_GOTO_PROGRAMS_PROPERTY_CHECKER_H diff --git a/src/goto-programs/read_bin_goto_object.cpp b/src/goto-programs/read_bin_goto_object.cpp index 9c92b403cf1..faad12665ae 100644 --- a/src/goto-programs/read_bin_goto_object.cpp +++ b/src/goto-programs/read_bin_goto_object.cpp @@ -8,6 +8,9 @@ Date: June 2006 \*******************************************************************/ +/// \file +/// Read goto object files. + #include #include #include @@ -16,18 +19,9 @@ Date: June 2006 #include "goto_functions.h" #include "read_bin_goto_object.h" -/*******************************************************************\ - -Function: read_goto_object_v3 - - Inputs: input stream, symbol_table, functions - - Outputs: true on error, false otherwise - - Purpose: read goto binary format v3 - -\*******************************************************************/ - +/// read goto binary format v3 +/// \par parameters: input stream, symbol_table, functions +/// \return true on error, false otherwise bool read_bin_goto_object_v3( std::istream &in, const std::string &filename, @@ -168,18 +162,9 @@ bool read_bin_goto_object_v3( return false; } -/*******************************************************************\ - -Function: read_goto_object - - Inputs: input stream, symbol table, functions - - Outputs: true on error, false otherwise - - Purpose: reads a goto binary file back into a symbol and a function table - -\*******************************************************************/ - +/// reads a goto binary file back into a symbol and a function table +/// \par parameters: input stream, symbol table, functions +/// \return true on error, false otherwise bool read_bin_goto_object( std::istream &in, const std::string &filename, diff --git a/src/goto-programs/read_bin_goto_object.h b/src/goto-programs/read_bin_goto_object.h index a4b679427d7..e7b684b3cc4 100644 --- a/src/goto-programs/read_bin_goto_object.h +++ b/src/goto-programs/read_bin_goto_object.h @@ -8,6 +8,9 @@ Date: May 2007 \*******************************************************************/ +/// \file +/// Read goto object files. + #ifndef CPROVER_GOTO_PROGRAMS_READ_BIN_GOTO_OBJECT_H #define CPROVER_GOTO_PROGRAMS_READ_BIN_GOTO_OBJECT_H diff --git a/src/goto-programs/read_goto_binary.cpp b/src/goto-programs/read_goto_binary.cpp index b5919d93eee..ec7eaf8f826 100644 --- a/src/goto-programs/read_goto_binary.cpp +++ b/src/goto-programs/read_goto_binary.cpp @@ -6,6 +6,9 @@ Module: Read Goto Programs \*******************************************************************/ +/// \file +/// Read Goto Programs + #if defined(__linux__) || \ defined(__FreeBSD_kernel__) || \ defined(__GNU__) || \ @@ -34,18 +37,6 @@ Module: Read Goto Programs #include "elf_reader.h" #include "osx_fat_reader.h" -/*******************************************************************\ - -Function: read_goto_binary - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool read_goto_binary( const std::string &filename, goto_modelt &dest, @@ -55,18 +46,6 @@ bool read_goto_binary( filename, dest.symbol_table, dest.goto_functions, message_handler); } -/*******************************************************************\ - -Function: read_goto_binary - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool read_goto_binary( const std::string &filename, symbol_tablet &symbol_table, @@ -172,18 +151,6 @@ bool read_goto_binary( return true; } -/*******************************************************************\ - -Function: is_goto_binary - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool is_goto_binary(const std::string &filename) { #ifdef _MSC_VER @@ -245,18 +212,6 @@ bool is_goto_binary(const std::string &filename) return false; } -/*******************************************************************\ - -Function: rename_symbols_in_function - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - static void rename_symbols_in_function( goto_functionst::goto_functiont &function, const rename_symbolt &rename_symbol) @@ -271,18 +226,6 @@ static void rename_symbols_in_function( } } -/*******************************************************************\ - -Function: link_functions - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - static bool link_functions( symbol_tablet &dest_symbol_table, goto_functionst &dest_functions, @@ -384,18 +327,9 @@ static bool link_functions( return false; } -/*******************************************************************\ - -Function: read_object_and_link - - Inputs: a file_name - - Outputs: true on error, false otherwise - - Purpose: reads an object file - -\*******************************************************************/ - +/// reads an object file +/// \par parameters: a file_name +/// \return true on error, false otherwise bool read_object_and_link( const std::string &file_name, symbol_tablet &symbol_table, @@ -435,18 +369,9 @@ bool read_object_and_link( return false; } -/*******************************************************************\ - -Function: read_object_and_link - - Inputs: a file_name - - Outputs: true on error, false otherwise - - Purpose: reads an object file - -\*******************************************************************/ - +/// reads an object file +/// \par parameters: a file_name +/// \return true on error, false otherwise bool read_object_and_link( const std::string &file_name, goto_modelt &goto_model, diff --git a/src/goto-programs/read_goto_binary.h b/src/goto-programs/read_goto_binary.h index f926179b134..bbaba7a5c11 100644 --- a/src/goto-programs/read_goto_binary.h +++ b/src/goto-programs/read_goto_binary.h @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Read Goto Programs + #ifndef CPROVER_GOTO_PROGRAMS_READ_GOTO_BINARY_H #define CPROVER_GOTO_PROGRAMS_READ_GOTO_BINARY_H diff --git a/src/goto-programs/remove_asm.cpp b/src/goto-programs/remove_asm.cpp index a77d1e0e418..9966051d176 100644 --- a/src/goto-programs/remove_asm.cpp +++ b/src/goto-programs/remove_asm.cpp @@ -9,6 +9,9 @@ Date: December 2014 \*******************************************************************/ +/// \file +/// Remove 'asm' statements by compiling into suitable standard code + #include #include @@ -48,18 +51,6 @@ class remove_asmt goto_programt &dest); }; -/*******************************************************************\ - -Function: remove_asmt::gcc_asm_function_call - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void remove_asmt::gcc_asm_function_call( const irep_idt &function_base_name, const codet &code, @@ -118,18 +109,7 @@ void remove_asmt::gcc_asm_function_call( } } -/*******************************************************************\ - -Function: remove_asmt::process_instruction - -Inputs: - -Outputs: - -Purpose: removes assembler - -\*******************************************************************/ - +/// removes assembler void remove_asmt::process_instruction( goto_programt::instructiont &instruction, goto_programt &dest) @@ -302,18 +282,7 @@ void remove_asmt::process_instruction( } } -/*******************************************************************\ - -Function: remove_asmt::process_function - -Inputs: - -Outputs: - -Purpose: removes assembler - -\*******************************************************************/ - +/// removes assembler void remove_asmt::process_function( goto_functionst::goto_functiont &goto_function) { @@ -333,18 +302,7 @@ void remove_asmt::process_function( } } -/*******************************************************************\ - -Function: remove_asmt:operator() - -Inputs: - -Outputs: - -Purpose: removes assembler - -\*******************************************************************/ - +/// removes assembler void remove_asmt::operator()() { Forall_goto_functions(it, goto_functions) @@ -353,18 +311,7 @@ void remove_asmt::operator()() } } -/*******************************************************************\ - -Function: remove_asm - -Inputs: - -Outputs: - -Purpose: removes assembler - -\*******************************************************************/ - +/// removes assembler void remove_asm( symbol_tablet &symbol_table, goto_functionst &goto_functions) @@ -372,18 +319,7 @@ void remove_asm( remove_asmt(symbol_table, goto_functions)(); } -/*******************************************************************\ - -Function: remove_asm - -Inputs: - -Outputs: - -Purpose: removes assembler - -\*******************************************************************/ - +/// removes assembler void remove_asm(goto_modelt &goto_model) { remove_asmt(goto_model.symbol_table, goto_model.goto_functions)(); diff --git a/src/goto-programs/remove_asm.h b/src/goto-programs/remove_asm.h index a0de50fc699..7717ba59ca0 100644 --- a/src/goto-programs/remove_asm.h +++ b/src/goto-programs/remove_asm.h @@ -9,6 +9,9 @@ Date: December 2014 \*******************************************************************/ +/// \file +/// Remove 'asm' statements by compiling into suitable standard code + #ifndef CPROVER_GOTO_PROGRAMS_REMOVE_ASM_H #define CPROVER_GOTO_PROGRAMS_REMOVE_ASM_H diff --git a/src/goto-programs/remove_complex.cpp b/src/goto-programs/remove_complex.cpp index 44539fb5f1e..bb031082bd0 100644 --- a/src/goto-programs/remove_complex.cpp +++ b/src/goto-programs/remove_complex.cpp @@ -8,22 +8,13 @@ Date: September 2014 \*******************************************************************/ +/// \file +/// Remove 'complex' data type + #include #include "remove_complex.h" -/*******************************************************************\ - -Function: complex_member - -Inputs: - -Outputs: - -Purpose: - -\*******************************************************************/ - static exprt complex_member(const exprt &expr, irep_idt id) { if(expr.id()==ID_struct && expr.operands().size()==2) @@ -45,18 +36,6 @@ static exprt complex_member(const exprt &expr, irep_idt id) } } -/*******************************************************************\ - -Function: have_to_remove_complex - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - static bool have_to_remove_complex(const typet &type); static bool have_to_remove_complex(const exprt &expr) @@ -94,18 +73,6 @@ static bool have_to_remove_complex(const exprt &expr) return false; } -/*******************************************************************\ - -Function: have_to_remove_complex - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - static bool have_to_remove_complex(const typet &type) { if(type.id()==ID_struct || type.id()==ID_union) @@ -129,18 +96,7 @@ static bool have_to_remove_complex(const typet &type) return false; } -/*******************************************************************\ - -Function: remove_complex - -Inputs: - -Outputs: - -Purpose: removes complex data type - -\*******************************************************************/ - +/// removes complex data type static void remove_complex(typet &); static void remove_complex(exprt &expr) @@ -274,18 +230,7 @@ static void remove_complex(exprt &expr) remove_complex(expr.type()); } -/*******************************************************************\ - -Function: remove_complex - -Inputs: - -Outputs: - -Purpose: removes complex data type - -\*******************************************************************/ - +/// removes complex data type static void remove_complex(typet &type) { if(!have_to_remove_complex(type)) @@ -327,54 +272,21 @@ static void remove_complex(typet &type) } } -/*******************************************************************\ - -Function: remove_complex - -Inputs: - -Outputs: - -Purpose: removes complex data type - -\*******************************************************************/ - +/// removes complex data type static void remove_complex(symbolt &symbol) { remove_complex(symbol.value); remove_complex(symbol.type); } -/*******************************************************************\ - -Function: remove_complex - -Inputs: - -Outputs: - -Purpose: removes complex data type - -\*******************************************************************/ - +/// removes complex data type void remove_complex(symbol_tablet &symbol_table) { Forall_symbols(it, symbol_table.symbols) remove_complex(it->second); } -/*******************************************************************\ - -Function: remove_complex - -Inputs: - -Outputs: - -Purpose: removes complex data type - -\*******************************************************************/ - +/// removes complex data type static void remove_complex( goto_functionst::goto_functiont &goto_function) { @@ -387,36 +299,14 @@ static void remove_complex( } } -/*******************************************************************\ - -Function: remove_complex - -Inputs: - -Outputs: - -Purpose: removes complex data type - -\*******************************************************************/ - +/// removes complex data type static void remove_complex(goto_functionst &goto_functions) { Forall_goto_functions(it, goto_functions) remove_complex(it->second); } -/*******************************************************************\ - -Function: remove_complex - -Inputs: - -Outputs: - -Purpose: removes complex data type - -\*******************************************************************/ - +/// removes complex data type void remove_complex( symbol_tablet &symbol_table, goto_functionst &goto_functions) @@ -425,18 +315,7 @@ void remove_complex( remove_complex(goto_functions); } -/*******************************************************************\ - -Function: remove_complex - -Inputs: - -Outputs: - -Purpose: removes complex data type - -\*******************************************************************/ - +/// removes complex data type void remove_complex(goto_modelt &goto_model) { remove_complex(goto_model.symbol_table, goto_model.goto_functions); diff --git a/src/goto-programs/remove_complex.h b/src/goto-programs/remove_complex.h index c42784318cf..098470ecc1a 100644 --- a/src/goto-programs/remove_complex.h +++ b/src/goto-programs/remove_complex.h @@ -8,6 +8,9 @@ Date: September 2014 \*******************************************************************/ +/// \file +/// Remove the 'complex' data type by compilation into structs + #ifndef CPROVER_GOTO_PROGRAMS_REMOVE_COMPLEX_H #define CPROVER_GOTO_PROGRAMS_REMOVE_COMPLEX_H diff --git a/src/goto-programs/remove_const_function_pointers.cpp b/src/goto-programs/remove_const_function_pointers.cpp index c0a7d8d5380..3e9824cad30 100644 --- a/src/goto-programs/remove_const_function_pointers.cpp +++ b/src/goto-programs/remove_const_function_pointers.cpp @@ -6,6 +6,9 @@ Author: Thomas Kiley, thomas.kiley@diffblue.com \*******************************************************************/ +/// \file +/// Goto Programs + #include #include #include @@ -16,23 +19,12 @@ Author: Thomas Kiley, thomas.kiley@diffblue.com debug() << "Case " << __LINE__ << " : " << message << "\n" \ << irep.pretty() << eom; -/*******************************************************************\ - -Function: remove_const_function_pointerst::remove_const_function_pointerst - - Inputs: - message_handler - The message handler for messaget - base_expression - The function call through a function pointer - ns - The namespace to use to resolve types - symbol_table - The symbol table to look up symbols in - - Outputs: - - Purpose: To take a function call on a function pointer, and if possible - resolve it to a small collection of possible values. - -\*******************************************************************/ - +/// To take a function call on a function pointer, and if possible resolve it to +/// a small collection of possible values. +/// \param message_handler: The message handler for messaget +/// \param base_expression: The function call through a function pointer +/// \param ns: The namespace to use to resolve types +/// \param symbol_table: The symbol table to look up symbols in remove_const_function_pointerst::remove_const_function_pointerst( message_handlert &message_handler, const exprt &base_expression, @@ -44,28 +36,16 @@ remove_const_function_pointerst::remove_const_function_pointerst( symbol_table(symbol_table) {} -/*******************************************************************\ - -Function: remove_const_function_pointerst::operator() - - Inputs: - out_functions - The functions that (symbols of type ID_code) the base - expression could take. - - Outputs: Returns true if it was able to resolve the call, false if not. - If it returns true, out_functions will be populated by all the - possible values the function pointer could be. - - Purpose: To take a function call on a function pointer, and if possible - resolve it to a small collection of possible values. It will - resolve function pointers that are const and: - - assigned directly to a function - - assigned to a value in an array of functions - - assigned to a const struct component - Or variations within. - -\*******************************************************************/ - +/// To take a function call on a function pointer, and if possible resolve it to +/// a small collection of possible values. It will resolve function pointers +/// that are const and: - assigned directly to a function - assigned to a value +/// in an array of functions - assigned to a const struct component Or +/// variations within. +/// \param out_functions: The functions that (symbols of type ID_code) the base +/// expression could take. +/// \return Returns true if it was able to resolve the call, false if not. If it +/// returns true, out_functions will be populated by all the possible values +/// the function pointer could be. bool remove_const_function_pointerst::operator()( functionst &out_functions) { @@ -74,23 +54,13 @@ bool remove_const_function_pointerst::operator()( return try_resolve_function_call(non_symbol_expression, out_functions); } -/*******************************************************************\ - -Function: remove_const_function_pointerst::replace_const_symbols - - Inputs: - expression - The expression to resolve symbols in - - Outputs: Returns a modified version of the expression, with all - const symbols resolved to their actual values. - - Purpose: To collapse the symbols down to their values where possible - This takes a very general approach, recreating the expr tree - exactly as it was and ignoring what type of expressions are found - and instead recurses over all the operands. - -\*******************************************************************/ - +/// To collapse the symbols down to their values where possible This takes a +/// very general approach, recreating the expr tree exactly as it was and +/// ignoring what type of expressions are found and instead recurses over all +/// the operands. +/// \param expression: The expression to resolve symbols in +/// \return Returns a modified version of the expression, with all const symbols +/// resolved to their actual values. exprt remove_const_function_pointerst::replace_const_symbols( const exprt &expression) const { @@ -129,19 +99,9 @@ exprt remove_const_function_pointerst::replace_const_symbols( } } -/*******************************************************************\ - -Function: remove_const_function_pointerst::resolve_symbol - - Inputs: - symbol_expr - The symbol expression - - Outputs: The expression value of the symbol. - - Purpose: Look up a symbol in the symbol table and return its value - -\*******************************************************************/ - +/// Look up a symbol in the symbol table and return its value +/// \param symbol_expr: The symbol expression +/// \return The expression value of the symbol. exprt remove_const_function_pointerst::resolve_symbol( const symbol_exprt &symbol_expr) const { @@ -150,25 +110,14 @@ exprt remove_const_function_pointerst::resolve_symbol( return symbol.value; } -/*******************************************************************\ - -Function: remove_const_function_pointerst::try_resolve_function_call - - Inputs: - expr - The expression to get the possible function calls - out_functions - The functions this expression could be resolved to - - Outputs: Returns true if it was able to resolve the expression to some - specific functions. If this is the case, out_functions will contain - the possible functions. - - Purpose: To resolve an expression to the specific function calls it can - be. This is different to try_resolve_expression which isn't - explicitly looking for functions and is instead just trying - to squash particular exprt structures. - -\*******************************************************************/ - +/// To resolve an expression to the specific function calls it can be. This is +/// different to try_resolve_expression which isn't explicitly looking for +/// functions and is instead just trying to squash particular exprt structures. +/// \param expr: The expression to get the possible function calls +/// \param out_functions: The functions this expression could be resolved to +/// \return Returns true if it was able to resolve the expression to some +/// specific functions. If this is the case, out_functions will contain the +/// possible functions. bool remove_const_function_pointerst::try_resolve_function_call( const exprt &expr, functionst &out_functions) { @@ -233,23 +182,12 @@ bool remove_const_function_pointerst::try_resolve_function_call( } } -/*******************************************************************\ - -Function: remove_const_function_pointerst::try_resolve_function_calls - - Inputs: - exprs - The expressions to evaluate - out_functions - The functions these expressions resolve to - - Outputs: Returns true if able to resolve each of the expressions down - to one or more functions. - - Purpose: To resolve a collection of expressions to the specific function - calls they can be. Returns a collection if and only if all of - them can be resolved. - -\*******************************************************************/ - +/// To resolve a collection of expressions to the specific function calls they +/// can be. Returns a collection if and only if all of them can be resolved. +/// \param exprs: The expressions to evaluate +/// \param out_functions: The functions these expressions resolve to +/// \return Returns true if able to resolve each of the expressions down to one +/// or more functions. bool remove_const_function_pointerst::try_resolve_function_calls( const expressionst &exprs, functionst &out_functions) { @@ -274,27 +212,17 @@ bool remove_const_function_pointerst::try_resolve_function_calls( return true; } -/*******************************************************************\ - -Function: remove_const_function_pointerst::try_resolve_index_of_function_call - - Inputs: - index_expr - The index expression to resolve to possible function calls - out_functions - The functions this expression could be - - Outputs: Returns true if it was able to resolve the index expression to some - specific functions. If this is the case, out_functions will contain - the possible functions. - - Purpose: To resolve an expression to the specific function calls it can - be. Specifically, this function deals with index expressions - where it squashes its array and squash its index - If we can get a precise number for the index, we - try_resolve_function_call on its value otherwise - try_resolve_function_call on each and return the union of them all - -\*******************************************************************/ - +/// To resolve an expression to the specific function calls it can be. +/// Specifically, this function deals with index expressions where it squashes +/// its array and squash its index If we can get a precise number for the index, +/// we try_resolve_function_call on its value otherwise +/// try_resolve_function_call on each and return the union of them all +/// \param index_expr: The index expression to resolve to possible function +/// calls +/// \param out_functions: The functions this expression could be +/// \return Returns true if it was able to resolve the index expression to some +/// specific functions. If this is the case, out_functions will contain the +/// possible functions. bool remove_const_function_pointerst::try_resolve_index_of_function_call( const index_exprt &index_expr, functionst &out_functions) { @@ -318,24 +246,15 @@ bool remove_const_function_pointerst::try_resolve_index_of_function_call( return try_resolve_function_calls(potential_array_values, out_functions); } -/*******************************************************************\ - -Function: remove_const_function_pointerst::try_resolve_member_function_call - - Inputs: - member_expr - The member expression to resolve to possible function calls - out_functions - The functions this expression could be - - Outputs: Returns true if it was able to resolve the member expression to some - specific functions. If this is the case, out_functions will contain - the possible functions. - - Purpose: To resolve an expression to the specific function calls it can - be. Specifically, this function deals with member expressions - by using try_resolve_member and then recursing on its value. - -\*******************************************************************/ - +/// To resolve an expression to the specific function calls it can be. +/// Specifically, this function deals with member expressions by using +/// try_resolve_member and then recursing on its value. +/// \param member_expr: The member expression to resolve to possible function +/// calls +/// \param out_functions: The functions this expression could be +/// \return Returns true if it was able to resolve the member expression to some +/// specific functions. If this is the case, out_functions will contain the +/// possible functions. bool remove_const_function_pointerst::try_resolve_member_function_call( const member_exprt &member_expr, functionst &out_functions) { @@ -359,24 +278,14 @@ bool remove_const_function_pointerst::try_resolve_member_function_call( return try_resolve_function_calls(potential_component_values, out_functions); } -/*******************************************************************\ - -Function: remove_const_function_pointerst::try_resolve_address_of_function_call - - Inputs: - address_expr - The address_of expression to resolve to possible function - calls - out_functions - The functions this expression could be - - Outputs: Returns true if it was able to resolve the address_of expression to - some specific functions. If this is the case, out_functions will - contain the possible functions. - - Purpose: To resolve an expression to the specific function calls it can - be. Specifically, this function deals with address_of expressions. - -\*******************************************************************/ - +/// To resolve an expression to the specific function calls it can be. +/// Specifically, this function deals with address_of expressions. +/// \param address_expr: The address_of expression to resolve to possible +/// function calls +/// \param out_functions: The functions this expression could be +/// \return Returns true if it was able to resolve the address_of expression to +/// some specific functions. If this is the case, out_functions will contain +/// the possible functions. bool remove_const_function_pointerst::try_resolve_address_of_function_call( const address_of_exprt &address_expr, functionst &out_functions) { @@ -389,24 +298,15 @@ bool remove_const_function_pointerst::try_resolve_address_of_function_call( return resolved; } -/*******************************************************************\ - -Function: remove_const_function_pointerst::try_resolve_dereference_function_call - - Inputs: - deref_expr - The dereference expression to resolve to possible function calls - out_functions - The functions this expression could be - - Outputs: Returns true if it was able to resolve the dereference expression to - some specific functions. If this is the case, out_functions will - contain the possible functions. - - Purpose: To resolve an expression to the specific function calls it can - be. Specifically, this function deals with dereference expressions - by using try_resolve_dereferebce and then recursing on its value. - -\*******************************************************************/ - +/// To resolve an expression to the specific function calls it can be. +/// Specifically, this function deals with dereference expressions by using +/// try_resolve_dereferebce and then recursing on its value. +/// \param deref_expr: The dereference expression to resolve to possible +/// function calls +/// \param out_functions: The functions this expression could be +/// \return Returns true if it was able to resolve the dereference expression to +/// some specific functions. If this is the case, out_functions will contain +/// the possible functions. bool remove_const_function_pointerst::try_resolve_dereference_function_call( const dereference_exprt &deref_expr, functionst &out_functions) { @@ -430,24 +330,15 @@ bool remove_const_function_pointerst::try_resolve_dereference_function_call( return try_resolve_function_calls(potential_deref_values, out_functions); } -/*******************************************************************\ - -Function: remove_const_function_pointerst::try_resolve_typecast_function_call - - Inputs: - typecast_expr - The typecast expression to resolve to possible function calls - out_functions - The functions this expression could be - - Outputs: Returns true if it was able to resolve the typecast expression to - some specific functions. If this is the case, out_functions will - contain the possible functions. - - Purpose: To resolve an expression to the specific function calls it can - be. Specifically, this function deals with typecast expressions - by looking at the type cast values. - -\*******************************************************************/ - +/// To resolve an expression to the specific function calls it can be. +/// Specifically, this function deals with typecast expressions by looking at +/// the type cast values. +/// \param typecast_expr: The typecast expression to resolve to possible +/// function calls +/// \param out_functions: The functions this expression could be +/// \return Returns true if it was able to resolve the typecast expression to +/// some specific functions. If this is the case, out_functions will contain +/// the possible functions. bool remove_const_function_pointerst::try_resolve_typecast_function_call( const typecast_exprt &typecast_expr, functionst &out_functions) { @@ -471,33 +362,20 @@ bool remove_const_function_pointerst::try_resolve_typecast_function_call( } } -/*******************************************************************\ - -Function: remove_const_function_pointerst::try_resolve_expression - - Inputs: - expr - The expression to try and squash - out_resolved_expression - The squashed version of this expression - out_is_const - Is the squashed expression constant - - Outputs: Returns true providing the squashing went OK (note it - may not have squashed anything). The out_resolved_expression will in - this case be all the possible squashed versions of the supplied - expression. - The out_is_const will return whether the squashed value is suitably - const (e.g. if we squashed a struct access, was the struct const). - - Purpose: To squash various expr types to simplify the expression. - ID_index -> dig to find ID_array and get the values out of it - ID_member -> dig to find ID_struct and extract the component value - ID_dereference -> dig to find ID_address_of and extract the value - ID_typecast -> return the value - ID_symbol -> return false, const symbols are squashed first and - non const symbols cannot be squashed - Everything else -> unchanged - -\*******************************************************************/ - +/// To squash various expr types to simplify the expression. ID_index -> dig to +/// find ID_array and get the values out of it ID_member -> dig to find +/// ID_struct and extract the component value ID_dereference -> dig to find +/// ID_address_of and extract the value ID_typecast -> return the value +/// ID_symbol -> return false, const symbols are squashed first and non const +/// symbols cannot be squashed Everything else -> unchanged +/// \param expr: The expression to try and squash +/// \param out_resolved_expression: The squashed version of this expression +/// \param out_is_const: Is the squashed expression constant +/// \return Returns true providing the squashing went OK (note it may not have +/// squashed anything). The out_resolved_expression will in this case be all +/// the possible squashed versions of the supplied expression. The +/// out_is_const will return whether the squashed value is suitably const +/// (e.g. if we squashed a struct access, was the struct const). bool remove_const_function_pointerst::try_resolve_expression( const exprt &expr, expressionst &out_resolved_expression, bool &out_is_const) { @@ -559,25 +437,14 @@ bool remove_const_function_pointerst::try_resolve_expression( } } -/*******************************************************************\ - -Function: remove_const_function_pointerst::try_resolve_index_value - - Inputs: - expr - The expression of the index of the index expression (e.g. - index_exprt::index()) - out_array_index - The constant value the index takes - - Outputs: Returns true if was able to find a constant value for the index - expression. If true, then out_array_index will be the index within - the array that the function pointer is pointing to. - - Purpose: Given an index into an array, resolve, if possible, the index - that is being accessed. This deals with symbols and typecasts to - constant values. - -\*******************************************************************/ - +/// Given an index into an array, resolve, if possible, the index that is being +/// accessed. This deals with symbols and typecasts to constant values. +/// \param expr: The expression of the index of the index expression (e.g. +/// index_exprt::index()) +/// \param out_array_index: The constant value the index takes +/// \return Returns true if was able to find a constant value for the index +/// expression. If true, then out_array_index will be the index within the +/// array that the function pointer is pointing to. bool remove_const_function_pointerst::try_resolve_index_value( const exprt &expr, mp_integer &out_array_index) { @@ -610,28 +477,16 @@ bool remove_const_function_pointerst::try_resolve_index_value( } } -/*******************************************************************\ - -Function: remove_const_function_pointerst::try_resolve_index_of - - Inputs: - index_expr - The index expression to to resolve - out_expressions - The expressions this expression could be - out_is_const - Is the squashed expression constant - - Outputs: Returns true if it was able to squash the index expression - If this is the case, out_expressions will contain - the possible values this index_of could return - The out_is_const will return whether either the array itself - is const, or the values of the array are const. - - Purpose: To squash an index access by first finding the array it is accessing - Then if the index can be resolved, return the squashed value. If - the index can't be determined then squash each value in the array - and return them all. - -\*******************************************************************/ - +/// To squash an index access by first finding the array it is accessing Then if +/// the index can be resolved, return the squashed value. If the index can't be +/// determined then squash each value in the array and return them all. +/// \param index_expr: The index expression to to resolve +/// \param out_expressions: The expressions this expression could be +/// \param out_is_const: Is the squashed expression constant +/// \return Returns true if it was able to squash the index expression If this +/// is the case, out_expressions will contain the possible values this +/// index_of could return The out_is_const will return whether either the +/// array itself is const, or the values of the array are const. bool remove_const_function_pointerst::try_resolve_index_of( const index_exprt &index_expr, expressionst &out_expressions, @@ -728,26 +583,14 @@ bool remove_const_function_pointerst::try_resolve_index_of( } } -/*******************************************************************\ - -Function: remove_const_function_pointerst::try_resolve_member - - Inputs: - member_expr - The member expression to resolve. - out_expressions - The expressions this component could be - out_is_const - Is the squashed expression constant - - Outputs: Returns true if it was able to squash the member expression - If this is the case, out_expressions will contain - the possible values this member could return - The out_is_const will return whether the struct - is const. - - Purpose: To squash an member access by first finding the struct it is accessing - Then return the squashed value of the relevant component. - -\*******************************************************************/ - +/// To squash an member access by first finding the struct it is accessing Then +/// return the squashed value of the relevant component. +/// \param member_expr: The member expression to resolve. +/// \param out_expressions: The expressions this component could be +/// \param out_is_const: Is the squashed expression constant +/// \return Returns true if it was able to squash the member expression If this +/// is the case, out_expressions will contain the possible values this member +/// could return The out_is_const will return whether the struct is const. bool remove_const_function_pointerst::try_resolve_member( const member_exprt &member_expr, expressionst &out_expressions, @@ -805,27 +648,16 @@ bool remove_const_function_pointerst::try_resolve_member( } } -/*******************************************************************\ - -Function: remove_const_function_pointerst::try_resolve_dereference - - Inputs: - deref_expr - The dereference expression to resolve. - out_expressions - The expressions this dereference could be - out_is_const - Is the squashed expression constant - - Outputs: Returns true if it was able to squash the dereference expression - If this is the case, out_expressions will contain - the possible values this dereference could return - The out_is_const will return whether the object that gets - dereferenced is constant. - - Purpose: To squash a dereference access by first finding the address_of - the dereference is dereferencing. - Then return the squashed value of the relevant component. - -\*******************************************************************/ - +/// To squash a dereference access by first finding the address_of the +/// dereference is dereferencing. Then return the squashed value of the relevant +/// component. +/// \param deref_expr: The dereference expression to resolve. +/// \param out_expressions: The expressions this dereference could be +/// \param out_is_const: Is the squashed expression constant +/// \return Returns true if it was able to squash the dereference expression If +/// this is the case, out_expressions will contain the possible values this +/// dereference could return The out_is_const will return whether the object +/// that gets dereferenced is constant. bool remove_const_function_pointerst::try_resolve_dereference( const dereference_exprt &deref_expr, expressionst &out_expressions, @@ -890,23 +722,13 @@ bool remove_const_function_pointerst::try_resolve_dereference( } } -/*******************************************************************\ - -Function: remove_const_function_pointerst::try_resolve_dereference - - Inputs: - typecast_expr - The typecast expression to resolve. - out_expressions - The expressions this typecast could be - out_is_const - Is the squashed expression constant - - Outputs: Returns true if it was able to squash the typecast expression - If this is the case, out_expressions will contain - the possible values after removing the typecast. - - Purpose: To squash a typecast access. - -\*******************************************************************/ - +/// To squash a typecast access. +/// \param typecast_expr: The typecast expression to resolve. +/// \param out_expressions: The expressions this typecast could be +/// \param out_is_const: Is the squashed expression constant +/// \return Returns true if it was able to squash the typecast expression If +/// this is the case, out_expressions will contain the possible values after +/// removing the typecast. bool remove_const_function_pointerst::try_resolve_typecast( const typecast_exprt &typecast_expr, expressionst &out_expressions, @@ -934,39 +756,19 @@ bool remove_const_function_pointerst::try_resolve_typecast( } } -/*******************************************************************\ - -Function: remove_const_function_pointerst::is_expression_const - - Inputs: - expression - The expression to check - - Outputs: Returns true if the type of the expression is constant. - - Purpose: To evaluate the const-ness of the expression type. - -\*******************************************************************/ - +/// To evaluate the const-ness of the expression type. +/// \param expression: The expression to check +/// \return Returns true if the type of the expression is constant. bool remove_const_function_pointerst::is_const_expression( const exprt &expression) const { return is_const_type(expression.type()); } -/*******************************************************************\ - -Function: remove_const_function_pointerst::is_type_const - - Inputs: - type - The type to check - - Outputs: Returns true if the type has ID_C_constant or is an array - since arrays are implicitly const in C. - - Purpose: To evaluate the const-ness of the type. - -\*******************************************************************/ - +/// To evaluate the const-ness of the type. +/// \param type: The type to check +/// \return Returns true if the type has ID_C_constant or is an array since +/// arrays are implicitly const in C. bool remove_const_function_pointerst::is_const_type(const typet &type) const { c_qualifierst qualifers(type); @@ -981,21 +783,11 @@ bool remove_const_function_pointerst::is_const_type(const typet &type) const } } -/*******************************************************************\ - -Function: remove_const_function_pointerst::get_component_value - - Inputs: - struct_expr - The expression of the structure being accessed - member_expr - The expression saying which component is being accessed - - Outputs: Returns the value of a specific component for a given struct - expression. - - Purpose: To extract the value of the specific component within a struct - -\*******************************************************************/ - +/// To extract the value of the specific component within a struct +/// \param struct_expr: The expression of the structure being accessed +/// \param member_expr: The expression saying which component is being accessed +/// \return Returns the value of a specific component for a given struct +/// expression. exprt remove_const_function_pointerst::get_component_value( const struct_exprt &struct_expr, const member_exprt &member_expr) { diff --git a/src/goto-programs/remove_const_function_pointers.h b/src/goto-programs/remove_const_function_pointers.h index 6516fb6ec64..45ed1c16fba 100644 --- a/src/goto-programs/remove_const_function_pointers.h +++ b/src/goto-programs/remove_const_function_pointers.h @@ -6,6 +6,9 @@ Author: Thomas Kiley, thomas.kiley@diffblue.com \*******************************************************************/ +/// \file +/// Goto Programs + #ifndef CPROVER_GOTO_PROGRAMS_REMOVE_CONST_FUNCTION_POINTERS_H #define CPROVER_GOTO_PROGRAMS_REMOVE_CONST_FUNCTION_POINTERS_H diff --git a/src/goto-programs/remove_exceptions.cpp b/src/goto-programs/remove_exceptions.cpp index de2ab742c07..c683fcf8c11 100644 --- a/src/goto-programs/remove_exceptions.cpp +++ b/src/goto-programs/remove_exceptions.cpp @@ -8,6 +8,9 @@ Date: December 2016 \*******************************************************************/ +/// \file +/// Remove exception handling + #ifdef DEBUG #include #endif @@ -66,19 +69,8 @@ class remove_exceptionst const goto_functionst::function_mapt::iterator &); }; -/*******************************************************************\ - -Function: remove_exceptionst::add_exceptional_returns - -Inputs: - -Outputs: - -Purpose: adds exceptional return variables for every function that - may escape exceptions - -\*******************************************************************/ - +/// adds exceptional return variables for every function that may escape +/// exceptions void remove_exceptionst::add_exceptional_returns( const goto_functionst::function_mapt::iterator &func_it) { @@ -179,19 +171,8 @@ void remove_exceptionst::add_exceptional_returns( } } -/*******************************************************************\ - -Function: remove_exceptionst::instrument_exception_handler - -Inputs: - -Outputs: - -Purpose: at the beginning of each handler in function f - adds exc=f#exception_value; f#exception_value=NULL; - -\*******************************************************************/ - +/// at the beginning of each handler in function f adds exc=f#exception_value; +/// f#exception_value=NULL; void remove_exceptionst::instrument_exception_handler( const goto_functionst::function_mapt::iterator &func_it, const goto_programt::instructionst::iterator &instr_it) @@ -235,19 +216,8 @@ void remove_exceptionst::instrument_exception_handler( instr_it->make_skip(); } -/*******************************************************************\ - -Function: get_exceptional_output - -Inputs: - -Outputs: - -Purpose: finds the instruction where the exceptional output is set - or the end of the function if no such output exists - -\*******************************************************************/ - +/// finds the instruction where the exceptional output is set or the end of the +/// function if no such output exists static goto_programt::targett get_exceptional_output( goto_programt &goto_program) { @@ -268,19 +238,8 @@ static goto_programt::targett get_exceptional_output( return goto_program.get_end_function(); } -/*******************************************************************\ - -Function: remove_exceptionst::instrument_throw - -Inputs: - -Outputs: - -Purpose: instruments each throw with conditional GOTOS to the - corresponding exception handlers - -\*******************************************************************/ - +/// instruments each throw with conditional GOTOS to the corresponding +/// exception handlers void remove_exceptionst::instrument_throw( const goto_functionst::function_mapt::iterator &func_it, const goto_programt::instructionst::iterator &instr_it, @@ -367,19 +326,8 @@ void remove_exceptionst::instrument_throw( instr_it->code=assignment; } -/*******************************************************************\ - -Function: remove_exceptionst::instrument_function_call - -Inputs: - -Outputs: - -Purpose: instruments each function call that may escape exceptions - with conditional GOTOS to the corresponding exception handlers - -\*******************************************************************/ - +/// instruments each function call that may escape exceptions with conditional +/// GOTOS to the corresponding exception handlers void remove_exceptionst::instrument_function_call( const goto_functionst::function_mapt::iterator &func_it, const goto_programt::instructionst::iterator &instr_it, @@ -476,20 +424,9 @@ void remove_exceptionst::instrument_function_call( } } -/*******************************************************************\ - -Function: remove_exceptionst::instrument_exceptions - -Inputs: - -Outputs: - -Purpose: instruments throws, function calls that may escape exceptions - and exception handlers. Additionally, it re-computes - the live-range of local variables in order to add DEAD instructions. - -\*******************************************************************/ - +/// instruments throws, function calls that may escape exceptions and exception +/// handlers. Additionally, it re-computes the live-range of local variables in +/// order to add DEAD instructions. void remove_exceptionst::instrument_exceptions( const goto_functionst::function_mapt::iterator &func_it) { @@ -572,18 +509,6 @@ void remove_exceptionst::instrument_exceptions( } } -/*******************************************************************\ - -Function: remove_exceptionst::operator() - -Inputs: - -Outputs: - -Purpose: - -\*******************************************************************/ - void remove_exceptionst::operator()(goto_functionst &goto_functions) { Forall_goto_functions(it, goto_functions) @@ -592,18 +517,7 @@ void remove_exceptionst::operator()(goto_functionst &goto_functions) instrument_exceptions(it); } -/*******************************************************************\ - -Function: remove_exceptions - -Inputs: - -Outputs: - -Purpose: removes throws/CATCH-POP/CATCH-PUSH - -\*******************************************************************/ - +/// removes throws/CATCH-POP/CATCH-PUSH void remove_exceptions( symbol_tablet &symbol_table, goto_functionst &goto_functions) @@ -615,18 +529,7 @@ void remove_exceptions( remove_exceptions(goto_functions); } -/*******************************************************************\ - -Function: remove_exceptions - -Inputs: - -Outputs: - -Purpose: removes throws/CATCH-POP/CATCH-PUSH - -\*******************************************************************/ - +/// removes throws/CATCH-POP/CATCH-PUSH void remove_exceptions(goto_modelt &goto_model) { std::map> exceptions_map; diff --git a/src/goto-programs/remove_exceptions.h b/src/goto-programs/remove_exceptions.h index 89162b5833d..47cf349cf13 100644 --- a/src/goto-programs/remove_exceptions.h +++ b/src/goto-programs/remove_exceptions.h @@ -8,6 +8,9 @@ Date: December 2016 \*******************************************************************/ +/// \file +/// Remove function exceptional returns + #ifndef CPROVER_GOTO_PROGRAMS_REMOVE_EXCEPTIONS_H #define CPROVER_GOTO_PROGRAMS_REMOVE_EXCEPTIONS_H diff --git a/src/goto-programs/remove_function_pointers.cpp b/src/goto-programs/remove_function_pointers.cpp index 2d5be9c0ab2..183574c8ce3 100644 --- a/src/goto-programs/remove_function_pointers.cpp +++ b/src/goto-programs/remove_function_pointers.cpp @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Program Transformation + #include #include @@ -26,14 +29,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "compute_called_functions.h" #include "remove_const_function_pointers.h" -/*******************************************************************\ - - Class: remove_function_pointerst - - Purpose: - -\*******************************************************************/ - class remove_function_pointerst:public messaget { public: @@ -94,18 +89,6 @@ class remove_function_pointerst:public messaget } }; -/*******************************************************************\ - -Function: remove_function_pointerst::remove_function_pointerst - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - remove_function_pointerst::remove_function_pointerst( message_handlert &_message_handler, symbol_tablet &_symbol_table, @@ -125,18 +108,6 @@ remove_function_pointerst::remove_function_pointerst( type_map[f_it->first]=f_it->second.type; } -/*******************************************************************\ - -Function: remove_function_pointerst::arg_is_type_compatible - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool remove_function_pointerst::arg_is_type_compatible( const typet &call_type, const typet &function_type) @@ -169,18 +140,6 @@ bool remove_function_pointerst::arg_is_type_compatible( return false; } -/*******************************************************************\ - -Function: remove_function_pointerst::is_type_compatible - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool remove_function_pointerst::is_type_compatible( bool return_value_used, const code_typet &call_type, @@ -231,18 +190,6 @@ bool remove_function_pointerst::is_type_compatible( return true; } -/*******************************************************************\ - -Function: remove_function_pointerst::fix_argument_types - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void remove_function_pointerst::fix_argument_types( code_function_callt &function_call) { @@ -268,18 +215,6 @@ void remove_function_pointerst::fix_argument_types( } } -/*******************************************************************\ - -Function: remove_function_pointerst::fix_return_type - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void remove_function_pointerst::fix_return_type( code_function_callt &function_call, goto_programt &dest) @@ -319,18 +254,6 @@ void remove_function_pointerst::fix_return_type( old_lhs, typecast_exprt(tmp_symbol_expr, old_lhs.type())); } -/*******************************************************************\ - -Function: remove_function_pointerst::remove_function_pointer - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void remove_function_pointerst::remove_function_pointer( goto_programt &goto_program, goto_programt::targett target) @@ -510,18 +433,6 @@ void remove_function_pointerst::remove_function_pointer( << functions.size() << " possible targets" << eom; } -/*******************************************************************\ - -Function: remove_function_pointerst::remove_function_pointers - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool remove_function_pointerst::remove_function_pointers( goto_programt &goto_program) { @@ -549,18 +460,6 @@ bool remove_function_pointerst::remove_function_pointers( return did_something; } -/*******************************************************************\ - -Function: remove_function_pointerst::operator() - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void remove_function_pointerst::operator()(goto_functionst &functions) { bool did_something=false; @@ -580,18 +479,6 @@ void remove_function_pointerst::operator()(goto_functionst &functions) functions.compute_location_numbers(); } -/*******************************************************************\ - -Function: remove_function_pointers - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool remove_function_pointers(message_handlert &_message_handler, symbol_tablet &symbol_table, const goto_functionst &goto_functions, @@ -610,18 +497,6 @@ bool remove_function_pointers(message_handlert &_message_handler, return rfp.remove_function_pointers(goto_program); } -/*******************************************************************\ - -Function: remove_function_pointers - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void remove_function_pointers( message_handlert &_message_handler, symbol_tablet &symbol_table, @@ -640,18 +515,6 @@ void remove_function_pointers( rfp(goto_functions); } -/*******************************************************************\ - -Function: remove_function_pointers - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void remove_function_pointers(message_handlert &_message_handler, goto_modelt &goto_model, bool add_safety_assertion, diff --git a/src/goto-programs/remove_function_pointers.h b/src/goto-programs/remove_function_pointers.h index e8eea37ea75..3038a940637 100644 --- a/src/goto-programs/remove_function_pointers.h +++ b/src/goto-programs/remove_function_pointers.h @@ -8,6 +8,9 @@ Date: June 2003 \*******************************************************************/ +/// \file +/// Remove Indirect Function Calls + #ifndef CPROVER_GOTO_PROGRAMS_REMOVE_FUNCTION_POINTERS_H #define CPROVER_GOTO_PROGRAMS_REMOVE_FUNCTION_POINTERS_H diff --git a/src/goto-programs/remove_instanceof.cpp b/src/goto-programs/remove_instanceof.cpp index 8e6c9f5de20..8a033668f6a 100644 --- a/src/goto-programs/remove_instanceof.cpp +++ b/src/goto-programs/remove_instanceof.cpp @@ -6,6 +6,9 @@ Author: Chris Smowton, chris.smowton@diffblue.com \*******************************************************************/ +/// \file +/// Remove Instance-of Operators + #include "class_hierarchy.h" #include "class_identifier.h" #include "remove_instanceof.h" @@ -54,19 +57,10 @@ class remove_instanceoft bool contains_instanceof(const exprt &); }; -/*******************************************************************\ - -Function: remove_instanceoft::contains_instanceof - - Inputs: Expression `expr` - - Outputs: Returns true if `expr` contains any instanceof ops - - Purpose: Avoid breaking sharing by checking for instanceof - before calling lower_instanceof. - -\*******************************************************************/ - +/// Avoid breaking sharing by checking for instanceof before calling +/// lower_instanceof. +/// \par parameters: Expression `expr` +/// \return Returns true if `expr` contains any instanceof ops bool remove_instanceoft::contains_instanceof( const exprt &expr) { @@ -78,24 +72,12 @@ bool remove_instanceoft::contains_instanceof( return false; } -/*******************************************************************\ - -Function: remove_instanceoft::lower_instanceof - - Inputs: Expression to lower `expr` and the `goto_program` and - instruction `this_inst` it belongs to. - - Outputs: Side-effect on `expr` replacing it with an explicit clsid test - - Purpose: Replaces an expression like - e instanceof A - with - e.@class_identifier == "A" - Or a big-or of similar expressions if we know of subtypes - that also satisfy the given test. - -\*******************************************************************/ - +/// Replaces an expression like e instanceof A with e.@class_identifier == "A" +/// Or a big-or of similar expressions if we know of subtypes that also satisfy +/// the given test. +/// \par parameters: Expression to lower `expr` and the `goto_program` and +/// instruction `this_inst` it belongs to. +/// \return Side-effect on `expr` replacing it with an explicit clsid test void remove_instanceoft::lower_instanceof( exprt &expr, goto_programt &goto_program, @@ -164,20 +146,12 @@ void remove_instanceoft::lower_instanceof( } } -/*******************************************************************\ - -Function: remove_instanceoft::lower_instanceof - - Inputs: GOTO program instruction `target` whose instanceof expressions, - if any, should be replaced with explicit tests, and the - `goto_program` it is part of. - - Outputs: Side-effect on `target` as above. - - Purpose: See function above - -\*******************************************************************/ - +/// See function above +/// \par parameters: GOTO program instruction `target` whose instanceof +/// expressions, +/// if any, should be replaced with explicit tests, and the +/// `goto_program` it is part of. +/// \return Side-effect on `target` as above. void remove_instanceoft::lower_instanceof( goto_programt &goto_program, goto_programt::targett target, @@ -198,18 +172,10 @@ void remove_instanceoft::lower_instanceof( lower_instanceof(target->guard, goto_program, target, inst_switch); } -/*******************************************************************\ - -Function: remove_instanceoft::lower_instanceof - - Inputs: `goto_program`, all of whose instanceof expressions will - be replaced by explicit class-identifier tests. - - Outputs: Side-effect on `goto_program` as above. - - Purpose: See function above - -\*******************************************************************/ +/// See function above +/// \par parameters: `goto_program`, all of whose instanceof expressions will +/// be replaced by explicit class-identifier tests. +/// \return Side-effect on `goto_program` as above. bool remove_instanceoft::lower_instanceof(goto_programt &goto_program) { instanceof_instt inst_switch; @@ -230,19 +196,9 @@ bool remove_instanceoft::lower_instanceof(goto_programt &goto_program) return false; } -/*******************************************************************\ - -Function: remove_instanceoft::lower_instanceof - - Inputs: None - - Outputs: Side-effects on this->goto_functions, replacing every - instanceof in every function with an explicit test. - - Purpose: See function above - -\*******************************************************************/ - +/// See function above +/// \return Side-effects on this->goto_functions, replacing every instanceof in +/// every function with an explicit test. void remove_instanceoft::lower_instanceof() { bool changed=false; @@ -252,22 +208,12 @@ void remove_instanceoft::lower_instanceof() goto_functions.compute_location_numbers(); } -/*******************************************************************\ - -Function: remove_instanceof - - Inputs: `goto_functions`, a function map, and the corresponding - `symbol_table`. - - Outputs: Side-effects on goto_functions, replacing every - instanceof in every function with an explicit test. - Extra auxiliary variables may be introduced into - `symbol_table`. - - Purpose: See function above - -\*******************************************************************/ - +/// See function above +/// \par parameters: `goto_functions`, a function map, and the corresponding +/// `symbol_table`. +/// \return Side-effects on goto_functions, replacing every instanceof in every +/// function with an explicit test. Extra auxiliary variables may be +/// introduced into `symbol_table`. void remove_instanceof( symbol_tablet &symbol_table, goto_functionst &goto_functions) diff --git a/src/goto-programs/remove_instanceof.h b/src/goto-programs/remove_instanceof.h index 7b4682ba9bf..15a02bf35b2 100644 --- a/src/goto-programs/remove_instanceof.h +++ b/src/goto-programs/remove_instanceof.h @@ -6,6 +6,9 @@ Author: Chris Smowton, chris.smowton@diffblue.com \*******************************************************************/ +/// \file +/// Remove Instance-of Operators + #ifndef CPROVER_GOTO_PROGRAMS_REMOVE_INSTANCEOF_H #define CPROVER_GOTO_PROGRAMS_REMOVE_INSTANCEOF_H diff --git a/src/goto-programs/remove_returns.cpp b/src/goto-programs/remove_returns.cpp index 9ca6554275c..fd8f49df4bc 100644 --- a/src/goto-programs/remove_returns.cpp +++ b/src/goto-programs/remove_returns.cpp @@ -8,6 +8,9 @@ Date: September 2009 \*******************************************************************/ +/// \file +/// Remove function return values + #include #include @@ -45,18 +48,7 @@ class remove_returnst goto_programt &goto_program); }; -/*******************************************************************\ - -Function: remove_returnst::replace_returns - -Inputs: - -Outputs: - -Purpose: turns 'return x' into an assignment to fkt#return_value - -\*******************************************************************/ - +/// turns 'return x' into an assignment to fkt#return_value void remove_returnst::replace_returns( goto_functionst::function_mapt::iterator f_it) { @@ -121,18 +113,7 @@ void remove_returnst::replace_returns( } } -/*******************************************************************\ - -Function: remove_returnst::do_function_calls - -Inputs: - -Outputs: - -Purpose: turns x=f(...) into f(...); lhs=f#return_value; - -\*******************************************************************/ - +/// turns x=f(...) into f(...); lhs=f#return_value; void remove_returnst::do_function_calls( goto_functionst &goto_functions, goto_programt &goto_program) @@ -208,18 +189,6 @@ void remove_returnst::do_function_calls( } } -/*******************************************************************\ - -Function: remove_returnst::operator() - -Inputs: - -Outputs: - -Purpose: - -\*******************************************************************/ - void remove_returnst::operator()(goto_functionst &goto_functions) { Forall_goto_functions(it, goto_functions) @@ -229,18 +198,7 @@ void remove_returnst::operator()(goto_functionst &goto_functions) } } -/*******************************************************************\ - -Function: remove_returns - -Inputs: - -Outputs: - -Purpose: removes returns - -\*******************************************************************/ - +/// removes returns void remove_returns( symbol_tablet &symbol_table, goto_functionst &goto_functions) @@ -249,36 +207,13 @@ void remove_returns( rr(goto_functions); } -/*******************************************************************\ - -Function: remove_returns - -Inputs: - -Outputs: - -Purpose: removes returns - -\*******************************************************************/ - +/// removes returns void remove_returns(goto_modelt &goto_model) { remove_returnst rr(goto_model.symbol_table); rr(goto_model.goto_functions); } -/*******************************************************************\ - -Function: original_return_type - -Inputs: - -Outputs: - -Purpose: - -\*******************************************************************/ - code_typet original_return_type( const symbol_tablet &symbol_table, const irep_idt &function_id) @@ -307,18 +242,7 @@ code_typet original_return_type( return type; } -/*******************************************************************\ - -Function: remove_returnst::restore_returns - -Inputs: - -Outputs: - -Purpose: turns 'return x' into an assignment to fkt#return_value - -\*******************************************************************/ - +/// turns 'return x' into an assignment to fkt#return_value bool remove_returnst::restore_returns( goto_functionst::function_mapt::iterator f_it) { @@ -391,18 +315,7 @@ bool remove_returnst::restore_returns( return false; } -/*******************************************************************\ - -Function: remove_returnst::undo_function_calls - -Inputs: - -Outputs: - -Purpose: turns f(...); lhs=f#return_value; into x=f(...) - -\*******************************************************************/ - +/// turns f(...); lhs=f#return_value; into x=f(...) void remove_returnst::undo_function_calls( goto_functionst &goto_functions, goto_programt &goto_program) @@ -461,18 +374,6 @@ void remove_returnst::undo_function_calls( } } -/*******************************************************************\ - -Function: remove_returnst::restore() - -Inputs: - -Outputs: - -Purpose: - -\*******************************************************************/ - void remove_returnst::restore(goto_functionst &goto_functions) { // restore all types first @@ -487,18 +388,7 @@ void remove_returnst::restore(goto_functionst &goto_functions) } } -/*******************************************************************\ - -Function: restore_returns - -Inputs: - -Outputs: - -Purpose: restores return statements - -\*******************************************************************/ - +/// restores return statements void restore_returns( symbol_tablet &symbol_table, goto_functionst &goto_functions) diff --git a/src/goto-programs/remove_returns.h b/src/goto-programs/remove_returns.h index 453d8a7be7f..d4e50cae57b 100644 --- a/src/goto-programs/remove_returns.h +++ b/src/goto-programs/remove_returns.h @@ -8,6 +8,9 @@ Date: September 2009 \*******************************************************************/ +/// \file +/// Remove function returns + #ifndef CPROVER_GOTO_PROGRAMS_REMOVE_RETURNS_H #define CPROVER_GOTO_PROGRAMS_REMOVE_RETURNS_H diff --git a/src/goto-programs/remove_skip.cpp b/src/goto-programs/remove_skip.cpp index dedeb8aca2a..816960b1ea0 100644 --- a/src/goto-programs/remove_skip.cpp +++ b/src/goto-programs/remove_skip.cpp @@ -6,19 +6,10 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ -#include "remove_skip.h" - -/*******************************************************************\ - -Function: is_skip - - Inputs: - - Outputs: - - Purpose: +/// \file +/// Program Transformation -\*******************************************************************/ +#include "remove_skip.h" static bool is_skip(goto_programt::instructionst::iterator it) { @@ -76,18 +67,7 @@ static bool is_skip(goto_programt::instructionst::iterator it) return false; } -/*******************************************************************\ - -Function: remove_skip - - Inputs: - - Outputs: - - Purpose: remove unnecessary skip statements - -\*******************************************************************/ - +/// remove unnecessary skip statements void remove_skip(goto_programt &goto_program) { // This needs to be a fixed-point, as @@ -174,18 +154,7 @@ void remove_skip(goto_programt &goto_program) while(goto_program.instructions.size() #include @@ -29,19 +32,10 @@ class remove_static_init_loopst const symbol_tablet &symbol_table; }; -/*******************************************************************\ - -Function: unwind_enum_static - - Inputs: goto_functions and options - - Outputs: side effect is adding loops to unwindset - - Purpose: unwind static initialization loops of Java enums as far as - the enum has elements, thus flattening them completely - -\*******************************************************************/ - +/// unwind static initialization loops of Java enums as far as the enum has +/// elements, thus flattening them completely +/// \par parameters: goto_functions and options +/// \return side effect is adding loops to unwindset void remove_static_init_loopst::unwind_enum_static( const goto_functionst &goto_functions, optionst &options) @@ -95,19 +89,10 @@ void remove_static_init_loopst::unwind_enum_static( } } -/*******************************************************************\ - -Function: remove_static_init_loops - - Inputs: symbol table, goto_functions and options - - Outputs: side effect is adding loops to unwindset - - Purpose: this is the entry point for the removal of loops in static - initialization code of Java enums - -\*******************************************************************/ - +/// this is the entry point for the removal of loops in static initialization +/// code of Java enums +/// \par parameters: symbol table, goto_functions and options +/// \return side effect is adding loops to unwindset void remove_static_init_loops( const symbol_tablet &symbol_table, const goto_functionst &goto_functions, diff --git a/src/goto-programs/remove_static_init_loops.h b/src/goto-programs/remove_static_init_loops.h index dd07ec6a670..eee270215a2 100644 --- a/src/goto-programs/remove_static_init_loops.h +++ b/src/goto-programs/remove_static_init_loops.h @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Unwind loops in static initializers + #include #include diff --git a/src/goto-programs/remove_unreachable.cpp b/src/goto-programs/remove_unreachable.cpp index 14f92e97be1..41ec75d39d0 100644 --- a/src/goto-programs/remove_unreachable.cpp +++ b/src/goto-programs/remove_unreachable.cpp @@ -6,23 +6,15 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Program Transformation + #include #include #include "remove_unreachable.h" -/*******************************************************************\ - -Function: remove_unreachable - - Inputs: - - Outputs: - - Purpose: remove unreachable code - -\*******************************************************************/ - +/// remove unreachable code void remove_unreachable(goto_programt &goto_program) { std::set reachable; diff --git a/src/goto-programs/remove_unreachable.h b/src/goto-programs/remove_unreachable.h index 694cd8c0af8..7e04c4df98f 100644 --- a/src/goto-programs/remove_unreachable.h +++ b/src/goto-programs/remove_unreachable.h @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Program Transformation + #ifndef CPROVER_GOTO_PROGRAMS_REMOVE_UNREACHABLE_H #define CPROVER_GOTO_PROGRAMS_REMOVE_UNREACHABLE_H diff --git a/src/goto-programs/remove_unused_functions.cpp b/src/goto-programs/remove_unused_functions.cpp index 860af2e1d73..986f615ba6b 100644 --- a/src/goto-programs/remove_unused_functions.cpp +++ b/src/goto-programs/remove_unused_functions.cpp @@ -6,22 +6,13 @@ Author: CM Wintersteiger \*******************************************************************/ +/// \file +/// Unused function removal + #include #include "remove_unused_functions.h" -/*******************************************************************\ - -Function: remove_unused_functions - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void remove_unused_functions( goto_functionst &functions, message_handlert &message_handler) @@ -54,18 +45,6 @@ void remove_unused_functions( functions.function_map.erase(f); } -/*******************************************************************\ - -Function: find_used_functions - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void find_used_functions( const irep_idt &start, goto_functionst &functions, diff --git a/src/goto-programs/remove_unused_functions.h b/src/goto-programs/remove_unused_functions.h index b571de4e059..550d657f299 100644 --- a/src/goto-programs/remove_unused_functions.h +++ b/src/goto-programs/remove_unused_functions.h @@ -6,6 +6,9 @@ Author: CM Wintersteiger \*******************************************************************/ +/// \file +/// Unused function removal + #ifndef CPROVER_GOTO_PROGRAMS_REMOVE_UNUSED_FUNCTIONS_H #define CPROVER_GOTO_PROGRAMS_REMOVE_UNUSED_FUNCTIONS_H diff --git a/src/goto-programs/remove_vector.cpp b/src/goto-programs/remove_vector.cpp index f7b63e42d4f..827bbb322dd 100644 --- a/src/goto-programs/remove_vector.cpp +++ b/src/goto-programs/remove_vector.cpp @@ -8,22 +8,13 @@ Date: September 2014 \*******************************************************************/ +/// \file +/// Remove 'vector' data type + #include #include "remove_vector.h" -/*******************************************************************\ - -Function: have_to_remove_vector - -Inputs: - -Outputs: - -Purpose: - -\*******************************************************************/ - static bool have_to_remove_vector(const typet &type); static bool have_to_remove_vector(const exprt &expr) @@ -51,18 +42,6 @@ static bool have_to_remove_vector(const exprt &expr) return false; } -/*******************************************************************\ - -Function: have_to_remove_vector - -Inputs: - -Outputs: - -Purpose: - -\*******************************************************************/ - static bool have_to_remove_vector(const typet &type) { if(type.id()==ID_struct || type.id()==ID_union) @@ -87,18 +66,7 @@ static bool have_to_remove_vector(const typet &type) return false; } -/*******************************************************************\ - -Function: remove_vector - -Inputs: - -Outputs: - -Purpose: removes vector data type - -\*******************************************************************/ - +/// removes vector data type static void remove_vector(typet &); static void remove_vector(exprt &expr) @@ -174,18 +142,7 @@ static void remove_vector(exprt &expr) remove_vector(expr.type()); } -/*******************************************************************\ - -Function: remove_vector - -Inputs: - -Outputs: - -Purpose: removes vector data type - -\*******************************************************************/ - +/// removes vector data type static void remove_vector(typet &type) { if(!have_to_remove_vector(type)) @@ -223,54 +180,21 @@ static void remove_vector(typet &type) } } -/*******************************************************************\ - -Function: remove_vector - -Inputs: - -Outputs: - -Purpose: removes vector data type - -\*******************************************************************/ - +/// removes vector data type static void remove_vector(symbolt &symbol) { remove_vector(symbol.value); remove_vector(symbol.type); } -/*******************************************************************\ - -Function: remove_vector - -Inputs: - -Outputs: - -Purpose: removes vector data type - -\*******************************************************************/ - +/// removes vector data type static void remove_vector(symbol_tablet &symbol_table) { Forall_symbols(it, symbol_table.symbols) remove_vector(it->second); } -/*******************************************************************\ - -Function: remove_vector - -Inputs: - -Outputs: - -Purpose: removes vector data type - -\*******************************************************************/ - +/// removes vector data type void remove_vector(goto_functionst::goto_functiont &goto_function) { remove_vector(goto_function.type); @@ -282,36 +206,14 @@ void remove_vector(goto_functionst::goto_functiont &goto_function) } } -/*******************************************************************\ - -Function: remove_vector - -Inputs: - -Outputs: - -Purpose: removes vector data type - -\*******************************************************************/ - +/// removes vector data type static void remove_vector(goto_functionst &goto_functions) { Forall_goto_functions(it, goto_functions) remove_vector(it->second); } -/*******************************************************************\ - -Function: remove_vector - -Inputs: - -Outputs: - -Purpose: removes vector data type - -\*******************************************************************/ - +/// removes vector data type void remove_vector( symbol_tablet &symbol_table, goto_functionst &goto_functions) @@ -320,18 +222,7 @@ void remove_vector( remove_vector(goto_functions); } -/*******************************************************************\ - -Function: remove_vector - -Inputs: - -Outputs: - -Purpose: removes vector data type - -\*******************************************************************/ - +/// removes vector data type void remove_vector(goto_modelt &goto_model) { remove_vector(goto_model.symbol_table, goto_model.goto_functions); diff --git a/src/goto-programs/remove_vector.h b/src/goto-programs/remove_vector.h index ffcb58421b4..960d75953a8 100644 --- a/src/goto-programs/remove_vector.h +++ b/src/goto-programs/remove_vector.h @@ -8,6 +8,9 @@ Date: September 2014 \*******************************************************************/ +/// \file +/// Remove the 'vector' data type by compilation into arrays + #ifndef CPROVER_GOTO_PROGRAMS_REMOVE_VECTOR_H #define CPROVER_GOTO_PROGRAMS_REMOVE_VECTOR_H diff --git a/src/goto-programs/remove_virtual_functions.cpp b/src/goto-programs/remove_virtual_functions.cpp index fde2f5f8405..e766b089274 100644 --- a/src/goto-programs/remove_virtual_functions.cpp +++ b/src/goto-programs/remove_virtual_functions.cpp @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Remove Virtual Function (Method) Calls + #include #include @@ -13,14 +16,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "class_identifier.h" #include "remove_virtual_functions.h" -/*******************************************************************\ - - Class: remove_virtual_functionst - - Purpose: - -\*******************************************************************/ - class remove_virtual_functionst { public: @@ -67,18 +62,6 @@ class remove_virtual_functionst const irep_idt &component_name) const; }; -/*******************************************************************\ - -Function: remove_virtual_functionst::remove_virtual_functionst - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - remove_virtual_functionst::remove_virtual_functionst( const symbol_tablet &_symbol_table, const goto_functionst &goto_functions): @@ -88,18 +71,6 @@ remove_virtual_functionst::remove_virtual_functionst( class_hierarchy(symbol_table); } -/*******************************************************************\ - -Function: remove_virtual_functionst::remove_virtual_function - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void remove_virtual_functionst::remove_virtual_function( goto_programt &goto_program, goto_programt::targett target) @@ -231,28 +202,17 @@ void remove_virtual_functionst::remove_virtual_function( target->make_skip(); } -/*******************************************************************\ - -Function: remove_virtual_functionst::get_child_functions_rec - - Inputs: `this_id`: class name - `last_method_defn`: the most-derived parent of `this_id` - to define the requested function - `component_name`: name of the function searched for - - Outputs: `functions` is assigned a list of {class name, function symbol} - pairs indicating that if `this` is of the given class, then the - call will target the given function. Thus if A <: B <: C and A - and C provide overrides of `f` (but B does not), - get_child_functions_rec("C", C.f, "f") -> [{"C", C.f}, - {"B", C.f}, - {"A", A.f}] - - Purpose: Used by get_functions to track the most-derived parent that - provides an override of a given function. - -\*******************************************************************/ - +/// Used by get_functions to track the most-derived parent that provides an +/// override of a given function. +/// \par parameters: `this_id`: class name +/// `last_method_defn`: the most-derived parent of `this_id` to define the +/// requested function +/// `component_name`: name of the function searched for +/// \return `functions` is assigned a list of {class name, function symbol} +/// pairs indicating that if `this` is of the given class, then the call will +/// target the given function. Thus if A <: B <: C and A and C provide +/// overrides of `f` (but B does not), get_child_functions_rec("C", C.f, "f") +/// -> [{"C", C.f}, {"B", C.f}, {"A", A.f}] void remove_virtual_functionst::get_child_functions_rec( const irep_idt &this_id, const symbol_exprt &last_method_defn, @@ -290,18 +250,6 @@ void remove_virtual_functionst::get_child_functions_rec( } } -/*******************************************************************\ - -Function: remove_virtual_functionst::get_functions - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void remove_virtual_functionst::get_functions( const exprt &function, functionst &functions) @@ -352,18 +300,6 @@ void remove_virtual_functionst::get_functions( functions.push_back(root_function); } -/*******************************************************************\ - -Function: remove_virtual_functionst::get_method - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - exprt remove_virtual_functionst::get_method( const irep_idt &class_id, const irep_idt &component_name) const @@ -378,18 +314,6 @@ exprt remove_virtual_functionst::get_method( return symbol->symbol_expr(); } -/*******************************************************************\ - -Function: remove_virtual_functionst::remove_virtual_functions - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool remove_virtual_functionst::remove_virtual_functions( goto_programt &goto_program) { @@ -416,18 +340,6 @@ bool remove_virtual_functionst::remove_virtual_functions( return did_something; } -/*******************************************************************\ - -Function: remove_virtual_functionst::operator() - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void remove_virtual_functionst::operator()(goto_functionst &functions) { bool did_something=false; @@ -447,18 +359,6 @@ void remove_virtual_functionst::operator()(goto_functionst &functions) functions.compute_location_numbers(); } -/*******************************************************************\ - -Function: remove_virtual_functions - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void remove_virtual_functions( const symbol_tablet &symbol_table, goto_functionst &goto_functions) @@ -469,18 +369,6 @@ void remove_virtual_functions( rvf(goto_functions); } -/*******************************************************************\ - -Function: remove_virtual_functions - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void remove_virtual_functions(goto_modelt &goto_model) { remove_virtual_functions( diff --git a/src/goto-programs/remove_virtual_functions.h b/src/goto-programs/remove_virtual_functions.h index 0fec71a318f..af83cf57e4d 100644 --- a/src/goto-programs/remove_virtual_functions.h +++ b/src/goto-programs/remove_virtual_functions.h @@ -8,6 +8,9 @@ Date: April 2016 \*******************************************************************/ +/// \file +/// Remove Virtual Function (Method) Calls + #ifndef CPROVER_GOTO_PROGRAMS_REMOVE_VIRTUAL_FUNCTIONS_H #define CPROVER_GOTO_PROGRAMS_REMOVE_VIRTUAL_FUNCTIONS_H diff --git a/src/goto-programs/replace_java_nondet.cpp b/src/goto-programs/replace_java_nondet.cpp index b0514d60a7b..02a989d307a 100644 --- a/src/goto-programs/replace_java_nondet.cpp +++ b/src/goto-programs/replace_java_nondet.cpp @@ -6,6 +6,9 @@ Author: Reuben Thomas, reuben.thomas@diffblue.com \*******************************************************************/ +/// \file +/// Replace Java Nondet expressions + #include "goto-programs/replace_java_nondet.h" #include "goto-programs/goto_convert.h" #include "goto-programs/goto_model.h" @@ -16,15 +19,8 @@ Author: Reuben Thomas, reuben.thomas@diffblue.com #include #include -/*******************************************************************\ - - Class: nondet_instruction_infot - - Purpose: Holds information about any discovered nondet methods, - with extreme type-safety. - -\*******************************************************************/ - +/// Holds information about any discovered nondet methods, with extreme type- +/// safety. class nondet_instruction_infot final { public: @@ -51,22 +47,11 @@ class nondet_instruction_infot final is_nullablet is_nullable; }; -/*******************************************************************\ - -Function: is_nondet_returning_object - - Inputs: - function_call: The function call declaration to check. - - Outputs: A structure detailing whether the function call appears to - be one of our nondet library methods, and if so, whether - or not it allows null results. - - Purpose: Checks whether the function call is one of our nondet - library functions. - -\*******************************************************************/ - +/// Checks whether the function call is one of our nondet library functions. +/// \param function_call: The function call declaration to check. +/// \return A structure detailing whether the function call appears to be one of +/// our nondet library methods, and if so, whether or not it allows null +/// results. static nondet_instruction_infot is_nondet_returning_object( const code_function_callt &function_call) { @@ -85,21 +70,10 @@ static nondet_instruction_infot is_nondet_returning_object( nondet_instruction_infot::is_nullablet(!match_results[1].matched)); } -/*******************************************************************\ - -Function: get_nondet_instruction_info - - Inputs: - instr: A goto-program instruction to check. - - Outputs: A structure detailing the properties of the nondet method. - - Purpose: Check whether the instruction is a function call which - matches one of the recognised nondet library methods, and - return some information about it. - -\*******************************************************************/ - +/// Check whether the instruction is a function call which matches one of the +/// recognised nondet library methods, and return some information about it. +/// \param instr: A goto-program instruction to check. +/// \return A structure detailing the properties of the nondet method. static nondet_instruction_infot get_nondet_instruction_info( const goto_programt::const_targett &instr) { @@ -116,43 +90,21 @@ static nondet_instruction_infot get_nondet_instruction_info( return is_nondet_returning_object(function_call); } -/*******************************************************************\ - -Function: is_symbol_with_id - - Inputs: - expr: The expression which may be a symbol. - identifier: Some identifier. - - Outputs: True if the expression is a symbol with the specified identifier. - - Purpose: Return whether the expression is a symbol with the specified - identifier. - -\*******************************************************************/ - +/// Return whether the expression is a symbol with the specified identifier. +/// \param expr: The expression which may be a symbol. +/// \param identifier: Some identifier. +/// \return True if the expression is a symbol with the specified identifier. static bool is_symbol_with_id(const exprt& expr, const irep_idt& identifier) { return expr.id()==ID_symbol && to_symbol_expr(expr).get_identifier()==identifier; } -/*******************************************************************\ - -Function: is_typecast_with_id - - Inputs: - expr: The expression which may be a typecast. - identifier: Some identifier. - - Outputs: True if the expression is a typecast with one operand, and the - typecast's identifier matches the specified identifier. - - Purpose: Return whether the expression is a typecast with the specified - identifier. - -\*******************************************************************/ - +/// Return whether the expression is a typecast with the specified identifier. +/// \param expr: The expression which may be a typecast. +/// \param identifier: Some identifier. +/// \return True if the expression is a typecast with one operand, and the +/// typecast's identifier matches the specified identifier. static bool is_typecast_with_id(const exprt& expr, const irep_idt& identifier) { if(!(expr.id()==ID_typecast && expr.operands().size()==1)) @@ -169,22 +121,12 @@ static bool is_typecast_with_id(const exprt& expr, const irep_idt& identifier) return op_symbol.get_identifier()==identifier; } -/*******************************************************************\ - -Function: is_assignment_from - - Inputs: - instr: A goto program instruction. - identifier: Some identifier. - - Outputs: True if the expression is a typecast with one operand, and the - typecast's identifier matches the specified identifier. - - Purpose: Return whether the instruction is an assignment, and the rhs is a - symbol or typecast expression with the specified identifier. - -\*******************************************************************/ - +/// Return whether the instruction is an assignment, and the rhs is a symbol or +/// typecast expression with the specified identifier. +/// \param instr: A goto program instruction. +/// \param identifier: Some identifier. +/// \return True if the expression is a typecast with one operand, and the +/// typecast's identifier matches the specified identifier. static bool is_assignment_from( const goto_programt::instructiont &instr, const irep_idt &identifier) @@ -199,23 +141,13 @@ static bool is_assignment_from( is_typecast_with_id(rhs, identifier); } -/*******************************************************************\ - -Function: check_and_replace_target - - Inputs: - goto_program: The goto program to modify. - target: A single step of the goto program which may be erased and - replaced. - - Outputs: The next instruction to process, probably with this function. - - Purpose: Given an iterator into a list of instructions, modify the list to - replace 'nondet' library functions with CBMC-native nondet - expressions, and return an iterator to the next instruction to check. - -\*******************************************************************/ - +/// Given an iterator into a list of instructions, modify the list to replace +/// 'nondet' library functions with CBMC-native nondet expressions, and return +/// an iterator to the next instruction to check. +/// \param goto_program: The goto program to modify. +/// \param target: A single step of the goto program which may be erased and +/// replaced. +/// \return The next instruction to process, probably with this function. static goto_programt::targett check_and_replace_target( goto_programt &goto_program, const goto_programt::targett &target) @@ -287,20 +219,10 @@ static goto_programt::targett check_and_replace_target( return after_matching_assignment; } -/*******************************************************************\ - -Function: replace_java_nondet - - Inputs: - goto_program: The goto program to modify. - - Purpose: Checks each instruction in the goto program to see whether - it is a method returning nondet. If it is, replaces the - function call with an irep representing a nondet side - effect with an appropriate type. - -\*******************************************************************/ - +/// Checks each instruction in the goto program to see whether it is a method +/// returning nondet. If it is, replaces the function call with an irep +/// representing a nondet side effect with an appropriate type. +/// \param goto_program: The goto program to modify. static void replace_java_nondet(goto_programt &goto_program) { for(auto instruction_iterator=goto_program.instructions.begin(), diff --git a/src/goto-programs/replace_java_nondet.h b/src/goto-programs/replace_java_nondet.h index 077f95ab84c..cc924e9e974 100644 --- a/src/goto-programs/replace_java_nondet.h +++ b/src/goto-programs/replace_java_nondet.h @@ -6,23 +6,17 @@ Author: Reuben Thomas, reuben.thomas@diffblue.com \*******************************************************************/ +/// \file +/// Replace Java Nondet expressions + #ifndef CPROVER_GOTO_PROGRAMS_REPLACE_JAVA_NONDET_H #define CPROVER_GOTO_PROGRAMS_REPLACE_JAVA_NONDET_H class goto_functionst; -/*******************************************************************\ - -Function: replace_java_nondet - - Inputs: - goto_functions: The set of goto programs to modify. - - Purpose: Replace calls to nondet library functions with an internal - nondet representation. - -\*******************************************************************/ - +/// Replace calls to nondet library functions with an internal nondet +/// representation. +/// \param goto_functions: The set of goto programs to modify. void replace_java_nondet(goto_functionst &goto_functions); #endif diff --git a/src/goto-programs/safety_checker.cpp b/src/goto-programs/safety_checker.cpp index 275cffbbe09..b1236c08dc7 100644 --- a/src/goto-programs/safety_checker.cpp +++ b/src/goto-programs/safety_checker.cpp @@ -6,37 +6,16 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ -#include "safety_checker.h" - -/*******************************************************************\ - -Function: safety_checkert::safety_checkert - - Inputs: +/// \file +/// Safety Checker Interface - Outputs: - - Purpose: - -\*******************************************************************/ +#include "safety_checker.h" safety_checkert::safety_checkert(const namespacet &_ns): ns(_ns) { } -/*******************************************************************\ - -Function: safety_checkert::safety_checkert - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - safety_checkert::safety_checkert( const namespacet &_ns, message_handlert &_message_handler): diff --git a/src/goto-programs/safety_checker.h b/src/goto-programs/safety_checker.h index e7f5e0b81ea..bb1492d6f53 100644 --- a/src/goto-programs/safety_checker.h +++ b/src/goto-programs/safety_checker.h @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Safety Checker Interface + #ifndef CPROVER_GOTO_PROGRAMS_SAFETY_CHECKER_H #define CPROVER_GOTO_PROGRAMS_SAFETY_CHECKER_H diff --git a/src/goto-programs/set_properties.cpp b/src/goto-programs/set_properties.cpp index fc79d4dcfe7..303d8a9367d 100644 --- a/src/goto-programs/set_properties.cpp +++ b/src/goto-programs/set_properties.cpp @@ -6,24 +6,15 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Set Properties + #include #include #include "set_properties.h" -/*******************************************************************\ - -Function: set_properties - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void set_properties( goto_programt &goto_program, std::unordered_set &property_set) @@ -48,35 +39,11 @@ void set_properties( } } -/*******************************************************************\ - -Function: label_properties - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void label_properties(goto_modelt &goto_model) { label_properties(goto_model.goto_functions); } -/*******************************************************************\ - -Function: label_properties - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void label_properties( goto_programt &goto_program, std::map &property_counters) @@ -119,36 +86,12 @@ void label_properties( } } -/*******************************************************************\ - -Function: label_properties - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void label_properties(goto_programt &goto_program) { std::map property_counters; label_properties(goto_program, property_counters); } -/*******************************************************************\ - -Function: set_properties - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void set_properties( goto_modelt &goto_model, const std::list &properties) @@ -156,18 +99,6 @@ void set_properties( set_properties(goto_model.goto_functions, properties); } -/*******************************************************************\ - -Function: set_properties - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void set_properties( goto_functionst &goto_functions, const std::list &properties) @@ -184,18 +115,6 @@ void set_properties( throw "property "+id2string(*property_set.begin())+" not found"; } -/*******************************************************************\ - -Function: label_properties - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void label_properties(goto_functionst &goto_functions) { std::map property_counters; @@ -208,35 +127,11 @@ void label_properties(goto_functionst &goto_functions) label_properties(it->second.body, property_counters); } -/*******************************************************************\ - -Function: make_assertions_false - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void make_assertions_false(goto_modelt &goto_model) { make_assertions_false(goto_model.goto_functions); } -/*******************************************************************\ - -Function: make_assertions_false - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void make_assertions_false( goto_functionst &goto_functions) { diff --git a/src/goto-programs/set_properties.h b/src/goto-programs/set_properties.h index 8f302b79bee..53d1bee93d7 100644 --- a/src/goto-programs/set_properties.h +++ b/src/goto-programs/set_properties.h @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Set the properties to check + #ifndef CPROVER_GOTO_PROGRAMS_SET_PROPERTIES_H #define CPROVER_GOTO_PROGRAMS_SET_PROPERTIES_H diff --git a/src/goto-programs/show_goto_functions.cpp b/src/goto-programs/show_goto_functions.cpp index 2b07d6d6db8..516d2e6a3d2 100644 --- a/src/goto-programs/show_goto_functions.cpp +++ b/src/goto-programs/show_goto_functions.cpp @@ -6,6 +6,9 @@ Author: Peter Schrammel \*******************************************************************/ +/// \file +/// Show goto functions + #include #include @@ -23,18 +26,6 @@ Author: Peter Schrammel #include "goto_functions.h" #include "goto_model.h" -/*******************************************************************\ - -Function: cbmc_parseoptionst::show_goto_functions - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void show_goto_functions( const namespacet &ns, ui_message_handlert::uit ui, @@ -62,18 +53,6 @@ void show_goto_functions( } } -/*******************************************************************\ - -Function: show_goto_functions - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void show_goto_functions( const goto_modelt &goto_model, ui_message_handlert::uit ui) diff --git a/src/goto-programs/show_goto_functions.h b/src/goto-programs/show_goto_functions.h index a496682961e..4f63fde97a6 100644 --- a/src/goto-programs/show_goto_functions.h +++ b/src/goto-programs/show_goto_functions.h @@ -6,6 +6,9 @@ Author: Peter Schrammel \*******************************************************************/ +/// \file +/// Show the goto functions + #ifndef CPROVER_GOTO_PROGRAMS_SHOW_GOTO_FUNCTIONS_H #define CPROVER_GOTO_PROGRAMS_SHOW_GOTO_FUNCTIONS_H diff --git a/src/goto-programs/show_goto_functions_json.cpp b/src/goto-programs/show_goto_functions_json.cpp index 47a19e0662a..da9c2424322 100644 --- a/src/goto-programs/show_goto_functions_json.cpp +++ b/src/goto-programs/show_goto_functions_json.cpp @@ -6,6 +6,9 @@ Author: Thomas Kiley \*******************************************************************/ +/// \file +/// Goto Program + #include #include @@ -20,37 +23,15 @@ Author: Thomas Kiley #include "goto_model.h" #include "show_goto_functions_json.h" -/*******************************************************************\ - -Function: show_goto_functions_jsont::show_goto_functions_jsont - - Inputs: - ns - the namespace to use to resolve names with - - Outputs: - - Purpose: For outputing the GOTO program in a readable JSON format. - -\*******************************************************************/ - +/// For outputing the GOTO program in a readable JSON format. +/// \param ns: the namespace to use to resolve names with show_goto_functions_jsont::show_goto_functions_jsont(const namespacet &ns): ns(ns) {} -/*******************************************************************\ - -Function: show_goto_functions_jsont::convert - - Inputs: - goto_functions - the goto functions that make up the program - - Outputs: - - Purpose: Walks through all of the functions in the program and returns - a JSON object representing all their functions - -\*******************************************************************/ - +/// Walks through all of the functions in the program and returns a JSON object +/// representing all their functions +/// \param goto_functions: the goto functions that make up the program json_objectt show_goto_functions_jsont::convert( const goto_functionst &goto_functions) { @@ -129,24 +110,13 @@ json_objectt show_goto_functions_jsont::convert( return json_result; } -/*******************************************************************\ - -Function: show_goto_functions_jsont::operator() - - Inputs: - goto_functions - the goto functions that make up the program - out - the stream to write the object to - append - should a command and newline be appended to the stream - before writing the JSON object. Defaults to true - - Outputs: - - Purpose: Print the json object generated by - show_goto_functions_jsont::show_goto_functions to the provided - stream (e.g. std::cout) - -\*******************************************************************/ - +/// Print the json object generated by +/// show_goto_functions_jsont::show_goto_functions to the provided stream (e.g. +/// std::cout) +/// \param goto_functions: the goto functions that make up the program +/// \param out: the stream to write the object to +/// \param append: should a command and newline be appended to the stream before +/// writing the JSON object. Defaults to true void show_goto_functions_jsont::operator()( const goto_functionst &goto_functions, std::ostream &out, diff --git a/src/goto-programs/show_goto_functions_json.h b/src/goto-programs/show_goto_functions_json.h index b6313247f43..0f2c7a9e8e5 100644 --- a/src/goto-programs/show_goto_functions_json.h +++ b/src/goto-programs/show_goto_functions_json.h @@ -6,6 +6,9 @@ Author: Thomas Kiley \*******************************************************************/ +/// \file +/// Goto Program + #ifndef CPROVER_GOTO_PROGRAMS_SHOW_GOTO_FUNCTIONS_JSON_H #define CPROVER_GOTO_PROGRAMS_SHOW_GOTO_FUNCTIONS_JSON_H diff --git a/src/goto-programs/show_goto_functions_xml.cpp b/src/goto-programs/show_goto_functions_xml.cpp index 7ccdd71a4ff..cce37c8d2c4 100644 --- a/src/goto-programs/show_goto_functions_xml.cpp +++ b/src/goto-programs/show_goto_functions_xml.cpp @@ -6,6 +6,9 @@ Author: Thomas Kiley \*******************************************************************/ +/// \file +/// Goto Program + #include #include @@ -21,51 +24,19 @@ Author: Thomas Kiley #include "show_goto_functions_xml.h" -/*******************************************************************\ - -Function: show_goto_functions_xmlt::show_goto_functions_xmlt - - Inputs: - ns - the namespace to use to resolve names with - - Outputs: - - Purpose: For outputing the GOTO program in a readable xml format. - -\*******************************************************************/ - +/// For outputing the GOTO program in a readable xml format. +/// \param ns: the namespace to use to resolve names with show_goto_functions_xmlt::show_goto_functions_xmlt(const namespacet &ns): ns(ns) {} -/*******************************************************************\ - -Function: show_goto_functions_xmlt::convert - - Inputs: - goto_functions - the goto functions that make up the program - - Outputs: - - Purpose: Walks through all of the functions in the program and returns - an xml object representing all their functions. Produces output - like this: - - - - - - - // 34 file main.c line 1 - s = { 'a', 'b', 'c', 0 }; - - - - - - -\*******************************************************************/ - +/// Walks through all of the functions in the program and returns an xml object +/// representing all their functions. Produces output like this: +/// +/// +/// // 34 file main.c line 1 s = { 'a', 'b', 'c', 0 }; +/// +/// \param goto_functions: the goto functions that make up the program xmlt show_goto_functions_xmlt::convert( const goto_functionst &goto_functions) { @@ -114,24 +85,13 @@ xmlt show_goto_functions_xmlt::convert( return xml_functions; } -/*******************************************************************\ - -Function: show_goto_functions_xmlt::operator() - - Inputs: - goto_functions - the goto functions that make up the program - out - the stream to write the object to - append - should a command and newline be appended to the stream - before writing the xml object. Defaults to true - - Outputs: - - Purpose: Print the xml object generated by - show_goto_functions_xmlt::show_goto_functions to the provided - stream (e.g. std::cout) - -\*******************************************************************/ - +/// Print the xml object generated by +/// show_goto_functions_xmlt::show_goto_functions to the provided stream (e.g. +/// std::cout) +/// \param goto_functions: the goto functions that make up the program +/// \param out: the stream to write the object to +/// \param append: should a command and newline be appended to the stream before +/// writing the xml object. Defaults to true void show_goto_functions_xmlt::operator()( const goto_functionst &goto_functions, std::ostream &out, diff --git a/src/goto-programs/show_goto_functions_xml.h b/src/goto-programs/show_goto_functions_xml.h index 6e170b5f32d..1d47bba0b55 100644 --- a/src/goto-programs/show_goto_functions_xml.h +++ b/src/goto-programs/show_goto_functions_xml.h @@ -6,6 +6,9 @@ Author: Thomas Kiley \*******************************************************************/ +/// \file +/// Goto Program + #ifndef CPROVER_GOTO_PROGRAMS_SHOW_GOTO_FUNCTIONS_XML_H #define CPROVER_GOTO_PROGRAMS_SHOW_GOTO_FUNCTIONS_XML_H diff --git a/src/goto-programs/show_properties.cpp b/src/goto-programs/show_properties.cpp index b6b03d1a7a4..feaeb4e9a06 100644 --- a/src/goto-programs/show_properties.cpp +++ b/src/goto-programs/show_properties.cpp @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Show Claims + #include #include @@ -19,18 +22,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "goto_functions.h" #include "goto_model.h" -/*******************************************************************\ - -Function: cbmc_parseoptionst::show_properties - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void show_properties( const namespacet &ns, const irep_idt &identifier, @@ -93,18 +84,6 @@ void show_properties( } -/*******************************************************************\ - -Function: cbmc_parseoptionst::show_properties_json - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void show_properties_json( json_arrayt &json_properties, const namespacet &ns, @@ -141,18 +120,6 @@ void show_properties_json( } } -/*******************************************************************\ - -Function: show_properties_json - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void show_properties_json( const namespacet &ns, const goto_functionst &goto_functions) @@ -172,18 +139,6 @@ void show_properties_json( std::cout << ",\n" << json_result; } -/*******************************************************************\ - -Function: show_properties - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void show_properties( const namespacet &ns, ui_message_handlert::uit ui, @@ -197,18 +152,6 @@ void show_properties( show_properties(ns, fct.first, ui, fct.second.body); } -/*******************************************************************\ - -Function: show_properties - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void show_properties( const goto_modelt &goto_model, ui_message_handlert::uit ui) diff --git a/src/goto-programs/show_properties.h b/src/goto-programs/show_properties.h index 0feff5f6a3d..b5564818195 100644 --- a/src/goto-programs/show_properties.h +++ b/src/goto-programs/show_properties.h @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Show the properties + #ifndef CPROVER_GOTO_PROGRAMS_SHOW_PROPERTIES_H #define CPROVER_GOTO_PROGRAMS_SHOW_PROPERTIES_H diff --git a/src/goto-programs/show_symbol_table.cpp b/src/goto-programs/show_symbol_table.cpp index cf24e4677ca..60460147e52 100644 --- a/src/goto-programs/show_symbol_table.cpp +++ b/src/goto-programs/show_symbol_table.cpp @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Show the symbol table + #include #include @@ -15,34 +18,10 @@ Author: Daniel Kroening, kroening@kroening.com #include "goto_model.h" #include "show_symbol_table.h" -/*******************************************************************\ - -Function: show_symbol_table_xml_ui - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void show_symbol_table_xml_ui() { } -/*******************************************************************\ - -Function: show_symbol_table_plain - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void show_symbol_table_plain( const goto_modelt &goto_model, std::ostream &out) @@ -130,18 +109,6 @@ void show_symbol_table_plain( } } -/*******************************************************************\ - -Function: show_symbol_table - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void show_symbol_table( const goto_modelt &goto_model, ui_message_handlert::uit ui) diff --git a/src/goto-programs/show_symbol_table.h b/src/goto-programs/show_symbol_table.h index 6e3b387f863..5ad717e7049 100644 --- a/src/goto-programs/show_symbol_table.h +++ b/src/goto-programs/show_symbol_table.h @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Show the symbol table + #ifndef CPROVER_GOTO_PROGRAMS_SHOW_SYMBOL_TABLE_H #define CPROVER_GOTO_PROGRAMS_SHOW_SYMBOL_TABLE_H diff --git a/src/goto-programs/slice_global_inits.cpp b/src/goto-programs/slice_global_inits.cpp index 5e58888d366..5496a8266a3 100644 --- a/src/goto-programs/slice_global_inits.cpp +++ b/src/goto-programs/slice_global_inits.cpp @@ -8,6 +8,9 @@ Date: December 2016 \*******************************************************************/ +/// \file +/// Remove initializations of unused global variables + #include #include @@ -22,18 +25,6 @@ Date: December 2016 #include "slice_global_inits.h" -/*******************************************************************\ - -Function: slice_global_inits - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void slice_global_inits( const namespacet &ns, goto_functionst &goto_functions) diff --git a/src/goto-programs/slice_global_inits.h b/src/goto-programs/slice_global_inits.h index 7907c31c49b..25a96121961 100644 --- a/src/goto-programs/slice_global_inits.h +++ b/src/goto-programs/slice_global_inits.h @@ -8,6 +8,9 @@ Date: December 2016 \*******************************************************************/ +/// \file +/// Remove initializations of unused global variables + #ifndef CPROVER_GOTO_PROGRAMS_SLICE_GLOBAL_INITS_H #define CPROVER_GOTO_PROGRAMS_SLICE_GLOBAL_INITS_H diff --git a/src/goto-programs/string_abstraction.cpp b/src/goto-programs/string_abstraction.cpp index 5c7a1868578..c217243f108 100644 --- a/src/goto-programs/string_abstraction.cpp +++ b/src/goto-programs/string_abstraction.cpp @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// String Abstraction + #include #include @@ -19,18 +22,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "pointer_arithmetic.h" #include "string_abstraction.h" -/*******************************************************************\ - -Function: string_abstractiont::build_wrap - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool string_abstractiont::build_wrap( const exprt &object, exprt &dest, bool write) @@ -60,18 +51,6 @@ bool string_abstractiont::build_wrap( return false; } -/*******************************************************************\ - -Function: string_abstractiont::is_ptr_string_struct - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool string_abstractiont::is_ptr_string_struct(const typet &type) const { return type.id()==ID_pointer && @@ -83,18 +62,6 @@ static inline bool is_ptr_argument(const typet &type) return type.id()==ID_pointer; } -/*******************************************************************\ - -Function: string_abstraction - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void string_abstraction( symbol_tablet &symbol_table, message_handlert &message_handler, @@ -104,18 +71,6 @@ void string_abstraction( string_abstraction(dest); } -/*******************************************************************\ - -Function: string_abstraction - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void string_abstraction( symbol_tablet &symbol_table, message_handlert &message_handler, @@ -125,18 +80,6 @@ void string_abstraction( string_abstraction(dest); } -/*******************************************************************\ - -Function: string_abstractiont::string_abstractiont - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - string_abstractiont::string_abstractiont( symbol_tablet &_symbol_table, message_handlert &_message_handler): @@ -166,18 +109,6 @@ string_abstractiont::string_abstractiont( string_struct=s; } -/*******************************************************************\ - -Function: string_abstractiont::build_type - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - typet string_abstractiont::build_type(whatt what) { typet type; @@ -192,18 +123,6 @@ typet string_abstractiont::build_type(whatt what) return type; } -/*******************************************************************\ - -Function: string_abstractiont::operator() - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void string_abstractiont::operator()(goto_functionst &dest) { Forall_goto_functions(it, dest) @@ -229,18 +148,6 @@ void string_abstractiont::operator()(goto_functionst &dest) } } -/*******************************************************************\ - -Function: string_abstractiont::operator() - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void string_abstractiont::operator()(goto_programt &dest) { abstract(dest); @@ -251,18 +158,6 @@ void string_abstractiont::operator()(goto_programt &dest) initialization.clear(); } -/*******************************************************************\ - -Function: string_abstractiont::add_str_arguments - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void string_abstractiont::add_str_arguments( const irep_idt &name, goto_functionst::goto_functiont &fct) @@ -302,18 +197,6 @@ void string_abstractiont::add_str_arguments( symb_parameters.end(), str_args.begin(), str_args.end()); } -/*******************************************************************\ - -Function: string_abstractiont::add_argument - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void string_abstractiont::add_argument( code_typet::parameterst &str_args, const symbolt &fct_symbol, @@ -342,18 +225,6 @@ void string_abstractiont::add_argument( symbol_table.move(new_symbol); } -/*******************************************************************\ - -Function: string_abstractiont::abstract - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void string_abstractiont::abstract(goto_programt &dest) { locals.clear(); @@ -369,18 +240,6 @@ void string_abstractiont::abstract(goto_programt &dest) locals.clear(); } -/*******************************************************************\ - -Function: string_abstractiont::declare_define_locals - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void string_abstractiont::declare_define_locals(goto_programt &dest) { typedef std::unordered_map @@ -417,18 +276,6 @@ void string_abstractiont::declare_define_locals(goto_programt &dest) } } -/*******************************************************************\ - -Function: string_abstractiont::make_decl_and_def - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void string_abstractiont::make_decl_and_def(goto_programt &dest, goto_programt::targett ref_instr, const irep_idt &identifier, @@ -464,18 +311,6 @@ void string_abstractiont::make_decl_and_def(goto_programt &dest, } } -/*******************************************************************\ - -Function: string_abstractiont::make_val_or_dummy_rec - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - exprt string_abstractiont::make_val_or_dummy_rec(goto_programt &dest, goto_programt::targett ref_instr, const symbolt &symbol, const typet &source_type) @@ -545,18 +380,6 @@ exprt string_abstractiont::make_val_or_dummy_rec(goto_programt &dest, return nil_exprt(); } -/*******************************************************************\ - -Function: string_abstractiont::add_dummy_symbol_and_value - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - symbol_exprt string_abstractiont::add_dummy_symbol_and_value( goto_programt &dest, goto_programt::targett ref_instr, @@ -623,18 +446,6 @@ symbol_exprt string_abstractiont::add_dummy_symbol_and_value( return sym_expr; } -/*******************************************************************\ - -Function: string_abstractiont::abstract - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - goto_programt::targett string_abstractiont::abstract( goto_programt &dest, goto_programt::targett it) @@ -682,18 +493,6 @@ goto_programt::targett string_abstractiont::abstract( return it; } -/*******************************************************************\ - -Function: string_abstractiont::abstract_assign - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - goto_programt::targett string_abstractiont::abstract_assign( goto_programt &dest, goto_programt::targett target) @@ -721,18 +520,6 @@ goto_programt::targett string_abstractiont::abstract_assign( return target; } -/*******************************************************************\ - -Function: string_abstractiont::abstract_function_call - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void string_abstractiont::abstract_function_call( goto_programt &dest, goto_programt::targett target) @@ -786,18 +573,6 @@ void string_abstractiont::abstract_function_call( arguments.insert(arguments.end(), str_args.begin(), str_args.end()); } -/*******************************************************************\ - -Function: string_abstractiont::has_string_macros - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool string_abstractiont::has_string_macros(const exprt &expr) { if(expr.id()=="is_zero_string" || @@ -812,18 +587,6 @@ bool string_abstractiont::has_string_macros(const exprt &expr) return false; } -/*******************************************************************\ - -Function: string_abstractiont::replace_string_macros - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void string_abstractiont::replace_string_macros( exprt &expr, bool lhs, @@ -852,18 +615,6 @@ void string_abstractiont::replace_string_macros( replace_string_macros(*it, lhs, source_location); } -/*******************************************************************\ - -Function: string_abstractiont::build - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - exprt string_abstractiont::build( const exprt &pointer, whatt what, @@ -901,18 +652,6 @@ exprt string_abstractiont::build( return result; } -/*******************************************************************\ - -Function: string_abstractiont::build_abstraction_type - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - const typet &string_abstractiont::build_abstraction_type(const typet &type) { const typet &eff_type=ns.follow(type); @@ -932,18 +671,6 @@ const typet &string_abstractiont::build_abstraction_type(const typet &type) std::make_pair(eff_type, map_entry->second)).first->second; } -/*******************************************************************\ - -Function: string_abstractiont::build_abstraction_type_rec - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - const typet &string_abstractiont::build_abstraction_type_rec(const typet &type, const abstraction_types_mapt &known) { @@ -1008,18 +735,6 @@ const typet &string_abstractiont::build_abstraction_type_rec(const typet &type, return map_entry.first->second; } -/*******************************************************************\ - -Function: string_abstractiont::build - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool string_abstractiont::build(const exprt &object, exprt &dest, bool write) { const typet &abstract_type=build_abstraction_type(object.type()); @@ -1084,18 +799,6 @@ bool string_abstractiont::build(const exprt &object, exprt &dest, bool write) return true; } -/*******************************************************************\ - -Function: string_abstractiont::build_if - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool string_abstractiont::build_if(const if_exprt &o_if, exprt &dest, bool write) { @@ -1124,18 +827,6 @@ bool string_abstractiont::build_if(const if_exprt &o_if, return false; } -/*******************************************************************\ - -Function: string_abstractiont::build_array - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool string_abstractiont::build_array(const array_exprt &object, exprt &dest, bool write) { @@ -1160,18 +851,6 @@ bool string_abstractiont::build_array(const array_exprt &object, return true; } -/*******************************************************************\ - -Function: string_abstractiont::build_pointer - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool string_abstractiont::build_pointer(const exprt &object, exprt &dest, bool write) { @@ -1204,18 +883,6 @@ bool string_abstractiont::build_pointer(const exprt &object, return true; } -/*******************************************************************\ - -Function: string_abstractiont::build_unknown - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - exprt string_abstractiont::build_unknown(whatt what, bool write) { typet type=build_type(what); @@ -1240,18 +907,6 @@ exprt string_abstractiont::build_unknown(whatt what, bool write) return result; } -/*******************************************************************\ - -Function: string_abstractiont::build_unknown - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - exprt string_abstractiont::build_unknown(const typet &type, bool write) { if(write) @@ -1279,18 +934,6 @@ exprt string_abstractiont::build_unknown(const typet &type, bool write) return ns.lookup(identifier).symbol_expr(); } -/*******************************************************************\ - -Function: string_abstractiont::build_symbol - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool string_abstractiont::build_symbol(const symbol_exprt &sym, exprt &dest) { const symbolt &symbol=ns.lookup(sym.get_identifier()); @@ -1318,18 +961,6 @@ bool string_abstractiont::build_symbol(const symbol_exprt &sym, exprt &dest) return false; } -/*******************************************************************\ - -Function: string_abstractiont::build_new_symbol - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void string_abstractiont::build_new_symbol(const symbolt &symbol, const irep_idt &identifier, const typet &type) { @@ -1361,18 +992,6 @@ void string_abstractiont::build_new_symbol(const symbolt &symbol, } } -/*******************************************************************\ - -Function: string_abstractiont::build_symbol_constant - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool string_abstractiont::build_symbol_constant( const mp_integer &zero_length, const mp_integer &buf_size, @@ -1418,18 +1037,6 @@ bool string_abstractiont::build_symbol_constant( return false; } -/*******************************************************************\ - -Function: string_abstractiont::move_lhs_arithmetic - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void string_abstractiont::move_lhs_arithmetic(exprt &lhs, exprt &rhs) { if(lhs.id()==ID_minus) @@ -1442,18 +1049,6 @@ void string_abstractiont::move_lhs_arithmetic(exprt &lhs, exprt &rhs) } } -/*******************************************************************\ - -Function: string_abstractiont::abstract_pointer_assign - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - goto_programt::targett string_abstractiont::abstract_pointer_assign( goto_programt &dest, goto_programt::targett target) @@ -1499,18 +1094,6 @@ goto_programt::targett string_abstractiont::abstract_pointer_assign( } } -/*******************************************************************\ - -Function: string_abstractiont::abstract_char_assign - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - goto_programt::targett string_abstractiont::abstract_char_assign( goto_programt &dest, goto_programt::targett target) @@ -1572,18 +1155,6 @@ goto_programt::targett string_abstractiont::abstract_char_assign( return target; } -/*******************************************************************\ - -Function: string_abstractiont::char_assign - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - goto_programt::targett string_abstractiont::char_assign( goto_programt &dest, goto_programt::targett target, @@ -1621,18 +1192,6 @@ goto_programt::targett string_abstractiont::char_assign( return target; } -/*******************************************************************\ - -Function: string_abstractiont::value_assignments - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - goto_programt::targett string_abstractiont::value_assignments( goto_programt &dest, goto_programt::targett target, @@ -1680,18 +1239,6 @@ goto_programt::targett string_abstractiont::value_assignments( return target; } -/*******************************************************************\ - -Function: string_abstractiont::value_assignments_if - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - goto_programt::targett string_abstractiont::value_assignments_if( goto_programt &dest, goto_programt::targett target, @@ -1730,18 +1277,6 @@ goto_programt::targett string_abstractiont::value_assignments_if( return last; } -/*******************************************************************\ - -Function: string_abstractiont::value_assignments_string_struct - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - goto_programt::targett string_abstractiont::value_assignments_string_struct( goto_programt &dest, goto_programt::targett target, @@ -1788,18 +1323,6 @@ goto_programt::targett string_abstractiont::value_assignments_string_struct( return last; } -/*******************************************************************\ - -Function: string_abstractiont::member - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - exprt string_abstractiont::member(const exprt &a, whatt what) { if(a.is_nil()) diff --git a/src/goto-programs/string_abstraction.h b/src/goto-programs/string_abstraction.h index ebc716accc3..9443b09d68b 100644 --- a/src/goto-programs/string_abstraction.h +++ b/src/goto-programs/string_abstraction.h @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// String Abstraction + #ifndef CPROVER_GOTO_PROGRAMS_STRING_ABSTRACTION_H #define CPROVER_GOTO_PROGRAMS_STRING_ABSTRACTION_H @@ -16,14 +19,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "goto_functions.h" -/*******************************************************************\ - - Class: string_abstractiont - - Purpose: - -\*******************************************************************/ - class string_abstractiont:public messaget { public: diff --git a/src/goto-programs/string_instrumentation.cpp b/src/goto-programs/string_instrumentation.cpp index 5a6596a97cd..0796b361341 100644 --- a/src/goto-programs/string_instrumentation.cpp +++ b/src/goto-programs/string_instrumentation.cpp @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// String Abstraction + #include #include @@ -20,18 +23,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "string_instrumentation.h" -/*******************************************************************\ - -Function: is_zero_string - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - exprt is_zero_string( const exprt &what, bool write) @@ -42,18 +33,6 @@ exprt is_zero_string( return result; } -/*******************************************************************\ - -Function: zero_string_length - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - exprt zero_string_length( const exprt &what, bool write) @@ -64,18 +43,6 @@ exprt zero_string_length( return result; } -/*******************************************************************\ - -Function: buffer_size - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - exprt buffer_size(const exprt &what) { exprt result("buffer_size", size_type()); @@ -83,18 +50,6 @@ exprt buffer_size(const exprt &what) return result; } -/*******************************************************************\ - - Class: string_instrumentationt - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - class string_instrumentationt:public messaget { public: @@ -197,18 +152,6 @@ class string_instrumentationt:public messaget const mp_integer &limit); }; -/*******************************************************************\ - -Function: string_instrumentation - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void string_instrumentation( symbol_tablet &symbol_table, message_handlert &message_handler, @@ -218,18 +161,6 @@ void string_instrumentation( string_instrumentation(dest); } -/*******************************************************************\ - -Function: string_instrumentation - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void string_instrumentation( symbol_tablet &symbol_table, message_handlert &message_handler, @@ -239,18 +170,6 @@ void string_instrumentation( string_instrumentation(dest); } -/*******************************************************************\ - -Function: string_instrumentationt::operator() - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void string_instrumentationt::operator()(goto_functionst &dest) { for(goto_functionst::function_mapt::iterator @@ -262,36 +181,12 @@ void string_instrumentationt::operator()(goto_functionst &dest) } } -/*******************************************************************\ - -Function: string_instrumentationt::operator() - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void string_instrumentationt::operator()(goto_programt &dest) { Forall_goto_program_instructions(it, dest) instrument(dest, it); } -/*******************************************************************\ - -Function: string_instrumentationt::instrument - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void string_instrumentationt::instrument( goto_programt &dest, goto_programt::targett it) @@ -311,18 +206,6 @@ void string_instrumentationt::instrument( } } -/*******************************************************************\ - -Function: string_instrumentationt::do_function_call - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void string_instrumentationt::do_function_call( goto_programt &dest, goto_programt::targett target) @@ -375,18 +258,6 @@ void string_instrumentationt::do_function_call( } } -/*******************************************************************\ - -Function: string_instrumentationt::do_sprintf - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void string_instrumentationt::do_sprintf( goto_programt &dest, goto_programt::targett target, @@ -429,18 +300,6 @@ void string_instrumentationt::do_sprintf( dest.insert_before_swap(target, tmp); } -/*******************************************************************\ - -Function: string_instrumentationt::do_snprintf - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void string_instrumentationt::do_snprintf( goto_programt &dest, goto_programt::targett target, @@ -484,18 +343,6 @@ void string_instrumentationt::do_snprintf( dest.insert_before_swap(target, tmp); } -/*******************************************************************\ - -Function: string_instrumentationt::do_fscanf - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void string_instrumentationt::do_fscanf( goto_programt &dest, goto_programt::targett target, @@ -529,18 +376,6 @@ void string_instrumentationt::do_fscanf( dest.insert_before_swap(target, tmp); } -/*******************************************************************\ - -Function: string_instrumentationt::do_format_string - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void string_instrumentationt::do_format_string_read( goto_programt &dest, goto_programt::const_targett target, @@ -644,18 +479,6 @@ void string_instrumentationt::do_format_string_read( } } -/*******************************************************************\ - -Function: string_instrumentationt::do_format_string_write - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void string_instrumentationt::do_format_string_write( goto_programt &dest, goto_programt::const_targett target, @@ -806,18 +629,6 @@ void string_instrumentationt::do_format_string_write( } } -/*******************************************************************\ - -Function: string_instrumentationt::do_strncmp - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void string_instrumentationt::do_strncmp( goto_programt &dest, goto_programt::targett target, @@ -825,18 +636,6 @@ void string_instrumentationt::do_strncmp( { } -/*******************************************************************\ - -Function: string_instrumentationt::do_strchr - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void string_instrumentationt::do_strchr( goto_programt &dest, goto_programt::targett target, @@ -864,18 +663,6 @@ void string_instrumentationt::do_strchr( dest.insert_before_swap(target, tmp); } -/*******************************************************************\ - -Function: string_instrumentationt::do_strrchr - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void string_instrumentationt::do_strrchr( goto_programt &dest, goto_programt::targett target, @@ -903,18 +690,6 @@ void string_instrumentationt::do_strrchr( dest.insert_before_swap(target, tmp); } -/*******************************************************************\ - -Function: string_instrumentationt::do_strstr - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void string_instrumentationt::do_strstr( goto_programt &dest, goto_programt::targett target, @@ -949,18 +724,6 @@ void string_instrumentationt::do_strstr( dest.insert_before_swap(target, tmp); } -/*******************************************************************\ - -Function: string_instrumentationt::do_strtok - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void string_instrumentationt::do_strtok( goto_programt &dest, goto_programt::targett target, @@ -995,18 +758,6 @@ void string_instrumentationt::do_strtok( dest.insert_before_swap(target, tmp); } -/*******************************************************************\ - -Function: string_instrumentationt::do_strerror - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void string_instrumentationt::do_strerror( goto_programt &dest, goto_programt::targett it, @@ -1103,18 +854,6 @@ void string_instrumentationt::do_strerror( dest.insert_before_swap(it, tmp); } -/*******************************************************************\ - -Function: string_instrumentationt::invalidate_buffer - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void string_instrumentationt::invalidate_buffer( goto_programt &dest, goto_programt::const_targett target, diff --git a/src/goto-programs/string_instrumentation.h b/src/goto-programs/string_instrumentation.h index cd52bb54a84..261b8dcdb1f 100644 --- a/src/goto-programs/string_instrumentation.h +++ b/src/goto-programs/string_instrumentation.h @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// String Abstraction + #ifndef CPROVER_GOTO_PROGRAMS_STRING_INSTRUMENTATION_H #define CPROVER_GOTO_PROGRAMS_STRING_INSTRUMENTATION_H diff --git a/src/goto-programs/system_library_symbols.cpp b/src/goto-programs/system_library_symbols.cpp index 250eb3b1cdb..91e099b170d 100644 --- a/src/goto-programs/system_library_symbols.cpp +++ b/src/goto-programs/system_library_symbols.cpp @@ -6,6 +6,9 @@ Author: Thomas Kiley \*******************************************************************/ +/// \file +/// Goto Programs + #include "system_library_symbols.h" #include #include @@ -17,20 +20,9 @@ system_library_symbolst::system_library_symbolst() init_system_library_map(); } -/*******************************************************************\ - -Function: system_library_symbolst::init_system_library_map - -Inputs: - -Outputs: - -Purpose: To generate a map of header file names -> list of symbols - The symbol names are reserved as the header and source files - will be compiled in to the goto program. - -\*******************************************************************/ - +/// To generate a map of header file names -> list of symbols The symbol names +/// are reserved as the header and source files will be compiled in to the goto +/// program. void system_library_symbolst::init_system_library_map() { // ctype.h @@ -240,22 +232,10 @@ void system_library_symbolst::init_system_library_map() add_to_system_library("sys/wait.h", sys_wait_syms); } -/*******************************************************************\ - -Function: system_library_symbolst::add_to_system_library - -Inputs: - header_file - the name of the header file the symbol came from - symbols - a list of the names of the symbols in the header file - -Outputs: - -Purpose: To add the symbols from a specific header file to the - system library map. The symbol is used as the key so that - we can easily look up symbols. - -\*******************************************************************/ - +/// To add the symbols from a specific header file to the system library map. +/// The symbol is used as the key so that we can easily look up symbols. +/// \param header_file: the name of the header file the symbol came from +/// \param symbols: a list of the names of the symbols in the header file void system_library_symbolst::add_to_system_library( irep_idt header_file, std::list symbols) @@ -267,21 +247,10 @@ void system_library_symbolst::add_to_system_library( } -/*******************************************************************\ - -Function: system_library_symbolst::is_symbol_internal_symbol - -Inputs: - symbol - the symbol to check - -Outputs: True if the symbol is an internal symbol. If specific system - headers need to be included, the out_system_headers will contain - the headers. - -Purpose: To find out if a symbol is an internal symbol. - -\*******************************************************************/ - +/// To find out if a symbol is an internal symbol. +/// \param symbol: the symbol to check +/// \return True if the symbol is an internal symbol. If specific system headers +/// need to be included, the out_system_headers will contain the headers. bool system_library_symbolst::is_symbol_internal_symbol( const symbolt &symbol, std::set &out_system_headers) const diff --git a/src/goto-programs/system_library_symbols.h b/src/goto-programs/system_library_symbols.h index 9438e052a76..f5236314f21 100644 --- a/src/goto-programs/system_library_symbols.h +++ b/src/goto-programs/system_library_symbols.h @@ -6,6 +6,9 @@ Author: Thomas Kiley \*******************************************************************/ +/// \file +/// Goto Programs + #ifndef CPROVER_GOTO_PROGRAMS_SYSTEM_LIBRARY_SYMBOLS_H #define CPROVER_GOTO_PROGRAMS_SYSTEM_LIBRARY_SYMBOLS_H diff --git a/src/goto-programs/vcd_goto_trace.cpp b/src/goto-programs/vcd_goto_trace.cpp index 9a3bbf443f7..d6c39603cc4 100644 --- a/src/goto-programs/vcd_goto_trace.cpp +++ b/src/goto-programs/vcd_goto_trace.cpp @@ -8,6 +8,9 @@ Date: June 2011 \*******************************************************************/ +/// \file +/// Traces of GOTO Programs in VCD (Value Change Dump) Format + #include #include #include @@ -18,18 +21,6 @@ Date: June 2011 #include "vcd_goto_trace.h" -/*******************************************************************\ - -Function: output_vcd - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string as_vcd_binary( const exprt &expr, const namespacet &ns) @@ -90,18 +81,6 @@ std::string as_vcd_binary( return ""; } -/*******************************************************************\ - -Function: output_vcd - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void output_vcd( const namespacet &ns, const goto_tracet &goto_trace, diff --git a/src/goto-programs/vcd_goto_trace.h b/src/goto-programs/vcd_goto_trace.h index 5b9a3680cb6..0f7990b92bd 100644 --- a/src/goto-programs/vcd_goto_trace.h +++ b/src/goto-programs/vcd_goto_trace.h @@ -8,6 +8,9 @@ Date: June 2011 \*******************************************************************/ +/// \file +/// Traces of GOTO Programs in VCD (Value Change Dump) Format + #ifndef CPROVER_GOTO_PROGRAMS_VCD_GOTO_TRACE_H #define CPROVER_GOTO_PROGRAMS_VCD_GOTO_TRACE_H diff --git a/src/goto-programs/wp.cpp b/src/goto-programs/wp.cpp index 4290734e2f5..ea6ddd6a286 100644 --- a/src/goto-programs/wp.cpp +++ b/src/goto-programs/wp.cpp @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Weakest Preconditions + // #include #include @@ -14,18 +17,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "wp.h" -/*******************************************************************\ - -Function: has_nondet - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool has_nondet(const exprt &dest) { forall_operands(it, dest) @@ -44,18 +35,6 @@ bool has_nondet(const exprt &dest) return false; } -/*******************************************************************\ - -Function: approximate_nondet_rec - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void approximate_nondet_rec(exprt &dest, unsigned &count) { if(dest.id()==ID_side_effect && @@ -71,36 +50,13 @@ void approximate_nondet_rec(exprt &dest, unsigned &count) approximate_nondet_rec(*it, count); } -/*******************************************************************\ - -Function: approximate_nondet - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void approximate_nondet(exprt &dest) { static unsigned count=0; // not proper, should be quantified approximate_nondet_rec(dest, count); } -/*******************************************************************\ - -Function: aliasing - - Inputs: - - Outputs: - - Purpose: consider possible aliasing - -\*******************************************************************/ - +/// consider possible aliasing enum class aliasingt { A_MAY, A_MUST, A_MUSTNOT }; aliasingt aliasing( @@ -155,19 +111,7 @@ aliasingt aliasing( return aliasingt::A_MAY; } -/*******************************************************************\ - -Function: substitute_rec - - Inputs: - - Outputs: - - Purpose: replace 'what' by 'by' in 'dest', - considering possible aliasing - -\*******************************************************************/ - +/// replace 'what' by 'by' in 'dest', considering possible aliasing void substitute_rec( exprt &dest, const exprt &what, @@ -217,18 +161,6 @@ void substitute_rec( } } -/*******************************************************************\ - -Function: rewrite_assignment - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void rewrite_assignment(exprt &lhs, exprt &rhs) { if(lhs.id()==ID_member) // turn s.x:=e into s:=(s with .x=e) @@ -267,18 +199,6 @@ void rewrite_assignment(exprt &lhs, exprt &rhs) } } -/*******************************************************************\ - -Function: wp_assign - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - exprt wp_assign( const code_assignt &code, const exprt &post, @@ -300,18 +220,6 @@ exprt wp_assign( return pre; } -/*******************************************************************\ - -Function: wp_assume - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - exprt wp_assume( const code_assumet &code, const exprt &post, @@ -320,18 +228,6 @@ exprt wp_assume( return implies_exprt(code.assumption(), post); } -/*******************************************************************\ - -Function: wp_decl - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - exprt wp_decl( const code_declt &code, const exprt &post, @@ -345,18 +241,6 @@ exprt wp_decl( return wp_assign(assignment, post, ns); } -/*******************************************************************\ - -Function: wp - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - exprt wp( const codet &code, const exprt &post, diff --git a/src/goto-programs/wp.h b/src/goto-programs/wp.h index 741298b9507..836832efbc1 100644 --- a/src/goto-programs/wp.h +++ b/src/goto-programs/wp.h @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Weakest Preconditions + #ifndef CPROVER_GOTO_PROGRAMS_WP_H #define CPROVER_GOTO_PROGRAMS_WP_H diff --git a/src/goto-programs/write_goto_binary.cpp b/src/goto-programs/write_goto_binary.cpp index f5649e992d3..045aa9984fa 100644 --- a/src/goto-programs/write_goto_binary.cpp +++ b/src/goto-programs/write_goto_binary.cpp @@ -6,6 +6,9 @@ Author: CM Wintersteiger \*******************************************************************/ +/// \file +/// Write GOTO binaries + #include #include @@ -14,18 +17,7 @@ Author: CM Wintersteiger #include "write_goto_binary.h" -/*******************************************************************\ - -Function: goto_programt::write_goto_binary_v3 - - Inputs: - - Outputs: - - Purpose: Writes a goto program to disc, using goto binary format ver 2 - -\*******************************************************************/ - +/// Writes a goto program to disc, using goto binary format ver 2 bool write_goto_binary_v3( std::ostream &out, const symbol_tablet &lsymbol_table, @@ -127,18 +119,7 @@ bool write_goto_binary_v3( return false; } -/*******************************************************************\ - -Function: goto_programt::write_goto_binary - - Inputs: - - Outputs: - - Purpose: Writes a goto program to disc - -\*******************************************************************/ - +/// Writes a goto program to disc bool write_goto_binary( std::ostream &out, const symbol_tablet &lsymbol_table, @@ -172,18 +153,7 @@ bool write_goto_binary( return false; } -/*******************************************************************\ - -Function: goto_programt::write_goto_binary - - Inputs: - - Outputs: - - Purpose: Writes a goto program to disc - -\*******************************************************************/ - +/// Writes a goto program to disc bool write_goto_binary( const std::string &filename, const symbol_tablet &symbol_table, diff --git a/src/goto-programs/write_goto_binary.h b/src/goto-programs/write_goto_binary.h index 5b5f0aef18c..fd3acd9cb77 100644 --- a/src/goto-programs/write_goto_binary.h +++ b/src/goto-programs/write_goto_binary.h @@ -6,6 +6,9 @@ Author: CM Wintersteiger \*******************************************************************/ +/// \file +/// Write GOTO binaries + #ifndef CPROVER_GOTO_PROGRAMS_WRITE_GOTO_BINARY_H #define CPROVER_GOTO_PROGRAMS_WRITE_GOTO_BINARY_H diff --git a/src/goto-programs/xml_goto_trace.cpp b/src/goto-programs/xml_goto_trace.cpp index 8b1bdb0e885..25e61157e9d 100644 --- a/src/goto-programs/xml_goto_trace.cpp +++ b/src/goto-programs/xml_goto_trace.cpp @@ -8,6 +8,9 @@ Author: Daniel Kroening \*******************************************************************/ +/// \file +/// Traces of GOTO Programs + #include #include @@ -18,18 +21,6 @@ Author: Daniel Kroening #include "xml_goto_trace.h" -/*******************************************************************\ - -Function: convert - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void convert( const namespacet &ns, const goto_tracet &goto_trace, diff --git a/src/goto-programs/xml_goto_trace.h b/src/goto-programs/xml_goto_trace.h index 123e0d69877..ce77b09c450 100644 --- a/src/goto-programs/xml_goto_trace.h +++ b/src/goto-programs/xml_goto_trace.h @@ -8,6 +8,9 @@ Date: November 2005 \*******************************************************************/ +/// \file +/// Traces of GOTO Programs + #ifndef CPROVER_GOTO_PROGRAMS_XML_GOTO_TRACE_H #define CPROVER_GOTO_PROGRAMS_XML_GOTO_TRACE_H diff --git a/src/goto-symex/adjust_float_expressions.cpp b/src/goto-symex/adjust_float_expressions.cpp index 46dee137447..67eb4a06b56 100644 --- a/src/goto-symex/adjust_float_expressions.cpp +++ b/src/goto-symex/adjust_float_expressions.cpp @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Symbolic Execution + #include #include #include @@ -17,18 +20,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "adjust_float_expressions.h" -/*******************************************************************\ - -Function: have_to_adjust_float_expressions - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - static bool have_to_adjust_float_expressions( const exprt &expr, const namespacet &ns) @@ -84,19 +75,8 @@ static bool have_to_adjust_float_expressions( return false; } -/*******************************************************************\ - -Function: adjust_float_expressions - - Inputs: - - Outputs: - - Purpose: This adds the rounding mode to floating-point operations, - including those in vectors and complex numbers. - -\*******************************************************************/ - +/// This adds the rounding mode to floating-point operations, including those in +/// vectors and complex numbers. void adjust_float_expressions( exprt &expr, const namespacet &ns) @@ -199,18 +179,6 @@ void adjust_float_expressions( } } -/*******************************************************************\ - -Function: adjust_float_expressions - -Inputs: - -Outputs: - -Purpose: - -\*******************************************************************/ - static void adjust_float_expressions( goto_functionst::goto_functiont &goto_function, const namespacet &ns) @@ -222,18 +190,6 @@ static void adjust_float_expressions( } } -/*******************************************************************\ - -Function: adjust_float_expressions - -Inputs: - -Outputs: - -Purpose: - -\*******************************************************************/ - void adjust_float_expressions( goto_functionst &goto_functions, const namespacet &ns) @@ -242,18 +198,6 @@ void adjust_float_expressions( adjust_float_expressions(it->second, ns); } -/*******************************************************************\ - -Function: adjust_float_expressions - -Inputs: - -Outputs: - -Purpose: - -\*******************************************************************/ - void adjust_float_expressions(goto_modelt &goto_model) { namespacet ns(goto_model.symbol_table); diff --git a/src/goto-symex/adjust_float_expressions.h b/src/goto-symex/adjust_float_expressions.h index f8547c59fa8..5cfd01d740f 100644 --- a/src/goto-symex/adjust_float_expressions.h +++ b/src/goto-symex/adjust_float_expressions.h @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Symbolic Execution + #ifndef CPROVER_GOTO_SYMEX_ADJUST_FLOAT_EXPRESSIONS_H #define CPROVER_GOTO_SYMEX_ADJUST_FLOAT_EXPRESSIONS_H diff --git a/src/goto-symex/auto_objects.cpp b/src/goto-symex/auto_objects.cpp index 1b3e6f2d636..dab9cdfa9b3 100644 --- a/src/goto-symex/auto_objects.cpp +++ b/src/goto-symex/auto_objects.cpp @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Symbolic Execution of ANSI-C + #include #include #include @@ -13,18 +16,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "goto_symex.h" -/*******************************************************************\ - -Function: goto_symext::make_auto_object - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - exprt goto_symext::make_auto_object(const typet &type) { dynamic_counter++; @@ -43,18 +34,6 @@ exprt goto_symext::make_auto_object(const typet &type) return symbol_exprt(symbol.name, symbol.type); } -/*******************************************************************\ - -Function: goto_symext::initialize_auto_object - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_symext::initialize_auto_object( const exprt &expr, statet &state) @@ -101,18 +80,6 @@ void goto_symext::initialize_auto_object( } } -/*******************************************************************\ - -Function: goto_symext::trigger_auto_object - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_symext::trigger_auto_object( const exprt &expr, statet &state) diff --git a/src/goto-symex/build_goto_trace.cpp b/src/goto-symex/build_goto_trace.cpp index d5c7b62c60a..6139c4dcdab 100644 --- a/src/goto-symex/build_goto_trace.cpp +++ b/src/goto-symex/build_goto_trace.cpp @@ -8,6 +8,9 @@ Author: Daniel Kroening \*******************************************************************/ +/// \file +/// Traces of GOTO Programs + #include #include @@ -21,18 +24,6 @@ Author: Daniel Kroening #include "build_goto_trace.h" -/*******************************************************************\ - -Function: build_full_lhs_rec - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - exprt build_full_lhs_rec( const prop_convt &prop_conv, const namespacet &ns, @@ -110,18 +101,6 @@ exprt build_full_lhs_rec( return src_original; } -/*******************************************************************\ - -Function: adjust_lhs_object - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - exprt adjust_lhs_object( const prop_convt &prop_conv, const namespacet &ns, @@ -130,19 +109,8 @@ exprt adjust_lhs_object( return nil_exprt(); } -/*******************************************************************\ - -Function: set_internal_dynamic_object - - Inputs: - - Outputs: - - Purpose: set internal field for variable assignment related to - dynamic_object[0-9] and dynamic_[0-9]_array. - -\*******************************************************************/ - +/// set internal field for variable assignment related to dynamic_object[0-9] +/// and dynamic_[0-9]_array. void set_internal_dynamic_object( const exprt &expr, goto_trace_stept &goto_trace_step, @@ -166,20 +134,8 @@ void set_internal_dynamic_object( } } -/*******************************************************************\ - -Function: update_internal_field - - Inputs: - - Outputs: - - Purpose: set internal for variables assignments related to - dynamic_object and CPROVER internal functions - (e.g., __CPROVER_initialize) - -\*******************************************************************/ - +/// set internal for variables assignments related to dynamic_object and CPROVER +/// internal functions (e.g., __CPROVER_initialize) void update_internal_field( const symex_target_equationt::SSA_stept &SSA_step, goto_trace_stept &goto_trace_step, @@ -214,18 +170,6 @@ void update_internal_field( } } -/*******************************************************************\ - -Function: build_goto_trace - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void build_goto_trace( const symex_target_equationt &target, symex_target_equationt::SSA_stepst::const_iterator end_step, @@ -403,18 +347,6 @@ void build_goto_trace( s_it.step_nr=++step_nr; } -/*******************************************************************\ - -Function: build_goto_trace - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void build_goto_trace( const symex_target_equationt &target, const prop_convt &prop_conv, diff --git a/src/goto-symex/build_goto_trace.h b/src/goto-symex/build_goto_trace.h index f7350d41ffe..16df35f7e7e 100644 --- a/src/goto-symex/build_goto_trace.h +++ b/src/goto-symex/build_goto_trace.h @@ -8,6 +8,9 @@ Date: July 2005 \*******************************************************************/ +/// \file +/// Traces of GOTO Programs + #ifndef CPROVER_GOTO_SYMEX_BUILD_GOTO_TRACE_H #define CPROVER_GOTO_SYMEX_BUILD_GOTO_TRACE_H diff --git a/src/goto-symex/goto_symex.cpp b/src/goto-symex/goto_symex.cpp index a3d55220e8d..0ed472967c1 100644 --- a/src/goto-symex/goto_symex.cpp +++ b/src/goto-symex/goto_symex.cpp @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Symbolic Execution + #include #include "goto_symex.h" @@ -13,36 +16,12 @@ Author: Daniel Kroening, kroening@kroening.com unsigned goto_symext::nondet_count=0; unsigned goto_symext::dynamic_counter=0; -/*******************************************************************\ - -Function: goto_symext::do_simplify - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_symext::do_simplify(exprt &expr) { if(options.get_bool_option("simplify")) simplify(expr, ns); } -/*******************************************************************\ - -Function: goto_symext::replace_nondet - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_symext::replace_nondet(exprt &expr) { if(expr.id()==ID_side_effect && diff --git a/src/goto-symex/goto_symex.h b/src/goto-symex/goto_symex.h index f8c2cda0bf9..f45d722ebf7 100644 --- a/src/goto-symex/goto_symex.h +++ b/src/goto-symex/goto_symex.h @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Symbolic Execution + #ifndef CPROVER_GOTO_SYMEX_GOTO_SYMEX_H #define CPROVER_GOTO_SYMEX_GOTO_SYMEX_H diff --git a/src/goto-symex/goto_symex_state.cpp b/src/goto-symex/goto_symex_state.cpp index 7b9b206902b..98976299aed 100644 --- a/src/goto-symex/goto_symex_state.cpp +++ b/src/goto-symex/goto_symex_state.cpp @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Symbolic Execution + #include #include #include @@ -17,18 +20,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "goto_symex_state.h" -/*******************************************************************\ - -Function: goto_symex_statet::goto_symex_statet - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - goto_symex_statet::goto_symex_statet(): depth(0), symex_target(NULL), @@ -40,18 +31,6 @@ goto_symex_statet::goto_symex_statet(): new_frame(); } -/*******************************************************************\ - -Function: goto_symex_statet::initialize - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_symex_statet::initialize(const goto_functionst &goto_functions) { goto_functionst::function_mapt::const_iterator it= @@ -67,18 +46,6 @@ void goto_symex_statet::initialize(const goto_functionst &goto_functions) top().calling_location.pc=top().end_of_function; } -/*******************************************************************\ - -Function: goto_symex_statet::level0t::operator() - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_symex_statet::level0t::operator()( ssa_exprt &ssa_expr, const namespacet &ns, @@ -111,18 +78,6 @@ void goto_symex_statet::level0t::operator()( ssa_expr.set_level_0(thread_nr); } -/*******************************************************************\ - -Function: goto_symex_statet::level1t::operator() - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_symex_statet::level1t::operator()(ssa_exprt &ssa_expr) { // already renamed? @@ -139,19 +94,8 @@ void goto_symex_statet::level1t::operator()(ssa_exprt &ssa_expr) ssa_expr.set_level_1(it->second.second); } -/*******************************************************************\ - -Function: goto_symex_statet::constant_propagation - - Inputs: - - Outputs: - - Purpose: This function determines what expressions are to - be propagated as "constants" - -\*******************************************************************/ - +/// This function determines what expressions are to be propagated as +/// "constants" bool goto_symex_statet::constant_propagation(const exprt &expr) const { if(expr.is_constant()) @@ -240,19 +184,7 @@ bool goto_symex_statet::constant_propagation(const exprt &expr) const return false; } -/*******************************************************************\ - -Function: goto_symex_statet::constant_propagation_reference - - Inputs: - - Outputs: - - Purpose: this function determines which reference-typed - expressions are constant - -\*******************************************************************/ - +/// this function determines which reference-typed expressions are constant bool goto_symex_statet::constant_propagation_reference(const exprt &expr) const { if(expr.id()==ID_symbol) @@ -277,18 +209,7 @@ bool goto_symex_statet::constant_propagation_reference(const exprt &expr) const return false; } -/*******************************************************************\ - -Function: goto_symex_statet::assignment - - Inputs: - - Outputs: - - Purpose: write to a variable - -\*******************************************************************/ - +/// write to a variable static bool check_renaming(const exprt &expr); static bool check_renaming(const typet &type) @@ -461,18 +382,6 @@ void goto_symex_statet::assignment( #endif } -/*******************************************************************\ - -Function: goto_symex_statet::propagationt::operator() - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_symex_statet::propagationt::operator()(exprt &expr) { if(expr.id()==ID_symbol) @@ -494,18 +403,6 @@ void goto_symex_statet::propagationt::operator()(exprt &expr) } } -/*******************************************************************\ - -Function: goto_symex_statet::set_ssa_indices - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_symex_statet::set_ssa_indices( ssa_exprt &ssa_expr, const namespacet &ns, @@ -539,18 +436,6 @@ void goto_symex_statet::set_ssa_indices( } } -/*******************************************************************\ - -Function: goto_symex_statet::rename - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_symex_statet::rename( exprt &expr, const namespacet &ns, @@ -642,18 +527,7 @@ void goto_symex_statet::rename( } } -/*******************************************************************\ - -Function: goto_symex_statet::l2_thread_read_encoding - - Inputs: - - Outputs: - - Purpose: thread encoding - -\*******************************************************************/ - +/// thread encoding bool goto_symex_statet::l2_thread_read_encoding( ssa_exprt &expr, const namespacet &ns) @@ -798,18 +672,7 @@ bool goto_symex_statet::l2_thread_read_encoding( return true; } -/*******************************************************************\ - -Function: goto_symex_statet::l2_thread_write_encoding - - Inputs: - - Outputs: - - Purpose: thread encoding - -\*******************************************************************/ - +/// thread encoding bool goto_symex_statet::l2_thread_write_encoding( const ssa_exprt &expr, const namespacet &ns) @@ -846,18 +709,6 @@ bool goto_symex_statet::l2_thread_write_encoding( return threads.size()>1; } -/*******************************************************************\ - -Function: goto_symex_statet::rename_address - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_symex_statet::rename_address( exprt &expr, const namespacet &ns, @@ -935,18 +786,6 @@ void goto_symex_statet::rename_address( } } -/*******************************************************************\ - -Function: goto_symex_statet::rename - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_symex_statet::rename( typet &type, const irep_idt &l1_identifier, @@ -1018,18 +857,6 @@ void goto_symex_statet::rename( l1_type_entry.first->second=type; } -/*******************************************************************\ - -Function: goto_symex_statet::get_original_name - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_symex_statet::get_original_name(exprt &expr) const { get_original_name(expr.type()); @@ -1042,18 +869,6 @@ void goto_symex_statet::get_original_name(exprt &expr) const get_original_name(*it); } -/*******************************************************************\ - -Function: goto_symex_statet::get_original_name - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_symex_statet::get_original_name(typet &type) const { // rename all the symbols with their last known value @@ -1082,18 +897,6 @@ void goto_symex_statet::get_original_name(typet &type) const } } -/*******************************************************************\ - -Function: goto_symex_statet::get_l1_name - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_symex_statet::get_l1_name(exprt &expr) const { // do not reset the type ! @@ -1106,18 +909,6 @@ void goto_symex_statet::get_l1_name(exprt &expr) const get_l1_name(*it); } -/*******************************************************************\ - -Function: goto_symex_statet::switch_to_thread - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_symex_statet::switch_to_thread(unsigned t) { assert(source.thread_nr #include "memory_model.h" -/*******************************************************************\ - -Function: memory_model_baset::memory_model_baset - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - memory_model_baset::memory_model_baset(const namespacet &_ns): partial_order_concurrencyt(_ns), var_cnt(0) { } -/*******************************************************************\ - -Function: memory_model_baset::~memory_model_baset - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - memory_model_baset::~memory_model_baset() { } -/*******************************************************************\ - -Function: memory_model_baset::nondet_bool_symbol - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - symbol_exprt memory_model_baset::nondet_bool_symbol( const std::string &prefix) { @@ -64,18 +31,6 @@ symbol_exprt memory_model_baset::nondet_bool_symbol( bool_typet()); } -/*******************************************************************\ - -Function: memory_model_baset::po - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool memory_model_baset::po(event_it e1, event_it e2) { // within same thread @@ -88,18 +43,6 @@ bool memory_model_baset::po(event_it e1, event_it e2) } } -/*******************************************************************\ - -Function: memory_model_baset::read_from - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void memory_model_baset::read_from(symex_target_equationt &equation) { // We iterate over all the reads, and diff --git a/src/goto-symex/memory_model.h b/src/goto-symex/memory_model.h index b72c3672613..083a75efa5b 100644 --- a/src/goto-symex/memory_model.h +++ b/src/goto-symex/memory_model.h @@ -6,6 +6,9 @@ Author: Michael Tautschnig, michael.tautschnig@cs.ox.ac.uk \*******************************************************************/ +/// \file +/// Memory models for partial order concurrency + #ifndef CPROVER_GOTO_SYMEX_MEMORY_MODEL_H #define CPROVER_GOTO_SYMEX_MEMORY_MODEL_H diff --git a/src/goto-symex/memory_model_pso.cpp b/src/goto-symex/memory_model_pso.cpp index 629451fc80b..2f4b59c8682 100644 --- a/src/goto-symex/memory_model_pso.cpp +++ b/src/goto-symex/memory_model_pso.cpp @@ -6,19 +6,10 @@ Author: Michael Tautschnig, michael.tautschnig@cs.ox.ac.uk \*******************************************************************/ -#include "memory_model_pso.h" - -/*******************************************************************\ - -Function: memory_model_psot::operator() - - Inputs: +/// \file +/// Memory model for partial order concurrency - Outputs: - - Purpose: - -\*******************************************************************/ +#include "memory_model_pso.h" void memory_model_psot::operator()(symex_target_equationt &equation) { @@ -35,18 +26,6 @@ void memory_model_psot::operator()(symex_target_equationt &equation) #endif } -/*******************************************************************\ - -Function: memory_model_psot::program_order_is_relaxed - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool memory_model_psot::program_order_is_relaxed( partial_order_concurrencyt::event_it e1, partial_order_concurrencyt::event_it e2) const diff --git a/src/goto-symex/memory_model_pso.h b/src/goto-symex/memory_model_pso.h index 386a035bdcb..ca3cab0cd14 100644 --- a/src/goto-symex/memory_model_pso.h +++ b/src/goto-symex/memory_model_pso.h @@ -6,6 +6,9 @@ Author: Michael Tautschnig, michael.tautschnig@cs.ox.ac.uk \*******************************************************************/ +/// \file +/// Memory models for partial order concurrency + #ifndef CPROVER_GOTO_SYMEX_MEMORY_MODEL_PSO_H #define CPROVER_GOTO_SYMEX_MEMORY_MODEL_PSO_H diff --git a/src/goto-symex/memory_model_sc.cpp b/src/goto-symex/memory_model_sc.cpp index 7c131269802..3afac35b90f 100644 --- a/src/goto-symex/memory_model_sc.cpp +++ b/src/goto-symex/memory_model_sc.cpp @@ -6,22 +6,13 @@ Author: Michael Tautschnig, michael.tautschnig@cs.ox.ac.uk \*******************************************************************/ +/// \file +/// Memory model for partial order concurrency + #include #include "memory_model_sc.h" -/*******************************************************************\ - -Function: memory_model_sct::operator() - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void memory_model_sct::operator()(symex_target_equationt &equation) { print(8, "Adding SC constraints"); @@ -35,36 +26,12 @@ void memory_model_sct::operator()(symex_target_equationt &equation) from_read(equation); } -/*******************************************************************\ - -Function: memory_model_sct::before - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - exprt memory_model_sct::before(event_it e1, event_it e2) { return partial_order_concurrencyt::before( e1, e2, AX_PROPAGATION); } -/*******************************************************************\ - -Function: memory_model_sct::program_order_is_relaxed - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool memory_model_sct::program_order_is_relaxed( partial_order_concurrencyt::event_it e1, partial_order_concurrencyt::event_it e2) const @@ -75,18 +42,6 @@ bool memory_model_sct::program_order_is_relaxed( return false; } -/*******************************************************************\ - -Function: memory_model_sct::build_per_thread_map - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void memory_model_sct::build_per_thread_map( const symex_target_equationt &equation, per_thread_mapt &dest) const @@ -108,18 +63,6 @@ void memory_model_sct::build_per_thread_map( } } -/*******************************************************************\ - -Function: memory_model_sct::thread_spawn - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void memory_model_sct::thread_spawn( symex_target_equationt &equation, const per_thread_mapt &per_thread_map) @@ -203,18 +146,6 @@ void memory_model_sct::thread_spawn( } #endif -/*******************************************************************\ - -Function: memory_model_sct::program_order - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void memory_model_sct::program_order( symex_target_equationt &equation) { @@ -262,18 +193,6 @@ void memory_model_sct::program_order( } } -/*******************************************************************\ - -Function: memory_model_sct::write_serialization_external - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void memory_model_sct::write_serialization_external( symex_target_equationt &equation) { @@ -326,18 +245,6 @@ void memory_model_sct::write_serialization_external( } } -/*******************************************************************\ - -Function: memory_model_sct::from_read - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void memory_model_sct::from_read(symex_target_equationt &equation) { // from-read: (w', w) in ws and (w', r) in rf -> (r, w) in fr diff --git a/src/goto-symex/memory_model_sc.h b/src/goto-symex/memory_model_sc.h index 66709ae22be..33e2edcb461 100644 --- a/src/goto-symex/memory_model_sc.h +++ b/src/goto-symex/memory_model_sc.h @@ -6,6 +6,9 @@ Author: Michael Tautschnig, michael.tautschnig@cs.ox.ac.uk \*******************************************************************/ +/// \file +/// Memory models for partial order concurrency + #ifndef CPROVER_GOTO_SYMEX_MEMORY_MODEL_SC_H #define CPROVER_GOTO_SYMEX_MEMORY_MODEL_SC_H diff --git a/src/goto-symex/memory_model_tso.cpp b/src/goto-symex/memory_model_tso.cpp index 1fec15c9bdd..f01b3900372 100644 --- a/src/goto-symex/memory_model_tso.cpp +++ b/src/goto-symex/memory_model_tso.cpp @@ -6,23 +6,14 @@ Author: Michael Tautschnig, michael.tautschnig@cs.ox.ac.uk \*******************************************************************/ +/// \file +/// Memory model for partial order concurrency + #include #include #include "memory_model_tso.h" -/*******************************************************************\ - -Function: memory_model_tsot::operator() - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void memory_model_tsot::operator()(symex_target_equationt &equation) { print(8, "Adding TSO constraints"); @@ -38,36 +29,12 @@ void memory_model_tsot::operator()(symex_target_equationt &equation) #endif } -/*******************************************************************\ - -Function: memory_model_tsot::before - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - exprt memory_model_tsot::before(event_it e1, event_it e2) { return partial_order_concurrencyt::before( e1, e2, AX_SC_PER_LOCATION | AX_PROPAGATION); } -/*******************************************************************\ - -Function: memory_model_tsot::program_order_is_relaxed - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool memory_model_tsot::program_order_is_relaxed( partial_order_concurrencyt::event_it e1, partial_order_concurrencyt::event_it e2) const @@ -84,18 +51,6 @@ bool memory_model_tsot::program_order_is_relaxed( return e1->is_shared_write() && e2->is_shared_read(); } -/*******************************************************************\ - -Function: memory_model_tsot::program_order - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void memory_model_tsot::program_order( symex_target_equationt &equation) { diff --git a/src/goto-symex/memory_model_tso.h b/src/goto-symex/memory_model_tso.h index 11de873e02a..87592e471f6 100644 --- a/src/goto-symex/memory_model_tso.h +++ b/src/goto-symex/memory_model_tso.h @@ -6,6 +6,9 @@ Author: Michael Tautschnig, michael.tautschnig@cs.ox.ac.uk \*******************************************************************/ +/// \file +/// Memory models for partial order concurrency + #ifndef CPROVER_GOTO_SYMEX_MEMORY_MODEL_TSO_H #define CPROVER_GOTO_SYMEX_MEMORY_MODEL_TSO_H diff --git a/src/goto-symex/partial_order_concurrency.cpp b/src/goto-symex/partial_order_concurrency.cpp index 568a799b098..8cb323fec37 100644 --- a/src/goto-symex/partial_order_concurrency.cpp +++ b/src/goto-symex/partial_order_concurrency.cpp @@ -6,6 +6,9 @@ Author: Michael Tautschnig, michael.tautschnig@cs.ox.ac.uk \*******************************************************************/ +/// \file +/// Add constraints to equation encoding partial orders on events + #include #include @@ -13,51 +16,15 @@ Author: Michael Tautschnig, michael.tautschnig@cs.ox.ac.uk #include "partial_order_concurrency.h" -/*******************************************************************\ - -Function: partial_order_concurrencyt::~partial_order_concurrencyt - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - partial_order_concurrencyt::partial_order_concurrencyt( const namespacet &_ns):ns(_ns) { } -/*******************************************************************\ - -Function: partial_order_concurrencyt::~partial_order_concurrencyt - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - partial_order_concurrencyt::~partial_order_concurrencyt() { } -/*******************************************************************\ - -Function: partial_order_concurrencyt::add_init_writes - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void partial_order_concurrencyt::add_init_writes( symex_target_equationt &equation) { @@ -107,18 +74,6 @@ void partial_order_concurrencyt::add_init_writes( equation.SSA_steps.splice(equation.SSA_steps.begin(), init_steps); } -/*******************************************************************\ - -Function: partial_order_concurrencyt::build_event_lists - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void partial_order_concurrencyt::build_event_lists( symex_target_equationt &equation) { @@ -169,18 +124,6 @@ void partial_order_concurrencyt::build_event_lists( } } -/*******************************************************************\ - -Function: partial_order_concurrencyt::rw_clock_id - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - irep_idt partial_order_concurrencyt::rw_clock_id( event_it event, axiomt axiom) @@ -195,18 +138,6 @@ irep_idt partial_order_concurrencyt::rw_clock_id( return ""; } -/*******************************************************************\ - -Function: partial_order_concurrencyt::clock - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - symbol_exprt partial_order_concurrencyt::clock( event_it event, axiomt axiom) @@ -230,18 +161,6 @@ symbol_exprt partial_order_concurrencyt::clock( return symbol_exprt(identifier, clock_type); } -/*******************************************************************\ - -Function: partial_order_concurrencyt::build_clock_type - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void partial_order_concurrencyt::build_clock_type( const symex_target_equationt &equation) { @@ -252,18 +171,6 @@ void partial_order_concurrencyt::build_clock_type( clock_type=unsignedbv_typet(integer2unsigned(width)); } -/*******************************************************************\ - -Function: partial_order_concurrencyt::before - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - exprt partial_order_concurrencyt::before( event_it e1, event_it e2, unsigned axioms) { @@ -298,18 +205,6 @@ exprt partial_order_concurrencyt::before( return conjunction(ops); } -/*******************************************************************\ - -Function: partial_order_concurrencyt::add_constraint - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void partial_order_concurrencyt::add_constraint( symex_target_equationt &equation, const exprt &cond, diff --git a/src/goto-symex/partial_order_concurrency.h b/src/goto-symex/partial_order_concurrency.h index 86817ba5360..5163451e210 100644 --- a/src/goto-symex/partial_order_concurrency.h +++ b/src/goto-symex/partial_order_concurrency.h @@ -6,6 +6,9 @@ Author: Michael Tautschnig, michael.tautschnig@cs.ox.ac.uk \*******************************************************************/ +/// \file +/// Add constraints to equation encoding partial orders on events + #ifndef CPROVER_GOTO_SYMEX_PARTIAL_ORDER_CONCURRENCY_H #define CPROVER_GOTO_SYMEX_PARTIAL_ORDER_CONCURRENCY_H diff --git a/src/goto-symex/postcondition.cpp b/src/goto-symex/postcondition.cpp index c93aa52a407..43aa79f6aa5 100644 --- a/src/goto-symex/postcondition.cpp +++ b/src/goto-symex/postcondition.cpp @@ -6,24 +6,15 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Symbolic Execution + #include #include #include "goto_symex_state.h" #include "postcondition.h" -/*******************************************************************\ - - Class: postconditiont - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - class postconditiont { public: @@ -55,18 +46,6 @@ class postconditiont bool is_used(const exprt &expr, const irep_idt &identifier); }; -/*******************************************************************\ - -Function: postcondition - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void postcondition( const namespacet &ns, const value_sett &value_set, @@ -86,18 +65,6 @@ void postcondition( } } -/*******************************************************************\ - -Function: postconditiont::is_used_address_of - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool postconditiont::is_used_address_of( const exprt &expr, const irep_idt &identifier) @@ -128,18 +95,6 @@ bool postconditiont::is_used_address_of( return false; } -/*******************************************************************\ - -Function: postconditiont::compute - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void postconditiont::compute(exprt &dest) { // weaken due to assignment @@ -149,18 +104,6 @@ void postconditiont::compute(exprt &dest) strengthen(dest); } -/*******************************************************************\ - -Function: postconditiont::strengthen - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void postconditiont::weaken(exprt &dest) { if(dest.id()==ID_and && @@ -183,18 +126,6 @@ void postconditiont::weaken(exprt &dest) // otherwise, no weakening needed } -/*******************************************************************\ - -Function: postconditiont::strengthen - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void postconditiont::strengthen(exprt &dest) { const irep_idt &lhs_identifier=SSA_step.ssa_lhs.get_object_name(); @@ -216,18 +147,6 @@ void postconditiont::strengthen(exprt &dest) } } -/*******************************************************************\ - -Function: postconditiont::is_used - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool postconditiont::is_used( const exprt &expr, const irep_idt &identifier) diff --git a/src/goto-symex/postcondition.h b/src/goto-symex/postcondition.h index 3e84235da47..4f154a572cf 100644 --- a/src/goto-symex/postcondition.h +++ b/src/goto-symex/postcondition.h @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Generate Equation using Symbolic Execution + #ifndef CPROVER_GOTO_SYMEX_POSTCONDITION_H #define CPROVER_GOTO_SYMEX_POSTCONDITION_H diff --git a/src/goto-symex/precondition.cpp b/src/goto-symex/precondition.cpp index 15cc3e180a2..091408f0afc 100644 --- a/src/goto-symex/precondition.cpp +++ b/src/goto-symex/precondition.cpp @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Symbolic Execution + #include #include @@ -13,18 +16,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "goto_symex_state.h" #include "precondition.h" -/*******************************************************************\ - - Class: preconditiont - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - class preconditiont { public: @@ -57,18 +48,6 @@ class preconditiont void compute_address_of(exprt &dest); }; -/*******************************************************************\ - -Function: precondition - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void precondition( const namespacet &ns, value_setst &value_sets, @@ -89,18 +68,6 @@ void precondition( } } -/*******************************************************************\ - -Function: preconditiont::compute_address_of - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void preconditiont::compute_address_of(exprt &dest) { if(dest.id()==ID_symbol) @@ -125,35 +92,11 @@ void preconditiont::compute_address_of(exprt &dest) } } -/*******************************************************************\ - -Function: preconditiont::compute - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void preconditiont::compute(exprt &dest) { compute_rec(dest); } -/*******************************************************************\ - -Function: preconditiont::compute_rec - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void preconditiont::compute_rec(exprt &dest) { if(dest.id()==ID_address_of) diff --git a/src/goto-symex/precondition.h b/src/goto-symex/precondition.h index 0d8b0caa23d..8adebcbd8c3 100644 --- a/src/goto-symex/precondition.h +++ b/src/goto-symex/precondition.h @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Generate Equation using Symbolic Execution + #ifndef CPROVER_GOTO_SYMEX_PRECONDITION_H #define CPROVER_GOTO_SYMEX_PRECONDITION_H diff --git a/src/goto-symex/rewrite_union.cpp b/src/goto-symex/rewrite_union.cpp index f0a329af5ae..aa691f17411 100644 --- a/src/goto-symex/rewrite_union.cpp +++ b/src/goto-symex/rewrite_union.cpp @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Symbolic Execution of ANSI-C + #include #include #include @@ -17,18 +20,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "rewrite_union.h" -/*******************************************************************\ - -Function: have_to_rewrite_union - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - static bool have_to_rewrite_union( const exprt &expr, const namespacet &ns) @@ -51,19 +42,8 @@ static bool have_to_rewrite_union( return false; } -/*******************************************************************\ - -Function: rewrite_union - - Inputs: - - Outputs: - - Purpose: We rewrite u.c for unions u into byte_extract(u, 0), - and { .c = v } into byte_update(NIL, 0, v) - -\*******************************************************************/ - +/// We rewrite u.c for unions u into byte_extract(u, 0), and { .c = v } into +/// byte_update(NIL, 0, v) void rewrite_union( exprt &expr, const namespacet &ns) @@ -97,18 +77,6 @@ void rewrite_union( } } -/*******************************************************************\ - -Function: rewrite_union - -Inputs: - -Outputs: - -Purpose: - -\*******************************************************************/ - static void rewrite_union( goto_functionst::goto_functiont &goto_function, const namespacet &ns) @@ -120,18 +88,6 @@ static void rewrite_union( } } -/*******************************************************************\ - -Function: rewrite_union - -Inputs: - -Outputs: - -Purpose: - -\*******************************************************************/ - void rewrite_union( goto_functionst &goto_functions, const namespacet &ns) @@ -140,18 +96,6 @@ void rewrite_union( rewrite_union(it->second, ns); } -/*******************************************************************\ - -Function: rewrite_union - -Inputs: - -Outputs: - -Purpose: - -\*******************************************************************/ - void rewrite_union(goto_modelt &goto_model) { namespacet ns(goto_model.symbol_table); diff --git a/src/goto-symex/rewrite_union.h b/src/goto-symex/rewrite_union.h index 7215e0bf0a4..d2c9b1772b4 100644 --- a/src/goto-symex/rewrite_union.h +++ b/src/goto-symex/rewrite_union.h @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Symbolic Execution + #ifndef CPROVER_GOTO_SYMEX_REWRITE_UNION_H #define CPROVER_GOTO_SYMEX_REWRITE_UNION_H diff --git a/src/goto-symex/slice.cpp b/src/goto-symex/slice.cpp index 483e76211bc..a398264963e 100644 --- a/src/goto-symex/slice.cpp +++ b/src/goto-symex/slice.cpp @@ -6,23 +6,14 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Slicer for symex traces + #include #include "slice.h" #include "symex_slice_class.h" -/*******************************************************************\ - -Function: symex_slicet::get_symbols - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void symex_slicet::get_symbols(const exprt &expr) { get_symbols(expr.type()); @@ -34,35 +25,11 @@ void symex_slicet::get_symbols(const exprt &expr) depends.insert(to_symbol_expr(expr).get_identifier()); } -/*******************************************************************\ - -Function: symex_slicet::get_symbols - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void symex_slicet::get_symbols(const typet &type) { // TODO } -/*******************************************************************\ - -Function: symex_slicet::slice - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void symex_slicet::slice( symex_target_equationt &equation, const expr_listt &exprs) @@ -74,18 +41,6 @@ void symex_slicet::slice( slice(equation); } -/*******************************************************************\ - -Function: symex_slicet::slice - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void symex_slicet::slice(symex_target_equationt &equation) { for(symex_target_equationt::SSA_stepst::reverse_iterator @@ -95,18 +50,6 @@ void symex_slicet::slice(symex_target_equationt &equation) slice(*it); } -/*******************************************************************\ - -Function: symex_slicet::slice - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void symex_slicet::slice(symex_target_equationt::SSA_stept &SSA_step) { get_symbols(SSA_step.guard); @@ -165,18 +108,6 @@ void symex_slicet::slice(symex_target_equationt::SSA_stept &SSA_step) } } -/*******************************************************************\ - -Function: symex_slicet::slice_assignment - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void symex_slicet::slice_assignment( symex_target_equationt::SSA_stept &SSA_step) { @@ -192,18 +123,6 @@ void symex_slicet::slice_assignment( get_symbols(SSA_step.ssa_rhs); } -/*******************************************************************\ - -Function: symex_slicet::slice_decl - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void symex_slicet::slice_decl( symex_target_equationt::SSA_stept &SSA_step) { @@ -217,20 +136,11 @@ void symex_slicet::slice_decl( } } -/*******************************************************************\ - -Function: symex_slice_classt::collect_open_variables - - Inputs: equation - symex trace - open_variables - target set - - Outputs: None. But open_variables is modified as a side-effect. - - Purpose: Collect the open variables, i.e., variables that are used - in RHS but never written in LHS - -\*******************************************************************/ - +/// Collect the open variables, i.e., variables that are used in RHS but never +/// written in LHS +/// \param equation: symex trace +/// \param open_variables: target set +/// \return None. But open_variables is modified as a side-effect. void symex_slicet::collect_open_variables( const symex_target_equationt &equation, symbol_sett &open_variables) @@ -295,38 +205,17 @@ void symex_slicet::collect_open_variables( open_variables.erase(lhs.begin(), lhs.end()); } -/*******************************************************************\ - -Function: slice - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void slice(symex_target_equationt &equation) { symex_slicet symex_slice; symex_slice.slice(equation); } -/*******************************************************************\ - -Function: collect_open_variables - - Inputs: equation - symex trace - open_variables - target set - - Outputs: None. But open_variables is modified as a side-effect. - - Purpose: Collect the open variables, i.e. variables that are used - in RHS but never written in LHS - -\*******************************************************************/ - +/// Collect the open variables, i.e. variables that are used in RHS but never +/// written in LHS +/// \param equation: symex trace +/// \param open_variables: target set +/// \return None. But open_variables is modified as a side-effect. void collect_open_variables( const symex_target_equationt &equation, symbol_sett &open_variables) @@ -335,19 +224,10 @@ void collect_open_variables( symex_slice.collect_open_variables(equation, open_variables); } -/*******************************************************************\ - -Function: slice - - Inputs: equation - symex trace to be sliced - expression - list of expressions, targets for slicing - - Outputs: None. But equation is modified as a side-effect. - - Purpose: Slice the symex trace with respect to a list of expressions - -\*******************************************************************/ - +/// Slice the symex trace with respect to a list of expressions +/// \param equation: symex trace to be sliced +/// \param expression: list of expressions, targets for slicing +/// \return None. But equation is modified as a side-effect. void slice(symex_target_equationt &equation, const expr_listt &expressions) { @@ -355,18 +235,6 @@ void slice(symex_target_equationt &equation, symex_slice.slice(equation, expressions); } -/*******************************************************************\ - -Function: simple_slice - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void simple_slice(symex_target_equationt &equation) { // just find the last assertion diff --git a/src/goto-symex/slice.h b/src/goto-symex/slice.h index 1fd15969274..2bc887a0c9f 100644 --- a/src/goto-symex/slice.h +++ b/src/goto-symex/slice.h @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Slicer for symex traces + #ifndef CPROVER_GOTO_SYMEX_SLICE_H #define CPROVER_GOTO_SYMEX_SLICE_H diff --git a/src/goto-symex/slice_by_trace.cpp b/src/goto-symex/slice_by_trace.cpp index 07a4f81b96a..20bce31beb8 100644 --- a/src/goto-symex/slice_by_trace.cpp +++ b/src/goto-symex/slice_by_trace.cpp @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Slicer for symex traces + #include #include #include @@ -21,18 +24,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "slice_by_trace.h" -/*******************************************************************\ - -Function: slice_by_trace - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void symex_slice_by_tracet::slice_by_trace( std::string trace_files, symex_target_equationt &equation) @@ -127,18 +118,6 @@ void symex_slice_by_tracet::slice_by_trace( std::cout << "Finished slicing by trace..." << std::endl; } -/*******************************************************************\ - -Function: read_trace - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void symex_slice_by_tracet::read_trace(std::string filename) { std::cout << "Reading trace from file " << filename << std::endl; @@ -184,18 +163,6 @@ void symex_slice_by_tracet::read_trace(std::string filename) t.push_back(t_e); } -/*******************************************************************\ - -Function: parse_alphabet - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool symex_slice_by_tracet::parse_alphabet(std::string read_line) { if((read_line==":") || (read_line == ":exact") || @@ -216,18 +183,6 @@ bool symex_slice_by_tracet::parse_alphabet(std::string read_line) return false; } -/*******************************************************************\ - -Function: parse_events - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void symex_slice_by_tracet::parse_events(std::string read_line) { if(read_line=="") @@ -276,18 +231,6 @@ void symex_slice_by_tracet::parse_events(std::string read_line) sigma.push_back(es); } -/*******************************************************************\ - -Function: compute_ts_back - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void symex_slice_by_tracet::compute_ts_back( symex_target_equationt &equation) { @@ -430,35 +373,11 @@ void symex_slice_by_tracet::compute_ts_back( } } -/*******************************************************************\ - -Function: compute_ts_fd - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void symex_slice_by_tracet::compute_ts_fd( symex_target_equationt &equation) { } -/*******************************************************************\ - -Function: slice_SSA_steps - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void symex_slice_by_tracet::slice_SSA_steps( symex_target_equationt &equation, std::set implications) @@ -576,18 +495,6 @@ void symex_slice_by_tracet::slice_SSA_steps( << " non-trace, non-location SSA_steps)" << std::endl; } -/*******************************************************************\ - -Function: matches - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool symex_slice_by_tracet::matches( event_sett s, irep_idt event) @@ -596,18 +503,6 @@ bool symex_slice_by_tracet::matches( return ((s.second && present) || (!s.second && !present)); } -/*******************************************************************\ - -Function: assign_merges - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void symex_slice_by_tracet::assign_merges( symex_target_equationt &equation) { @@ -638,18 +533,6 @@ void symex_slice_by_tracet::assign_merges( } } -/*******************************************************************\ - -Function: implied_guards - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::set symex_slice_by_tracet::implied_guards(exprt e) { std::set s; @@ -732,18 +615,6 @@ std::set symex_slice_by_tracet::implied_guards(exprt e) return s; } -/*******************************************************************\ - -Function: symex_slice_by_tracet::implies_false - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool symex_slice_by_tracet::implies_false(const exprt e) { std::set imps=implied_guards(e); diff --git a/src/goto-symex/slice_by_trace.h b/src/goto-symex/slice_by_trace.h index 8223e6589e1..eb5f706694c 100644 --- a/src/goto-symex/slice_by_trace.h +++ b/src/goto-symex/slice_by_trace.h @@ -6,6 +6,9 @@ Author: Alex Groce (agroce@gmail.com) \*******************************************************************/ +/// \file +/// Slicer for matching with trace files + #ifndef CPROVER_GOTO_SYMEX_SLICE_BY_TRACE_H #define CPROVER_GOTO_SYMEX_SLICE_BY_TRACE_H diff --git a/src/goto-symex/symex_assign.cpp b/src/goto-symex/symex_assign.cpp index 61b6ad28488..4daf5a9303c 100644 --- a/src/goto-symex/symex_assign.cpp +++ b/src/goto-symex/symex_assign.cpp @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Symbolic Execution + #include #include @@ -16,18 +19,6 @@ Author: Daniel Kroening, kroening@kroening.com // #define USE_UPDATE -/*******************************************************************\ - -Function: goto_symext::symex_assign_rec - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_symext::symex_assign_rec( statet &state, const code_assignt &code) @@ -40,18 +31,6 @@ void goto_symext::symex_assign_rec( symex_assign(state, deref_code); } -/*******************************************************************\ - -Function: goto_symext::symex_assign - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_symext::symex_assign( statet &state, const code_assignt &code) @@ -114,18 +93,6 @@ void goto_symext::symex_assign( } } -/*******************************************************************\ - -Function: goto_symext::add_to_lhs - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - exprt goto_symext::add_to_lhs( const exprt &lhs, const exprt &what) @@ -156,18 +123,6 @@ exprt goto_symext::add_to_lhs( return new_lhs; } -/*******************************************************************\ - -Function: goto_symext::symex_assign_rec - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_symext::symex_assign_rec( statet &state, const exprt &lhs, @@ -246,18 +201,6 @@ void goto_symext::symex_assign_rec( throw "assignment to `"+lhs.id_string()+"' not handled"; } -/*******************************************************************\ - -Function: goto_symext::symex_assign_symbol - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_symext::symex_assign_symbol( statet &state, const ssa_exprt &lhs, // L1 @@ -314,18 +257,6 @@ void goto_symext::symex_assign_symbol( assignment_type); } -/*******************************************************************\ - -Function: goto_symext::symex_assign_typecast - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_symext::symex_assign_typecast( statet &state, const typecast_exprt &lhs, @@ -347,18 +278,6 @@ void goto_symext::symex_assign_typecast( state, lhs.op0(), new_full_lhs, rhs_typecasted, guard, assignment_type); } -/*******************************************************************\ - -Function: goto_symext::symex_assign_array - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_symext::symex_assign_array( statet &state, const index_exprt &lhs, @@ -415,18 +334,6 @@ void goto_symext::symex_assign_array( #endif } -/*******************************************************************\ - -Function: goto_symext::symex_assign_struct_member - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_symext::symex_assign_struct_member( statet &state, const member_exprt &lhs, @@ -501,18 +408,6 @@ void goto_symext::symex_assign_struct_member( #endif } -/*******************************************************************\ - -Function: goto_symext::symex_assign_if - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_symext::symex_assign_if( statet &state, const if_exprt &lhs, @@ -546,18 +441,6 @@ void goto_symext::symex_assign_if( } } -/*******************************************************************\ - -Function: goto_symext::symex_assign_byte_extract - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_symext::symex_assign_byte_extract( statet &state, const byte_extract_exprt &lhs, diff --git a/src/goto-symex/symex_atomic_section.cpp b/src/goto-symex/symex_atomic_section.cpp index 7f4e239f676..c243cafbcd4 100644 --- a/src/goto-symex/symex_atomic_section.cpp +++ b/src/goto-symex/symex_atomic_section.cpp @@ -6,19 +6,10 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ -#include "goto_symex.h" - -/*******************************************************************\ - -Function: goto_symext::symex_atomic_begin - - Inputs: +/// \file +/// Symbolic Execution - Outputs: - - Purpose: - -\*******************************************************************/ +#include "goto_symex.h" void goto_symext::symex_atomic_begin(statet &state) { @@ -40,18 +31,6 @@ void goto_symext::symex_atomic_begin(statet &state) state.source); } -/*******************************************************************\ - -Function: goto_symext::symex_atomic_end - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_symext::symex_atomic_end(statet &state) { if(state.guard.is_false()) diff --git a/src/goto-symex/symex_builtin_functions.cpp b/src/goto-symex/symex_builtin_functions.cpp index c5bdd32d0f2..6dd3de38591 100644 --- a/src/goto-symex/symex_builtin_functions.cpp +++ b/src/goto-symex/symex_builtin_functions.cpp @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Symbolic Execution of ANSI-C + #include #include @@ -26,18 +29,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "goto_symex.h" #include "goto_symex_state.h" -/*******************************************************************\ - -Function: goto_symext::symex_malloc - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - inline static typet c_sizeof_type_rec(const exprt &expr) { const irept &sizeof_type=expr.find(ID_C_c_sizeof_type); @@ -195,18 +186,6 @@ void goto_symext::symex_malloc( symex_assign_rec(state, code_assignt(lhs, rhs)); } -/*******************************************************************\ - -Function: goto_symext::symex_gcc_builtin_va_arg_next - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - irep_idt get_symbol(const exprt &src) { if(src.id()==ID_typecast) @@ -271,18 +250,6 @@ void goto_symext::symex_gcc_builtin_va_arg_next( symex_assign_rec(state, code_assignt(lhs, rhs)); } -/*******************************************************************\ - -Function: goto_symext::get_string_argument_rec - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - irep_idt get_string_argument_rec(const exprt &src) { if(src.id()==ID_typecast) @@ -309,18 +276,6 @@ irep_idt get_string_argument_rec(const exprt &src) return ""; } -/*******************************************************************\ - -Function: goto_symext::get_string_argument - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - irep_idt get_string_argument(const exprt &src, const namespacet &ns) { exprt tmp=src; @@ -328,18 +283,6 @@ irep_idt get_string_argument(const exprt &src, const namespacet &ns) return get_string_argument_rec(tmp); } -/*******************************************************************\ - -Function: goto_symext::symex_printf - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_symext::symex_printf( statet &state, const exprt &lhs, @@ -367,18 +310,6 @@ void goto_symext::symex_printf( state.source, "printf", format_string, args); } -/*******************************************************************\ - -Function: goto_symext::symex_input - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_symext::symex_input( statet &state, const codet &code) @@ -404,18 +335,6 @@ void goto_symext::symex_input( target.input(state.guard.as_expr(), state.source, input_id, args); } -/*******************************************************************\ - -Function: goto_symext::symex_output - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_symext::symex_output( statet &state, const codet &code) @@ -441,18 +360,6 @@ void goto_symext::symex_output( target.output(state.guard.as_expr(), state.source, output_id, args); } -/*******************************************************************\ - -Function: goto_symext::symex_cpp_new - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_symext::symex_cpp_new( statet &state, const exprt &lhs, @@ -513,18 +420,6 @@ void goto_symext::symex_cpp_new( symex_assign_rec(state, code_assignt(lhs, rhs)); } -/*******************************************************************\ - -Function: goto_symext::symex_cpp_delete - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_symext::symex_cpp_delete( statet &state, const codet &code) @@ -532,18 +427,6 @@ void goto_symext::symex_cpp_delete( // bool do_array=code.get(ID_statement)==ID_cpp_delete_array; } -/*******************************************************************\ - -Function: goto_symext::symex_trace - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_symext::symex_trace( statet &state, const code_function_callt &code) @@ -583,18 +466,6 @@ void goto_symext::symex_trace( } } -/*******************************************************************\ - -Function: goto_symext::symex_fkt - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_symext::symex_fkt( statet &state, const code_function_callt &code) @@ -618,18 +489,6 @@ void goto_symext::symex_fkt( #endif } -/*******************************************************************\ - -Function: goto_symext::symex_macro - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_symext::symex_macro( statet &state, const code_function_callt &code) diff --git a/src/goto-symex/symex_catch.cpp b/src/goto-symex/symex_catch.cpp index ffddd6314e8..c36deb71645 100644 --- a/src/goto-symex/symex_catch.cpp +++ b/src/goto-symex/symex_catch.cpp @@ -6,19 +6,10 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ -#include "goto_symex.h" - -/*******************************************************************\ - -Function: goto_symext::symex_catch - - Inputs: +/// \file +/// Symbolic Execution - Outputs: - - Purpose: - -\*******************************************************************/ +#include "goto_symex.h" void goto_symext::symex_catch(statet &state) { diff --git a/src/goto-symex/symex_clean_expr.cpp b/src/goto-symex/symex_clean_expr.cpp index e3e650d7b99..1e3be8d8d3f 100644 --- a/src/goto-symex/symex_clean_expr.cpp +++ b/src/goto-symex/symex_clean_expr.cpp @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Symbolic Execution of ANSI-C + #include #include #include @@ -15,18 +18,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "goto_symex.h" -/*******************************************************************\ - -Function: goto_symext::process_array_expr_rec - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_symext::process_array_expr_rec( exprt &expr, const typet &type) const @@ -82,18 +73,6 @@ void goto_symext::process_array_expr_rec( } } -/*******************************************************************\ - -Function: goto_symext::process_array_expr - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_symext::process_array_expr(exprt &expr) { // This may change the type of the expression! @@ -143,18 +122,6 @@ void goto_symext::process_array_expr(exprt &expr) process_array_expr(*it); } -/*******************************************************************\ - -Function: goto_symext::replace_array_equal - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_symext::replace_array_equal(exprt &expr) { if(expr.id()==ID_array_equal) @@ -180,18 +147,6 @@ void goto_symext::replace_array_equal(exprt &expr) replace_array_equal(*it); } -/*******************************************************************\ - -Function: goto_symext::clean_expr - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_symext::clean_expr( exprt &expr, statet &state, diff --git a/src/goto-symex/symex_dead.cpp b/src/goto-symex/symex_dead.cpp index ec9440bc5e8..11bcadcfbd7 100644 --- a/src/goto-symex/symex_dead.cpp +++ b/src/goto-symex/symex_dead.cpp @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Symbolic Execution + #include #include @@ -15,18 +18,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "goto_symex.h" -/*******************************************************************\ - -Function: goto_symext::symex_dead - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_symext::symex_dead(statet &state) { const goto_programt::instructiont &instruction=*state.source.pc; diff --git a/src/goto-symex/symex_decl.cpp b/src/goto-symex/symex_decl.cpp index 4d5e162a4d9..436a2d6e55c 100644 --- a/src/goto-symex/symex_decl.cpp +++ b/src/goto-symex/symex_decl.cpp @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Symbolic Execution + #include #include @@ -17,18 +20,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "goto_symex.h" -/*******************************************************************\ - -Function: goto_symext::symex_decl - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_symext::symex_decl(statet &state) { const goto_programt::instructiont &instruction=*state.source.pc; @@ -47,18 +38,6 @@ void goto_symext::symex_decl(statet &state) symex_decl(state, to_symbol_expr(code.op0())); } -/*******************************************************************\ - -Function: goto_symext::symex_decl - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_symext::symex_decl(statet &state, const symbol_exprt &expr) { // We increase the L2 renaming to make these non-deterministic. diff --git a/src/goto-symex/symex_dereference.cpp b/src/goto-symex/symex_dereference.cpp index 513655f44b9..28186bd97fd 100644 --- a/src/goto-symex/symex_dereference.cpp +++ b/src/goto-symex/symex_dereference.cpp @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Symbolic Execution of ANSI-C + #include #include #include @@ -20,18 +23,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "goto_symex.h" #include "symex_dereference_state.h" -/*******************************************************************\ - -Function: goto_symext::dereference_rec_address_of - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_symext::dereference_rec_address_of( exprt &expr, statet &state, @@ -72,18 +63,6 @@ void goto_symext::dereference_rec_address_of( } } -/*******************************************************************\ - -Function: goto_symext::is_index_member_symbol_if - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool goto_symext::is_index_member_symbol_if(const exprt &expr) { // Could be member, could be if, could be index. @@ -109,18 +88,7 @@ bool goto_symext::is_index_member_symbol_if(const exprt &expr) return false; } -/*******************************************************************\ - -Function: goto_symext::address_arithmetic - - Inputs: - - Outputs: - - Purpose: Evaluate an ID_address_of expression - -\*******************************************************************/ - +/// Evaluate an ID_address_of expression exprt goto_symext::address_arithmetic( const exprt &expr, statet &state, @@ -258,18 +226,6 @@ exprt goto_symext::address_arithmetic( return result; } -/*******************************************************************\ - -Function: goto_symext::dereference_rec - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_symext::dereference_rec( exprt &expr, statet &state, @@ -384,18 +340,6 @@ void goto_symext::dereference_rec( } } -/*******************************************************************\ - -Function: goto_symext::dereference - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_symext::dereference( exprt &expr, statet &state, diff --git a/src/goto-symex/symex_dereference_state.cpp b/src/goto-symex/symex_dereference_state.cpp index cd69913e6a2..fd4ff4218f4 100644 --- a/src/goto-symex/symex_dereference_state.cpp +++ b/src/goto-symex/symex_dereference_state.cpp @@ -6,22 +6,13 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Symbolic Execution of ANSI-C + #include #include "symex_dereference_state.h" -/*******************************************************************\ - -Function: symex_dereference_statet::dereference_failure - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void symex_dereference_statet::dereference_failure( const std::string &property, const std::string &msg, @@ -29,18 +20,6 @@ void symex_dereference_statet::dereference_failure( { } -/*******************************************************************\ - -Function: symex_dereference_statet::has_failed_symbol - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool symex_dereference_statet::has_failed_symbol( const exprt &expr, const symbolt *&symbol) @@ -98,18 +77,6 @@ bool symex_dereference_statet::has_failed_symbol( return false; } -/*******************************************************************\ - -Function: symex_dereference_statet::get_value_set - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void symex_dereference_statet::get_value_set( const exprt &expr, value_setst::valuest &value_set) diff --git a/src/goto-symex/symex_dereference_state.h b/src/goto-symex/symex_dereference_state.h index 0afaf8a696f..315afb00a70 100644 --- a/src/goto-symex/symex_dereference_state.h +++ b/src/goto-symex/symex_dereference_state.h @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Symbolic Execution of ANSI-C + #ifndef CPROVER_GOTO_SYMEX_SYMEX_DEREFERENCE_STATE_H #define CPROVER_GOTO_SYMEX_SYMEX_DEREFERENCE_STATE_H @@ -13,18 +16,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "goto_symex.h" -/*******************************************************************\ - - Class: symex_dereference_statet - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - class symex_dereference_statet: public dereference_callbackt { diff --git a/src/goto-symex/symex_function_call.cpp b/src/goto-symex/symex_function_call.cpp index 00636ae339b..e1de5516f74 100644 --- a/src/goto-symex/symex_function_call.cpp +++ b/src/goto-symex/symex_function_call.cpp @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Symbolic Execution of ANSI-C + #include #include #include @@ -23,18 +26,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "goto_symex.h" -/*******************************************************************\ - -Function: goto_symext::get_unwind_recursion - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool goto_symext::get_unwind_recursion( const irep_idt &identifier, const unsigned thread_nr, @@ -43,18 +34,6 @@ bool goto_symext::get_unwind_recursion( return false; } -/*******************************************************************\ - -Function: goto_symext::parameter_assignments - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_symext::parameter_assignments( const irep_idt function_identifier, const goto_functionst::goto_functiont &goto_function, @@ -190,18 +169,6 @@ void goto_symext::parameter_assignments( } } -/*******************************************************************\ - -Function: goto_symext::symex_function_call - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_symext::symex_function_call( const goto_functionst &goto_functions, statet &state, @@ -219,18 +186,6 @@ void goto_symext::symex_function_call( throw "unexpected function for symex_function_call: "+function.id_string(); } -/*******************************************************************\ - -Function: goto_symext::symex_function_call_symbol - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_symext::symex_function_call_symbol( const goto_functionst &goto_functions, statet &state, @@ -259,18 +214,7 @@ void goto_symext::symex_function_call_symbol( symex_function_call_code(goto_functions, state, code); } -/*******************************************************************\ - -Function: goto_symext::symex_function_call_code - - Inputs: - - Outputs: - - Purpose: do function call by inlining - -\*******************************************************************/ - +/// do function call by inlining void goto_symext::symex_function_call_code( const goto_functionst &goto_functions, statet &state, @@ -373,18 +317,7 @@ void goto_symext::symex_function_call_code( state.source.pc=goto_function.body.instructions.begin(); } -/*******************************************************************\ - -Function: goto_symext::pop_frame - - Inputs: - - Outputs: - - Purpose: pop one call frame - -\*******************************************************************/ - +/// pop one call frame void goto_symext::pop_frame(statet &state) { assert(!state.call_stack().empty()); @@ -424,18 +357,7 @@ void goto_symext::pop_frame(statet &state) state.pop_frame(); } -/*******************************************************************\ - -Function: goto_symext::symex_end_of_function - - Inputs: - - Outputs: - - Purpose: do function call by inlining - -\*******************************************************************/ - +/// do function call by inlining void goto_symext::symex_end_of_function(statet &state) { // first record the return @@ -446,20 +368,8 @@ void goto_symext::symex_end_of_function(statet &state) pop_frame(state); } -/*******************************************************************\ - -Function: goto_symext::locality - - Inputs: - - Outputs: - - Purpose: preserves locality of local variables of a given - function by applying L1 renaming to the local - identifiers - -\*******************************************************************/ - +/// preserves locality of local variables of a given function by applying L1 +/// renaming to the local identifiers void goto_symext::locality( const irep_idt function_identifier, statet &state, @@ -517,18 +427,6 @@ void goto_symext::locality( } } -/*******************************************************************\ - -Function: goto_symext::return_assignment - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_symext::return_assignment(statet &state) { statet::framet &frame=state.top(); diff --git a/src/goto-symex/symex_goto.cpp b/src/goto-symex/symex_goto.cpp index 0f6328bdc44..270871afc1d 100644 --- a/src/goto-symex/symex_goto.cpp +++ b/src/goto-symex/symex_goto.cpp @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Symbolic Execution + #include #include @@ -15,18 +18,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "goto_symex.h" -/*******************************************************************\ - -Function: goto_symext::symex_goto - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_symext::symex_goto(statet &state) { const goto_programt::instructiont &instruction=*state.source.pc; @@ -206,18 +197,6 @@ void goto_symext::symex_goto(statet &state) } } -/*******************************************************************\ - -Function: goto_symext::symex_step_goto - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_symext::symex_step_goto(statet &state, bool taken) { const goto_programt::instructiont &instruction=*state.source.pc; @@ -235,18 +214,6 @@ void goto_symext::symex_step_goto(statet &state, bool taken) target.assumption(state.guard.as_expr(), guard, state.source); } -/*******************************************************************\ - -Function: goto_symext::merge_gotos - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_symext::merge_gotos(statet &state) { statet::framet &frame=state.top(); @@ -271,18 +238,6 @@ void goto_symext::merge_gotos(statet &state) frame.goto_state_map.erase(state_map_it); } -/*******************************************************************\ - -Function: goto_symext::merge_goto - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_symext::merge_goto( const statet::goto_statet &goto_state, statet &state) @@ -303,18 +258,6 @@ void goto_symext::merge_goto( state.depth=std::min(state.depth, goto_state.depth); } -/*******************************************************************\ - -Function: goto_symext::merge_value_sets - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_symext::merge_value_sets( const statet::goto_statet &src, statet &dest) @@ -328,18 +271,6 @@ void goto_symext::merge_value_sets( dest.value_set.make_union(src.value_set); } -/*******************************************************************\ - -Function: goto_symext::phi_function - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_symext::phi_function( const statet::goto_statet &goto_state, statet &dest_state) @@ -441,18 +372,6 @@ void goto_symext::phi_function( } } -/*******************************************************************\ - -Function: goto_symext::loop_bound_exceeded - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_symext::loop_bound_exceeded( statet &state, const exprt &guard) @@ -492,18 +411,6 @@ void goto_symext::loop_bound_exceeded( } } -/*******************************************************************\ - -Function: goto_symext::get_unwind - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool goto_symext::get_unwind( const symex_targett::sourcet &source, unsigned unwind) diff --git a/src/goto-symex/symex_main.cpp b/src/goto-symex/symex_main.cpp index 2cb7ac09290..7351b89a836 100644 --- a/src/goto-symex/symex_main.cpp +++ b/src/goto-symex/symex_main.cpp @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Symbolic Execution + #include #include @@ -17,36 +20,12 @@ Author: Daniel Kroening, kroening@kroening.com #include "goto_symex.h" -/*******************************************************************\ - -Function: goto_symext::new_name - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_symext::new_name(symbolt &symbol) { get_new_name(symbol, ns); new_symbol_table.add(symbol); } -/*******************************************************************\ - -Function: goto_symext::vcc - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_symext::vcc( const exprt &vcc_expr, const std::string &msg, @@ -74,18 +53,6 @@ void goto_symext::vcc( target.assertion(state.guard.as_expr(), expr, msg, state.source); } -/*******************************************************************\ - -Function: goto_symext::symex_assume - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_symext::symex_assume(statet &state, const exprt &cond) { exprt simplified_cond=cond; @@ -115,18 +82,6 @@ void goto_symext::symex_assume(statet &state, const exprt &cond) symex_atomic_end(state); } -/*******************************************************************\ - -Function: goto_symext::rewrite_quantifiers - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_symext::rewrite_quantifiers(exprt &expr, statet &state) { if(expr.id()==ID_forall) @@ -143,18 +98,7 @@ void goto_symext::rewrite_quantifiers(exprt &expr, statet &state) } } -/*******************************************************************\ - -Function: goto_symext::operator() - - Inputs: - - Outputs: - - Purpose: symex from given state - -\*******************************************************************/ - +/// symex from given state void goto_symext::operator()( statet &state, const goto_functionst &goto_functions, @@ -190,18 +134,7 @@ void goto_symext::operator()( state.dirty=0; } -/*******************************************************************\ - -Function: goto_symext::operator() - - Inputs: - - Outputs: - - Purpose: symex starting from given program - -\*******************************************************************/ - +/// symex starting from given program void goto_symext::operator()( const goto_functionst &goto_functions, const goto_programt &goto_program) @@ -210,18 +143,7 @@ void goto_symext::operator()( operator() (state, goto_functions, goto_program); } -/*******************************************************************\ - -Function: goto_symext::operator() - - Inputs: - - Outputs: - - Purpose: symex from entry point - -\*******************************************************************/ - +/// symex from entry point void goto_symext::operator()(const goto_functionst &goto_functions) { goto_functionst::function_mapt::const_iterator it= @@ -235,18 +157,7 @@ void goto_symext::operator()(const goto_functionst &goto_functions) operator()(goto_functions, body); } -/*******************************************************************\ - -Function: goto_symext::symex_step - - Inputs: - - Outputs: - - Purpose: do just one step - -\*******************************************************************/ - +/// do just one step void goto_symext::symex_step( const goto_functionst &goto_functions, statet &state) diff --git a/src/goto-symex/symex_other.cpp b/src/goto-symex/symex_other.cpp index 315447093ea..73e913aa098 100644 --- a/src/goto-symex/symex_other.cpp +++ b/src/goto-symex/symex_other.cpp @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Symbolic Execution + #include #include @@ -18,18 +21,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "goto_symex.h" -/*******************************************************************\ - -Function: goto_symext::symex_other - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_symext::symex_other( const goto_functionst &goto_functions, statet &state) diff --git a/src/goto-symex/symex_slice_class.h b/src/goto-symex/symex_slice_class.h index c669ded9ed2..413a0bdc472 100644 --- a/src/goto-symex/symex_slice_class.h +++ b/src/goto-symex/symex_slice_class.h @@ -6,20 +6,15 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Slicer for symex traces + #ifndef CPROVER_GOTO_SYMEX_SYMEX_SLICE_CLASS_H #define CPROVER_GOTO_SYMEX_SYMEX_SLICE_CLASS_H #include "symex_target_equation.h" #include "slice.h" -/*******************************************************************\ - - Class: symex_slicet - - Purpose: - -\*******************************************************************/ - class symex_slicet { public: diff --git a/src/goto-symex/symex_start_thread.cpp b/src/goto-symex/symex_start_thread.cpp index 67cb147964c..e5891d79242 100644 --- a/src/goto-symex/symex_start_thread.cpp +++ b/src/goto-symex/symex_start_thread.cpp @@ -6,22 +6,13 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Symbolic Execution + #include #include "goto_symex.h" -/*******************************************************************\ - -Function: goto_symext::symex_start_thread - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_symext::symex_start_thread(statet &state) { if(state.guard.is_false()) diff --git a/src/goto-symex/symex_target.cpp b/src/goto-symex/symex_target.cpp index 808ec3d2004..cc03c29eaad 100644 --- a/src/goto-symex/symex_target.cpp +++ b/src/goto-symex/symex_target.cpp @@ -6,19 +6,10 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ -#include "symex_target.h" - -/*******************************************************************\ - -Function: operator < - - Inputs: +/// \file +/// Symbolic Execution - Outputs: - - Purpose: - -\*******************************************************************/ +#include "symex_target.h" bool operator<( const symex_targett::sourcet &a, diff --git a/src/goto-symex/symex_target.h b/src/goto-symex/symex_target.h index 2aae977f71f..24a8daee0e2 100644 --- a/src/goto-symex/symex_target.h +++ b/src/goto-symex/symex_target.h @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Generate Equation using Symbolic Execution + #ifndef CPROVER_GOTO_SYMEX_SYMEX_TARGET_H #define CPROVER_GOTO_SYMEX_SYMEX_TARGET_H diff --git a/src/goto-symex/symex_target_equation.cpp b/src/goto-symex/symex_target_equation.cpp index e522affb3ac..7b1ff044622 100644 --- a/src/goto-symex/symex_target_equation.cpp +++ b/src/goto-symex/symex_target_equation.cpp @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Symbolic Execution + #include #include @@ -18,51 +21,16 @@ Author: Daniel Kroening, kroening@kroening.com #include "goto_symex_state.h" #include "symex_target_equation.h" -/*******************************************************************\ - -Function: symex_target_equationt::symex_target_equationt - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - symex_target_equationt::symex_target_equationt( const namespacet &_ns):ns(_ns) { } -/*******************************************************************\ - -Function: symex_target_equationt::~symex_target_equationt - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - symex_target_equationt::~symex_target_equationt() { } -/*******************************************************************\ - -Function: symex_target_equationt::shared_read - - Inputs: - - Outputs: - - Purpose: read from a shared variable - -\*******************************************************************/ - +/// read from a shared variable void symex_target_equationt::shared_read( const exprt &guard, const ssa_exprt &ssa_object, @@ -81,18 +49,7 @@ void symex_target_equationt::shared_read( merge_ireps(SSA_step); } -/*******************************************************************\ - -Function: symex_target_equationt::shared_write - - Inputs: - - Outputs: - - Purpose: write to a sharedvariable - -\*******************************************************************/ - +/// write to a sharedvariable void symex_target_equationt::shared_write( const exprt &guard, const ssa_exprt &ssa_object, @@ -111,18 +68,7 @@ void symex_target_equationt::shared_write( merge_ireps(SSA_step); } -/*******************************************************************\ - -Function: symex_target_equationt::spawn - - Inputs: - - Outputs: - - Purpose: spawn a new thread - -\*******************************************************************/ - +/// spawn a new thread void symex_target_equationt::spawn( const exprt &guard, const sourcet &source) @@ -136,18 +82,6 @@ void symex_target_equationt::spawn( merge_ireps(SSA_step); } -/*******************************************************************\ - -Function: symex_target_equationt::memory_barrier - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void symex_target_equationt::memory_barrier( const exprt &guard, const sourcet &source) @@ -161,18 +95,7 @@ void symex_target_equationt::memory_barrier( merge_ireps(SSA_step); } -/*******************************************************************\ - -Function: symex_target_equationt::atomic_begin - - Inputs: - - Outputs: - - Purpose: start an atomic section - -\*******************************************************************/ - +/// start an atomic section void symex_target_equationt::atomic_begin( const exprt &guard, unsigned atomic_section_id, @@ -188,18 +111,7 @@ void symex_target_equationt::atomic_begin( merge_ireps(SSA_step); } -/*******************************************************************\ - -Function: symex_target_equationt::atomic_end - - Inputs: - - Outputs: - - Purpose: end an atomic section - -\*******************************************************************/ - +/// end an atomic section void symex_target_equationt::atomic_end( const exprt &guard, unsigned atomic_section_id, @@ -215,18 +127,7 @@ void symex_target_equationt::atomic_end( merge_ireps(SSA_step); } -/*******************************************************************\ - -Function: symex_target_equationt::assignment - - Inputs: - - Outputs: - - Purpose: write to a variable - -\*******************************************************************/ - +/// write to a variable void symex_target_equationt::assignment( const exprt &guard, const ssa_exprt &ssa_lhs, @@ -257,18 +158,7 @@ void symex_target_equationt::assignment( merge_ireps(SSA_step); } -/*******************************************************************\ - -Function: symex_target_equationt::decl - - Inputs: - - Outputs: - - Purpose: declare a fresh variable - -\*******************************************************************/ - +/// declare a fresh variable void symex_target_equationt::decl( const exprt &guard, const ssa_exprt &ssa_lhs, @@ -295,18 +185,7 @@ void symex_target_equationt::decl( merge_ireps(SSA_step); } -/*******************************************************************\ - -Function: symex_target_equationt::dead - - Inputs: - - Outputs: - - Purpose: declare a fresh variable - -\*******************************************************************/ - +/// declare a fresh variable void symex_target_equationt::dead( const exprt &guard, const ssa_exprt &ssa_lhs, @@ -315,18 +194,7 @@ void symex_target_equationt::dead( // we currently don't record these } -/*******************************************************************\ - -Function: symex_target_equationt::location - - Inputs: - - Outputs: - - Purpose: just record a location - -\*******************************************************************/ - +/// just record a location void symex_target_equationt::location( const exprt &guard, const sourcet &source) @@ -341,18 +209,7 @@ void symex_target_equationt::location( merge_ireps(SSA_step); } -/*******************************************************************\ - -Function: symex_target_equationt::function_call - - Inputs: - - Outputs: - - Purpose: just record a location - -\*******************************************************************/ - +/// just record a location void symex_target_equationt::function_call( const exprt &guard, const irep_idt &identifier, @@ -369,18 +226,7 @@ void symex_target_equationt::function_call( merge_ireps(SSA_step); } -/*******************************************************************\ - -Function: symex_target_equationt::function_return - - Inputs: - - Outputs: - - Purpose: just record a location - -\*******************************************************************/ - +/// just record a location void symex_target_equationt::function_return( const exprt &guard, const irep_idt &identifier, @@ -397,18 +243,7 @@ void symex_target_equationt::function_return( merge_ireps(SSA_step); } -/*******************************************************************\ - -Function: symex_target_equationt::output - - Inputs: - - Outputs: - - Purpose: just record output - -\*******************************************************************/ - +/// just record output void symex_target_equationt::output( const exprt &guard, const sourcet &source, @@ -427,18 +262,7 @@ void symex_target_equationt::output( merge_ireps(SSA_step); } -/*******************************************************************\ - -Function: symex_target_equationt::output_fmt - - Inputs: - - Outputs: - - Purpose: just record formatted output - -\*******************************************************************/ - +/// just record formatted output void symex_target_equationt::output_fmt( const exprt &guard, const sourcet &source, @@ -460,18 +284,7 @@ void symex_target_equationt::output_fmt( merge_ireps(SSA_step); } -/*******************************************************************\ - -Function: symex_target_equationt::input - - Inputs: - - Outputs: - - Purpose: just record input - -\*******************************************************************/ - +/// just record input void symex_target_equationt::input( const exprt &guard, const sourcet &source, @@ -490,18 +303,7 @@ void symex_target_equationt::input( merge_ireps(SSA_step); } -/*******************************************************************\ - -Function: symex_target_equationt::assumption - - Inputs: - - Outputs: - - Purpose: record an assumption - -\*******************************************************************/ - +/// record an assumption void symex_target_equationt::assumption( const exprt &guard, const exprt &cond, @@ -518,18 +320,7 @@ void symex_target_equationt::assumption( merge_ireps(SSA_step); } -/*******************************************************************\ - -Function: symex_target_equationt::assertion - - Inputs: - - Outputs: - - Purpose: record an assertion - -\*******************************************************************/ - +/// record an assertion void symex_target_equationt::assertion( const exprt &guard, const exprt &cond, @@ -548,18 +339,7 @@ void symex_target_equationt::assertion( merge_ireps(SSA_step); } -/*******************************************************************\ - -Function: symex_target_equationt::goto_instruction - - Inputs: - - Outputs: - - Purpose: record a goto instruction - -\*******************************************************************/ - +/// record a goto instruction void symex_target_equationt::goto_instruction( const exprt &guard, const exprt &cond, @@ -576,18 +356,7 @@ void symex_target_equationt::goto_instruction( merge_ireps(SSA_step); } -/*******************************************************************\ - -Function: symex_target_equationt::constraint - - Inputs: - - Outputs: - - Purpose: record a constraint - -\*******************************************************************/ - +/// record a constraint void symex_target_equationt::constraint( const exprt &cond, const std::string &msg, @@ -606,18 +375,6 @@ void symex_target_equationt::constraint( merge_ireps(SSA_step); } -/*******************************************************************\ - -Function: symex_target_equationt::convert - - Inputs: converter - - Outputs: - - Purpose: - -\*******************************************************************/ - void symex_target_equationt::convert( prop_convt &prop_conv) { @@ -631,18 +388,9 @@ void symex_target_equationt::convert( convert_constraints(prop_conv); } -/*******************************************************************\ - -Function: symex_target_equationt::convert_assignments - - Inputs: decision procedure - - Outputs: - - - Purpose: converts assignments - -\*******************************************************************/ - +/// converts assignments +/// \par parameters: decision procedure +/// \return - void symex_target_equationt::convert_assignments( decision_proceduret &decision_procedure) const { @@ -653,18 +401,8 @@ void symex_target_equationt::convert_assignments( } } -/*******************************************************************\ - -Function: symex_target_equationt::convert_decls - - Inputs: converter - - Outputs: - - - Purpose: converts declarations - -\*******************************************************************/ - +/// converts declarations +/// \return - void symex_target_equationt::convert_decls( prop_convt &prop_conv) const { @@ -679,18 +417,8 @@ void symex_target_equationt::convert_decls( } } -/*******************************************************************\ - -Function: symex_target_equationt::convert_guards - - Inputs: converter - - Outputs: - - - Purpose: converts guards - -\*******************************************************************/ - +/// converts guards +/// \return - void symex_target_equationt::convert_guards( prop_convt &prop_conv) { @@ -703,18 +431,8 @@ void symex_target_equationt::convert_guards( } } -/*******************************************************************\ - -Function: symex_target_equationt::convert_assumptions - - Inputs: converter - - Outputs: - - - Purpose: converts assumptions - -\*******************************************************************/ - +/// converts assumptions +/// \return - void symex_target_equationt::convert_assumptions( prop_convt &prop_conv) { @@ -730,18 +448,8 @@ void symex_target_equationt::convert_assumptions( } } -/*******************************************************************\ - -Function: symex_target_equationt::convert_goto_instructions - - Inputs: converter - - Outputs: - - - Purpose: converts goto instructions - -\*******************************************************************/ - +/// converts goto instructions +/// \return - void symex_target_equationt::convert_goto_instructions( prop_convt &prop_conv) { @@ -757,18 +465,9 @@ void symex_target_equationt::convert_goto_instructions( } } -/*******************************************************************\ - -Function: symex_target_equationt::convert_constraints - - Inputs: decision procedure - - Outputs: - - - Purpose: converts constraints - -\*******************************************************************/ - +/// converts constraints +/// \par parameters: decision procedure +/// \return - void symex_target_equationt::convert_constraints( decision_proceduret &decision_procedure) const { @@ -784,18 +483,8 @@ void symex_target_equationt::convert_constraints( } } -/*******************************************************************\ - -Function: symex_target_equationt::convert_assertions - - Inputs: converter - - Outputs: - - - Purpose: converts assertions - -\*******************************************************************/ - +/// converts assertions +/// \return - void symex_target_equationt::convert_assertions( prop_convt &prop_conv) { @@ -861,18 +550,9 @@ void symex_target_equationt::convert_assertions( prop_conv.set_to_true(disjunction(disjuncts)); } -/*******************************************************************\ - -Function: symex_target_equationt::convert_io - - Inputs: decision procedure - - Outputs: - - - Purpose: converts I/O - -\*******************************************************************/ - +/// converts I/O +/// \par parameters: decision procedure +/// \return - void symex_target_equationt::convert_io( decision_proceduret &dec_proc) { @@ -903,18 +583,6 @@ void symex_target_equationt::convert_io( } -/*******************************************************************\ - -Function: symex_target_equationt::merge_ireps - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void symex_target_equationt::merge_ireps(SSA_stept &SSA_step) { merge_irep(SSA_step.guard); @@ -932,18 +600,6 @@ void symex_target_equationt::merge_ireps(SSA_stept &SSA_step) // converted_io_args is merged in convert_io } -/*******************************************************************\ - -Function: symex_target_equationt::output - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void symex_target_equationt::output(std::ostream &out) const { for(const auto &step : SSA_steps) @@ -953,18 +609,6 @@ void symex_target_equationt::output(std::ostream &out) const } } -/*******************************************************************\ - -Function: symex_target_equationt::SSA_stept::output - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void symex_target_equationt::SSA_stept::output( const namespacet &ns, std::ostream &out) const @@ -1059,18 +703,6 @@ void symex_target_equationt::SSA_stept::output( out << "Guard: " << from_expr(ns, "", guard) << std::endl; } -/*******************************************************************\ - -Function: operator << - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::ostream &operator<<( std::ostream &out, const symex_target_equationt &equation) @@ -1079,18 +711,6 @@ std::ostream &operator<<( return out; } -/*******************************************************************\ - -Function: operator << - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::ostream &operator<<( std::ostream &out, const symex_target_equationt::SSA_stept &step) diff --git a/src/goto-symex/symex_target_equation.h b/src/goto-symex/symex_target_equation.h index e7f0274aac1..abee81346a7 100644 --- a/src/goto-symex/symex_target_equation.h +++ b/src/goto-symex/symex_target_equation.h @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Generate Equation using Symbolic Execution + #ifndef CPROVER_GOTO_SYMEX_SYMEX_TARGET_EQUATION_H #define CPROVER_GOTO_SYMEX_SYMEX_TARGET_EQUATION_H diff --git a/src/goto-symex/symex_throw.cpp b/src/goto-symex/symex_throw.cpp index e5091c566f2..a29ce901440 100644 --- a/src/goto-symex/symex_throw.cpp +++ b/src/goto-symex/symex_throw.cpp @@ -6,19 +6,10 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ -#include "goto_symex.h" - -/*******************************************************************\ - -Function: goto_symext::symex_throw - - Inputs: +/// \file +/// Symbolic Execution - Outputs: - - Purpose: - -\*******************************************************************/ +#include "goto_symex.h" void goto_symext::symex_throw(statet &state) { diff --git a/src/java_bytecode/character_refine_preprocess.cpp b/src/java_bytecode/character_refine_preprocess.cpp index f4e896eea11..8c0723599d5 100644 --- a/src/java_bytecode/character_refine_preprocess.cpp +++ b/src/java_bytecode/character_refine_preprocess.cpp @@ -9,22 +9,17 @@ Date: March 2017 \*******************************************************************/ +/// \file +/// Preprocess a goto-programs so that calls to the java Character library are +/// replaced by simple expressions. + #include #include #include "character_refine_preprocess.h" -/*******************************************************************\ - -Function: character_refine_preprocesst::convert_char_function - - Inputs: - expr_function - A reference to a function on expressions - target - A position in a goto program - - Purpose: converts based on a function on expressions - -\*******************************************************************/ - +/// converts based on a function on expressions +/// \param expr_function: A reference to a function on expressions +/// \param target: A position in a goto program codet character_refine_preprocesst::convert_char_function( exprt (*expr_function)(const exprt &chr, const typet &type), conversion_inputt &target) @@ -37,22 +32,12 @@ codet character_refine_preprocesst::convert_char_function( return code_assignt(result, expr_function(arg, type)); } -/*******************************************************************\ - -Function: character_refine_preprocesst::in_interval_expr - - Inputs: - arg - Expression we want to bound - lower_bound - Integer lower bound - upper_bound - Integer upper bound - - Outputs: A Boolean expression - - Purpose: The returned expression is true when the first argument is in the - interval defined by the lower and upper bounds (included) - -\*******************************************************************/ - +/// The returned expression is true when the first argument is in the interval +/// defined by the lower and upper bounds (included) +/// \param arg: Expression we want to bound +/// \param lower_bound: Integer lower bound +/// \param upper_bound: Integer upper bound +/// \return A Boolean expression exprt character_refine_preprocesst::in_interval_expr( const exprt &chr, const mp_integer &lower_bound, @@ -63,21 +48,11 @@ exprt character_refine_preprocesst::in_interval_expr( binary_relation_exprt(chr, ID_le, from_integer(upper_bound, chr.type()))); } -/*******************************************************************\ - -Function: character_refine_preprocesst::in_list_expr - - Inputs: - chr - An expression of type character - list - A list of integer representing unicode characters - - Outputs: A Boolean expression - - Purpose: The returned expression is true when the given character - is equal to one of the element in the list - -\*******************************************************************/ - +/// The returned expression is true when the given character is equal to one of +/// the element in the list +/// \param chr: An expression of type character +/// \param list: A list of integer representing unicode characters +/// \return A Boolean expression exprt character_refine_preprocesst::in_list_expr( const exprt &chr, const std::list &list) { @@ -87,21 +62,11 @@ exprt character_refine_preprocesst::in_list_expr( return disjunction(ops); } -/*******************************************************************\ - -Function: character_refine_preprocesst::expr_of_char_count - - Inputs: - expr - An expression of type character - type - A type for the output - - Outputs: A integer expression of the given type - - Purpose: Determines the number of char values needed to represent - the specified character (Unicode code point). - -\*******************************************************************/ - +/// Determines the number of char values needed to represent the specified +/// character (Unicode code point). +/// \param expr: An expression of type character +/// \param type: A type for the output +/// \return A integer expression of the given type exprt character_refine_preprocesst::expr_of_char_count( const exprt &chr, const typet &type) { @@ -110,18 +75,9 @@ exprt character_refine_preprocesst::expr_of_char_count( return if_exprt(small, from_integer(1, type), from_integer(2, type)); } -/*******************************************************************\ - -Function: character_refine_preprocesst::convert_char_count - - Inputs: - target - a position in a goto program - - Purpose: Converts function call to an assignment of an expression - corresponding to the java method Character.charCount:(I)I - -\*******************************************************************/ - +/// Converts function call to an assignment of an expression corresponding to +/// the java method Character.charCount:(I)I +/// \param target: a position in a goto program codet character_refine_preprocesst::convert_char_count( conversion_inputt &target) { @@ -129,37 +85,17 @@ codet character_refine_preprocesst::convert_char_count( &character_refine_preprocesst::expr_of_char_count, target); } -/*******************************************************************\ - -Function: character_refine_preprocesst::expr_of_char_value - Inputs: - expr - An expression of type character - type - A type for the output - - Outputs: An expression of the given type - - Purpose: Casts the given expression to the given type - -\*******************************************************************/ - +/// Casts the given expression to the given type +/// \return An expression of the given type exprt character_refine_preprocesst::expr_of_char_value( const exprt &chr, const typet &type) { return typecast_exprt(chr, type); } -/*******************************************************************\ - -Function: character_refine_preprocesst::convert_char_value - - Inputs: - target - a position in a goto program - - Purpose: Converts function call to an assignment of an expression - corresponding to the java method Character.charValue:()C - -\*******************************************************************/ - +/// Converts function call to an assignment of an expression corresponding to +/// the java method Character.charValue:()C +/// \param target: a position in a goto program codet character_refine_preprocesst::convert_char_value( conversion_inputt &target) { @@ -167,18 +103,9 @@ codet character_refine_preprocesst::convert_char_value( &character_refine_preprocesst::expr_of_char_value, target); } -/*******************************************************************\ - -Function: character_refine_preprocesst::convert_compare - - Inputs: - target - a position in a goto program - - Purpose: Converts function call to an assignment of an expression - corresponding to the java method Character.compare:(CC)I - -\*******************************************************************/ - +/// Converts function call to an assignment of an expression corresponding to +/// the java method Character.compare:(CC)I +/// \param target: a position in a goto program codet character_refine_preprocesst::convert_compare(conversion_inputt &target) { const code_function_callt &function_call=target; @@ -198,18 +125,9 @@ codet character_refine_preprocesst::convert_compare(conversion_inputt &target) } -/*******************************************************************\ - -Function: character_refine_preprocesst::convert_digit_char - - Inputs: - target - a position in a goto program - - Purpose: Converts function call to an assignment of an expression - corresponding to the java method Character.digit:(CI)I - -\*******************************************************************/ - +/// Converts function call to an assignment of an expression corresponding to +/// the java method Character.digit:(CI)I +/// \param target: a position in a goto program codet character_refine_preprocesst::convert_digit_char( conversion_inputt &target) { @@ -281,37 +199,19 @@ codet character_refine_preprocesst::convert_digit_char( return code_assignt(result, tc_expr); } -/*******************************************************************\ - -Function: character_refine_preprocesst::convert_char_is_digit_int - - Inputs: - target - a position in a goto program - - Purpose: Converts function call to an assignment of an expression - corresponding to the java method Character.digit:(II)I - -\*******************************************************************/ - +/// Converts function call to an assignment of an expression corresponding to +/// the java method Character.digit:(II)I +/// \param target: a position in a goto program codet character_refine_preprocesst::convert_digit_int(conversion_inputt &target) { return convert_digit_char(target); } -/*******************************************************************\ - -Function: character_refine_preprocesst::convert_for_digit - - Inputs: - target - a position in a goto program - - Purpose: Converts function call to an assignment of an expression - corresponding to the java method Character.forDigit:(II)C - - TODO: For now the radix argument is ignored - -\*******************************************************************/ - +/// Converts function call to an assignment of an expression corresponding to +/// the java method Character.forDigit:(II)C +/// +/// TODO: For now the radix argument is ignored +/// \param target: a position in a goto program codet character_refine_preprocesst::convert_for_digit(conversion_inputt &target) { const code_function_callt &function_call=target; @@ -328,18 +228,9 @@ codet character_refine_preprocesst::convert_for_digit(conversion_inputt &target) return code_assignt(result, if_exprt(small, value1, value2)); } -/*******************************************************************\ - -Function: character_refine_preprocesst::convert_get_directionality_char - - Inputs: - target - a position in a goto program - - Purpose: Converts function call to an assignment of an expression - corresponding to the java method Character.getDirectionality:(C)I - -\*******************************************************************/ - +/// Converts function call to an assignment of an expression corresponding to +/// the java method Character.getDirectionality:(C)I +/// \param target: a position in a goto program codet character_refine_preprocesst::convert_get_directionality_char( conversion_inputt &target) { @@ -348,75 +239,39 @@ codet character_refine_preprocesst::convert_get_directionality_char( return target; } -/*******************************************************************\ - -Function: character_refine_preprocesst::convert_char_is_digit_char - - Inputs: - target - a position in a goto program - - Purpose: Converts function call to an assignment of an expression - corresponding to the java method Character.getDirectionality:(I)I - -\*******************************************************************/ - +/// Converts function call to an assignment of an expression corresponding to +/// the java method Character.getDirectionality:(I)I +/// \param target: a position in a goto program codet character_refine_preprocesst::convert_get_directionality_int( conversion_inputt &target) { return convert_get_directionality_char(target); } -/*******************************************************************\ - -Function: character_refine_preprocesst::convert_get_numeric_value_char - Inputs: - target - a position in a goto program - - Purpose: Converts function call to an assignment of an expression - corresponding to the java method Character.getNumericValue:(C)I - - TODO: For now this is only for ASCII characters - -\*******************************************************************/ - +/// Converts function call to an assignment of an expression corresponding to +/// the java method Character.getNumericValue:(C)I +/// +/// TODO: For now this is only for ASCII characters codet character_refine_preprocesst::convert_get_numeric_value_char( conversion_inputt &target) { return convert_digit_char(target); } -/*******************************************************************\ - -Function: character_refine_preprocesst::convert_get_numeric_value_int - - Inputs: - target - a position in a goto program - - Purpose: Converts function call to an assignment of an expression - corresponding to the java method Character.getNumericValue:(C)I - - TODO: For now this is only for ASCII characters - -\*******************************************************************/ - +/// Converts function call to an assignment of an expression corresponding to +/// the java method Character.getNumericValue:(C)I +/// +/// TODO: For now this is only for ASCII characters +/// \param target: a position in a goto program codet character_refine_preprocesst::convert_get_numeric_value_int( conversion_inputt &target) { return convert_digit_int(target); } -/*******************************************************************\ - -Function: character_refine_preprocesst::convert_get_type_char - - Inputs: - target - a position in a goto program - - Purpose: Converts function call to an assignment of an expression - corresponding to the java method Character.getType:(C)I - -\*******************************************************************/ - +/// Converts function call to an assignment of an expression corresponding to +/// the java method Character.getType:(C)I +/// \param target: a position in a goto program codet character_refine_preprocesst::convert_get_type_char( conversion_inputt &target) { @@ -425,58 +280,29 @@ codet character_refine_preprocesst::convert_get_type_char( return target; } -/*******************************************************************\ - -Function: character_refine_preprocesst::convert_get_type_int - - Inputs: - target - a position in a goto program - - Purpose: Converts function call to an assignment of an expression - corresponding to the java method Character.getType:(I)I - -\*******************************************************************/ - +/// Converts function call to an assignment of an expression corresponding to +/// the java method Character.getType:(I)I +/// \param target: a position in a goto program codet character_refine_preprocesst::convert_get_type_int( conversion_inputt &target) { return convert_get_type_char(target); } -/*******************************************************************\ - -Function: character_refine_preprocesst::convert_hash_code - - Inputs: - target - a position in a goto program - - Purpose: Converts function call to an assignment of an expression - corresponding to the java method Character.hashCode:()I - -\*******************************************************************/ - +/// Converts function call to an assignment of an expression corresponding to +/// the java method Character.hashCode:()I +/// \param target: a position in a goto program codet character_refine_preprocesst::convert_hash_code(conversion_inputt &target) { return convert_char_value(target); } -/*******************************************************************\ - -Function: character_refine_preprocesst::expr_of_high_surrogate - - Inputs: - expr - An expression of type character - type - A type for the output - - Outputs: An expression of the given type - - Purpose: Returns the leading surrogate (a high surrogate code unit) - of the surrogate pair representing the specified - supplementary character (Unicode code point) in the UTF-16 - encoding. - -\*******************************************************************/ - +/// Returns the leading surrogate (a high surrogate code unit) of the surrogate +/// pair representing the specified supplementary character (Unicode code point) +/// in the UTF-16 encoding. +/// \param expr: An expression of type character +/// \param type: A type for the output +/// \return An expression of the given type exprt character_refine_preprocesst::expr_of_high_surrogate( const exprt &chr, const typet &type) { @@ -488,17 +314,8 @@ exprt character_refine_preprocesst::expr_of_high_surrogate( return high_surrogate; } -/*******************************************************************\ - -Function: character_refine_preprocesst::convert_high_surrogate - Inputs: - target - a position in a goto program - - Purpose: Converts function call to an assignment of an expression - corresponding to the java method Character.highSurrogate:(C)Z - -\*******************************************************************/ - +/// Converts function call to an assignment of an expression corresponding to +/// the java method Character.highSurrogate:(C)Z codet character_refine_preprocesst::convert_high_surrogate( conversion_inputt &target) { @@ -506,66 +323,34 @@ codet character_refine_preprocesst::convert_high_surrogate( &character_refine_preprocesst::expr_of_high_surrogate, target); } -/*******************************************************************\ - -Function: character_refine_preprocesst::expr_of_is_ascii_lower_case - - Inputs: - chr - An expression of type character - type - A type for the output - - Outputs: A Boolean expression - - Purpose: Determines if the specified character is an ASCII lowercase - character. - -\*******************************************************************/ - +/// Determines if the specified character is an ASCII lowercase character. +/// \param chr: An expression of type character +/// \param type: A type for the output +/// \return A Boolean expression exprt character_refine_preprocesst::expr_of_is_ascii_lower_case( const exprt &chr, const typet &type) { return in_interval_expr(chr, 'a', 'z'); } -/*******************************************************************\ - -Function: character_refine_preprocesst::expr_of_is_ascii_upper_case - - Inputs: - expr - An expression of type character - type - A type for the output - - Outputs: A Boolean expression - - Purpose: Determines if the specified character is an ASCII uppercase - character. - -\*******************************************************************/ - +/// Determines if the specified character is an ASCII uppercase character. +/// \param expr: An expression of type character +/// \param type: A type for the output +/// \return A Boolean expression exprt character_refine_preprocesst::expr_of_is_ascii_upper_case( const exprt &chr, const typet &type) { return in_interval_expr(chr, 'A', 'Z'); } -/*******************************************************************\ - -Function: character_refine_preprocesst::expr_of_is_letter - - Inputs: - expr - An expression of type character - type - A type for the output - - Outputs: An expression of the given type - - Purpose: Determines if the specified character is a letter. - - TODO: for now this is only for ASCII characters, the - following unicode categories are not yet considered: - TITLECASE_LETTER MODIFIER_LETTER OTHER_LETTER LETTER_NUMBER - -\*******************************************************************/ - +/// Determines if the specified character is a letter. +/// +/// TODO: for now this is only for ASCII characters, the +/// following unicode categories are not yet considered: +/// TITLECASE_LETTER MODIFIER_LETTER OTHER_LETTER LETTER_NUMBER +/// \param expr: An expression of type character +/// \param type: A type for the output +/// \return An expression of the given type exprt character_refine_preprocesst::expr_of_is_letter( const exprt &chr, const typet &type) { @@ -574,45 +359,25 @@ exprt character_refine_preprocesst::expr_of_is_letter( expr_of_is_ascii_lower_case(chr, type)); } -/*******************************************************************\ - -Function: character_refine_preprocesst::expr_of_is_alphabetic - - Inputs: - expr - An expression of type character - type - A type for the output - - Outputs: An expression of the given type - - Purpose: Determines if the specified character (Unicode code point) - is alphabetic. - - TODO: for now this is only for ASCII characters, the - following unicode categorise are not yet considered: - TITLECASE_LETTER MODIFIER_LETTER OTHER_LETTER LETTER_NUMBER - and contributory property Other_Alphabetic as defined by the - Unicode Standard. - -\*******************************************************************/ - +/// Determines if the specified character (Unicode code point) is alphabetic. +/// +/// TODO: for now this is only for ASCII characters, the +/// following unicode categorise are not yet considered: +/// TITLECASE_LETTER MODIFIER_LETTER OTHER_LETTER LETTER_NUMBER +/// and contributory property Other_Alphabetic as defined by the +/// Unicode Standard. +/// \param expr: An expression of type character +/// \param type: A type for the output +/// \return An expression of the given type exprt character_refine_preprocesst::expr_of_is_alphabetic( const exprt &chr, const typet &type) { return expr_of_is_letter(chr, type); } -/*******************************************************************\ - -Function: character_refine_preprocesst::convert_is_alphabetic - - Inputs: - target - a position in a goto program - - Purpose: Converts function call to an assignment of an expression - corresponding to the java method Character.isAlphabetic:(I)Z - -\*******************************************************************/ - +/// Converts function call to an assignment of an expression corresponding to +/// the java method Character.isAlphabetic:(I)Z +/// \param target: a position in a goto program codet character_refine_preprocesst::convert_is_alphabetic( conversion_inputt &target) { @@ -620,22 +385,12 @@ codet character_refine_preprocesst::convert_is_alphabetic( &character_refine_preprocesst::expr_of_is_alphabetic, target); } -/*******************************************************************\ - -Function: character_refine_preprocesst::expr_of_is_bmp_code_point - - Inputs: - expr - An expression of type character - type - A type for the output - - Outputs: A Boolean expression - - Purpose: Determines whether the specified character (Unicode code - point) is in the Basic Multilingual Plane (BMP). Such code - points can be represented using a single char. - -\*******************************************************************/ - +/// Determines whether the specified character (Unicode code point) is in the +/// Basic Multilingual Plane (BMP). Such code points can be represented using a +/// single char. +/// \param expr: An expression of type character +/// \param type: A type for the output +/// \return A Boolean expression exprt character_refine_preprocesst::expr_of_is_bmp_code_point( const exprt &chr, const typet &type) { @@ -643,18 +398,9 @@ exprt character_refine_preprocesst::expr_of_is_bmp_code_point( return is_bmp; } -/*******************************************************************\ - -Function: character_refine_preprocesst::convert_is_bmp_code_point - - Inputs: - target - a position in a goto program - - Purpose: Converts function call to an assignment of an expression - corresponding to the java method Character.isBmpCodePoint:(I)Z - -\*******************************************************************/ - +/// Converts function call to an assignment of an expression corresponding to +/// the java method Character.isBmpCodePoint:(I)Z +/// \param target: a position in a goto program codet character_refine_preprocesst::convert_is_bmp_code_point( conversion_inputt &target) { @@ -662,20 +408,10 @@ codet character_refine_preprocesst::convert_is_bmp_code_point( &character_refine_preprocesst::expr_of_is_bmp_code_point, target); } -/*******************************************************************\ - -Function: character_refine_preprocesst::expr_for_is_defined - - Inputs: - expr - An expression of type character - type - A type for the output - - Outputs: An expression of the given type - - Purpose: Determines if a character is defined in Unicode. - -\*******************************************************************/ - +/// Determines if a character is defined in Unicode. +/// \param expr: An expression of type character +/// \param type: A type for the output +/// \return An expression of the given type exprt character_refine_preprocesst::expr_of_is_defined( const exprt &chr, const typet &type) { @@ -707,18 +443,9 @@ exprt character_refine_preprocesst::expr_of_is_defined( return not_exprt(disjunction(intervals)); } -/*******************************************************************\ - -Function: character_refine_preprocesst::convert_is_defined_char - - Inputs: - target - a position in a goto program - - Purpose: Converts function call to an assignment of an expression - corresponding to the java method Character.isDefined:(C)Z - -\*******************************************************************/ - +/// Converts function call to an assignment of an expression corresponding to +/// the java method Character.isDefined:(C)Z +/// \param target: a position in a goto program codet character_refine_preprocesst::convert_is_defined_char( conversion_inputt &target) { @@ -726,48 +453,29 @@ codet character_refine_preprocesst::convert_is_defined_char( &character_refine_preprocesst::expr_of_is_defined, target); } -/*******************************************************************\ - -Function: character_refine_preprocesst::convert_char_is_digit_char - - Inputs: - target - a position in a goto program - - Purpose: Converts function call to an assignment of an expression - corresponding to the java method Character.isDefined:(I)Z - -\*******************************************************************/ - +/// Converts function call to an assignment of an expression corresponding to +/// the java method Character.isDefined:(I)Z +/// \param target: a position in a goto program codet character_refine_preprocesst::convert_is_defined_int( conversion_inputt &target) { return convert_is_defined_char(target); } -/*******************************************************************\ - -Function: character_refine_preprocesst::expr_of_is_digit - - Inputs: - chr - An expression of type character - type - A type for the output - - Outputs: An expression of the given type - - Purpose: Determines if the specified character is a digit. - A character is a digit if its general category type, - provided by Character.getType(ch), is DECIMAL_DIGIT_NUMBER. - - TODO: for now we only support these ranges of digits: - '\u0030' through '\u0039', ISO-LATIN-1 digits ('0' through '9') - '\u0660' through '\u0669', Arabic-Indic digits - '\u06F0' through '\u06F9', Extended Arabic-Indic digits - '\u0966' through '\u096F', Devanagari digits - '\uFF10' through '\uFF19', Fullwidth digits - Many other character ranges contain digits as well. - -\*******************************************************************/ - +/// Determines if the specified character is a digit. A character is a digit if +/// its general category type, provided by Character.getType(ch), is +/// DECIMAL_DIGIT_NUMBER. +/// +/// TODO: for now we only support these ranges of digits: +/// '\u0030' through '\u0039', ISO-LATIN-1 digits ('0' through '9') +/// '\u0660' through '\u0669', Arabic-Indic digits +/// '\u06F0' through '\u06F9', Extended Arabic-Indic digits +/// '\u0966' through '\u096F', Devanagari digits +/// '\uFF10' through '\uFF19', Fullwidth digits +/// Many other character ranges contain digits as well. +/// \param chr: An expression of type character +/// \param type: A type for the output +/// \return An expression of the given type exprt character_refine_preprocesst::expr_of_is_digit( const exprt &chr, const typet &type) { @@ -782,18 +490,9 @@ exprt character_refine_preprocesst::expr_of_is_digit( return digit; } -/*******************************************************************\ - -Function: character_refine_preprocesst::convert_is_digit_char - - Inputs: - target - a position in a goto program - - Purpose: Converts function call to an assignment of an expression - corresponding to the java method Character.isDigit:(C)Z - -\*******************************************************************/ - +/// Converts function call to an assignment of an expression corresponding to +/// the java method Character.isDigit:(C)Z +/// \param target: a position in a goto program codet character_refine_preprocesst::convert_is_digit_char( conversion_inputt &target) { @@ -801,58 +500,29 @@ codet character_refine_preprocesst::convert_is_digit_char( &character_refine_preprocesst::expr_of_is_digit, target); } -/*******************************************************************\ - -Function: character_refine_preprocesst::convert_is_digit_int - - Inputs: - target - a position in a goto program - - Purpose: Converts function call to an assignment of an expression - corresponding to the java method Character.digit:(I)Z - -\*******************************************************************/ - +/// Converts function call to an assignment of an expression corresponding to +/// the java method Character.digit:(I)Z +/// \param target: a position in a goto program codet character_refine_preprocesst::convert_is_digit_int( conversion_inputt &target) { return convert_is_digit_char(target); } -/*******************************************************************\ - -Function: character_refine_preprocesst::expr_of_is_high_surrogate - - Inputs: - expr - An expression of type character - type - A type for the output - - Outputs: A Boolean expression - - Purpose: Determines if the given char value is a Unicode - high-surrogate code unit (also known as leading-surrogate - code unit). - -\*******************************************************************/ - +/// Determines if the given char value is a Unicode high-surrogate code unit +/// (also known as leading-surrogate code unit). +/// \param expr: An expression of type character +/// \param type: A type for the output +/// \return A Boolean expression exprt character_refine_preprocesst::expr_of_is_high_surrogate( const exprt &chr, const typet &type) { return in_interval_expr(chr, 0xD800, 0xDBFF); } -/*******************************************************************\ - -Function: character_refine_preprocesst::convert_is_high_surrogate - - Inputs: - target - a position in a goto program - - Purpose: Converts function call to an assignment of an expression - corresponding to the java method Character.isHighSurrogate:(C)Z - -\*******************************************************************/ - +/// Converts function call to an assignment of an expression corresponding to +/// the java method Character.isHighSurrogate:(C)Z +/// \param target: a position in a goto program codet character_refine_preprocesst::convert_is_high_surrogate( conversion_inputt &target) { @@ -860,26 +530,14 @@ codet character_refine_preprocesst::convert_is_high_surrogate( &character_refine_preprocesst::expr_of_is_high_surrogate, target); } -/*******************************************************************\ - -Function: character_refine_preprocesst::expr_of_is_identifier_ignorable - - Inputs: - expr - An expression of type character - type - A type for the output - - Outputs: A Boolean expression - - Purpose: Determines if the character is one of ignorable in a Java - identifier, that is, it is in one of these ranges: - '\u0000' through '\u0008' - '\u000E' through '\u001B' - '\u007F' through '\u009F' - - TODO: For now, we ignore the FORMAT general category value - -\*******************************************************************/ - +/// Determines if the character is one of ignorable in a Java identifier, that +/// is, it is in one of these ranges: '\u0000' through '\u0008' '\u000E' through +/// '\u001B' '\u007F' through '\u009F' +/// +/// TODO: For now, we ignore the FORMAT general category value +/// \param expr: An expression of type character +/// \param type: A type for the output +/// \return A Boolean expression exprt character_refine_preprocesst::expr_of_is_identifier_ignorable( const exprt &chr, const typet &type) { @@ -891,21 +549,11 @@ exprt character_refine_preprocesst::expr_of_is_identifier_ignorable( return ignorable; } -/*******************************************************************\ - -Function: character_refine_preprocesst::convert_is_identifier_ignorable_char - - Inputs: - target - a position in a goto program - - Purpose: Converts function call to an assignment of an expression - corresponding to the java method - Character.isIdentifierIgnorable:(C)Z - - TODO: For now, we ignore the FORMAT general category value - -\*******************************************************************/ - +/// Converts function call to an assignment of an expression corresponding to +/// the java method Character.isIdentifierIgnorable:(C)Z +/// +/// TODO: For now, we ignore the FORMAT general category value +/// \param target: a position in a goto program codet character_refine_preprocesst::convert_is_identifier_ignorable_char( conversion_inputt &target) { @@ -913,39 +561,20 @@ codet character_refine_preprocesst::convert_is_identifier_ignorable_char( &character_refine_preprocesst::expr_of_is_identifier_ignorable, target); } -/*******************************************************************\ - -Function: character_refine_preprocesst::convert_is_identifier_ignorable_int - - Inputs: - target - a position in a goto program - - Purpose: Converts function call to an assignment of an expression - corresponding to the java method - Character.isIdentifierIgnorable:(I)Z - - TODO: For now, we ignore the FORMAT general category value - -\*******************************************************************/ - +/// Converts function call to an assignment of an expression corresponding to +/// the java method Character.isIdentifierIgnorable:(I)Z +/// +/// TODO: For now, we ignore the FORMAT general category value +/// \param target: a position in a goto program codet character_refine_preprocesst::convert_is_identifier_ignorable_int( conversion_inputt &target) { return convert_is_identifier_ignorable_char(target); } -/*******************************************************************\ - -Function: character_refine_preprocesst::convert_is_ideographic - - Inputs: - target - a position in a goto program - - Purpose: Converts function call to an assignment of an expression - corresponding to the java method Character.isIdeographic:(C)Z - -\*******************************************************************/ - +/// Converts function call to an assignment of an expression corresponding to +/// the java method Character.isIdeographic:(C)Z +/// \param target: a position in a goto program codet character_refine_preprocesst::convert_is_ideographic( conversion_inputt &target) { @@ -957,18 +586,9 @@ codet character_refine_preprocesst::convert_is_ideographic( return code_assignt(result, is_ideograph); } -/*******************************************************************\ - -Function: character_refine_preprocesst::convert_is_ISO_control_char - - Inputs: - target - a position in a goto program - - Purpose: Converts function call to an assignment of an expression - corresponding to the java method Character.isISOControl:(C)Z - -\*******************************************************************/ - +/// Converts function call to an assignment of an expression corresponding to +/// the java method Character.isISOControl:(C)Z +/// \param target: a position in a goto program codet character_refine_preprocesst::convert_is_ISO_control_char( conversion_inputt &target) { @@ -981,39 +601,21 @@ codet character_refine_preprocesst::convert_is_ISO_control_char( return code_assignt(result, iso); } -/*******************************************************************\ - -Function: character_refine_preprocesst::convert_is_ISO_control_int - - Inputs: - target - a position in a goto program - - Purpose: Converts function call to an assignment of an expression - corresponding to the java method Character.isISOControl:(I)Z - -\*******************************************************************/ - +/// Converts function call to an assignment of an expression corresponding to +/// the java method Character.isISOControl:(I)Z +/// \param target: a position in a goto program codet character_refine_preprocesst::convert_is_ISO_control_int( conversion_inputt &target) { return convert_is_ISO_control_char(target); } -/*******************************************************************\ - -Function: character_refine_preprocesst::convert_is_java_identifier_part_char - - Inputs: - target - a position in a goto program - - Purpose: Converts function call to an assignment of an expression - corresponding to the java method Character.isJavaIdentifierPart:(C)Z - - TODO: For now we do not allow currency symbol, connecting punctuation, - combining mark, non-spacing mark - -\*******************************************************************/ - +/// Converts function call to an assignment of an expression corresponding to +/// the java method Character.isJavaIdentifierPart:(C)Z +/// +/// TODO: For now we do not allow currency symbol, connecting punctuation, +/// combining mark, non-spacing mark +/// \param target: a position in a goto program codet character_refine_preprocesst::convert_is_java_identifier_part_char( conversion_inputt &target) { @@ -1021,40 +623,22 @@ codet character_refine_preprocesst::convert_is_java_identifier_part_char( &character_refine_preprocesst::expr_of_is_unicode_identifier_part, target); } -/*******************************************************************\ - -Function: character_refine_preprocesst::convert_is_java_identifier_part_int - - Inputs: - target - a position in a goto program - - Purpose: Converts function call to an assignment of an expression - corresponding to the java method isJavaIdentifierPart:(I)Z - -\*******************************************************************/ - +/// Converts function call to an assignment of an expression corresponding to +/// the java method isJavaIdentifierPart:(I)Z +/// \param target: a position in a goto program codet character_refine_preprocesst::convert_is_java_identifier_part_int( conversion_inputt &target) { return convert_is_unicode_identifier_part_char(target); } -/*******************************************************************\ - -Function: character_refine_preprocesst::convert_is_java_identifier_start_char - - Inputs: - target - a position in a goto program - - Purpose: Converts function call to an assignment of an expression - corresponding to the java method isJavaIdentifierStart:(C)Z - - TODO: For now we only allow letters and letter numbers. - The java specification for this function is not precise on the - other characters. - -\*******************************************************************/ - +/// Converts function call to an assignment of an expression corresponding to +/// the java method isJavaIdentifierStart:(C)Z +/// +/// TODO: For now we only allow letters and letter numbers. +/// The java specification for this function is not precise on the +/// other characters. +/// \param target: a position in a goto program codet character_refine_preprocesst::convert_is_java_identifier_start_char( conversion_inputt &target) { @@ -1062,72 +646,36 @@ codet character_refine_preprocesst::convert_is_java_identifier_start_char( &character_refine_preprocesst::expr_of_is_unicode_identifier_start, target); } -/*******************************************************************\ - -Function: character_refine_preprocesst::convert_char_is_digit_char - - Inputs: - target - a position in a goto program - - Purpose: Converts function call to an assignment of an expression - corresponding to the java method isJavaIdentifierStart:(I)Z - -\*******************************************************************/ - +/// Converts function call to an assignment of an expression corresponding to +/// the java method isJavaIdentifierStart:(I)Z +/// \param target: a position in a goto program codet character_refine_preprocesst::convert_is_java_identifier_start_int( conversion_inputt &target) { return convert_is_java_identifier_start_char(target); } -/*******************************************************************\ - -Function: character_refine_preprocesst::convert_is_java_letter - - Inputs: - target - a position in a goto program - - Purpose: Converts function call to an assignment of an expression - corresponding to the java method Character.isJavaLetter:(C)Z - -\*******************************************************************/ - +/// Converts function call to an assignment of an expression corresponding to +/// the java method Character.isJavaLetter:(C)Z +/// \param target: a position in a goto program codet character_refine_preprocesst::convert_is_java_letter( conversion_inputt &target) { return convert_is_java_identifier_start_char(target); } -/*******************************************************************\ - -Function: character_refine_preprocesst::convert_is_java_letter_or_digit - - Inputs: - target - a position in a goto program - - Purpose: Converts function call to an assignment of an expression - corresponding to the java method isJavaLetterOrDigit:(C)Z - -\*******************************************************************/ - +/// Converts function call to an assignment of an expression corresponding to +/// the java method isJavaLetterOrDigit:(C)Z +/// \param target: a position in a goto program codet character_refine_preprocesst::convert_is_java_letter_or_digit( conversion_inputt &target) { return convert_is_java_identifier_part_char(target); } -/*******************************************************************\ - -Function: character_refine_preprocesst::convert_is_letter_char - - Inputs: - target - a position in a goto program - - Purpose: Converts function call to an assignment of an expression - corresponding to the java method Character.isLetter:(C)Z - -\*******************************************************************/ - +/// Converts function call to an assignment of an expression corresponding to +/// the java method Character.isLetter:(C)Z +/// \param target: a position in a goto program codet character_refine_preprocesst::convert_is_letter_char( conversion_inputt &target) { @@ -1135,56 +683,28 @@ codet character_refine_preprocesst::convert_is_letter_char( &character_refine_preprocesst::expr_of_is_letter, target); } -/*******************************************************************\ - -Function: character_refine_preprocesst::convert_is_letter_int - - Inputs: - target - a position in a goto program - - Purpose: Converts function call to an assignment of an expression - corresponding to the java method Character.isLetter:(I)Z - -\*******************************************************************/ - +/// Converts function call to an assignment of an expression corresponding to +/// the java method Character.isLetter:(I)Z +/// \param target: a position in a goto program codet character_refine_preprocesst::convert_is_letter_int( conversion_inputt &target) { return convert_is_letter_char(target); } -/*******************************************************************\ - -Function: character_refine_preprocesst::expr_of_is_letter_or_digit - - Inputs: - chr - An expression of type character - type - A type for the output - - Outputs: An expression of the given type - - Purpose: Determines if the specified character is a letter or digit. - -\*******************************************************************/ - +/// Determines if the specified character is a letter or digit. +/// \param chr: An expression of type character +/// \param type: A type for the output +/// \return An expression of the given type exprt character_refine_preprocesst::expr_of_is_letter_or_digit( const exprt &chr, const typet &type) { return or_exprt(expr_of_is_letter(chr, type), expr_of_is_digit(chr, type)); } -/*******************************************************************\ - -Function: character_refine_preprocesst::convert_is_letter_or_digit_char - - Inputs: - target - a position in a goto program - - Purpose: Converts function call to an assignment of an expression - corresponding to the java method Character.isLetterOrDigit:(C)Z - -\*******************************************************************/ - +/// Converts function call to an assignment of an expression corresponding to +/// the java method Character.isLetterOrDigit:(C)Z +/// \param target: a position in a goto program codet character_refine_preprocesst::convert_is_letter_or_digit_char( conversion_inputt &target) { @@ -1192,38 +712,20 @@ codet character_refine_preprocesst::convert_is_letter_or_digit_char( &character_refine_preprocesst::expr_of_is_digit, target); } -/*******************************************************************\ - -Function: character_refine_preprocesst::convert_is_letter_or_digit_int - - Inputs: - target - a position in a goto program - - Purpose: Converts function call to an assignment of an expression - corresponding to the java method Character.isLetterOrDigit:(I)Z - -\*******************************************************************/ - +/// Converts function call to an assignment of an expression corresponding to +/// the java method Character.isLetterOrDigit:(I)Z +/// \param target: a position in a goto program codet character_refine_preprocesst::convert_is_letter_or_digit_int( conversion_inputt &target) { return convert_is_letter_or_digit_char(target); } -/*******************************************************************\ - -Function: character_refine_preprocesst::convert_is_lower_case_char - - Inputs: - target - a position in a goto program - - Purpose: Converts function call to an assignment of an expression - corresponding to the java method Character.isLowerCase:(C)Z - - TODO: For now we only consider ASCII characters - -\*******************************************************************/ - +/// Converts function call to an assignment of an expression corresponding to +/// the java method Character.isLowerCase:(C)Z +/// +/// TODO: For now we only consider ASCII characters +/// \param target: a position in a goto program codet character_refine_preprocesst::convert_is_lower_case_char( conversion_inputt &target) { @@ -1231,38 +733,20 @@ codet character_refine_preprocesst::convert_is_lower_case_char( &character_refine_preprocesst::expr_of_is_ascii_lower_case, target); } -/*******************************************************************\ - -Function: character_refine_preprocesst::convert_is_lower_case_int() - - Inputs: - target - a position in a goto program - - Purpose: Converts function call to an assignment of an expression - corresponding to the java method Character.isLowerCase:(I)Z - - TODO: For now we only consider ASCII characters - -\*******************************************************************/ - +/// Converts function call to an assignment of an expression corresponding to +/// the java method Character.isLowerCase:(I)Z +/// +/// TODO: For now we only consider ASCII characters +/// \param target: a position in a goto program codet character_refine_preprocesst::convert_is_lower_case_int( conversion_inputt &target) { return convert_is_lower_case_char(target); } -/*******************************************************************\ - -Function: character_refine_preprocesst::convert_is_low_surrogate - - Inputs: - target - a position in a goto program - - Purpose: Converts function call to an assignment of an expression - corresponding to the java method Character.isLowSurrogate:(I)Z - -\*******************************************************************/ - +/// Converts function call to an assignment of an expression corresponding to +/// the java method Character.isLowSurrogate:(I)Z +/// \param target: a position in a goto program codet character_refine_preprocesst::convert_is_low_surrogate( conversion_inputt &target) { @@ -1274,43 +758,24 @@ codet character_refine_preprocesst::convert_is_low_surrogate( return code_assignt(result, is_low_surrogate); } -/*******************************************************************\ - -Function: character_refine_preprocesst::expr_of_is_mirrored - - Inputs: - expr - An expression of type character - type - A type for the output - - Outputs: An expression of the given type - - Purpose: Determines whether the character is mirrored according to - the Unicode specification. - - TODO: For now only ASCII characters are considered - -\*******************************************************************/ - +/// Determines whether the character is mirrored according to the Unicode +/// specification. +/// +/// TODO: For now only ASCII characters are considered +/// \param expr: An expression of type character +/// \param type: A type for the output +/// \return An expression of the given type exprt character_refine_preprocesst::expr_of_is_mirrored( const exprt &chr, const typet &type) { return in_list_expr(chr, {0x28, 0x29, 0x3C, 0x3E, 0x5B, 0x5D, 0x7B, 0x7D}); } -/*******************************************************************\ - -Function: character_refine_preprocesst::convert_is_mirrored_char - - Inputs: - target - a position in a goto program - - Purpose: Converts function call to an assignment of an expression - corresponding to the java method Character.isMirrored:(C)Z - - TODO: For now only ASCII characters are considered - -\*******************************************************************/ - +/// Converts function call to an assignment of an expression corresponding to +/// the java method Character.isMirrored:(C)Z +/// +/// TODO: For now only ASCII characters are considered +/// \param target: a position in a goto program codet character_refine_preprocesst::convert_is_mirrored_char( conversion_inputt &target) { @@ -1318,59 +783,30 @@ codet character_refine_preprocesst::convert_is_mirrored_char( &character_refine_preprocesst::expr_of_is_mirrored, target); } -/*******************************************************************\ - -Function: character_refine_preprocesst::convert_is_mirrored_int - - Inputs: - target - a position in a goto program - - Purpose: Converts function call to an assignment of an expression - corresponding to the java method Character.isMirrored:(I)Z - - TODO: For now only ASCII characters are considered - -\*******************************************************************/ - +/// Converts function call to an assignment of an expression corresponding to +/// the java method Character.isMirrored:(I)Z +/// +/// TODO: For now only ASCII characters are considered +/// \param target: a position in a goto program codet character_refine_preprocesst::convert_is_mirrored_int( conversion_inputt &target) { return convert_is_mirrored_char(target); } -/*******************************************************************\ - -Function: character_refine_preprocesst::convert_is_space - - Inputs: - target - a position in a goto program - - Purpose: Converts function call to an assignment of an expression - corresponding to the java method Character.isSpace:(C)Z - -\*******************************************************************/ - +/// Converts function call to an assignment of an expression corresponding to +/// the java method Character.isSpace:(C)Z +/// \param target: a position in a goto program codet character_refine_preprocesst::convert_is_space(conversion_inputt &target) { return convert_is_whitespace_char(target); } -/*******************************************************************\ - -Function: character_refine_preprocesst::expr_of_is_space_char - - Inputs: - expr - An expression of type character - type - A type for the output - - Outputs: A Boolean expression - - Purpose: Determines if the specified character is white space - according to Unicode (SPACE_SEPARATOR, LINE_SEPARATOR, or - PARAGRAPH_SEPARATOR) - -\*******************************************************************/ - +/// Determines if the specified character is white space according to Unicode +/// (SPACE_SEPARATOR, LINE_SEPARATOR, or PARAGRAPH_SEPARATOR) +/// \param expr: An expression of type character +/// \param type: A type for the output +/// \return A Boolean expression exprt character_refine_preprocesst::expr_of_is_space_char( const exprt &chr, const typet &type) { @@ -1381,18 +817,9 @@ exprt character_refine_preprocesst::expr_of_is_space_char( return or_exprt(condition0, condition1); } -/*******************************************************************\ - -Function: character_refine_preprocesst::convert_is_space_char - - Inputs: - target - a position in a goto program - - Purpose: Converts function call to an assignment of an expression - corresponding to the java method Character.isSpaceChar:(C)Z - -\*******************************************************************/ - +/// Converts function call to an assignment of an expression corresponding to +/// the java method Character.isSpaceChar:(C)Z +/// \param target: a position in a goto program codet character_refine_preprocesst::convert_is_space_char( conversion_inputt &target) { @@ -1400,58 +827,29 @@ codet character_refine_preprocesst::convert_is_space_char( &character_refine_preprocesst::expr_of_is_space_char, target); } -/*******************************************************************\ - -Function: character_refine_preprocesst::convert_is_space_char_int() - - Inputs: - target - a position in a goto program - - Purpose: Converts function call to an assignment of an expression - corresponding to the java method Character.isSpaceChar:(I)Z - -\*******************************************************************/ - +/// Converts function call to an assignment of an expression corresponding to +/// the java method Character.isSpaceChar:(I)Z +/// \param target: a position in a goto program codet character_refine_preprocesst::convert_is_space_char_int( conversion_inputt &target) { return convert_is_space_char(target); } -/*******************************************************************\ - -Function: character_refine_preprocesst::expr_of_is_supplementary_code_point - - Inputs: - expr - An expression of type character - type - A type for the output - - Outputs: A Boolean expression - - Purpose: Determines whether the specified character (Unicode code - point) is in the supplementary character range. - -\*******************************************************************/ - +/// Determines whether the specified character (Unicode code point) is in the +/// supplementary character range. +/// \param expr: An expression of type character +/// \param type: A type for the output +/// \return A Boolean expression exprt character_refine_preprocesst::expr_of_is_supplementary_code_point( const exprt &chr, const typet &type) { return binary_relation_exprt(chr, ID_gt, from_integer(0xFFFF, chr.type())); } -/*******************************************************************\ - -Function: character_refine_preprocesst::convert_is_supplementary_code_point - - Inputs: - target - a position in a goto program - - Purpose: Converts function call to an assignment of an expression - corresponding to the java method - Character.isSupplementaryCodePoint:(I)Z - -\*******************************************************************/ - +/// Converts function call to an assignment of an expression corresponding to +/// the java method Character.isSupplementaryCodePoint:(I)Z +/// \param target: a position in a goto program codet character_refine_preprocesst::convert_is_supplementary_code_point( conversion_inputt &target) { @@ -1459,39 +857,19 @@ codet character_refine_preprocesst::convert_is_supplementary_code_point( &character_refine_preprocesst::expr_of_is_supplementary_code_point, target); } -/*******************************************************************\ - -Function: character_refine_preprocesst::expr_of_is_surrogate - - Inputs: - expr - An expression of type character - type - A type for the output - - Outputs: A Boolean expression - - Purpose: Determines if the given char value is a Unicode surrogate - code unit. - -\*******************************************************************/ - +/// Determines if the given char value is a Unicode surrogate code unit. +/// \param expr: An expression of type character +/// \param type: A type for the output +/// \return A Boolean expression exprt character_refine_preprocesst::expr_of_is_surrogate( const exprt &chr, const typet &type) { return in_interval_expr(chr, 0xD800, 0xDFFF); } -/*******************************************************************\ - -Function: character_refine_preprocesst::convert_is_surrogate - - Inputs: - target - a position in a goto program - - Purpose: Converts function call to an assignment of an expression - corresponding to the java method Character.isSurrogate:(C)Z - -\*******************************************************************/ - +/// Converts function call to an assignment of an expression corresponding to +/// the java method Character.isSurrogate:(C)Z +/// \param target: a position in a goto program codet character_refine_preprocesst::convert_is_surrogate( conversion_inputt &target) { @@ -1499,18 +877,9 @@ codet character_refine_preprocesst::convert_is_surrogate( &character_refine_preprocesst::expr_of_is_surrogate, target); } -/*******************************************************************\ - -Function: character_refine_preprocesst::convert_is_surrogate_pair - - Inputs: - target - a position in a goto program - - Purpose: Converts function call to an assignment of an expression - corresponding to the java method Character.isSurrogatePair:(CC)Z - -\*******************************************************************/ - +/// Converts function call to an assignment of an expression corresponding to +/// the java method Character.isSurrogatePair:(CC)Z +/// \param target: a position in a goto program codet character_refine_preprocesst::convert_is_surrogate_pair( conversion_inputt &target) { @@ -1524,20 +893,10 @@ codet character_refine_preprocesst::convert_is_surrogate_pair( return code_assignt(result, and_exprt(is_high_surrogate, is_low_surrogate)); } -/*******************************************************************\ - -Function: character_refine_preprocesst::expr_of_is_title_case - - Inputs: - expr - An expression of type character - type - A type for the output - - Outputs: A Boolean expression - - Purpose: Determines if the specified character is a titlecase character. - -\*******************************************************************/ - +/// Determines if the specified character is a titlecase character. +/// \param expr: An expression of type character +/// \param type: A type for the output +/// \return A Boolean expression exprt character_refine_preprocesst::expr_of_is_title_case( const exprt &chr, const typet &type) { @@ -1551,18 +910,9 @@ exprt character_refine_preprocesst::expr_of_is_title_case( return disjunction(conditions); } -/*******************************************************************\ - -Function: character_refine_preprocesst::convert_is_title_case_char - - Inputs: - target - a position in a goto program - - Purpose: Converts function call to an assignment of an expression - corresponding to the java method Character.isTitleCase:(C)Z - -\*******************************************************************/ - +/// Converts function call to an assignment of an expression corresponding to +/// the java method Character.isTitleCase:(C)Z +/// \param target: a position in a goto program codet character_refine_preprocesst::convert_is_title_case_char( conversion_inputt &target) { @@ -1570,39 +920,20 @@ codet character_refine_preprocesst::convert_is_title_case_char( &character_refine_preprocesst::expr_of_is_title_case, target); } -/*******************************************************************\ - -Function: character_refine_preprocesst::convert_is_title_case_int - - Inputs: - target - a position in a goto program - - Purpose: Converts function call to an assignment of an expression - corresponding to the java method Character.isTitleCase:(I)Z - -\*******************************************************************/ - +/// Converts function call to an assignment of an expression corresponding to +/// the java method Character.isTitleCase:(I)Z +/// \param target: a position in a goto program codet character_refine_preprocesst::convert_is_title_case_int( conversion_inputt &target) { return convert_is_title_case_char(target); } -/*******************************************************************\ - -Function: character_refine_preprocesst::expr_of_is_letter_number - - Inputs: - expr - An expression of type character - type - A type for the output - - Outputs: A Boolean expression - - Purpose: Determines if the specified character is in the LETTER_NUMBER - category of Unicode - -\*******************************************************************/ - +/// Determines if the specified character is in the LETTER_NUMBER category of +/// Unicode +/// \param expr: An expression of type character +/// \param type: A type for the output +/// \return A Boolean expression exprt character_refine_preprocesst::expr_of_is_letter_number( const exprt &chr, const typet &type) { @@ -1623,23 +954,13 @@ exprt character_refine_preprocesst::expr_of_is_letter_number( } -/*******************************************************************\ - -Function: character_refine_preprocesst::expr_of_is_unicode_identifier_part - - Inputs: - expr - An expression of type character - type - A type for the output - - Outputs: A Boolean expression - - Purpose: Determines if the character may be part of a Unicode identifier. - - TODO: For now we do not allow connecting punctuation, combining mark, - non-spacing mark - -\*******************************************************************/ - +/// Determines if the character may be part of a Unicode identifier. +/// +/// TODO: For now we do not allow connecting punctuation, combining mark, +/// non-spacing mark +/// \param expr: An expression of type character +/// \param type: A type for the output +/// \return A Boolean expression exprt character_refine_preprocesst::expr_of_is_unicode_identifier_part( const exprt &chr, const typet &type) { @@ -1650,19 +971,9 @@ exprt character_refine_preprocesst::expr_of_is_unicode_identifier_part( return disjunction(conditions); } -/*******************************************************************\ - -Function: character_refine_preprocesst::convert_is_unicode_identifier_part_char - - Inputs: - target - a position in a goto program - - Purpose: Converts function call to an assignment of an expression - corresponding to the java method - Character.isUnicodeIdentifierPart:(C)Z - -\*******************************************************************/ - +/// Converts function call to an assignment of an expression corresponding to +/// the java method Character.isUnicodeIdentifierPart:(C)Z +/// \param target: a position in a goto program codet character_refine_preprocesst::convert_is_unicode_identifier_part_char( conversion_inputt &target) { @@ -1670,40 +981,20 @@ codet character_refine_preprocesst::convert_is_unicode_identifier_part_char( &character_refine_preprocesst::expr_of_is_unicode_identifier_part, target); } -/*******************************************************************\ - -Function: character_refine_preprocesst::convert_is_unicode_identifier_part_int - - Inputs: - target - a position in a goto program - - Purpose: Converts function call to an assignment of an expression - corresponding to the java method - Character.isUnicodeIdentifierPart:(I)Z - -\*******************************************************************/ - +/// Converts function call to an assignment of an expression corresponding to +/// the java method Character.isUnicodeIdentifierPart:(I)Z +/// \param target: a position in a goto program codet character_refine_preprocesst::convert_is_unicode_identifier_part_int( conversion_inputt &target) { return convert_is_unicode_identifier_part_char(target); } -/*******************************************************************\ - -Function: character_refine_preprocesst::expr_of_is_unicode_identifier_start - - Inputs: - chr - An expression of type character - type - A type for the output - - Outputs: A Boolean expression - - Purpose: Determines if the specified character is permissible as the - first character in a Unicode identifier. - -\*******************************************************************/ - +/// Determines if the specified character is permissible as the first character +/// in a Unicode identifier. +/// \param chr: An expression of type character +/// \param type: A type for the output +/// \return A Boolean expression exprt character_refine_preprocesst::expr_of_is_unicode_identifier_start( const exprt &chr, const typet &type) { @@ -1711,19 +1002,9 @@ exprt character_refine_preprocesst::expr_of_is_unicode_identifier_start( expr_of_is_letter(chr, type), expr_of_is_letter_number(chr, type)); } -/*******************************************************************\ - -Function: character_refine_preprocesst::convert_is_unicode_identifier_start_char - - Inputs: - target - a position in a goto program - - Purpose: Converts function call to an assignment of an expression - corresponding to the java method - Character.isUnicodeIdentifierStart:(C)Z - -\*******************************************************************/ - +/// Converts function call to an assignment of an expression corresponding to +/// the java method Character.isUnicodeIdentifierStart:(C)Z +/// \param target: a position in a goto program codet character_refine_preprocesst::convert_is_unicode_identifier_start_char( conversion_inputt &target) { @@ -1731,39 +1012,20 @@ codet character_refine_preprocesst::convert_is_unicode_identifier_start_char( &character_refine_preprocesst::expr_of_is_unicode_identifier_start, target); } -/*******************************************************************\ - -Function: character_refine_preprocesst::convert_is_unicode_identifier_start_int - - Inputs: - target - a position in a goto program - - Purpose: Converts function call to an assignment of an expression - corresponding to the java method - Character.isUnicodeIdentifierStart:(I)Z - -\*******************************************************************/ - +/// Converts function call to an assignment of an expression corresponding to +/// the java method Character.isUnicodeIdentifierStart:(I)Z +/// \param target: a position in a goto program codet character_refine_preprocesst::convert_is_unicode_identifier_start_int( conversion_inputt &target) { return convert_is_unicode_identifier_start_char(target); } -/*******************************************************************\ - -Function: character_refine_preprocesst::convert_is_upper_case_char - - Inputs: - target - a position in a goto program - - Purpose: Converts function call to an assignment of an expression - corresponding to the java method Character.isUpperCase:(C)Z - - TODO: For now we only consider ASCII characters - -\*******************************************************************/ - +/// Converts function call to an assignment of an expression corresponding to +/// the java method Character.isUpperCase:(C)Z +/// +/// TODO: For now we only consider ASCII characters +/// \param target: a position in a goto program codet character_refine_preprocesst::convert_is_upper_case_char( conversion_inputt &target) { @@ -1771,58 +1033,29 @@ codet character_refine_preprocesst::convert_is_upper_case_char( &character_refine_preprocesst::expr_of_is_ascii_upper_case, target); } -/*******************************************************************\ - -Function: character_refine_preprocesst::convert_is_upper_case_int - - Inputs: - target - a position in a goto program - - Purpose: Converts function call to an assignment of an expression - corresponding to the java method Character.isUpperCase:(I)Z - -\*******************************************************************/ - +/// Converts function call to an assignment of an expression corresponding to +/// the java method Character.isUpperCase:(I)Z +/// \param target: a position in a goto program codet character_refine_preprocesst::convert_is_upper_case_int( conversion_inputt &target) { return convert_is_upper_case_char(target); } -/*******************************************************************\ - -Function: character_refine_preprocesst::expr_of_is_valid_code_point - - Inputs: - chr - An expression of type character - type - A type for the output - - Outputs: A Boolean expression - - Purpose: Determines whether the specified code point is a valid - Unicode code point value. - That is, in the range of integers from 0 to 0x10FFFF - -\*******************************************************************/ - +/// Determines whether the specified code point is a valid Unicode code point +/// value. That is, in the range of integers from 0 to 0x10FFFF +/// \param chr: An expression of type character +/// \param type: A type for the output +/// \return A Boolean expression exprt character_refine_preprocesst::expr_of_is_valid_code_point( const exprt &chr, const typet &type) { return binary_relation_exprt(chr, ID_le, from_integer(0x10FFFF, chr.type())); } -/*******************************************************************\ - -Function: character_refine_preprocesst::convert_is_valid_code_point - - Inputs: - target - a position in a goto program - - Purpose: Converts function call to an assignment of an expression - corresponding to the java method Character.isValidCodePoint:(I)Z - -\*******************************************************************/ - +/// Converts function call to an assignment of an expression corresponding to +/// the java method Character.isValidCodePoint:(I)Z +/// \param target: a position in a goto program codet character_refine_preprocesst::convert_is_valid_code_point( conversion_inputt &target) { @@ -1830,26 +1063,14 @@ codet character_refine_preprocesst::convert_is_valid_code_point( &character_refine_preprocesst::expr_of_is_valid_code_point, target); } -/*******************************************************************\ - -Function: character_refine_preprocesst::expr_of_is_whitespace - - Inputs: - expr - An expression of type character - type - A type for the output - - Outputs: A Boolean expression - - Purpose: Determines if the specified character is white space according - to Java. It is the case when it one of the following: - * a Unicode space character (SPACE_SEPARATOR, LINE_SEPARATOR, or - PARAGRAPH_SEPARATOR) but is not also a non-breaking space - ('\u00A0', '\u2007', '\u202F'). - * it is one of these: U+0009 U+000A U+000B U+000C U+000D - U+001C U+001D U+001E U+001F - -\*******************************************************************/ - +/// Determines if the specified character is white space according to Java. It +/// is the case when it one of the following: * a Unicode space character +/// (SPACE_SEPARATOR, LINE_SEPARATOR, or PARAGRAPH_SEPARATOR) but is not also a +/// non-breaking space ('\u00A0', '\u2007', '\u202F'). * it is one of these: +/// U+0009 U+000A U+000B U+000C U+000D U+001C U+001D U+001E U+001F +/// \param expr: An expression of type character +/// \param type: A type for the output +/// \return A Boolean expression exprt character_refine_preprocesst::expr_of_is_whitespace( const exprt &chr, const typet &type) { @@ -1864,18 +1085,9 @@ exprt character_refine_preprocesst::expr_of_is_whitespace( return disjunction(conditions); } -/*******************************************************************\ - -Function: character_refine_preprocesst::convert_is_whitespace_char - - Inputs: - target - a position in a goto program - - Purpose: Converts function call to an assignment of an expression - corresponding to the java method Character.isWhitespace:(C)Z - -\*******************************************************************/ - +/// Converts function call to an assignment of an expression corresponding to +/// the java method Character.isWhitespace:(C)Z +/// \param target: a position in a goto program codet character_refine_preprocesst::convert_is_whitespace_char( conversion_inputt &target) { @@ -1883,41 +1095,21 @@ codet character_refine_preprocesst::convert_is_whitespace_char( &character_refine_preprocesst::expr_of_is_whitespace, target); } -/*******************************************************************\ - -Function: character_refine_preprocesst::convert_is_whitespace_int - - Inputs: - target - a position in a goto program - - Purpose: Converts function call to an assignment of an expression - corresponding to the java method Character.isWhitespace:(I)Z - -\*******************************************************************/ - +/// Converts function call to an assignment of an expression corresponding to +/// the java method Character.isWhitespace:(I)Z +/// \param target: a position in a goto program codet character_refine_preprocesst::convert_is_whitespace_int( conversion_inputt &target) { return convert_is_whitespace_char(target); } -/*******************************************************************\ - -Function: character_refine_preprocesst::expr_of_low_surrogate - - Inputs: - expr - An expression of type character - type - A type for the output - - Outputs: A integer expression of the given type - - Purpose: Returns the trailing surrogate (a low surrogate code unit) - of the surrogate pair representing the specified - supplementary character (Unicode code point) in the UTF-16 - encoding. - -\*******************************************************************/ - +/// Returns the trailing surrogate (a low surrogate code unit) of the surrogate +/// pair representing the specified supplementary character (Unicode code point) +/// in the UTF-16 encoding. +/// \param expr: An expression of type character +/// \param type: A type for the output +/// \return A integer expression of the given type exprt character_refine_preprocesst::expr_of_low_surrogate( const exprt &chr, const typet &type) { @@ -1926,18 +1118,9 @@ exprt character_refine_preprocesst::expr_of_low_surrogate( return plus_exprt(uDC00, mod_exprt(chr, u0400)); } -/*******************************************************************\ - -Function: character_refine_preprocesst::convert_low_surrogate - - Inputs: - target - a position in a goto program - - Purpose: Converts function call to an assignment of an expression - corresponding to the java method Character.lowSurrogate:(I)Z - -\*******************************************************************/ - +/// Converts function call to an assignment of an expression corresponding to +/// the java method Character.lowSurrogate:(I)Z +/// \param target: a position in a goto program codet character_refine_preprocesst::convert_low_surrogate( conversion_inputt &target) { @@ -1945,21 +1128,11 @@ codet character_refine_preprocesst::convert_low_surrogate( &character_refine_preprocesst::expr_of_low_surrogate, target); } -/*******************************************************************\ - -Function: character_refine_preprocesst::expr_of_reverse_bytes - - Inputs: - expr - An expression of type character - type - A type for the output - - Outputs: A character expression of the given type - - Purpose: Returns the value obtained by reversing the order of the - bytes in the specified char value. - -\*******************************************************************/ - +/// Returns the value obtained by reversing the order of the bytes in the +/// specified char value. +/// \param expr: An expression of type character +/// \param type: A type for the output +/// \return A character expression of the given type exprt character_refine_preprocesst::expr_of_reverse_bytes( const exprt &chr, const typet &type) { @@ -1968,18 +1141,9 @@ exprt character_refine_preprocesst::expr_of_reverse_bytes( return plus_exprt(first_byte, second_byte); } -/*******************************************************************\ - -Function: character_refine_preprocesst::convert_reverse_bytes - - Inputs: - target - a position in a goto program - - Purpose: Converts function call to an assignment of an expression - corresponding to the java method Character.reverseBytes:(C)C - -\*******************************************************************/ - +/// Converts function call to an assignment of an expression corresponding to +/// the java method Character.reverseBytes:(C)C +/// \param target: a position in a goto program codet character_refine_preprocesst::convert_reverse_bytes( conversion_inputt &target) { @@ -1987,26 +1151,14 @@ codet character_refine_preprocesst::convert_reverse_bytes( &character_refine_preprocesst::expr_of_reverse_bytes, target); } -/*******************************************************************\ - -Function: character_refine_preprocesst::expr_of_to_chars - - Inputs: - expr - An expression of type character - type - A type for the output - - Outputs: A character array expression of the given type - - Purpose: Converts the specified character (Unicode code point) to - its UTF-16 representation stored in a char array. - If the specified code point is a BMP (Basic Multilingual - Plane or Plane 0) value, the resulting char array has the - same value as codePoint. - If the specified code point is a supplementary code point, - the resulting char array has the corresponding surrogate pair. - -\*******************************************************************/ - +/// Converts the specified character (Unicode code point) to its UTF-16 +/// representation stored in a char array. If the specified code point is a BMP +/// (Basic Multilingual Plane or Plane 0) value, the resulting char array has +/// the same value as codePoint. If the specified code point is a supplementary +/// code point, the resulting char array has the corresponding surrogate pair. +/// \param expr: An expression of type character +/// \param type: A type for the output +/// \return A character array expression of the given type exprt character_refine_preprocesst::expr_of_to_chars( const exprt &chr, const typet &type) { @@ -2022,36 +1174,18 @@ exprt character_refine_preprocesst::expr_of_to_chars( return if_exprt(expr_of_is_bmp_code_point(chr, type), case1, case2); } -/*******************************************************************\ - -Function: character_refine_preprocesst::convert_to_chars - - Inputs: - target - a position in a goto program - - Purpose: Converts function call to an assignment of an expression - corresponding to the java method Character.toChars:(I)[C - -\*******************************************************************/ - +/// Converts function call to an assignment of an expression corresponding to +/// the java method Character.toChars:(I)[C +/// \param target: a position in a goto program codet character_refine_preprocesst::convert_to_chars(conversion_inputt &target) { return convert_char_function( &character_refine_preprocesst::expr_of_to_chars, target); } -/*******************************************************************\ - -Function: character_refine_preprocesst::convert_to_code_point - - Inputs: - target - a position in a goto program - - Purpose: Converts function call to an assignment of an expression - corresponding to the java method Character.toCodePoint:(CC)I - -\*******************************************************************/ - +/// Converts function call to an assignment of an expression corresponding to +/// the java method Character.toCodePoint:(CC)I +/// \param target: a position in a goto program codet character_refine_preprocesst::convert_to_code_point( conversion_inputt &target) { @@ -2077,24 +1211,14 @@ codet character_refine_preprocesst::convert_to_code_point( return code_assignt(result, pair_value); } -/*******************************************************************\ - -Function: character_refine_preprocesst::expr_of_to_lower_case - - Inputs: - chr - An expression of type character - type - A type for the output - - Outputs: An expression of the given type - - Purpose: Converts the character argument to lowercase. - - TODO: For now we only consider ASCII characters but ultimately - we should use case mapping information from the - UnicodeData file - -\*******************************************************************/ - +/// Converts the character argument to lowercase. +/// +/// TODO: For now we only consider ASCII characters but ultimately +/// we should use case mapping information from the +/// UnicodeData file +/// \param chr: An expression of type character +/// \param type: A type for the output +/// \return An expression of the given type exprt character_refine_preprocesst::expr_of_to_lower_case( const exprt &chr, const typet &type) { @@ -2105,18 +1229,9 @@ exprt character_refine_preprocesst::expr_of_to_lower_case( return res; } -/*******************************************************************\ - -Function: character_refine_preprocesst::convert_to_lower_case_char - - Inputs: - target - a position in a goto program - - Purpose: Converts function call to an assignment of an expression - corresponding to the java method Character.toLowerCase:(C)C - -\*******************************************************************/ - +/// Converts function call to an assignment of an expression corresponding to +/// the java method Character.toLowerCase:(C)C +/// \param target: a position in a goto program codet character_refine_preprocesst::convert_to_lower_case_char( conversion_inputt &target) { @@ -2124,38 +1239,19 @@ codet character_refine_preprocesst::convert_to_lower_case_char( &character_refine_preprocesst::expr_of_to_lower_case, target); } -/*******************************************************************\ - -Function: character_refine_preprocesst::convert_to_lower_case_int() - - Inputs: - target - a position in a goto program - - Purpose: Converts function call to an assignment of an expression - corresponding to the java method Character.toLowerCase:(I)I - -\*******************************************************************/ - +/// Converts function call to an assignment of an expression corresponding to +/// the java method Character.toLowerCase:(I)I +/// \param target: a position in a goto program codet character_refine_preprocesst::convert_to_lower_case_int( conversion_inputt &target) { return convert_to_lower_case_char(target); } -/*******************************************************************\ - -Function: character_refine_preprocesst::expr_of_to_title_case - - Inputs: - chr - An expression of type character - type - A type for the output - - Outputs: An expression of the given type - - Purpose: Converts the character argument to titlecase. - -\*******************************************************************/ - +/// Converts the character argument to titlecase. +/// \param chr: An expression of type character +/// \param type: A type for the output +/// \return An expression of the given type exprt character_refine_preprocesst::expr_of_to_title_case( const exprt &chr, const typet &type) { @@ -2189,18 +1285,9 @@ exprt character_refine_preprocesst::expr_of_to_title_case( return res; } -/*******************************************************************\ - -Function: character_refine_preprocesst::convert_to_title_case_char - - Inputs: - target - a position in a goto program - - Purpose: Converts function call to an assignment of an expression - corresponding to the java method Character.toTitleCase:(C)C - -\*******************************************************************/ - +/// Converts function call to an assignment of an expression corresponding to +/// the java method Character.toTitleCase:(C)C +/// \param target: a position in a goto program codet character_refine_preprocesst::convert_to_title_case_char( conversion_inputt &target) { @@ -2208,42 +1295,23 @@ codet character_refine_preprocesst::convert_to_title_case_char( &character_refine_preprocesst::expr_of_to_title_case, target); } -/*******************************************************************\ - -Function: character_refine_preprocesst::convert_to_title_case_int - - Inputs: - target - a position in a goto program - - Purpose: Converts function call to an assignment of an expression - corresponding to the java method Character.toTitleCase:(I)I - -\*******************************************************************/ - +/// Converts function call to an assignment of an expression corresponding to +/// the java method Character.toTitleCase:(I)I +/// \param target: a position in a goto program codet character_refine_preprocesst::convert_to_title_case_int( conversion_inputt &target) { return convert_to_title_case_char(target); } -/*******************************************************************\ - -Function: character_refine_preprocesst::expr_of_to_upper_case - - Inputs: - chr - An expression of type character - type - A type for the output - - Outputs: An expression of the given type - - Purpose: Converts the character argument to uppercase. - - TODO: For now we only consider ASCII characters but ultimately - we should use case mapping information from the - UnicodeData file - -\*******************************************************************/ - +/// Converts the character argument to uppercase. +/// +/// TODO: For now we only consider ASCII characters but ultimately +/// we should use case mapping information from the +/// UnicodeData file +/// \param chr: An expression of type character +/// \param type: A type for the output +/// \return An expression of the given type exprt character_refine_preprocesst::expr_of_to_upper_case( const exprt &chr, const typet &type) { @@ -2254,18 +1322,9 @@ exprt character_refine_preprocesst::expr_of_to_upper_case( return res; } -/*******************************************************************\ - -Function: character_refine_preprocesst::convert_to_upper_case_char - - Inputs: - target - a position in a goto program - - Purpose: Converts function call to an assignment of an expression - corresponding to the java method Character.toUpperCase:(C)C - -\*******************************************************************/ - +/// Converts function call to an assignment of an expression corresponding to +/// the java method Character.toUpperCase:(C)C +/// \param target: a position in a goto program codet character_refine_preprocesst::convert_to_upper_case_char( conversion_inputt &target) { @@ -2273,41 +1332,21 @@ codet character_refine_preprocesst::convert_to_upper_case_char( &character_refine_preprocesst::expr_of_to_upper_case, target); } -/*******************************************************************\ - -Function: character_refine_preprocesst::convert_to_upper_case_int - - Inputs: - target - a position in a goto program - - Purpose: Converts function call to an assignment of an expression - corresponding to the java method Character.toUpperCase:(I)I - -\*******************************************************************/ - +/// Converts function call to an assignment of an expression corresponding to +/// the java method Character.toUpperCase:(I)I +/// \param target: a position in a goto program codet character_refine_preprocesst::convert_to_upper_case_int( conversion_inputt &target) { return convert_to_upper_case_char(target); } -/*******************************************************************\ - -Function: character_refine_preprocesst::replace_character_call - - Inputs: - code - the code of a function call - - Outputs: code where character function call get replaced by - an simple instruction - - Purpose: replace function calls to functions of the Character by - an affectation if possible, returns the same code otherwise. - For this method to have an effect initialize_conversion_table - must have been called before. - -\*******************************************************************/ - +/// replace function calls to functions of the Character by an affectation if +/// possible, returns the same code otherwise. For this method to have an effect +/// initialize_conversion_table must have been called before. +/// \param code: the code of a function call +/// \return code where character function call get replaced by an simple +/// instruction codet character_refine_preprocesst::replace_character_call( const code_function_callt &code) const { @@ -2323,15 +1362,7 @@ codet character_refine_preprocesst::replace_character_call( return code; } -/*******************************************************************\ - -Function: character_refine_preprocesst::initialize_conversion_table - - Purpose: fill maps with correspondance from java method names to - conversion functions - -\*******************************************************************/ - +/// fill maps with correspondance from java method names to conversion functions void character_refine_preprocesst::initialize_conversion_table() { // All methods are listed here in alphabetic order diff --git a/src/java_bytecode/character_refine_preprocess.h b/src/java_bytecode/character_refine_preprocess.h index 45f76a5d5b6..2f41b2ec932 100644 --- a/src/java_bytecode/character_refine_preprocess.h +++ b/src/java_bytecode/character_refine_preprocess.h @@ -11,6 +11,12 @@ Date: March 2017 \*******************************************************************/ +/// \file +/// Preprocess a goto-programs so that calls to the java Character library are +/// replaced by simple expressions. For now support is limited to character in +/// the ASCII range, some methods may have incorrect specifications outside of +/// this range. + #ifndef CPROVER_JAVA_BYTECODE_CHARACTER_REFINE_PREPROCESS_H #define CPROVER_JAVA_BYTECODE_CHARACTER_REFINE_PREPROCESS_H diff --git a/src/java_bytecode/ci_lazy_methods.cpp b/src/java_bytecode/ci_lazy_methods.cpp index 5cafa74ac73..dc71b1c0cd1 100644 --- a/src/java_bytecode/ci_lazy_methods.cpp +++ b/src/java_bytecode/ci_lazy_methods.cpp @@ -6,42 +6,28 @@ Author: Chris Smowton, chris.smowton@diffblue.com \*******************************************************************/ +/// \file +/// Context-insensitive lazy methods container + #include #include "ci_lazy_methods.h" -/*******************************************************************\ - -Function: ci_lazy_methodst::add_needed_method - - Inputs: `method_symbol_name`: method name; must exist in symbol table. - - Outputs: - - Purpose: Notes `method_symbol_name` is referenced from some reachable - function, and should therefore be elaborated. - -\*******************************************************************/ - +/// Notes `method_symbol_name` is referenced from some reachable function, and +/// should therefore be elaborated. +/// \par parameters: `method_symbol_name`: method name; must exist in symbol +/// table. void ci_lazy_methodst::add_needed_method(const irep_idt &method_symbol_name) { needed_methods.push_back(method_symbol_name); } -/*******************************************************************\ - -Function: java_bytecode_parsert::parse - - Inputs: `class_symbol_name`: class name; must exist in symbol table. - - Outputs: Returns true if `class_symbol_name` is new (not seen before). - - Purpose: Notes class `class_symbol_name` will be instantiated, or - a static field belonging to it will be accessed. Also notes - that its static initializer is therefore reachable. - -\*******************************************************************/ - +/// Notes class `class_symbol_name` will be instantiated, or a static field +/// belonging to it will be accessed. Also notes that its static initializer is +/// therefore reachable. +/// \par parameters: `class_symbol_name`: class name; must exist in symbol +/// table. +/// \return Returns true if `class_symbol_name` is new (not seen before). bool ci_lazy_methodst::add_needed_class(const irep_idt &class_symbol_name) { if(!needed_classes.insert(class_symbol_name).second) diff --git a/src/java_bytecode/ci_lazy_methods.h b/src/java_bytecode/ci_lazy_methods.h index 54c4664c694..e64a3f2467c 100644 --- a/src/java_bytecode/ci_lazy_methods.h +++ b/src/java_bytecode/ci_lazy_methods.h @@ -6,6 +6,9 @@ Author: Chris Smowton, chris.smowton@diffblue.com \*******************************************************************/ +/// \file +/// Context-insensitive lazy methods container + #ifndef CPROVER_JAVA_BYTECODE_CI_LAZY_METHODS_H #define CPROVER_JAVA_BYTECODE_CI_LAZY_METHODS_H diff --git a/src/java_bytecode/expr2java.cpp b/src/java_bytecode/expr2java.cpp index e5a1d921bfa..4ea68803020 100644 --- a/src/java_bytecode/expr2java.cpp +++ b/src/java_bytecode/expr2java.cpp @@ -21,18 +21,6 @@ Author: Daniel Kroening, kroening@cs.cmu.edu #include "java_types.h" #include "expr2java.h" -/*******************************************************************\ - -Function: expr2javat::convert_code_function_call - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string expr2javat::convert_code_function_call( const code_function_callt &src, unsigned indent) @@ -103,18 +91,6 @@ std::string expr2javat::convert_code_function_call( return dest; } -/*******************************************************************\ - -Function: expr2javat::convert_struct - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string expr2javat::convert_struct( const exprt &src, unsigned &precedence) @@ -179,18 +155,6 @@ std::string expr2javat::convert_struct( return dest; } -/*******************************************************************\ - -Function: expr2javat::convert_constant - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string expr2javat::convert_constant( const constant_exprt &src, unsigned &precedence) @@ -274,18 +238,6 @@ std::string expr2javat::convert_constant( return expr2ct::convert_constant(src, precedence); } -/*******************************************************************\ - -Function: expr2javat::convert_rec - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string expr2javat::convert_rec( const typet &src, const c_qualifierst &qualifiers, @@ -360,18 +312,6 @@ std::string expr2javat::convert_rec( return expr2ct::convert_rec(src, qualifiers, declarator); } -/*******************************************************************\ - -Function: expr2javat::convert_java_this - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string expr2javat::convert_java_this( const exprt &src, unsigned precedence) @@ -379,18 +319,6 @@ std::string expr2javat::convert_java_this( return "this"; } -/*******************************************************************\ - -Function: expr2javat::convert_java_instanceof - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string expr2javat::convert_java_instanceof( const exprt &src, unsigned precedence) @@ -404,18 +332,6 @@ std::string expr2javat::convert_java_instanceof( return convert(src.op0())+" instanceof "+convert(src.op1().type()); } -/*******************************************************************\ - -Function: expr2javat::convert_java_new - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string expr2javat::convert_java_new( const exprt &src, unsigned precedence) @@ -441,18 +357,6 @@ std::string expr2javat::convert_java_new( return dest; } -/*******************************************************************\ - -Function: expr2javat::convert_code_java_delete - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string expr2javat::convert_code_java_delete( const exprt &src, unsigned indent) @@ -472,18 +376,6 @@ std::string expr2javat::convert_code_java_delete( return dest; } -/*******************************************************************\ - -Function: expr2javat::convert - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string expr2javat::convert_with_precedence( const exprt &src, unsigned &precedence) @@ -519,18 +411,6 @@ std::string expr2javat::convert_with_precedence( return expr2ct::convert_with_precedence(src, precedence); } -/*******************************************************************\ - -Function: expr2javat::convert_code - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string expr2javat::convert_code( const codet &src, unsigned indent) @@ -547,18 +427,6 @@ std::string expr2javat::convert_code( return expr2ct::convert_code(src, indent); } -/*******************************************************************\ - -Function: expr2java - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string expr2java(const exprt &expr, const namespacet &ns) { expr2javat expr2java(ns); @@ -566,18 +434,6 @@ std::string expr2java(const exprt &expr, const namespacet &ns) return expr2java.convert(expr); } -/*******************************************************************\ - -Function: type2java - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string type2java(const typet &type, const namespacet &ns) { expr2javat expr2java(ns); diff --git a/src/java_bytecode/jar_file.cpp b/src/java_bytecode/jar_file.cpp index ee08a50838a..ecfd759932e 100644 --- a/src/java_bytecode/jar_file.cpp +++ b/src/java_bytecode/jar_file.cpp @@ -15,18 +15,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "jar_file.h" -/*******************************************************************\ - -Function: jar_filet::open - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void jar_filet::open( java_class_loader_limitt &class_loader_limit, const std::string &filename) @@ -68,18 +56,6 @@ void jar_filet::open( } } -/*******************************************************************\ - -Function: jar_filet::~jar_filet - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - jar_filet::~jar_filet() { if(mz_ok) @@ -89,18 +65,6 @@ jar_filet::~jar_filet() } } -/*******************************************************************\ - -Function: jar_filet::get_entry - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string jar_filet::get_entry(const irep_idt &name) { if(!mz_ok) @@ -130,18 +94,6 @@ std::string jar_filet::get_entry(const irep_idt &name) return dest; } -/*******************************************************************\ - -Function: jar_filet::get_manifest - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - jar_filet::manifestt jar_filet::get_manifest() { auto entry=filtered_jar.find("META-INF/MANIFEST.MF"); diff --git a/src/java_bytecode/jar_file.h b/src/java_bytecode/jar_file.h index 3ecdfc80d0f..819acf336fd 100644 --- a/src/java_bytecode/jar_file.h +++ b/src/java_bytecode/jar_file.h @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// JAR File Reading + #ifndef CPROVER_JAVA_BYTECODE_JAR_FILE_H #define CPROVER_JAVA_BYTECODE_JAR_FILE_H diff --git a/src/java_bytecode/java_bytecode_convert_class.cpp b/src/java_bytecode/java_bytecode_convert_class.cpp index c92c016bd02..e68409c1d49 100644 --- a/src/java_bytecode/java_bytecode_convert_class.cpp +++ b/src/java_bytecode/java_bytecode_convert_class.cpp @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// JAVA Bytecode Language Conversion + #ifdef DEBUG #include #endif @@ -74,18 +77,6 @@ class java_bytecode_convert_classt:public messaget void add_array_types(); }; -/*******************************************************************\ - -Function: java_bytecode_convert_classt::convert - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void java_bytecode_convert_classt::convert(const classt &c) { std::string qualified_classname="java::"+id2string(c.name); @@ -171,18 +162,6 @@ void java_bytecode_convert_classt::convert(const classt &c) java_root_class(*class_symbol); } -/*******************************************************************\ - -Function: java_bytecode_convert_classt::generate_class_stub - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void java_bytecode_convert_classt::generate_class_stub( const irep_idt &class_name) { @@ -217,18 +196,6 @@ void java_bytecode_convert_classt::generate_class_stub( } } -/*******************************************************************\ - -Function: java_bytecode_convert_classt::convert - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void java_bytecode_convert_classt::convert( symbolt &class_symbol, const fieldt &f) @@ -290,18 +257,6 @@ void java_bytecode_convert_classt::convert( } } -/*******************************************************************\ - -Function: java_bytecode_convert_classt::add_array_types - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void java_bytecode_convert_classt::add_array_types() { const std::string letters="ijsbcfdza"; @@ -459,18 +414,6 @@ void java_bytecode_convert_classt::add_array_types() } } -/*******************************************************************\ - -Function: java_bytecode_convert_class - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool java_bytecode_convert_class( const java_bytecode_parse_treet &parse_tree, symbol_tablet &symbol_table, diff --git a/src/java_bytecode/java_bytecode_convert_class.h b/src/java_bytecode/java_bytecode_convert_class.h index b3b71426b1d..60fd9ad4fdd 100644 --- a/src/java_bytecode/java_bytecode_convert_class.h +++ b/src/java_bytecode/java_bytecode_convert_class.h @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// JAVA Bytecode Language Conversion + #ifndef CPROVER_JAVA_BYTECODE_JAVA_BYTECODE_CONVERT_CLASS_H #define CPROVER_JAVA_BYTECODE_JAVA_BYTECODE_CONVERT_CLASS_H diff --git a/src/java_bytecode/java_bytecode_convert_method.cpp b/src/java_bytecode/java_bytecode_convert_method.cpp index 2f9de7497ad..60f8734e65b 100644 --- a/src/java_bytecode/java_bytecode_convert_method.cpp +++ b/src/java_bytecode/java_bytecode_convert_method.cpp @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// JAVA Bytecode Language Conversion + #ifdef DEBUG #include #endif @@ -57,24 +60,14 @@ class patternt const char *p; }; -/*******************************************************************\ - -Function: assign_parameter_names - - Inputs: `ftype`: Function type whose parameters should be named - `name_prefix`: Prefix for parameter names, typically the - parent function's name. - `symbol_table`: Global symbol table - - Outputs: Assigns parameter names (side-effects on `ftype`) to - function stub parameters, which are initially nameless - as method conversion hasn't happened. - Also creates symbols in `symbol_table`. - - Purpose: See above - -\*******************************************************************/ - +/// See above +/// \par parameters: `ftype`: Function type whose parameters should be named +/// `name_prefix`: Prefix for parameter names, typically the parent function's +/// name. +/// `symbol_table`: Global symbol table +/// \return Assigns parameter names (side-effects on `ftype`) to function stub +/// parameters, which are initially nameless as method conversion hasn't +/// happened. Also creates symbols in `symbol_table`. void assign_parameter_names( code_typet &ftype, const irep_idt &name_prefix, @@ -160,18 +153,7 @@ exprt::operandst java_bytecode_convert_methodt::pop(std::size_t n) return operands; } -/*******************************************************************\ - -Function: java_bytecode_convert_methodt::pop_residue - -Inputs: - -Outputs: - -Purpose: removes minimum(n, stack.size()) elements from the stack - -\*******************************************************************/ - +/// removes minimum(n, stack.size()) elements from the stack void java_bytecode_convert_methodt::pop_residue(std::size_t n) { std::size_t residue_size=std::min(n, stack.size()); @@ -251,25 +233,14 @@ const exprt java_bytecode_convert_methodt::variable( } } -/*******************************************************************\ - -Function: java_bytecode_convert_method_lazy - - Inputs: `class_symbol`: class this method belongs to - `method_identifier`: fully qualified method name, including - type signature (e.g. "x.y.z.f:(I)") - `m`: parsed method object to convert - `symbol_table`: global symbol table (will be modified) - - Outputs: - - Purpose: This creates a method symbol in the symtab, but doesn't - actually perform method conversion just yet. The caller - should call java_bytecode_convert_method later to give the - symbol/method a body. - -\*******************************************************************/ - +/// This creates a method symbol in the symtab, but doesn't actually perform +/// method conversion just yet. The caller should call +/// java_bytecode_convert_method later to give the symbol/method a body. +/// \par parameters: `class_symbol`: class this method belongs to +/// `method_identifier`: fully qualified method name, including type signature +/// (e.g. "x.y.z.f:(I)") +/// `m`: parsed method object to convert +/// `symbol_table`: global symbol table (will be modified) void java_bytecode_convert_method_lazy( const symbolt &class_symbol, const irep_idt &method_identifier, @@ -321,18 +292,6 @@ void java_bytecode_convert_method_lazy( symbol_table.add(method_symbol); } -/*******************************************************************\ - -Function: java_bytecode_convert_methodt::convert - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void java_bytecode_convert_methodt::convert( const symbolt &class_symbol, const methodt &m) @@ -483,18 +442,6 @@ void java_bytecode_convert_methodt::convert( symbol_table.add(method_symbol); } -/*******************************************************************\ - -Function: java_bytecode_convert_methodt::get_bytecode_info - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - const bytecode_infot &java_bytecode_convert_methodt::get_bytecode_info( const irep_idt &statement) { @@ -569,20 +516,12 @@ codet java_bytecode_convert_methodt::get_array_bounds_check( return bounds_checks; } -/*******************************************************************\ - -Function: replace_goto_target - - Inputs: 'repl', a block of code in which to perform replacement, and - an old_label that should be replaced throughout by new_label. - - Outputs: None (side-effects on repl) - - Purpose: Find all goto statements in 'repl' that target 'old_label' - and redirect them to 'new_label'. - -\*******************************************************************/ - +/// Find all goto statements in 'repl' that target 'old_label' and redirect them +/// to 'new_label'. +/// \par parameters: 'repl', a block of code in which to perform replacement, +/// and +/// an old_label that should be replaced throughout by new_label. +/// \return None (side-effects on repl) void java_bytecode_convert_methodt::replace_goto_target( codet &repl, const irep_idt &old_label, @@ -603,27 +542,20 @@ void java_bytecode_convert_methodt::replace_goto_target( } } -/*******************************************************************\ - -Function: java_bytecode_convert_methodt::get_block_for_pcrange - - Inputs: 'tree', a code block descriptor, and 'this_block', the corresponding - actual code_blockt. 'address_start' and 'address_limit', the Java - bytecode offsets searched for. 'next_block_start_address', the - bytecode offset of tree/this_block's successor sibling, or UINT_MAX - if none exists. - - Outputs: Returns the code_blockt most closely enclosing the given address range. - - Purpose: 'tree' describes a tree of code_blockt objects; this_block is the - corresponding block (thus they are both trees with the same shape). - The caller is looking for the single block in the tree that most - closely encloses bytecode address range [address_start,address_limit). - 'next_block_start_address' is the start address of 'tree's successor - sibling and is used to determine when the range spans out of its bounds. - -\*******************************************************************/ - +/// 'tree' describes a tree of code_blockt objects; this_block is the +/// corresponding block (thus they are both trees with the same shape). The +/// caller is looking for the single block in the tree that most closely +/// encloses bytecode address range [address_start,address_limit). +/// 'next_block_start_address' is the start address of 'tree's successor sibling +/// and is used to determine when the range spans out of its bounds. +/// \par parameters: 'tree', a code block descriptor, and 'this_block', the +/// corresponding +/// actual code_blockt. 'address_start' and 'address_limit', the Java +/// bytecode offsets searched for. 'next_block_start_address', the +/// bytecode offset of tree/this_block's successor sibling, or UINT_MAX +/// if none exists. +/// \return Returns the code_blockt most closely enclosing the given address +/// range. code_blockt &java_bytecode_convert_methodt::get_block_for_pcrange( block_tree_nodet &tree, code_blockt &this_block, @@ -642,29 +574,20 @@ code_blockt &java_bytecode_convert_methodt::get_block_for_pcrange( false); } -/*******************************************************************\ - -Function: java_bytecode_convert_methodt::get_or_create_block_for_pcrange - - Inputs: See above, plus the bytecode address map 'amap' and 'allow_merge' - which is always true except when called from get_block_for_pcrange - - Outputs: See above, plus potential side-effects on 'tree' and 'this_block' - as descibed in 'Purpose' - - Purpose: As above, but this version can additionally create a new branch - in the block_tree-node and code_blockt trees to envelop the requested - address range. For example, if the tree was initially flat, with - nodes (1-10), (11-20), (21-30) and the caller asked for range 13-28, - this would build a surrounding tree node, leaving the tree of shape - (1-10), ^( (11-20), (21-30) )^, and return a reference to the - new branch highlighted with ^^. - 'tree' and 'this_block' trees are always maintained with equal - shapes. ('this_block' may additionally contain code_declt children - which are ignored for this purpose) - -\*******************************************************************/ - +/// As above, but this version can additionally create a new branch in the +/// block_tree-node and code_blockt trees to envelop the requested address +/// range. For example, if the tree was initially flat, with nodes (1-10), +/// (11-20), (21-30) and the caller asked for range 13-28, this would build a +/// surrounding tree node, leaving the tree of shape (1-10), ^( (11-20), (21-30) +/// )^, and return a reference to the new branch highlighted with ^^. 'tree' and +/// 'this_block' trees are always maintained with equal shapes. ('this_block' +/// may additionally contain code_declt children which are ignored for this +/// purpose) +/// \par parameters: See above, plus the bytecode address map 'amap' and +/// 'allow_merge' +/// which is always true except when called from get_block_for_pcrange +/// \return See above, plus potential side-effects on 'tree' and 'this_block' as +/// descibed in 'Purpose' code_blockt &java_bytecode_convert_methodt::get_or_create_block_for_pcrange( block_tree_nodet &tree, code_blockt &this_block, @@ -882,20 +805,11 @@ static void gather_symbol_live_ranges( } } -/*******************************************************************\ - -Function: java_bytecode_convert_methodt::check_static_field_stub - - Inputs: `se`: Symbol expression referring to a static field - `basename`: The static field's basename - - Outputs: Creates a symbol table entry for the static field if one - doesn't exist already. - - Purpose: See above - -\*******************************************************************/ - +/// See above +/// \par parameters: `se`: Symbol expression referring to a static field +/// `basename`: The static field's basename +/// \return Creates a symbol table entry for the static field if one doesn't +/// exist already. void java_bytecode_convert_methodt::check_static_field_stub( const symbol_exprt &symbol_expr, const irep_idt &basename) @@ -919,20 +833,11 @@ void java_bytecode_convert_methodt::check_static_field_stub( } } -/*******************************************************************\ - -Function: java_bytecode_convert_methodt::class_needs_clinit - - Inputs: classname: Class name - - Outputs: Returns true if the given class or one of its parents - has a static initializer - - Purpose: Determine whether a `new` or static access against `classname` - should be prefixed with a static initialization check. - -\*******************************************************************/ - +/// Determine whether a `new` or static access against `classname` should be +/// prefixed with a static initialization check. +/// \param classname: Class name +/// \return Returns true if the given class or one of its parents has a static +/// initializer bool java_bytecode_convert_methodt::class_needs_clinit( const irep_idt &classname) { @@ -970,22 +875,13 @@ bool java_bytecode_convert_methodt::class_needs_clinit( return false; } -/*******************************************************************\ - -Function: java_bytecode_convert_methodt::get_or_create_clinit_wrapper - - Inputs: classname: Class name - - Outputs: Returns a symbol_exprt pointing to the given class' clinit - wrapper if one is required, or nil otherwise. - - Purpose: Create a ::clinit_wrapper the first time a static initializer - might be called. The wrapper method checks whether static init - has already taken place, calls the actual method if - not, and initializes super-classes and interfaces. - -\*******************************************************************/ - +/// Create a ::clinit_wrapper the first time a static initializer might be +/// called. The wrapper method checks whether static init has already taken +/// place, calls the actual method if not, and initializes super- +/// classes and interfaces. +/// \param classname: Class name +/// \return Returns a symbol_exprt pointing to the given class' clinit wrapper +/// if one is required, or nil otherwise. exprt java_bytecode_convert_methodt::get_or_create_clinit_wrapper( const irep_idt &classname) { @@ -1061,21 +957,11 @@ exprt java_bytecode_convert_methodt::get_or_create_clinit_wrapper( return wrapper_method_symbol.symbol_expr(); } -/*******************************************************************\ - -Function: java_bytecode_convert_methodt::get_clinit_call - - Inputs: classname: Class name - - Outputs: Returns a function call to the given class' static initializer - wrapper if one is needed, or a skip instruction otherwise. - - Purpose: Each static access to classname should be prefixed with a check - for necessary static init; this returns a call implementing - that check. - -\*******************************************************************/ - +/// Each static access to classname should be prefixed with a check for +/// necessary static init; this returns a call implementing that check. +/// \param classname: Class name +/// \return Returns a function call to the given class' static initializer +/// wrapper if one is needed, or a skip instruction otherwise. codet java_bytecode_convert_methodt::get_clinit_call( const irep_idt &classname) { @@ -1087,18 +973,6 @@ codet java_bytecode_convert_methodt::get_clinit_call( return ret; } -/*******************************************************************\ - -Function: get_bytecode_type_width - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - static unsigned get_bytecode_type_width(const typet &ty) { if(ty.id()==ID_pointer) @@ -1106,18 +980,6 @@ static unsigned get_bytecode_type_width(const typet &ty) return ty.get_unsigned_int(ID_width); } -/*******************************************************************\ - -Function: java_bytecode_convert_methodt::convert_instructions - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - codet java_bytecode_convert_methodt::convert_instructions( const methodt &method, const code_typet &method_type) @@ -2752,18 +2614,6 @@ codet java_bytecode_convert_methodt::convert_instructions( return code; } -/*******************************************************************\ - -Function: java_bytecode_convert_method - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void java_bytecode_convert_method( const symbolt &class_symbol, const java_bytecode_parse_treet::methodt &method, diff --git a/src/java_bytecode/java_bytecode_convert_method.h b/src/java_bytecode/java_bytecode_convert_method.h index 43c1cdec380..ba0926e301a 100644 --- a/src/java_bytecode/java_bytecode_convert_method.h +++ b/src/java_bytecode/java_bytecode_convert_method.h @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// JAVA Bytecode Language Conversion + #ifndef CPROVER_JAVA_BYTECODE_JAVA_BYTECODE_CONVERT_METHOD_H #define CPROVER_JAVA_BYTECODE_JAVA_BYTECODE_CONVERT_METHOD_H diff --git a/src/java_bytecode/java_bytecode_convert_method_class.h b/src/java_bytecode/java_bytecode_convert_method_class.h index 67cc175c184..eea60595266 100644 --- a/src/java_bytecode/java_bytecode_convert_method_class.h +++ b/src/java_bytecode/java_bytecode_convert_method_class.h @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// JAVA Bytecode Language Conversion + #ifndef CPROVER_JAVA_BYTECODE_JAVA_BYTECODE_CONVERT_METHOD_CLASS_H #define CPROVER_JAVA_BYTECODE_JAVA_BYTECODE_CONVERT_METHOD_CLASS_H diff --git a/src/java_bytecode/java_bytecode_internal_additions.cpp b/src/java_bytecode/java_bytecode_internal_additions.cpp index c0d019a4cc4..bae844d6532 100644 --- a/src/java_bytecode/java_bytecode_internal_additions.cpp +++ b/src/java_bytecode/java_bytecode_internal_additions.cpp @@ -13,18 +13,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "java_bytecode_internal_additions.h" -/*******************************************************************\ - -Function: java_internal_additions - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void java_internal_additions(symbol_tablet &dest) { // add __CPROVER_rounding_mode diff --git a/src/java_bytecode/java_bytecode_language.cpp b/src/java_bytecode/java_bytecode_language.cpp index c38b8d735fa..6f90fd70cf7 100644 --- a/src/java_bytecode/java_bytecode_language.cpp +++ b/src/java_bytecode/java_bytecode_language.cpp @@ -28,18 +28,9 @@ Author: Daniel Kroening, kroening@kroening.com #include "expr2java.h" -/*******************************************************************\ - -Function: java_bytecode_languaget::get_language_options - - Inputs: Command-line options - - Outputs: None - - Purpose: Consume options that are java bytecode specific. - -\*******************************************************************/ - +/// Consume options that are java bytecode specific. +/// \param Command:line options +/// \return None void java_bytecode_languaget::get_language_options(const cmdlinet &cmd) { assume_inputs_non_null=cmd.isset("java-assume-inputs-non-null"); @@ -87,52 +78,17 @@ void java_bytecode_languaget::get_language_options(const cmdlinet &cmd) java_cp_include_files=".*"; } -/*******************************************************************\ - -Function: java_bytecode_languaget::extensions - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::set java_bytecode_languaget::extensions() const { return { "class", "jar" }; } -/*******************************************************************\ - -Function: java_bytecode_languaget::modules_provided - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void java_bytecode_languaget::modules_provided(std::set &modules) { // modules.insert(translation_unit(parse_path)); } -/*******************************************************************\ - -Function: java_bytecode_languaget::preprocess - - Inputs: - - Outputs: - - Purpose: ANSI-C preprocessing - -\*******************************************************************/ - +/// ANSI-C preprocessing bool java_bytecode_languaget::preprocess( std::istream &instream, const std::string &path, @@ -142,18 +98,6 @@ bool java_bytecode_languaget::preprocess( return true; } -/*******************************************************************\ - -Function: java_bytecode_languaget::parse - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool java_bytecode_languaget::parse( std::istream &instream, const std::string &path) @@ -208,27 +152,18 @@ bool java_bytecode_languaget::parse( return false; } -/*******************************************************************\ - -Function: get_virtual_method_target - - Inputs: `needed_classes`: set of classes that can be instantiated. - Any potential callee not in this set will be ignored. - `call_basename`: unqualified function name with type - signature (e.g. "f:(I)") - `classname`: class name that may define or override a - function named `call_basename`. - `symbol_table`: global symtab - - Outputs: Returns the fully qualified name of `classname`'s definition - of `call_basename` if found and `classname` is present in - `needed_classes`, or irep_idt() otherwise. - - Purpose: Find a virtual callee, if one is defined and the callee type - is known to exist. - -\*******************************************************************/ - +/// Find a virtual callee, if one is defined and the callee type is known to +/// exist. +/// \par parameters: `needed_classes`: set of classes that can be instantiated. +/// Any potential callee not in this set will be ignored. +/// `call_basename`: unqualified function name with type signature (e.g. +/// "f:(I)") +/// `classname`: class name that may define or override a function named +/// `call_basename`. +/// `symbol_table`: global symtab +/// \return Returns the fully qualified name of `classname`'s definition of +/// `call_basename` if found and `classname` is present in `needed_classes`, +/// or irep_idt() otherwise. static irep_idt get_virtual_method_target( const std::set &needed_classes, const irep_idt &call_basename, @@ -245,27 +180,17 @@ static irep_idt get_virtual_method_target( return irep_idt(); } -/*******************************************************************\ - -Function: get_virtual_method_target - - Inputs: `c`: function call whose potential target functions should - be determined. - `needed_classes`: set of classes that can be instantiated. - Any potential callee not in this set will be ignored. - `symbol_table`: global symtab - `class_hierarchy`: global class hierarchy - - Outputs: Populates `needed_methods` with all possible `c` callees, - taking `needed_classes` into account (virtual function - overrides defined on classes that are not 'needed' are - ignored) - - Purpose: Find possible callees, excluding types that are not known - to be instantiated. - -\*******************************************************************/ - +/// Find possible callees, excluding types that are not known to be +/// instantiated. +/// \par parameters: `c`: function call whose potential target functions should +/// be determined. +/// `needed_classes`: set of classes that can be instantiated. Any potential +/// callee not in this set will be ignored. +/// `symbol_table`: global symtab +/// `class_hierarchy`: global class hierarchy +/// \return Populates `needed_methods` with all possible `c` callees, taking +/// `needed_classes` into account (virtual function overrides defined on +/// classes that are not 'needed' are ignored) static void get_virtual_method_targets( const code_function_callt &c, const std::set &needed_classes, @@ -340,19 +265,10 @@ static void get_virtual_method_targets( } } -/*******************************************************************\ - -Function: gather_virtual_callsites - - Inputs: `e`: expression tree to search - - Outputs: Populates `result` with pointers to each function call - within e that calls a virtual function. - - Purpose: See output - -\*******************************************************************/ - +/// See output +/// \par parameters: `e`: expression tree to search +/// \return Populates `result` with pointers to each function call within e that +/// calls a virtual function. static void gather_virtual_callsites( const exprt &e, std::vector &result) @@ -368,20 +284,11 @@ static void gather_virtual_callsites( gather_virtual_callsites(*it, result); } -/*******************************************************************\ - -Function: gather_needed_globals - - Inputs: `e`: expression tree to search - `symbol_table`: global symtab - - Outputs: Populates `needed` with global variable symbols referenced - from `e` or its children. - - Purpose: See output - -\*******************************************************************/ - +/// See output +/// \par parameters: `e`: expression tree to search +/// `symbol_table`: global symtab +/// \return Populates `needed` with global variable symbols referenced from `e` +/// or its children. static void gather_needed_globals( const exprt &e, const symbol_tablet &symbol_table, @@ -405,22 +312,13 @@ static void gather_needed_globals( gather_needed_globals(*opit, symbol_table, needed); } -/*******************************************************************\ - -Function: gather_field_types - - Inputs: `class_type`: root of class tree to search - `ns`: global namespace - - Outputs: Populates `lazy_methods` with all Java reference types - reachable starting at `class_type`. For example if - `class_type` is `symbol_typet("java::A")` and A has a B - field, then `B` (but not `A`) will noted as a needed class. - - Purpose: See output - -\*******************************************************************/ - +/// See output +/// \par parameters: `class_type`: root of class tree to search +/// `ns`: global namespace +/// \return Populates `lazy_methods` with all Java reference types reachable +/// starting at `class_type`. For example if `class_type` is +/// `symbol_typet("java::A")` and A has a B field, then `B` (but not `A`) will +/// noted as a needed class. static void gather_field_types( const typet &class_type, const namespacet &ns, @@ -444,23 +342,14 @@ static void gather_field_types( } } -/*******************************************************************\ - -Function: initialize_needed_classes - - Inputs: `entry_points`: list of fully-qualified function names that - we should assume are reachable - `ns`: global namespace - `ch`: global class hierarchy - - Outputs: Populates `lazy_methods` with all Java reference types - whose references may be passed, directly or indirectly, - to any of the functions in `entry_points`. - - Purpose: See output - -\*******************************************************************/ - +/// See output +/// \par parameters: `entry_points`: list of fully-qualified function names that +/// we should assume are reachable +/// `ns`: global namespace +/// `ch`: global class hierarchy +/// \return Populates `lazy_methods` with all Java reference types whose +/// references may be passed, directly or indirectly, to any of the functions +/// in `entry_points`. static void initialize_needed_classes( const std::vector &entry_points, const namespacet &ns, @@ -495,18 +384,6 @@ static void initialize_needed_classes( lazy_methods.add_needed_class("java::java.lang.Object"); } -/*******************************************************************\ - -Function: java_bytecode_languaget::typecheck - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool java_bytecode_languaget::typecheck( symbol_tablet &symbol_table, const std::string &module) @@ -568,32 +445,19 @@ bool java_bytecode_languaget::typecheck( return false; } -/*******************************************************************\ - -Function: java_bytecode_languaget::do_ci_lazy_method_conversion - - Inputs: `symbol_table`: global symbol table - `lazy_methods`: map from method names to relevant symbol - and parsed-method objects. - - Outputs: Elaborates lazily-converted methods that may be reachable - starting from the main entry point (usually provided with - the --function command-line option) (side-effect on the - symbol_table). Returns false on success. - - Purpose: Uses a simple context-insensitive ('ci') analysis to - determine which methods may be reachable from the main - entry point. In brief, static methods are reachable if we - find a callsite in another reachable site, while virtual - methods are reachable if we find a virtual callsite - targeting a compatible type *and* a constructor callsite - indicating an object of that type may be instantiated (or - evidence that an object of that type exists before the - main function is entered, such as being passed as a - parameter). - -\*******************************************************************/ - +/// Uses a simple context-insensitive ('ci') analysis to determine which methods +/// may be reachable from the main entry point. In brief, static methods are +/// reachable if we find a callsite in another reachable site, while virtual +/// methods are reachable if we find a virtual callsite targeting a compatible +/// type *and* a constructor callsite indicating an object of that type may be +/// instantiated (or evidence that an object of that type exists before the main +/// function is entered, such as being passed as a parameter). +/// \par parameters: `symbol_table`: global symbol table +/// `lazy_methods`: map from method names to relevant symbol and parsed-method +/// objects. +/// \return Elaborates lazily-converted methods that may be reachable starting +/// from the main entry point (usually provided with the --function command- +/// line option) (side-effect on the symbol_table). Returns false on success. bool java_bytecode_languaget::do_ci_lazy_method_conversion( symbol_tablet &symbol_table, lazy_methodst &lazy_methods) @@ -740,22 +604,11 @@ bool java_bytecode_languaget::do_ci_lazy_method_conversion( return false; } -/*******************************************************************\ - -Function: java_bytecode_languaget::lazy_methods_provided - - Inputs: None - - Outputs: Populates `methods` with the complete list of lazy methods - that are available to convert (those which are valid - parameters for `convert_lazy_method`) - - Purpose: Provide feedback to `language_filest` so that when asked - for a lazy method, it can delegate to this instance of - java_bytecode_languaget. - -\*******************************************************************/ - +/// Provide feedback to `language_filest` so that when asked for a lazy method, +/// it can delegate to this instance of java_bytecode_languaget. +/// \return Populates `methods` with the complete list of lazy methods that are +/// available to convert (those which are valid parameters for +/// `convert_lazy_method`) void java_bytecode_languaget::lazy_methods_provided( std::set &methods) const { @@ -763,26 +616,15 @@ void java_bytecode_languaget::lazy_methods_provided( methods.insert(kv.first); } -/*******************************************************************\ - -Function: java_bytecode_languaget::convert_lazy_method - - Inputs: `id`: method ID to convert - `symtab`: global symbol table - - Outputs: Amends the symbol table entry for function `id`, which - should be a lazy method provided by this instance of - `java_bytecode_languaget`. It should initially have a nil - value. After this method completes, it will have a value - representing the method body, identical to that produced - using eager method conversion. - - Purpose: Promote a lazy-converted method (one whose type is known - but whose body hasn't been converted) into a fully- - elaborated one. - -\*******************************************************************/ - +/// Promote a lazy-converted method (one whose type is known but whose body +/// hasn't been converted) into a fully- elaborated one. +/// \par parameters: `id`: method ID to convert +/// `symtab`: global symbol table +/// \return Amends the symbol table entry for function `id`, which should be a +/// lazy method provided by this instance of `java_bytecode_languaget`. It +/// should initially have a nil value. After this method completes, it will +/// have a value representing the method body, identical to that produced +/// using eager method conversion. void java_bytecode_languaget::convert_lazy_method( const irep_idt &id, symbol_tablet &symtab) @@ -797,18 +639,9 @@ void java_bytecode_languaget::convert_lazy_method( string_preprocess); } -/*******************************************************************\ - -Function: java_bytecode_languaget::replace_string_methods - - Inputs: - context - a symbol table - - Purpose: Replace methods of the String library that are in the symbol table - by code generated by string_preprocess. - -\*******************************************************************/ - +/// Replace methods of the String library that are in the symbol table by code +/// generated by string_preprocess. +/// \param context: a symbol table void java_bytecode_languaget::replace_string_methods( symbol_tablet &context) { @@ -834,18 +667,6 @@ void java_bytecode_languaget::replace_string_methods( } } -/*******************************************************************\ - -Function: java_bytecode_languaget::final - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool java_bytecode_languaget::final(symbol_tablet &symbol_table) { /* @@ -872,52 +693,16 @@ bool java_bytecode_languaget::final(symbol_tablet &symbol_table) max_nondet_array_length)); } -/*******************************************************************\ - -Function: java_bytecode_languaget::show_parse - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void java_bytecode_languaget::show_parse(std::ostream &out) { java_class_loader(main_class).output(out); } -/*******************************************************************\ - -Function: new_java_bytecode_language - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - languaget *new_java_bytecode_language() { return new java_bytecode_languaget; } -/*******************************************************************\ - -Function: java_bytecode_languaget::from_expr - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool java_bytecode_languaget::from_expr( const exprt &expr, std::string &code, @@ -927,18 +712,6 @@ bool java_bytecode_languaget::from_expr( return false; } -/*******************************************************************\ - -Function: java_bytecode_languaget::from_type - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool java_bytecode_languaget::from_type( const typet &type, std::string &code, @@ -948,18 +721,6 @@ bool java_bytecode_languaget::from_type( return false; } -/*******************************************************************\ - -Function: java_bytecode_languaget::to_expr - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool java_bytecode_languaget::to_expr( const std::string &code, const std::string &module, @@ -1007,18 +768,6 @@ bool java_bytecode_languaget::to_expr( return true; // fail for now } -/*******************************************************************\ - -Function: java_bytecode_languaget::~java_bytecode_languaget - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - java_bytecode_languaget::~java_bytecode_languaget() { } diff --git a/src/java_bytecode/java_bytecode_parse_tree.cpp b/src/java_bytecode/java_bytecode_parse_tree.cpp index 63fb5674f85..325d6df9caf 100644 --- a/src/java_bytecode/java_bytecode_parse_tree.cpp +++ b/src/java_bytecode/java_bytecode_parse_tree.cpp @@ -17,18 +17,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "java_bytecode_parse_tree.h" -/*******************************************************************\ - -Function: java_bytecode_parse_treet::swap - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void java_bytecode_parse_treet::classt::swap( classt &other) { @@ -43,18 +31,6 @@ void java_bytecode_parse_treet::classt::swap( other.annotations.swap(annotations); } -/*******************************************************************\ - -Function: java_bytecode_parse_treet::classt::output - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void java_bytecode_parse_treet::output(std::ostream &out) const { parsed_class.output(out); @@ -66,18 +42,6 @@ void java_bytecode_parse_treet::output(std::ostream &out) const out << " " << *it << '\n'; } -/*******************************************************************\ - -Function: java_bytecode_parse_treet::classt::output - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void java_bytecode_parse_treet::classt::output(std::ostream &out) const { for(const auto &annotation : annotations) @@ -113,18 +77,6 @@ void java_bytecode_parse_treet::classt::output(std::ostream &out) const out << '\n'; } -/*******************************************************************\ - -Function: java_bytecode_parse_treet::annotationt::output - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void java_bytecode_parse_treet::annotationt::output(std::ostream &out) const { symbol_tablet symbol_table; @@ -150,18 +102,6 @@ void java_bytecode_parse_treet::annotationt::output(std::ostream &out) const } } -/*******************************************************************\ - -Function: java_bytecode_parse_treet::annotationt::element_value_pairt::output - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void java_bytecode_parse_treet::annotationt::element_value_pairt::output( std::ostream &out) const { @@ -172,18 +112,6 @@ void java_bytecode_parse_treet::annotationt::element_value_pairt::output( out << expr2java(value, ns); } -/*******************************************************************\ - -Function: java_bytecode_parse_treet::methodt::output - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void java_bytecode_parse_treet::methodt::output(std::ostream &out) const { symbol_tablet symbol_table; @@ -263,18 +191,6 @@ void java_bytecode_parse_treet::methodt::output(std::ostream &out) const out << '\n'; } -/*******************************************************************\ - -Function: java_bytecode_parse_treet::fieldt::output - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void java_bytecode_parse_treet::fieldt::output(std::ostream &out) const { for(const auto &annotation : annotations) diff --git a/src/java_bytecode/java_bytecode_parser.cpp b/src/java_bytecode/java_bytecode_parser.cpp index dd458860c97..5ec3f841270 100644 --- a/src/java_bytecode/java_bytecode_parser.cpp +++ b/src/java_bytecode/java_bytecode_parser.cpp @@ -200,18 +200,6 @@ class java_bytecode_parsert:public parsert #define VTYPE_INFO_OBJECT 7 #define VTYPE_INFO_UNINIT 8 -/*******************************************************************\ - -Function: java_bytecode_parsert::parse - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool java_bytecode_parsert::parse() { try @@ -240,18 +228,6 @@ bool java_bytecode_parsert::parse() return false; } -/*******************************************************************\ - -Function: java_bytecode_parsert::rClassFile - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - #define ACC_PUBLIC 0x0001 #define ACC_PRIVATE 0x0002 #define ACC_PROTECTED 0x0004 @@ -329,18 +305,6 @@ void java_bytecode_parsert::rClassFile() parse_tree.loading_successful=true; } -/*******************************************************************\ - -Function: java_bytecode_parsert::get_class_refs - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void java_bytecode_parsert::get_class_refs() { // Get the class references for the benefit of a dependency @@ -383,18 +347,6 @@ void java_bytecode_parsert::get_class_refs() } } -/*******************************************************************\ - -Function: java_bytecode_parsert::get_class_refs_rec - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void java_bytecode_parsert::get_class_refs_rec(const typet &src) { if(src.id()==ID_code) @@ -427,18 +379,6 @@ void java_bytecode_parsert::get_class_refs_rec(const typet &src) get_class_refs_rec(src.subtype()); } -/*******************************************************************\ - -Function: java_bytecode_parsert::rconstant_pool - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void java_bytecode_parsert::rconstant_pool() { u2 constant_pool_count=read_u2(); @@ -658,18 +598,6 @@ void java_bytecode_parsert::rconstant_pool() } } -/*******************************************************************\ - -Function: java_bytecode_parsert::rinterfaces - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void java_bytecode_parsert::rinterfaces(classt &parsed_class) { u2 interfaces_count=read_u2(); @@ -679,18 +607,6 @@ void java_bytecode_parsert::rinterfaces(classt &parsed_class) .push_back(constant(read_u2()).type().get(ID_C_base_name)); } -/*******************************************************************\ - -Function: java_bytecode_parsert::rfields - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void java_bytecode_parsert::rfields(classt &parsed_class) { u2 fields_count=read_u2(); @@ -722,18 +638,6 @@ void java_bytecode_parsert::rfields(classt &parsed_class) } } -/*******************************************************************\ - -Function: java_bytecode_parsert::rbytecode - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - #define T_BOOLEAN 4 #define T_CHAR 5 #define T_FLOAT 6 @@ -975,18 +879,6 @@ void java_bytecode_parsert::rbytecode( } } -/*******************************************************************\ - -Function: java_bytecode_parsert::rmethod_attribute - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void java_bytecode_parsert::rmethod_attribute(methodt &method) { u2 attribute_name_index=read_u2(); @@ -1055,18 +947,6 @@ void java_bytecode_parsert::rmethod_attribute(methodt &method) skip_bytes(attribute_length); } -/*******************************************************************\ - -Function: java_bytecode_parsert::rfield_attribute - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void java_bytecode_parsert::rfield_attribute(fieldt &field) { u2 attribute_name_index=read_u2(); @@ -1083,18 +963,6 @@ void java_bytecode_parsert::rfield_attribute(fieldt &field) skip_bytes(attribute_length); } -/*******************************************************************\ - -Function: java_bytecode_parsert::rcode_attribute - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void java_bytecode_parsert::rcode_attribute(methodt &method) { u2 attribute_name_index=read_u2(); @@ -1299,18 +1167,6 @@ void java_bytecode_parsert::read_verification_type_info( } } -/*******************************************************************\ - -Function: java_bytecode_parsert::rRuntimeAnnotation_attribute - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void java_bytecode_parsert::rRuntimeAnnotation_attribute( annotationst &annotations) { @@ -1324,18 +1180,6 @@ void java_bytecode_parsert::rRuntimeAnnotation_attribute( } } -/*******************************************************************\ - -Function: java_bytecode_parsert::rRuntimeAnnotation - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void java_bytecode_parsert::rRuntimeAnnotation( annotationt &annotation) { @@ -1344,18 +1188,6 @@ void java_bytecode_parsert::rRuntimeAnnotation( relement_value_pairs(annotation.element_value_pairs); } -/*******************************************************************\ - -Function: java_bytecode_parsert::relement_value_pairs - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void java_bytecode_parsert::relement_value_pairs( annotationt::element_value_pairst &element_value_pairs) { @@ -1371,18 +1203,6 @@ void java_bytecode_parsert::relement_value_pairs( } } -/*******************************************************************\ - -Function: java_bytecode_parsert::relement_value_pair - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void java_bytecode_parsert::relement_value_pair( annotationt::element_value_pairt &element_value_pair) { @@ -1442,18 +1262,6 @@ void java_bytecode_parsert::relement_value_pair( } } -/*******************************************************************\ - -Function: java_bytecode_parsert::rclass_attribute - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void java_bytecode_parsert::rclass_attribute(classt &parsed_class) { u2 attribute_name_index=read_u2(); @@ -1502,18 +1310,6 @@ void java_bytecode_parsert::rclass_attribute(classt &parsed_class) skip_bytes(attribute_length); } -/*******************************************************************\ - -Function: java_bytecode_parsert::rmethods - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void java_bytecode_parsert::rmethods(classt &parsed_class) { u2 methods_count=read_u2(); @@ -1522,18 +1318,6 @@ void java_bytecode_parsert::rmethods(classt &parsed_class) rmethod(parsed_class); } -/*******************************************************************\ - -Function: java_bytecode_parsert::rmethod - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - #define ACC_PUBLIC 0x0001 #define ACC_PRIVATE 0x0002 #define ACC_PROTECTED 0x0004 @@ -1578,18 +1362,6 @@ void java_bytecode_parsert::rmethod(classt &parsed_class) rmethod_attribute(method); } -/*******************************************************************\ - -Function: java_bytecode_parse - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool java_bytecode_parse( std::istream &istream, java_bytecode_parse_treet &parse_tree, @@ -1606,18 +1378,6 @@ bool java_bytecode_parse( return parser_result; } -/*******************************************************************\ - -Function: java_bytecode_parse - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool java_bytecode_parse( const std::string &file, java_bytecode_parse_treet &parse_tree, diff --git a/src/java_bytecode/java_bytecode_typecheck.cpp b/src/java_bytecode/java_bytecode_typecheck.cpp index 4f09e366452..2386cdc87f0 100644 --- a/src/java_bytecode/java_bytecode_typecheck.cpp +++ b/src/java_bytecode/java_bytecode_typecheck.cpp @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// JAVA Bytecode Conversion / Type Checking + #include #include #include @@ -13,52 +16,16 @@ Author: Daniel Kroening, kroening@kroening.com #include "expr2java.h" #include "java_bytecode_typecheck.h" -/*******************************************************************\ - -Function: java_bytecode_typecheckt::to_string - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string java_bytecode_typecheckt::to_string(const exprt &expr) { return expr2java(expr, ns); } -/*******************************************************************\ - -Function: java_bytecode_typecheckt::to_string - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string java_bytecode_typecheckt::to_string(const typet &type) { return type2java(type, ns); } -/*******************************************************************\ - -Function: java_bytecode_typecheckt::typecheck_non_type_symbol - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void java_bytecode_typecheckt::typecheck_non_type_symbol(symbolt &symbol) { assert(!symbol.is_type); @@ -66,18 +33,6 @@ void java_bytecode_typecheckt::typecheck_non_type_symbol(symbolt &symbol) typecheck_expr(symbol.value); } -/*******************************************************************\ - -Function: java_bytecode_typecheckt::typecheck - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void java_bytecode_typecheckt::typecheck() { // The hash table iterators are not stable, @@ -112,18 +67,6 @@ void java_bytecode_typecheckt::typecheck() } } -/*******************************************************************\ - -Function: java_bytecode_typecheck - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool java_bytecode_typecheck( symbol_tablet &symbol_table, message_handlert &message_handler, @@ -134,18 +77,6 @@ bool java_bytecode_typecheck( return java_bytecode_typecheck.typecheck_main(); } -/*******************************************************************\ - -Function: java_bytecode_typecheck - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool java_bytecode_typecheck( exprt &expr, message_handlert &message_handler, diff --git a/src/java_bytecode/java_bytecode_typecheck.h b/src/java_bytecode/java_bytecode_typecheck.h index 618b6fce44d..fa35ba5eda9 100644 --- a/src/java_bytecode/java_bytecode_typecheck.h +++ b/src/java_bytecode/java_bytecode_typecheck.h @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// JAVA Bytecode Language Type Checking + #ifndef CPROVER_JAVA_BYTECODE_JAVA_BYTECODE_TYPECHECK_H #define CPROVER_JAVA_BYTECODE_JAVA_BYTECODE_TYPECHECK_H diff --git a/src/java_bytecode/java_bytecode_typecheck_code.cpp b/src/java_bytecode/java_bytecode_typecheck_code.cpp index 788f5fa592b..431e39234f5 100644 --- a/src/java_bytecode/java_bytecode_typecheck_code.cpp +++ b/src/java_bytecode/java_bytecode_typecheck_code.cpp @@ -6,19 +6,10 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ -#include "java_bytecode_typecheck.h" - -/*******************************************************************\ - -Function: java_bytecode_typecheckt::typecheck_code - - Inputs: +/// \file +/// JAVA Bytecode Conversion / Type Checking - Outputs: - - Purpose: - -\*******************************************************************/ +#include "java_bytecode_typecheck.h" void java_bytecode_typecheckt::typecheck_code(codet &code) { diff --git a/src/java_bytecode/java_bytecode_typecheck_expr.cpp b/src/java_bytecode/java_bytecode_typecheck_expr.cpp index 11e488ff7fe..d1d0e988d49 100644 --- a/src/java_bytecode/java_bytecode_typecheck_expr.cpp +++ b/src/java_bytecode/java_bytecode_typecheck_expr.cpp @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// JAVA Bytecode Conversion / Type Checking + #include #include @@ -19,18 +22,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "java_pointer_casts.h" #include "java_types.h" -/*******************************************************************\ - -Function: java_bytecode_typecheckt::typecheck_expr - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void java_bytecode_typecheckt::typecheck_expr(exprt &expr) { if(expr.id()==ID_code) @@ -59,18 +50,6 @@ void java_bytecode_typecheckt::typecheck_expr(exprt &expr) typecheck_expr_member(to_member_expr(expr)); } -/*******************************************************************\ - -Function: java_bytecode_typecheckt::typecheck_expr_java_new - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void java_bytecode_typecheckt::typecheck_expr_java_new(side_effect_exprt &expr) { assert(expr.operands().empty()); @@ -78,18 +57,6 @@ void java_bytecode_typecheckt::typecheck_expr_java_new(side_effect_exprt &expr) typecheck_type(type); } -/*******************************************************************\ - -Function: java_bytecode_typecheckt::typecheck_expr_java_new_array - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void java_bytecode_typecheckt::typecheck_expr_java_new_array( side_effect_exprt &expr) { @@ -117,18 +84,9 @@ static std::string escape_non_alnum(const std::string &toescape) return escaped.str(); } -/*******************************************************************\ - -Function: utf16_to_array - - Inputs: `in`: wide string to convert - - Outputs: Returns a Java char array containing the same wchars. - - Purpose: Convert UCS-2 or UTF-16 to an array expression. - -\*******************************************************************/ - +/// Convert UCS-2 or UTF-16 to an array expression. +/// \par parameters: `in`: wide string to convert +/// \return Returns a Java char array containing the same wchars. static array_exprt utf16_to_array(const std::wstring &in) { const auto jchar=java_char_type(); @@ -138,18 +96,6 @@ static array_exprt utf16_to_array(const std::wstring &in) return ret; } -/*******************************************************************\ - -Function: java_bytecode_typecheckt::typecheck_expr_java_string_literal - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void java_bytecode_typecheckt::typecheck_expr_java_string_literal(exprt &expr) { const irep_idt value=expr.get(ID_value); @@ -264,18 +210,6 @@ void java_bytecode_typecheckt::typecheck_expr_java_string_literal(exprt &expr) expr=address_of_exprt(new_symbol.symbol_expr()); } -/*******************************************************************\ - -Function: java_bytecode_typecheckt::typecheck_expr_symbol - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void java_bytecode_typecheckt::typecheck_expr_symbol(symbol_exprt &expr) { irep_idt identifier=expr.get_identifier(); @@ -324,18 +258,6 @@ void java_bytecode_typecheckt::typecheck_expr_symbol(symbol_exprt &expr) } } -/*******************************************************************\ - -Function: java_bytecode_typecheckt::typecheck_expr_symbol - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void java_bytecode_typecheckt::typecheck_expr_member(member_exprt &expr) { // The member might be in a parent class or an opaque class, which we resolve diff --git a/src/java_bytecode/java_bytecode_typecheck_type.cpp b/src/java_bytecode/java_bytecode_typecheck_type.cpp index 647aa35a45e..79b2146f07a 100644 --- a/src/java_bytecode/java_bytecode_typecheck_type.cpp +++ b/src/java_bytecode/java_bytecode_typecheck_type.cpp @@ -6,22 +6,13 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// JAVA Bytecode Conversion / Type Checking + #include #include "java_bytecode_typecheck.h" -/*******************************************************************\ - -Function: java_bytecode_typecheckt::typecheck_type - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void java_bytecode_typecheckt::typecheck_type(typet &type) { if(type.id()==ID_symbol) @@ -62,18 +53,6 @@ void java_bytecode_typecheckt::typecheck_type(typet &type) } } -/*******************************************************************\ - -Function: java_bytecode_typecheckt::typecheck_type_symbol - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void java_bytecode_typecheckt::typecheck_type_symbol(symbolt &symbol) { assert(symbol.is_type); diff --git a/src/java_bytecode/java_class_loader.cpp b/src/java_bytecode/java_class_loader.cpp index fdd37c4b312..645974aadb2 100644 --- a/src/java_bytecode/java_class_loader.cpp +++ b/src/java_bytecode/java_class_loader.cpp @@ -18,18 +18,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "java_class_loader.h" #include "jar_file.h" -/*******************************************************************\ - -Function: java_class_loadert::operator() - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - java_bytecode_parse_treet &java_class_loadert::operator()( const irep_idt &class_name) { @@ -72,18 +60,6 @@ java_bytecode_parse_treet &java_class_loadert::operator()( return class_map[class_name]; } -/*******************************************************************\ - -Function: java_class_loadert::set_java_cp_include_files - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void java_class_loadert::set_java_cp_include_files( std::string &_java_cp_include_files) { @@ -91,18 +67,6 @@ void java_class_loadert::set_java_cp_include_files( jar_pool.set_message_handler(get_message_handler()); } -/*******************************************************************\ - -Function: java_class_loadert::get_parse_tree - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - java_bytecode_parse_treet &java_class_loadert::get_parse_tree( java_class_loader_limitt &class_loader_limit, const irep_idt &class_name) @@ -196,18 +160,6 @@ java_bytecode_parse_treet &java_class_loadert::get_parse_tree( return parse_tree; } -/*******************************************************************\ - -Function: java_class_loadert::load_entire_jar - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void java_class_loadert::load_entire_jar( java_class_loader_limitt &class_loader_limit, const std::string &file) @@ -224,18 +176,6 @@ void java_class_loadert::load_entire_jar( jar_files.pop_front(); } -/*******************************************************************\ - -Function: java_class_loadert::read_jar_file - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void java_class_loadert::read_jar_file( java_class_loader_limitt &class_loader_limit, const irep_idt &file) @@ -271,18 +211,6 @@ void java_class_loadert::read_jar_file( } } -/*******************************************************************\ - -Function: java_class_loadert::file_to_class_name - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string java_class_loadert::file_to_class_name(const std::string &file) { std::string result=file; @@ -310,18 +238,6 @@ std::string java_class_loadert::file_to_class_name(const std::string &file) return result; } -/*******************************************************************\ - -Function: java_class_loadert::class_name_to_file - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string java_class_loadert::class_name_to_file(const irep_idt &class_name) { std::string result=id2string(class_name); diff --git a/src/java_bytecode/java_class_loader_limit.cpp b/src/java_bytecode/java_class_loader_limit.cpp index 3a9ed66d3d5..7ba1d4fe0ee 100644 --- a/src/java_bytecode/java_class_loader_limit.cpp +++ b/src/java_bytecode/java_class_loader_limit.cpp @@ -6,22 +6,15 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// limit class path loading + #include #include "java_class_loader_limit.h" -/*******************************************************************\ - -Function: java_class_loader_limitt::setup_class_load_limit - - Inputs: parameter from `java-cp-include-files` - - Outputs: - - Purpose: initializes class with either regex matcher or match set - -\*******************************************************************/ - +/// initializes class with either regex matcher or match set +/// \par parameters: parameter from `java-cp-include-files` void java_class_loader_limitt::setup_class_load_limit( std::string &java_cp_include_files) { @@ -54,18 +47,8 @@ void java_class_loader_limitt::setup_class_load_limit( } } -/*******************************************************************\ - -Function: java_class_loader_limitt::load_class_file - - Inputs: class file name - - Outputs: true if file should be loaded, else false - - Purpose: - -\*******************************************************************/ - +/// \par parameters: class file name +/// \return true if file should be loaded, else false bool java_class_loader_limitt::load_class_file(const irep_idt &file_name) { if(regex_match) diff --git a/src/java_bytecode/java_class_loader_limit.h b/src/java_bytecode/java_class_loader_limit.h index fa5e21ffd95..149561f29e4 100644 --- a/src/java_bytecode/java_class_loader_limit.h +++ b/src/java_bytecode/java_class_loader_limit.h @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// limit class path loading + #ifndef CPROVER_JAVA_BYTECODE_JAVA_CLASS_LOADER_LIMIT_H #define CPROVER_JAVA_BYTECODE_JAVA_CLASS_LOADER_LIMIT_H diff --git a/src/java_bytecode/java_entry_point.cpp b/src/java_bytecode/java_entry_point.cpp index a16959b96da..e71c3ad8128 100644 --- a/src/java_bytecode/java_entry_point.cpp +++ b/src/java_bytecode/java_entry_point.cpp @@ -33,18 +33,6 @@ Author: Daniel Kroening, kroening@kroening.com #define INITIALIZE CPROVER_PREFIX "initialize" -/*******************************************************************\ - -Function: create_initialize - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - static void create_initialize(symbol_tablet &symbol_table) { symbolt initialize; @@ -85,18 +73,6 @@ static bool should_init_symbol(const symbolt &sym) return has_prefix(id2string(sym.name), "java::java.lang.String.Literal"); } -/*******************************************************************\ - -Function: java_static_lifetime_init - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void java_static_lifetime_init( symbol_tablet &symbol_table, const source_locationt &source_location, @@ -155,18 +131,6 @@ void java_static_lifetime_init( } } -/*******************************************************************\ - -Function: java_build_arguments - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - exprt::operandst java_build_arguments( const symbolt &function, code_blockt &init_code, @@ -234,18 +198,6 @@ exprt::operandst java_build_arguments( return main_arguments; } -/*******************************************************************\ - -Function: java_record_outputs - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void java_record_outputs( const symbolt &function, const exprt::operandst &main_arguments, @@ -494,24 +446,14 @@ main_function_resultt get_main_symbol( return res; // give up with error } -/*******************************************************************\ - -Function: java_entry_point - - Inputs: - symbol_table - main class - message_handler - assume_init_pointers_not_null - allow pointers in initialization code to be - null - max_nondet_array_length - - Outputs: true if error occurred on entry point search - - Purpose: find entry point and create initialization code for function - -\*******************************************************************/ - +/// find entry point and create initialization code for function +/// symbol_table +/// main class +/// message_handler +/// \param assume_init_pointers_not_null: allow pointers in initialization code +/// to be null +/// max_nondet_array_length +/// \return true if error occurred on entry point search bool java_entry_point( symbol_tablet &symbol_table, const irep_idt &main_class, diff --git a/src/java_bytecode/java_local_variable_table.cpp b/src/java_bytecode/java_local_variable_table.cpp index 85e9766d5ab..ee7d061f9d6 100644 --- a/src/java_bytecode/java_local_variable_table.cpp +++ b/src/java_bytecode/java_local_variable_table.cpp @@ -6,6 +6,9 @@ Author: Chris Smowton, chris.smowton@diffblue.com \*******************************************************************/ +/// \file +/// Java local variable table processing + #include "java_bytecode_convert_method_class.h" #include "java_types.h" @@ -141,20 +144,11 @@ struct is_predecessor_oft // Helper routines for the find-initialisers code below: -/*******************************************************************\ - -Function: gather_transitive_predecessors - - Inputs: `start`: Variable to find the predecessors of - `predecessor_map`: Map from local variables - to sets of predecessors - Outputs: `result`: populated with all transitive predecessors of - `start` found in `predecessor_map` - - Purpose: See above - -\*******************************************************************/ - +/// See above +/// `start`: Variable to find the predecessors of `predecessor_map`: Map from +/// local variables to sets of predecessors +/// \param Outputs: `result`: populated with all transitive predecessors of +/// `start` found in `predecessor_map` static void gather_transitive_predecessors( local_variable_with_holest *start, const predecessor_mapt &predecessor_map, @@ -169,20 +163,11 @@ static void gather_transitive_predecessors( gather_transitive_predecessors(pred, predecessor_map, result); } -/*******************************************************************\ - -Function: is_store_to_slot - - Inputs: `inst`: Java bytecode instruction - `slotidx`: local variable slot number - - Outputs: Returns true if `inst` is any form of store instruction - targeting slot `slotidx` - - Purpose: See above - -\*******************************************************************/ - +/// See above +/// \par parameters: `inst`: Java bytecode instruction +/// `slotidx`: local variable slot number +/// \return Returns true if `inst` is any form of store instruction targeting +/// slot `slotidx` static bool is_store_to_slot( const java_bytecode_convert_methodt::instructiont &inst, unsigned slotidx) @@ -209,19 +194,10 @@ static bool is_store_to_slot( return storeslotidx==slotidx; } -/*******************************************************************\ - -Function: maybe_add_hole - - Inputs: `from`, `to`: bounds of a gap in `var`'s live range, - inclusive and exclusive respectively - - Outputs: Adds a hole to `var`, unless it would be of zero size. - - Purpose: See above - -\*******************************************************************/ - +/// See above +/// \par parameters: `from`, `to`: bounds of a gap in `var`'s live range, +/// inclusive and exclusive respectively +/// \return Adds a hole to `var`, unless it would be of zero size. static void maybe_add_hole( local_variable_with_holest &var, unsigned from, @@ -232,22 +208,13 @@ static void maybe_add_hole( var.holes.push_back({from, to-from}); } -/*******************************************************************\ - -Function: populate_variable_address_map - - Inputs: `firstvar`-`varlimit`: range of local variable table - entries to consider - - Outputs: `live_variable_at_address` is populated with a sequence of - local variable table entry pointers, such that - `live_variable_at_address[addr]` yields the unique table - entry covering that address. Asserts if entries overlap. - - Purpose: See above - -\*******************************************************************/ - +/// See above +/// \par parameters: `firstvar`-`varlimit`: range of local variable table +/// entries to consider +/// \return `live_variable_at_address` is populated with a sequence of local +/// variable table entry pointers, such that `live_variable_at_address[addr]` +/// yields the unique table entry covering that address. Asserts if entries +/// overlap. static void populate_variable_address_map( local_variable_table_with_holest::iterator firstvar, local_variable_table_with_holest::iterator varlimit, @@ -269,32 +236,20 @@ static void populate_variable_address_map( } } -/*******************************************************************\ - -Function: populate_predecessor_map - - Inputs: `firstvar`-`varlimit`: range of local variable table - entries to consider - `live_variable_at_address`: map from bytecode address - to table entry (drawn from firstvar-varlimit) live - at that address - `amap`: map from bytecode address to instructions - - Outputs: Populates `predecessor_map` with a graph from local variable - table entries to their predecessors (table entries which - may flow together and thus may be considered the same live - range). - - Purpose: Usually a live variable range begins with a store - instruction initialising the relevant local variable slot, - but instead of or in addition to this, control flow edges - may exist from bytecode addresses that fall under a - table entry which differs, but which has the same variable - name and type descriptor. This indicates a split live - range, and will be recorded in the predecessor map. - -\*******************************************************************/ - +/// Usually a live variable range begins with a store instruction initialising +/// the relevant local variable slot, but instead of or in addition to this, +/// control flow edges may exist from bytecode addresses that fall under a table +/// entry which differs, but which has the same variable name and type +/// descriptor. This indicates a split live range, and will be recorded in the +/// predecessor map. +/// \par parameters: `firstvar`-`varlimit`: range of local variable table +/// entries to consider +/// `live_variable_at_address`: map from bytecode address to table entry (drawn +/// from firstvar-varlimit) live at that address +/// `amap`: map from bytecode address to instructions +/// \return Populates `predecessor_map` with a graph from local variable table +/// entries to their predecessors (table entries which may flow together and +/// thus may be considered the same live range). static void populate_predecessor_map( local_variable_table_with_holest::iterator firstvar, local_variable_table_with_holest::iterator varlimit, @@ -393,24 +348,14 @@ static void populate_predecessor_map( } } -/*******************************************************************\ - -Function: get_common_dominator - - Inputs: `merge_vars`: Set of variables we want the common dominator - for. - `dominator_analysis`: Already-initialised dominator tree - - Outputs: Returns the bytecode address of the closest common - dominator of all given variable table entries. - In the worst case the function entry point should always - satisfy this criterion. - - Purpose: Used to find out where to put a variable declaration that - subsumes several variable live ranges. - -\*******************************************************************/ - +/// Used to find out where to put a variable declaration that subsumes several +/// variable live ranges. +/// \par parameters: `merge_vars`: Set of variables we want the common dominator +/// for. +/// `dominator_analysis`: Already-initialised dominator tree +/// \return Returns the bytecode address of the closest common dominator of all +/// given variable table entries. In the worst case the function entry point +/// should always satisfy this criterion. static unsigned get_common_dominator( const std::set &merge_vars, const java_cfg_dominatorst &dominator_analysis) @@ -460,24 +405,14 @@ static unsigned get_common_dominator( throw "variable live ranges with no common dominator?"; } -/*******************************************************************\ - -Function: populate_live_range_holes - - Inputs: `merge_vars`: a set of 2+ variable table entries to merge - `expanded_live_range_start`: address where the merged - variable will be declared - - Outputs: Adds holes to `merge_into`, indicating where gaps in the - variable's live range fall. For example, if the - declaration happens at address 10 and the entries in - `merge_into` have live ranges [(20-30), (40-50)] then - holes will be added at (10-20) and (30-40). - - Purpose: See above - -\*******************************************************************/ - +/// See above +/// \par parameters: `merge_vars`: a set of 2+ variable table entries to merge +/// `expanded_live_range_start`: address where the merged variable will be +/// declared +/// \return Adds holes to `merge_into`, indicating where gaps in the variable's +/// live range fall. For example, if the declaration happens at address 10 and +/// the entries in `merge_into` have live ranges [(20-30), (40-50)] then holes +/// will be added at (10-20) and (30-40). static void populate_live_range_holes( local_variable_with_holest &merge_into, const std::set &merge_vars, @@ -500,22 +435,13 @@ static void populate_live_range_holes( } } -/*******************************************************************\ - -Function: merge_variable_table_entries - - Inputs: `merge_vars`: a set of 2+ variable table entries to merge - `dominator_analysis`: already-calculated dominator tree - - Outputs: Populates `merge_into` as a combined variable table entry, - with live range holes if the `merge_vars` entries do not - cover a contiguous address range, beginning the combined - live range at the common dominator of all `merge_vars`. - - Purpose: See above - -\*******************************************************************/ - +/// See above +/// \par parameters: `merge_vars`: a set of 2+ variable table entries to merge +/// `dominator_analysis`: already-calculated dominator tree +/// \return Populates `merge_into` as a combined variable table entry, with live +/// range holes if the `merge_vars` entries do not cover a contiguous address +/// range, beginning the combined live range at the common dominator of all +/// `merge_vars`. static void merge_variable_table_entries( local_variable_with_holest &merge_into, const std::set &merge_vars, @@ -559,28 +485,17 @@ static void merge_variable_table_entries( v->var.length=0; } -/*******************************************************************\ - -Function: find_initialisers_for_slot - - Inputs: `firstvar`-`varlimit`: sequence of variable table entries, - all of which should concern the same slot index. - `amap`: Map from bytecode address to instruction - - Outputs: Side-effect: merges variable table entries which flow into - one another (e.g. there are branches from one live range - to another without re-initialising the local slot). - - Purpose: Given a sequence of users of the same local variable slot, - this figures out which ones are related by control flow, - and combines them into a single entry with holes, such that - after combination we can create a single - declaration per variable table entry, - placed at the live range's start address, which may - be moved back so that the declaration dominates all uses. - -\*******************************************************************/ - +/// Given a sequence of users of the same local variable slot, this figures out +/// which ones are related by control flow, and combines them into a single +/// entry with holes, such that after combination we can create a single +/// declaration per variable table entry, placed at the live range's start +/// address, which may be moved back so that the declaration dominates all uses. +/// \par parameters: `firstvar`-`varlimit`: sequence of variable table entries, +/// all of which should concern the same slot index. +/// `amap`: Map from bytecode address to instruction +/// \return Side-effect: merges variable table entries which flow into one +/// another (e.g. there are branches from one live range to another without +/// re-initialising the local slot). void java_bytecode_convert_methodt::find_initialisers_for_slot( local_variable_table_with_holest::iterator firstvar, local_variable_table_with_holest::iterator varlimit, @@ -647,23 +562,13 @@ void java_bytecode_convert_methodt::find_initialisers_for_slot( } } -/*******************************************************************\ - -Function: walk_to_next_index - - Inputs: `it1` and `it2`, which are iterators into the same vector, - of which `itend` is the end() iterator. - - Outputs: Moves `it1` and `it2` to delimit a sequence of variable - table entries with slot index equal to it2->var.index - on entering this function, or to both equal itend if - it2==itend on entry. - - Purpose: Walk a vector, a contiguous block of entries with equal - slot index at a time. - -\*******************************************************************/ - +/// Walk a vector, a contiguous block of entries with equal slot index at a +/// time. +/// \par parameters: `it1` and `it2`, which are iterators into the same vector, +/// of which `itend` is the end() iterator. +/// \return Moves `it1` and `it2` to delimit a sequence of variable table +/// entries with slot index equal to it2->var.index on entering this function, +/// or to both equal itend if it2==itend on entry. static void walk_to_next_index( local_variable_table_with_holest::iterator &it1, local_variable_table_with_holest::iterator &it2, @@ -682,21 +587,12 @@ static void walk_to_next_index( it1=old_it2; } -/*******************************************************************\ - -Function: find_initialisers - - Inputs: `vars`: Local variable table - `amap`: Map from bytecode index to instruction - `dominator_analysis`: Already computed dominator tree for - the Java function described by `amap` - - Outputs: Combines entries in `vars` which flow together - - Purpose: See `find_initialisers_for_slot` above for more detail. - -\*******************************************************************/ - +/// See `find_initialisers_for_slot` above for more detail. +/// \par parameters: `vars`: Local variable table +/// `amap`: Map from bytecode index to instruction +/// `dominator_analysis`: Already computed dominator tree for the Java function +/// described by `amap` +/// \return Combines entries in `vars` which flow together void java_bytecode_convert_methodt::find_initialisers( local_variable_table_with_holest &vars, const address_mapt &amap, @@ -715,18 +611,9 @@ void java_bytecode_convert_methodt::find_initialisers( find_initialisers_for_slot(it1, it2, amap, dominator_analysis); } -/*******************************************************************\ - -Function: cleanup_var_table - - Inputs: `vars_with_holes`: variable table - - Outputs: Removes zero-size entries from `vars_with_holes` - - Purpose: See above - -\*******************************************************************/ - +/// See above +/// \par parameters: `vars_with_holes`: variable table +/// \return Removes zero-size entries from `vars_with_holes` static void cleanup_var_table( std::vector &vars_with_holes) { @@ -749,22 +636,12 @@ static void cleanup_var_table( vars_with_holes.resize(vars_with_holes.size()-toremove); } -/*******************************************************************\ - -Function: setup_local_variables - - Inputs: `m`: Java method - `amap`: Map from bytecode indices to instructions in `m` - - Outputs: Populates `this->vars_with_holes` equal to - `this->local_variable_table`, only with variable table - entries that flow together combined. - Also symbol-table registers all locals. - - Purpose: See `find_initialisers_for_slot` above for more detail. - -\*******************************************************************/ - +/// See `find_initialisers_for_slot` above for more detail. +/// \par parameters: `m`: Java method +/// `amap`: Map from bytecode indices to instructions in `m` +/// \return Populates `this->vars_with_holes` equal to +/// `this->local_variable_table`, only with variable table entries that flow +/// together combined. Also symbol-table registers all locals. void java_bytecode_convert_methodt::setup_local_variables( const methodt &m, const address_mapt &amap) @@ -827,22 +704,12 @@ void java_bytecode_convert_methodt::setup_local_variables( } } -/*******************************************************************\ - -Function: find_variable_for_slot - - Inputs: `address`: Address to find a variable table entry for - `var_list`: List of candidates that use the slot we're - interested in - - Outputs: Returns the list entry covering this address (taking live - range holes into account), or creates/returns an anonymous - variable entry if nothing covers `address`. - - Purpose: See above - -\*******************************************************************/ - +/// See above +/// \par parameters: `address`: Address to find a variable table entry for +/// `var_list`: List of candidates that use the slot we're interested in +/// \return Returns the list entry covering this address (taking live range +/// holes into account), or creates/returns an anonymous variable entry if +/// nothing covers `address`. const java_bytecode_convert_methodt::variablet & java_bytecode_convert_methodt::find_variable_for_slot( size_t address, diff --git a/src/java_bytecode/java_object_factory.cpp b/src/java_bytecode/java_object_factory.cpp index 31d5741140a..50f40922d79 100644 --- a/src/java_bytecode/java_object_factory.cpp +++ b/src/java_bytecode/java_object_factory.cpp @@ -28,18 +28,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "java_types.h" #include "java_utils.h" -/*******************************************************************\ - -Function: new_tmp_symbol - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - static symbolt &new_tmp_symbol( symbol_tablet &symbol_table, const source_locationt &loc, @@ -130,27 +118,18 @@ class java_object_factoryt update_in_placet); }; -/*******************************************************************\ - -Function: allocate_dynamic_object - - Inputs: - target_expr - expression to which the necessary memory will be allocated - allocate_type - type of the object allocated - symbol_table - symbol table - loc - location in the source - output_code - code block to which the necessary code is added - symbols_created - created symbols to be declared by the caller - cast_needed - Boolean flags saying where we need to cast the malloc site - - Outputs: Expression representing the malloc site allocated. - - Purpose: Generates code for allocating a dynamic object. - This is used in allocate_object and for allocating strings - in the library preprocessing. - -\*******************************************************************/ - +/// Generates code for allocating a dynamic object. This is used in +/// allocate_object and for allocating strings in the library preprocessing. +/// \param target_expr: expression to which the necessary memory will be +/// allocated +/// \param allocate_type: type of the object allocated +/// \param symbol_table: symbol table +/// \param loc: location in the source +/// \param output_code: code block to which the necessary code is added +/// \param symbols_created: created symbols to be declared by the caller +/// \param cast_needed: Boolean flags saying where we need to cast the malloc +/// site +/// \return Expression representing the malloc site allocated. exprt allocate_dynamic_object( const exprt &target_expr, const typet &allocate_type, @@ -202,27 +181,18 @@ exprt allocate_dynamic_object( } } -/*******************************************************************\ - -Function: allocate_dynamic_object_with_decl - - Inputs: - target_expr - expression to which the necessary memory will be allocated - allocate_type - type of the object allocated - symbol_table - symbol table - loc - location in the source - output_code - code block to which the necessary code is added - cast_needed - Boolean flags saying where we need to cast the malloc site - - Outputs: Expression representing the malloc site allocated. - - Purpose: Generates code for allocating a dynamic object. - This is a static version of allocate_dynamic_object that can - be called from outside java_object_factory and which takes care - of creating the associated declarations. - -\*******************************************************************/ - +/// Generates code for allocating a dynamic object. This is a static version of +/// allocate_dynamic_object that can be called from outside java_object_factory +/// and which takes care of creating the associated declarations. +/// \param target_expr: expression to which the necessary memory will be +/// allocated +/// \param allocate_type: type of the object allocated +/// \param symbol_table: symbol table +/// \param loc: location in the source +/// \param output_code: code block to which the necessary code is added +/// \param cast_needed: Boolean flags saying where we need to cast the malloc +/// site +/// \return Expression representing the malloc site allocated. exprt allocate_dynamic_object_with_decl( const exprt &target_expr, const typet &allocate_type, @@ -254,25 +224,15 @@ exprt allocate_dynamic_object_with_decl( return result; } -/*******************************************************************\ - -Function: java_object_factoryt::allocate_object - - Inputs: - assignments - The code block to add code to - target_expr - The expression which we are allocating a symbol for - allocate_type - - create_dynamic_objects - Whether to create a symbol with static - lifetime or - - Outputs: the allocated object - - Purpose: Returns false if we can't figure out the size of allocate_type. - allocate_type may differ from target_expr, e.g. for target_expr - having type int* and allocate_type being an int[10]. - -\*******************************************************************/ - +/// Returns false if we can't figure out the size of allocate_type. +/// allocate_type may differ from target_expr, e.g. for target_expr having type +/// int* and allocate_type being an int[10]. +/// \param assignments: The code block to add code to +/// \param target_expr: The expression which we are allocating a symbol for +/// \param allocate_type: +/// \param create_dynamic_objects: Whether to create a symbol with static +/// lifetime or +/// \return the allocated object exprt java_object_factoryt::allocate_object( code_blockt &assignments, const exprt &target_expr, @@ -309,20 +269,9 @@ exprt java_object_factoryt::allocate_object( } } -/*******************************************************************\ - -Function: java_object_factoryt::get_null_assignment - - Inputs: `expr`: pointer-typed lvalue expression to initialise - `ptr_type`: pointer type to write - - Outputs: - - Purpose: Adds an instruction to `init_code` null-initialising - `expr`. - -\*******************************************************************/ - +/// Adds an instruction to `init_code` null-initialising `expr`. +/// \par parameters: `expr`: pointer-typed lvalue expression to initialise +/// `ptr_type`: pointer type to write code_assignt java_object_factoryt::get_null_assignment( const exprt &expr, const pointer_typet &ptr_type) @@ -333,29 +282,17 @@ code_assignt java_object_factoryt::get_null_assignment( return code; } -/*******************************************************************\ - -Function: java_object_factoryt::gen_pointer_target_init - - Inputs: `expr`: pointer-typed lvalue expression to initialise - `target_type`: structure type to initialise, which may - not match *expr (for example, expr might be void*) - `create_dynamic_objects`: if true, use malloc to allocate - objects; otherwise generate fresh static symbols. - `update_in_place`: - NO_UPDATE_IN_PLACE: initialise `expr` from scratch - MUST_UPDATE_IN_PLACE: reinitialise an existing object - MAY_UPDATE_IN_PLACE: invalid input - - Outputs: - - Purpose: Initialises an object tree rooted at `expr`, allocating - child objects as necessary and nondet-initialising their - members, or if MUST_UPDATE_IN_PLACE is set, re-initialising - already-allocated objects. - -\*******************************************************************/ - +/// Initialises an object tree rooted at `expr`, allocating child objects as +/// necessary and nondet-initialising their members, or if MUST_UPDATE_IN_PLACE +/// is set, re-initialising already-allocated objects. +/// \par parameters: `expr`: pointer-typed lvalue expression to initialise +/// `target_type`: structure type to initialise, which may not match *expr (for +/// example, expr might be void*) +/// `create_dynamic_objects`: if true, use malloc to allocate objects; otherwise +/// generate fresh static symbols. +/// `update_in_place`: NO_UPDATE_IN_PLACE: initialise `expr` from scratch +/// MUST_UPDATE_IN_PLACE: reinitialise an existing object MAY_UPDATE_IN_PLACE: +/// invalid input void java_object_factoryt::gen_pointer_target_init( code_blockt &assignments, const exprt &expr, @@ -409,40 +346,25 @@ void java_object_factoryt::gen_pointer_target_init( } } -/*******************************************************************\ - -Function: java_object_factoryt::gen_nondet_init - - Inputs: `expr`: lvalue expression to initialise - `is_sub`: If true, `expr` is a substructure of a larger - object, which in Java necessarily means a base class. - not match *expr (for example, expr might be void*) - `class_identifier`: clsid to initialise @java.lang.Object. - @class_identifier - `skip_classid`: if true, skip initialising @class_identifier - `create_dynamic_objects`: if true, use malloc to allocate - objects; otherwise generate fresh static symbols. - `override`: If true, initialise with `override_type` instead - of `expr.type()`. Used at the moment for - reference arrays, which are implemented as void* - arrays but should be init'd as their true type with - appropriate casts. - `override_type`: Override type per above - `update_in_place`: - NO_UPDATE_IN_PLACE: initialise `expr` from scratch - MUST_UPDATE_IN_PLACE: reinitialise an existing object - MAY_UPDATE_IN_PLACE: generate a runtime nondet branch - between the NO_ and MUST_ cases. - - Outputs: - - Purpose: Initialises a primitive or object tree rooted at `expr`, - allocating child objects as necessary and nondet-initialising - their members, or if MUST_UPDATE_IN_PLACE is set, - re-initialising already-allocated objects. - -\*******************************************************************/ - +/// Initialises a primitive or object tree rooted at `expr`, allocating child +/// objects as necessary and nondet-initialising their members, or if +/// MUST_UPDATE_IN_PLACE is set, re-initialising already-allocated objects. +/// \par parameters: `expr`: lvalue expression to initialise +/// `is_sub`: If true, `expr` is a substructure of a larger object, which in +/// Java necessarily means a base class. not match *expr (for example, expr +/// might be void*) +/// `class_identifier`: clsid to initialise @java.lang.Object. @class_identifier +/// `skip_classid`: if true, skip initialising @class_identifier +/// `create_dynamic_objects`: if true, use malloc to allocate objects; otherwise +/// generate fresh static symbols. +/// `override`: If true, initialise with `override_type` instead of +/// `expr.type()`. Used at the moment for reference arrays, which are +/// implemented as void* arrays but should be init'd as their true type with +/// appropriate casts. +/// `override_type`: Override type per above +/// `update_in_place`: NO_UPDATE_IN_PLACE: initialise `expr` from scratch +/// MUST_UPDATE_IN_PLACE: reinitialise an existing object MAY_UPDATE_IN_PLACE: +/// generate a runtime nondet branch between the NO_ and MUST_ cases. void java_object_factoryt::gen_nondet_init( code_blockt &assignments, const exprt &expr, @@ -646,24 +568,15 @@ void java_object_factoryt::gen_nondet_init( } } -/*******************************************************************\ - -Function: java_object_factoryt::allocate_nondet_length_array - - Inputs: `lhs`, symbol to assign the new array structure - `max_length_expr`, maximum length of the new array - (minimum is fixed at zero for now) - `element_type`, actual element type of the array (the array - for all reference types will have void* type, but this - will be annotated as the true member type) - - Outputs: Appends instructions to `assignments` - - Purpose: Allocates a fresh array. Single-use herem at the moment, but - useful to keep as a separate function for downstream branches. - -\*******************************************************************/ - +/// Allocates a fresh array. Single-use herem at the moment, but useful to keep +/// as a separate function for downstream branches. +/// \par parameters: `lhs`, symbol to assign the new array structure +/// `max_length_expr`, maximum length of the new array (minimum is fixed at zero +/// for now) +/// `element_type`, actual element type of the array (the array for all +/// reference types will have void* type, but this will be annotated as the +/// true member type) +/// \return Appends instructions to `assignments` void java_object_factoryt::allocate_nondet_length_array( code_blockt &assignments, const exprt &lhs, @@ -708,20 +621,8 @@ void java_object_factoryt::allocate_nondet_length_array( assignments.copy_to_operands(assign); } -/*******************************************************************\ - -Function: java_object_factoryt::gen_nondet_array_init - - Inputs: - - Outputs: - - Purpose: create code to initialize a Java array with size - `max_nondet_array_length`, loop over elements and initialize - them - -\*******************************************************************/ - +/// create code to initialize a Java array with size `max_nondet_array_length`, +/// loop over elements and initialize them void java_object_factoryt::gen_nondet_array_init( code_blockt &assignments, const exprt &expr, @@ -841,28 +742,16 @@ void java_object_factoryt::gen_nondet_array_init( assignments.move_to_operands(init_done_label); } -/*******************************************************************\ - -Function: object_factory - - Inputs: `type`: type of new object to create - `allow_null`: if true, may return null; otherwise always - allocates an object - `max_nondet_array_length`: upper bound on size of initialised - arrays. - `loc`: source location for all generated code - `message_handler`: logging - - Outputs: `symbol_table` gains any new symbols created, as per - gen_nondet_init above. - `init_code` gains any instructions requried to initialise - either the returned value or its child objects - - Purpose: Similar to `gen_nondet_init` above, but always creates a - fresh static global object or primitive nondet expression. - -\*******************************************************************/ - +/// Similar to `gen_nondet_init` above, but always creates a fresh static global +/// object or primitive nondet expression. +/// \par parameters: `type`: type of new object to create +/// `allow_null`: if true, may return null; otherwise always allocates an object +/// `max_nondet_array_length`: upper bound on size of initialised arrays. +/// `loc`: source location for all generated code +/// `message_handler`: logging +/// \return `symbol_table` gains any new symbols created, as per gen_nondet_init +/// above. `init_code` gains any instructions requried to initialise either +/// the returned value or its child objects exprt object_factory( const typet &type, const irep_idt base_name, @@ -926,39 +815,25 @@ exprt object_factory( return object; } -/*******************************************************************\ - -Function: gen_nondet_init - - Inputs: `expr`: lvalue expression to initialise - `loc`: source location for all generated code - `skip_classid`: if true, skip initialising @class_identifier - `create_dyn_objs`: if true, use malloc to allocate - objects; otherwise generate fresh static symbols. - `assume_non_null`: never initialise pointer members with - null, unless forced to by recursive datatypes - `message_handler`: logging - `max_nondet_array_length`: upper bound on size of initialised - arrays. - `update_in_place`: - NO_UPDATE_IN_PLACE: initialise `expr` from scratch - MUST_UPDATE_IN_PLACE: reinitialise an existing object - MAY_UPDATE_IN_PLACE: generate a runtime nondet branch - between the NO_ and MUST_ cases. - - Outputs: `init_code` gets an instruction sequence to initialise or - reinitialise `expr` and child objects it refers to. - `symbol_table` is modified with any new symbols created. This - includes any necessary temporaries, and if `create_dyn_objs` - is false, any allocated objects. - - Purpose: Initialises a primitive or object tree rooted at `expr`, - allocating child objects as necessary and nondet-initialising - their members, or if MAY_ or MUST_UPDATE_IN_PLACE is set, - re-initialising already-allocated objects. - -\*******************************************************************/ - +/// Initialises a primitive or object tree rooted at `expr`, allocating child +/// objects as necessary and nondet-initialising their members, or if MAY_ or +/// MUST_UPDATE_IN_PLACE is set, re-initialising already-allocated objects. +/// \par parameters: `expr`: lvalue expression to initialise +/// `loc`: source location for all generated code +/// `skip_classid`: if true, skip initialising @class_identifier +/// `create_dyn_objs`: if true, use malloc to allocate objects; otherwise +/// generate fresh static symbols. +/// `assume_non_null`: never initialise pointer members with null, unless forced +/// to by recursive datatypes +/// `message_handler`: logging +/// `max_nondet_array_length`: upper bound on size of initialised arrays. +/// `update_in_place`: NO_UPDATE_IN_PLACE: initialise `expr` from scratch +/// MUST_UPDATE_IN_PLACE: reinitialise an existing object MAY_UPDATE_IN_PLACE: +/// generate a runtime nondet branch between the NO_ and MUST_ cases. +/// \return `init_code` gets an instruction sequence to initialise or +/// reinitialise `expr` and child objects it refers to. `symbol_table` is +/// modified with any new symbols created. This includes any necessary +/// temporaries, and if `create_dyn_objs` is false, any allocated objects. void gen_nondet_init( const exprt &expr, code_blockt &init_code, diff --git a/src/java_bytecode/java_pointer_casts.cpp b/src/java_bytecode/java_pointer_casts.cpp index 174bad0a9b1..c2f04e4d1a5 100644 --- a/src/java_bytecode/java_pointer_casts.cpp +++ b/src/java_bytecode/java_pointer_casts.cpp @@ -6,24 +6,17 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// JAVA Pointer Casts + #include #include #include #include "java_pointer_casts.h" -/*******************************************************************\ - -Function: clean_deref - - Inputs: pointer - - Outputs: dereferenced pointer - - Purpose: dereference pointer expression - -\*******************************************************************/ - +/// dereference pointer expression +/// \return dereferenced pointer static exprt clean_deref(const exprt &ptr) { return ptr.id()==ID_address_of @@ -31,19 +24,9 @@ static exprt clean_deref(const exprt &ptr) : dereference_exprt(ptr, ptr.type().subtype()); } -/*******************************************************************\ - -Function: find_superclass_with_type - - Inputs: pointer - target type to search - - Outputs: true iff a super class with target type is found - - Purpose: - -\*******************************************************************/ - +/// \par parameters: pointer +/// target type to search +/// \return true iff a super class with target type is found bool find_superclass_with_type( exprt &ptr, const typet &target_type, @@ -77,18 +60,8 @@ bool find_superclass_with_type( } -/*******************************************************************\ - -Function: look_through_casts - - Inputs: input expression - - Outputs: recursively search target of typecast - - Purpose: - -\*******************************************************************/ - +/// \par parameters: input expression +/// \return recursively search target of typecast static const exprt &look_through_casts(const exprt &in) { if(in.id()==ID_typecast) @@ -101,20 +74,10 @@ static const exprt &look_through_casts(const exprt &in) } -/*******************************************************************\ - -Function: make_clean_pointer_cast - - Inputs: raw pointer - target type - namespace - - Outputs: cleaned up typecast expression - - Purpose: - -\*******************************************************************/ - +/// \par parameters: raw pointer +/// target type +/// namespace +/// \return cleaned up typecast expression exprt make_clean_pointer_cast( const exprt &rawptr, const typet &target_type, diff --git a/src/java_bytecode/java_pointer_casts.h b/src/java_bytecode/java_pointer_casts.h index 7b5d23a3c8a..eff1f6ccef8 100644 --- a/src/java_bytecode/java_pointer_casts.h +++ b/src/java_bytecode/java_pointer_casts.h @@ -6,6 +6,9 @@ Author: DiffBlue \*******************************************************************/ +/// \file +/// JAVA Pointer Casts + #ifndef CPROVER_JAVA_BYTECODE_JAVA_POINTER_CASTS_H #define CPROVER_JAVA_BYTECODE_JAVA_POINTER_CASTS_H diff --git a/src/java_bytecode/java_string_library_preprocess.cpp b/src/java_bytecode/java_string_library_preprocess.cpp index 6af2b4fe3e7..3fefade428f 100644 --- a/src/java_bytecode/java_string_library_preprocess.cpp +++ b/src/java_bytecode/java_string_library_preprocess.cpp @@ -11,6 +11,11 @@ Date: April 2017 \*******************************************************************/ +/// \file +/// Java_string_libraries_preprocess, gives code for methods on strings of the +/// java standard library. In particular methods from java.lang.String, +/// java.lang.StringBuilder, java.lang.StringBuffer. + #include #include #include @@ -22,19 +27,8 @@ Date: April 2017 #include "java_string_library_preprocess.h" -/*******************************************************************\ - -Function: java_string_library_preprocesst::java_type_matches_tag - - Inputs: - type - a type - tag - a string - - Output: Boolean telling whether the type is a struct with the given - tag or a symbolic type with the tag prefixed by "java::" - -\*******************************************************************/ - +/// \param type: a type +/// \param tag: a string bool java_string_library_preprocesst::java_type_matches_tag( const typet &type, const std::string &tag) { @@ -51,16 +45,7 @@ bool java_string_library_preprocesst::java_type_matches_tag( return false; } -/*******************************************************************\ - -Function: java_string_library_preprocesst::is_java_string_pointer_type - - Inputs: a type - - Output: Boolean telling whether the type is that of java string pointer - -\*******************************************************************/ - +/// \par parameters: a type bool java_string_library_preprocesst::is_java_string_pointer_type( const typet &type) { @@ -73,49 +58,21 @@ bool java_string_library_preprocesst::is_java_string_pointer_type( return false; } -/*******************************************************************\ - -Function: java_string_library_preprocesst::is_java_string_type - - Inputs: a type - - Output: Boolean telling whether the type is that of java string - -\*******************************************************************/ - +/// \par parameters: a type bool java_string_library_preprocesst::is_java_string_type( const typet &type) { return java_type_matches_tag(type, "java.lang.String"); } -/*******************************************************************\ - -Function: java_string_library_preprocesst::is_java_string_builder_type - - Inputs: a type - - Output: Boolean telling whether the type is that of java StringBuilder - -\*******************************************************************/ - +/// \par parameters: a type bool java_string_library_preprocesst::is_java_string_builder_type( const typet &type) { return java_type_matches_tag(type, "java.lang.StringBuilder"); } -/*******************************************************************\ - -Function: java_string_library_preprocesst::is_java_string_builder_pointer_type - - Inputs: a type - - Output: Boolean telling whether the type is that of java StringBuilder - pointers - -\*******************************************************************/ - +/// \par parameters: a type bool java_string_library_preprocesst::is_java_string_builder_pointer_type( const typet &type) { @@ -128,33 +85,14 @@ bool java_string_library_preprocesst::is_java_string_builder_pointer_type( return false; } -/*******************************************************************\ - -Function: java_string_library_preprocesst::is_java_string_buffer_type - - Inputs: a type - - Output: Boolean telling whether the type is that of java StringBuffer - -\*******************************************************************/ - +/// \par parameters: a type bool java_string_library_preprocesst::is_java_string_buffer_type( const typet &type) { return java_type_matches_tag(type, "java.lang.StringBuffer"); } -/*******************************************************************\ - -Function: java_string_library_preprocesst::is_java_string_buffer_pointer_type - - Inputs: a type - - Output: Boolean telling whether the type is that of java StringBuffer - pointers - -\*******************************************************************/ - +/// \par parameters: a type bool java_string_library_preprocesst::is_java_string_buffer_pointer_type( const typet &type) { @@ -167,33 +105,14 @@ bool java_string_library_preprocesst::is_java_string_buffer_pointer_type( return false; } -/*******************************************************************\ - -Function: java_string_library_preprocesst::is_java_char_sequence_type - - Inputs: a type - - Output: Boolean telling whether the type is that of java char sequence - -\*******************************************************************/ - +/// \par parameters: a type bool java_string_library_preprocesst::is_java_char_sequence_type( const typet &type) { return java_type_matches_tag(type, "java.lang.CharSequence"); } -/*******************************************************************\ - -Function: java_string_library_preprocesst::is_java_char_sequence_pointer_type - - Inputs: a type - - Output: Boolean telling whether the type is that of a pointer - to a java char sequence - -\*******************************************************************/ - +/// \par parameters: a type bool java_string_library_preprocesst::is_java_char_sequence_pointer_type( const typet &type) { @@ -206,33 +125,16 @@ bool java_string_library_preprocesst::is_java_char_sequence_pointer_type( return false; } -/*******************************************************************\ - -Function: java_string_library_preprocesst::is_java_char_array_type - - Inputs: a type - - Output: Boolean telling whether the type is that of java char array - -\*******************************************************************/ - +/// \par parameters: a type bool java_string_library_preprocesst::is_java_char_array_type( const typet &type) { return java_type_matches_tag(type, "array[char]"); } -/*******************************************************************\ - -Function: java_string_library_preprocesst::is_java_char_array_pointer_type - - Inputs: a type - - Outputs: Boolean telling whether the type is that of a pointer - to a java char array - -\*******************************************************************/ - +/// \par parameters: a type +/// \return Boolean telling whether the type is that of a pointer to a java char +/// array bool java_string_library_preprocesst::is_java_char_array_pointer_type( const typet &type) { @@ -245,17 +147,7 @@ bool java_string_library_preprocesst::is_java_char_array_pointer_type( return false; } -/*******************************************************************\ - -Function: java_string_library_preprocesst::string_data_type - - Inputs: - symbol_table - a symbol_table containing an entry for java Strings - - Output: the type of data fields in java Strings. - -\*******************************************************************/ - +/// \param symbol_table: a symbol_table containing an entry for java Strings typet string_data_type(symbol_tablet symbol_table) { symbolt sym=symbol_table.lookup("java::java.lang.String"); @@ -266,32 +158,15 @@ typet string_data_type(symbol_tablet symbol_table) return data_type; } -/*******************************************************************\ - -Function: java_string_library_preprocesst::string_length_type - - Outputs: the type of the length field in java Strings. - -\*******************************************************************/ - +/// \return the type of the length field in java Strings. typet string_length_type() { return java_int_type(); } -/*******************************************************************\ - -Function: java_string_library_preprocesst::add_string_type - - Inputs: - class_name - a name for the class such as "java.lang.String" - symbol_table - symbol table to which the class will be added - - Purpose: Add to the symbol table type declaration for a String-like - Java class. - -\*******************************************************************/ - +/// Add to the symbol table type declaration for a String-like Java class. +/// \param class_name: a name for the class such as "java.lang.String" +/// \param symbol_table: symbol table to which the class will be added void java_string_library_preprocesst::add_string_type( const irep_idt &class_name, symbol_tablet &symbol_table) { @@ -323,22 +198,11 @@ void java_string_library_preprocesst::add_string_type( string_symbol->is_type=true; } -/*******************************************************************\ - -Function: fresh_array - - Inputs: - type - an array type - location - a location in the program - symbol_table - symbol table - - Output: a new symbol - - Purpose: add a symbol in the table with static lifetime and name - containing `cprover_string_array` and given type - -\*******************************************************************/ - +/// add a symbol in the table with static lifetime and name containing +/// `cprover_string_array` and given type +/// \param type: an array type +/// \param location: a location in the program +/// \param symbol_table: symbol table symbol_exprt java_string_library_preprocesst::fresh_array( const typet &type, const source_locationt &location, @@ -355,19 +219,10 @@ symbol_exprt java_string_library_preprocesst::fresh_array( return array_symbol.symbol_expr(); } -/*******************************************************************\ - -Function: java_string_library_preprocesst::declare_function - - Inputs: - function_name - a name - type - a type - symbol_table - symbol table - - Purpose: declare a function with the given name and type - -\*******************************************************************/ - +/// declare a function with the given name and type +/// \param function_name: a name +/// \param type: a type +/// \param symbol_table: symbol table void java_string_library_preprocesst::declare_function( irep_idt function_name, const typet &type, symbol_tablet &symbol_table) { @@ -381,24 +236,12 @@ void java_string_library_preprocesst::declare_function( symbol_table.add(func_symbol); } -/*******************************************************************\ - -Function: string_refine_preprocesst::process_arguments - - Inputs: - params - a list of function parameters - loc - location in the source - symbol_table - symbol table - init_code - code block, in which declaration of some arguments - may be added - - Output: a list of expressions - - Purpose: calls string_refine_preprocesst::process_operands with a - list of parameters. - -\*******************************************************************/ - +/// calls string_refine_preprocesst::process_operands with a list of parameters. +/// \param params: a list of function parameters +/// \param loc: location in the source +/// \param symbol_table: symbol table +/// \param init_code: code block, in which declaration of some arguments may be +/// added exprt::operandst java_string_library_preprocesst::process_parameters( const code_typet::parameterst ¶ms, const source_locationt &loc, @@ -414,23 +257,13 @@ exprt::operandst java_string_library_preprocesst::process_parameters( return process_operands(ops, loc, symbol_table, init_code); } -/*******************************************************************\ - -Function: java_string_library_preprocesst::process_single_operand - - Inputs: - processed_ops - the list of processed operands to populate - op_to_process - a list of expressions - loc - location in the source - symbol_table - symbol table - init_code - code block, in which declaration of some arguments - may be added - - Purpose: Creates a string_exprt from the input exprt and adds it to - processed_ops - -\*******************************************************************/ - +/// Creates a string_exprt from the input exprt and adds it to processed_ops +/// \param processed_ops: the list of processed operands to populate +/// \param op_to_process: a list of expressions +/// \param loc: location in the source +/// \param symbol_table: symbol table +/// \param init_code: code block, in which declaration of some arguments may be +/// added void java_string_library_preprocesst::process_single_operand( exprt::operandst &processed_ops, const exprt &op_to_process, @@ -452,28 +285,16 @@ void java_string_library_preprocesst::process_single_operand( processed_ops.push_back(string_expr); } -/*******************************************************************\ - -Function: java_string_library_preprocesst::process_operands - - Inputs: - operands - a list of expressions - loc - location in the source - symbol_table - symbol table - init_code - code block, in which declaration of some arguments - may be added - - Output: a list of expressions - - Purpose: for each expression that is of a type implementing strings, - we declare a new `cprover_string` whose contents is deduced - from the expression and replace the - expression by this cprover_string in the output list; - in the other case the expression is kept as is for the output list. - Also does the same thing for char array references. - -\*******************************************************************/ - +/// for each expression that is of a type implementing strings, we declare a new +/// `cprover_string` whose contents is deduced from the expression and replace +/// the expression by this cprover_string in the output list; in the other case +/// the expression is kept as is for the output list. Also does the same thing +/// for char array references. +/// \param operands: a list of expressions +/// \param loc: location in the source +/// \param symbol_table: symbol table +/// \param init_code: code block, in which declaration of some arguments may be +/// added exprt::operandst java_string_library_preprocesst::process_operands( const exprt::operandst &operands, const source_locationt &loc, @@ -500,25 +321,14 @@ exprt::operandst java_string_library_preprocesst::process_operands( return ops; } -/*******************************************************************\ - -Function: java_string_library_preprocesst::process_equals_function_operands - - Inputs: - operands - a list of expressions - loc - location in the source - symbol_table - symbol table - init_code - code block, in which declaration of some arguments - may be added - - Output: a list of expressions - - Purpose: Converts the operands of the equals function to string - expressions and outputs these conversions. As a side effect - of the conversions it adds some code to init_code. - -\*******************************************************************/ - +/// Converts the operands of the equals function to string expressions and +/// outputs these conversions. As a side effect of the conversions it adds some +/// code to init_code. +/// \param operands: a list of expressions +/// \param loc: location in the source +/// \param symbol_table: symbol table +/// \param init_code: code block, in which declaration of some arguments may be +/// added exprt::operandst java_string_library_preprocesst::process_equals_function_operands( const exprt::operandst &operands, @@ -544,20 +354,9 @@ exprt::operandst return ops; } -/*******************************************************************\ - -Function: java_string_library_preprocesst::get_data_type - - Inputs: - type - a type containing a "data" component - symbol_table - symbol table - - Output: type of the "data" component - - Purpose: Finds the type of the data component - -\*******************************************************************/ - +/// Finds the type of the data component +/// \param type: a type containing a "data" component +/// \param symbol_table: symbol table typet java_string_library_preprocesst::get_data_type( const typet &type, const symbol_tablet &symbol_table) { @@ -578,20 +377,9 @@ typet java_string_library_preprocesst::get_data_type( } } -/*******************************************************************\ - -Function: java_string_library_preprocesst::get_length_type - - Inputs: - type - a type containing a "length" component - symbol_table - symbol table - - Output: type of the "length" component - - Purpose: Finds the type of the length component - -\*******************************************************************/ - +/// Finds the type of the length component +/// \param type: a type containing a "length" component +/// \param symbol_table: symbol table typet java_string_library_preprocesst::get_length_type( const typet &type, const symbol_tablet &symbol_table) { @@ -612,20 +400,9 @@ typet java_string_library_preprocesst::get_length_type( } } -/*******************************************************************\ - -Function: java_string_library_preprocesst::get_length - - Inputs: - expr - an expression of structured type with length component - symbol_table - symbol table - - Output: expression representing the "length" member - - Purpose: access length member - -\*******************************************************************/ - +/// access length member +/// \param expr: an expression of structured type with length component +/// \param symbol_table: symbol table exprt java_string_library_preprocesst::get_length( const exprt &expr, const symbol_tablet &symbol_table) { @@ -633,43 +410,21 @@ exprt java_string_library_preprocesst::get_length( expr, "length", get_length_type(expr.type(), symbol_table)); } -/*******************************************************************\ - -Function: java_string_library_preprocesst::get_data - - Inputs: - expr - an expression of structured type with length component - symbol_table - symbol table - - Output: expression representing the "data" member - - Purpose: access data member - -\*******************************************************************/ - +/// access data member +/// \param expr: an expression of structured type with length component +/// \param symbol_table: symbol table exprt java_string_library_preprocesst::get_data( const exprt &expr, const symbol_tablet &symbol_table) { return member_exprt(expr, "data", get_data_type(expr.type(), symbol_table)); } -/*******************************************************************\ - -Function: string_refine_preprocesst::replace_char_array - - Inputs: - array_pointer - an expression of type char array pointer - loc - location in the source - symbol_table - symbol table - code - code block, in which some assignments will be added - - Output: a string expression - - Purpose: we declare a new `cprover_string` whose contents is deduced - from the char array. - -\*******************************************************************/ - +/// we declare a new `cprover_string` whose contents is deduced from the char +/// array. +/// \param array_pointer: an expression of type char array pointer +/// \param loc: location in the source +/// \param symbol_table: symbol table +/// \param code: code block, in which some assignments will be added string_exprt java_string_library_preprocesst::replace_char_array( const exprt &array_pointer, const source_locationt &loc, @@ -704,22 +459,11 @@ string_exprt java_string_library_preprocesst::replace_char_array( return string_expr; } -/*******************************************************************\ - -Function: java_string_library_preprocesst::fresh_string - - Inputs: - type - a type for refined strings - loc - a location in the program - symbol_table - symbol table - - Output: a new symbol - - Purpose: add a symbol with static lifetime and name containing - `cprover_string` and given type - -\*******************************************************************/ - +/// add a symbol with static lifetime and name containing `cprover_string` and +/// given type +/// \param type: a type for refined strings +/// \param loc: a location in the program +/// \param symbol_table: symbol table symbol_exprt java_string_library_preprocesst::fresh_string( const typet &type, const source_locationt &loc, symbol_tablet &symbol_table) { @@ -729,22 +473,11 @@ symbol_exprt java_string_library_preprocesst::fresh_string( return string_symbol.symbol_expr(); } -/*******************************************************************\ - -Function: java_string_library_preprocesst::fresh_string_expr - - Inputs: - loc - a location in the program - symbol_table - symbol table - code - code block to which allocation instruction will be added - - Output: a new string_expr - - Purpose: add symbols with prefix cprover_string_length and - cprover_string_data and construct a string_expr from them. - -\*******************************************************************/ - +/// add symbols with prefix cprover_string_length and cprover_string_data and +/// construct a string_expr from them. +/// \param loc: a location in the program +/// \param symbol_table: symbol table +/// \param code: code block to which allocation instruction will be added string_exprt java_string_library_preprocesst::fresh_string_expr( const source_locationt &loc, symbol_tablet &symbol_table, code_blockt &code) { @@ -765,22 +498,11 @@ string_exprt java_string_library_preprocesst::fresh_string_expr( return str; } -/*******************************************************************\ - -Function: java_string_library_preprocesst::fresh_string_expr_symbol - - Inputs: - loc - a location in the program - symbol_table - symbol table - code - code block to which allocation instruction will be added - - Output: a new expression of refined string type - - Purpose: add symbols with prefix cprover_string_length and - cprover_string_data and construct a string_expr from them. - -\*******************************************************************/ - +/// add symbols with prefix cprover_string_length and cprover_string_data and +/// construct a string_expr from them. +/// \param loc: a location in the program +/// \param symbol_table: symbol table +/// \param code: code block to which allocation instruction will be added exprt java_string_library_preprocesst::fresh_string_expr_symbol( const source_locationt &loc, symbol_tablet &symbol_table, code_blockt &code) { @@ -795,22 +517,11 @@ exprt java_string_library_preprocesst::fresh_string_expr_symbol( return sym.symbol_expr(); } -/*******************************************************************\ - -Function: java_string_library_preprocesst::allocate_fresh_string - - Inputs: - type - a type for string - loc - a location in the program - symbol_table - symbol table - code - code block to which allocation instruction will be added - - Output: a new string - - Purpose: declare a new String and allocate it - -\*******************************************************************/ - +/// declare a new String and allocate it +/// \param type: a type for string +/// \param loc: a location in the program +/// \param symbol_table: symbol table +/// \param code: code block to which allocation instruction will be added exprt java_string_library_preprocesst::allocate_fresh_string( const typet &type, const source_locationt &loc, @@ -824,22 +535,11 @@ exprt java_string_library_preprocesst::allocate_fresh_string( return str; } -/*******************************************************************\ - -Function: java_string_library_preprocesst::allocate_fresh_array - - Inputs: - type - a type for string - loc - a location in the program - symbol_table - symbol table - code - code block to which allocation instruction will be added - - Output: a new array - - Purpose: declare a new character array and allocate it - -\*******************************************************************/ - +/// declare a new character array and allocate it +/// \param type: a type for string +/// \param loc: a location in the program +/// \param symbol_table: symbol table +/// \param code: code block to which allocation instruction will be added exprt java_string_library_preprocesst::allocate_fresh_array( const typet &type, const source_locationt &loc, @@ -853,20 +553,10 @@ exprt java_string_library_preprocesst::allocate_fresh_array( return array; } -/*******************************************************************\ - -Function: java_string_library_preprocesst::make_function_application - - Inputs: - function_name - the name of the function - arguments - a list of arguments - type - return type of the function - symbol_table - a symbol table - - Output: a function application representing: function_name(arguments) - -\*******************************************************************/ - +/// \param function_name: the name of the function +/// \param arguments: a list of arguments +/// \param type: return type of the function +/// \param symbol_table: a symbol table exprt java_string_library_preprocesst::make_function_application( const irep_idt &function_name, const exprt::operandst &arguments, @@ -885,23 +575,11 @@ exprt java_string_library_preprocesst::make_function_application( return call; } -/*******************************************************************\ - -Function: java_string_library_preprocesst::code_assign_function_application - - Inputs: - lhs - an expression - function_name - the name of the function - arguments - a list of arguments - symbol_table - a symbol table - - Output: the following code: - > lhs=function_name_length(arguments) - - Purpose: assign the result of a function call - -\*******************************************************************/ - +/// assign the result of a function call +/// \param lhs: an expression +/// \param function_name: the name of the function +/// \param arguments: a list of arguments +/// \param symbol_table: a symbol table codet java_string_library_preprocesst::code_assign_function_application( const exprt &lhs, const irep_idt &function_name, @@ -913,23 +591,11 @@ codet java_string_library_preprocesst::code_assign_function_application( return code_assignt(lhs, fun_app); } -/*******************************************************************\ - -Function: java_string_library_preprocesst::code_return_function_application - - Inputs: - function_name - the name of the function - arguments - a list of arguments - type - the return type - symbol_table - a symbol table - - Output: the following code: - > return function_name_length(arguments) - - Purpose: return the result of a function call - -\*******************************************************************/ - +/// return the result of a function call +/// \param function_name: the name of the function +/// \param arguments: a list of arguments +/// \param type: the return type +/// \param symbol_table: a symbol table codet java_string_library_preprocesst::code_return_function_application( const irep_idt &function_name, const exprt::operandst &arguments, @@ -941,22 +607,10 @@ codet java_string_library_preprocesst::code_return_function_application( return code_returnt(fun_app); } -/*******************************************************************\ - -Function: java_string_library_preprocesst::code_assign_function_to_string_expr - - Inputs: - string_expr - a string expression - function_name - the name of the function - arguments - arguments of the function - symbol_table - symbol table - - Output: return the following code: - > str.length <- function_name_length(arguments) - > str.data <- function_name_data(arguments) - -\*******************************************************************/ - +/// \param string_expr: a string expression +/// \param function_name: the name of the function +/// \param arguments: arguments of the function +/// \param symbol_table: symbol table codet java_string_library_preprocesst::code_assign_function_to_string_expr( const string_exprt &string_expr, const irep_idt &function_name, @@ -976,24 +630,11 @@ codet java_string_library_preprocesst::code_assign_function_to_string_expr( return code_blockt({assign_fun_length, assign_fun_data}); } -/*******************************************************************\ - -Function: java_string_library_preprocesst::string_expr_of_function_application - - Inputs: - function_name - the name of the function - arguments - arguments of the function - loc - a location in the program - symbol_table - symbol table - code - code block in which we add instructions - - Output: return a string expr str and add the following code: - > array str.data - > str.length <- function_name_length(arguments) - > str.data <- function_name_data(arguments) - -\*******************************************************************/ - +/// \param function_name: the name of the function +/// \param arguments: arguments of the function +/// \param loc: a location in the program +/// \param symbol_table: symbol table +/// \param code: code block in which we add instructions string_exprt java_string_library_preprocesst:: string_expr_of_function_application( const irep_idt &function_name, @@ -1008,25 +649,12 @@ string_exprt java_string_library_preprocesst:: return string_expr; } -/*******************************************************************\ - -Function: java_string_library_preprocesst:: - code_assign_components_to_java_string - - Inputs: - lhs - expression representing the java string to assign to - rhs_array - pointer to the array to assign - rhs_length - length of the array to assign - symbol_table - symbol table - - Output: return the following code: - > lhs = { {Object}, length=rhs_length, data=rhs_array } - - Purpose: Produce code for an assignemnrt of a string expr to a - Java string, component-wise. - -\*******************************************************************/ - +/// Produce code for an assignemnrt of a string expr to a Java string, +/// component-wise. +/// \param lhs: expression representing the java string to assign to +/// \param rhs_array: pointer to the array to assign +/// \param rhs_length: length of the array to assign +/// \param symbol_table: symbol table codet java_string_library_preprocesst::code_assign_components_to_java_string( const exprt &lhs, const exprt &rhs_array, @@ -1056,24 +684,10 @@ codet java_string_library_preprocesst::code_assign_components_to_java_string( return code; } -/*******************************************************************\ - -Function: java_string_library_preprocesst:: - code_assign_string_expr_to_java_string - - Inputs: - lhs - an expression representing a java string - rhs - a string expression - symbol_table - symbol table - - Output: return the following code: - > lhs = { {Object}, length=rhs.length, data=rhs.data } - - Purpose: Produce code for an assignemnt of a string expr to a Java - string. - -\*******************************************************************/ - +/// Produce code for an assignemnt of a string expr to a Java string. +/// \param lhs: an expression representing a java string +/// \param rhs: a string expression +/// \param symbol_table: symbol table codet java_string_library_preprocesst::code_assign_string_expr_to_java_string( const exprt &lhs, const string_exprt &rhs, @@ -1083,26 +697,11 @@ codet java_string_library_preprocesst::code_assign_string_expr_to_java_string( lhs, address_of_exprt(rhs.content()), rhs.length(), symbol_table); } -/*******************************************************************\ - -Function: java_string_library_preprocesst:: - code_assign_string_expr_to_new_java_string - - Inputs: - lhs - an expression representing a java string - rhs - a string expression - loc - a location in the program - symbol_table - symbol table - - Output: return the following code: - > data = new array[]; - > *data = rhs.data; - > lhs = { {Object} , length=rhs.length, data=data} - - Purpose: Produce code for an assignment of a string from a string expr. - -\*******************************************************************/ - +/// Produce code for an assignment of a string from a string expr. +/// \param lhs: an expression representing a java string +/// \param rhs: a string expression +/// \param loc: a location in the program +/// \param symbol_table: symbol table codet java_string_library_preprocesst:: code_assign_string_expr_to_new_java_string( const exprt &lhs, @@ -1125,22 +724,9 @@ codet java_string_library_preprocesst:: return code; } -/*******************************************************************\ - -Function: java_string_library_preprocesst:: - code_assign_java_string_to_string_expr - - Inputs: - lhs - a string expression - rhs - an expression representing a java string - symbol_table - symbol table - - Output: return the following code: - > lhs.length=rhs->length - > lhs.data=*(rhs->data) - -\*******************************************************************/ - +/// \param lhs: a string expression +/// \param rhs: an expression representing a java string +/// \param symbol_table: symbol table codet java_string_library_preprocesst::code_assign_java_string_to_string_expr( const string_exprt &lhs, const exprt &rhs, symbol_tablet &symbol_table) { @@ -1167,23 +753,10 @@ codet java_string_library_preprocesst::code_assign_java_string_to_string_expr( return code; } -/*******************************************************************\ - -Function: java_string_library_preprocesst:: - code_assign_string_literal_to_string_expr - - Inputs: - lhs - an expression representing a java string - tmp_string - a temporary string to hold the literal - s - the literal to be assigned - symbol_table - symbol table - - Output: return the following code: - > tmp_string = "s" - > lhs = (string_expr) tmp_string - -\*******************************************************************/ - +/// \param lhs: an expression representing a java string +/// \param tmp_string: a temporary string to hold the literal +/// \param s: the literal to be assigned +/// \param symbol_table: symbol table codet java_string_library_preprocesst:: code_assign_string_literal_to_string_expr( const string_exprt &lhs, @@ -1198,25 +771,13 @@ codet java_string_library_preprocesst:: return code; } -/*******************************************************************\ - -Function: java_string_library_preprocesst:: - make_string_builder_append_object_code - - Inputs: - type - type of the function called - loc - location in the program - symbol_table - symbol table - - Outputs: code for the StringBuilder.append(Object) function: - > string1 = arguments[1].toString() - > string_expr1 = string_to_string_expr(string1) - > string_expr2 = concat(this, string_expr1) - > this = string_expr_to_string(string_expr2) - > return this - -\*******************************************************************/ - +/// \param type: type of the function called +/// \param loc: location in the program +/// \param symbol_table: symbol table +/// \return code for the StringBuilder.append(Object) function: > string1 = +/// arguments[1].toString() > string_expr1 = string_to_string_expr(string1) > +/// string_expr2 = concat(this, string_expr1) > this = +/// string_expr_to_string(string_expr2) > return this codet java_string_library_preprocesst::make_string_builder_append_object_code( const code_typet &type, const source_locationt &loc, @@ -1269,24 +830,13 @@ codet java_string_library_preprocesst::make_string_builder_append_object_code( return code; } -/*******************************************************************\ - -Function: java_string_library_preprocesst::make_equals_code - - Inputs: - type - type of the function call - loc - location in the program_invocation_name - symbol_table - symbol table - - Outputs: Code corresponding to: - > string_expr1 = {this->length; *this->data} - > string_expr2 = {arg->length; *arg->data} - > return cprover_string_equal(string_expr1, string_expr2) - - Purpose: Used to provide code for the Java String.equals(Object) function. - -\*******************************************************************/ - +/// Used to provide code for the Java String.equals(Object) function. +/// \param type: type of the function call +/// \param loc: location in the program_invocation_name +/// \param symbol_table: symbol table +/// \return Code corresponding to: > string_expr1 = {this->length; *this->data} +/// > string_expr2 = {arg->length; *arg->data} > return +/// cprover_string_equal(string_expr1, string_expr2) codet java_string_library_preprocesst::make_equals_function_code( const code_typet &type, const source_locationt &loc, @@ -1307,28 +857,14 @@ codet java_string_library_preprocesst::make_equals_function_code( return code; } -/*******************************************************************\ - -Function: java_string_library_preprocesst:: - make_string_builder_append_float_code - - Inputs: - type - type of the function call - loc - location in the program_invocation_name - symbol_table - symbol table - - Outputs: Code corresponding to: - > string1 = arguments[1].toString() - > string_expr1 = string_to_string_expr(string1) - > string_expr2 = concat(this, string_expr1) - > this = string_expr_to_string(string_expr2) - > return this - - Purpose: Used to provide code for the Java StringBuilder.append(F) - function. - -\*******************************************************************/ - +/// Used to provide code for the Java StringBuilder.append(F) function. +/// \param type: type of the function call +/// \param loc: location in the program_invocation_name +/// \param symbol_table: symbol table +/// \return Code corresponding to: > string1 = arguments[1].toString() > +/// string_expr1 = string_to_string_expr(string1) > string_expr2 = +/// concat(this, string_expr1) > this = string_expr_to_string(string_expr2) > +/// return this codet java_string_library_preprocesst::make_string_builder_append_float_code( const code_typet &type, const source_locationt &loc, @@ -1386,20 +922,10 @@ codet java_string_library_preprocesst::make_string_builder_append_float_code( return code; } -/*******************************************************************\ - -Function: java_string_library_preprocesst::string_literal - - Inputs: - s - a string - - Outputs: an expression representing a Java string literal with the - given content. - - Purpose: construct a Java string literal from a constant string value - -\*******************************************************************/ - +/// construct a Java string literal from a constant string value +/// \param s: a string +/// \return an expression representing a Java string literal with the given +/// content. exprt java_string_library_preprocesst::string_literal(const std::string &s) { exprt string_literal(ID_java_string_literal); @@ -1407,37 +933,20 @@ exprt java_string_library_preprocesst::string_literal(const std::string &s) return string_literal; } -/*******************************************************************\ - -Function: java_string_library_preprocesst::make_float_to_string_code - - Inputs: - type - type of the function call - loc - location in the program_invocation_name - symbol_table - symbol table - - Outputs: Code corresponding to: - > String * str; - > str = MALLOC(String); - > String * tmp_string; - > int string_expr_length; - > char[] string_expr_content; - > CPROVER_string string_expr_sym; - > if arguments[1]==NaN - > then {tmp_string="NaN"; string_expr=(string_expr)tmp_string} - > if arguments[1]==Infinity - > then {tmp_string="Infinity"; string_expr=(string_expr)tmp_string} - > if 1e-3 then string_expr=cprover_float_to_string(arguments[1]) - > else string_expr=cprover_float_to_scientific_notation_string(arg[1]) - > string_expr_sym=string_expr; - > str=(String*) string_expr; - > return str; - - Purpose: Provide code for the Float.toString(F) function. - -\*******************************************************************/ - +/// Provide code for the Float.toString(F) function. +/// \param type: type of the function call +/// \param loc: location in the program_invocation_name +/// \param symbol_table: symbol table +/// \return Code corresponding to: > String * str; > str = MALLOC(String); > +/// String * tmp_string; > int string_expr_length; > char[] +/// string_expr_content; > CPROVER_string string_expr_sym; > if +/// arguments[1]==NaN > then {tmp_string="NaN"; +/// string_expr=(string_expr)tmp_string} > if arguments[1]==Infinity > then +/// {tmp_string="Infinity"; string_expr=(string_expr)tmp_string} > if +/// 1e-3 then +/// string_expr=cprover_float_to_string(arguments[1]) > else +/// string_expr=cprover_float_to_scientific_notation_string(arg[1]) > +/// string_expr_sym=string_expr; > str=(String*) string_expr; > return str; codet java_string_library_preprocesst::make_float_to_string_code( const code_typet &type, const source_locationt &loc, @@ -1536,30 +1045,18 @@ codet java_string_library_preprocesst::make_float_to_string_code( return code; } -/*******************************************************************\ - -Function: java_string_library_preprocesst::make_init_function_from_call - - Inputs: - function_name - name of the function to be called - type - the type of the function call - loc - location in program - symbol_table - the symbol table to populate - ignore_first_arg - boolean flag telling that the first argument - should not be part of the arguments of the call - (but only used to be assigned the result) - - Outputs: code for the String.(args) function: - > cprover_string_length = fun(arg).length; - > cprover_string_array = fun(arg).data; - > this->length = cprover_string_length; - > this->data = cprover_string_array; - > cprover_string = {.=cprover_string_length, .=cprover_string_array}; - - Purpose: Generate the goto code for string initialization. - -\*******************************************************************/ - +/// Generate the goto code for string initialization. +/// \param function_name: name of the function to be called +/// \param type: the type of the function call +/// \param loc: location in program +/// \param symbol_table: the symbol table to populate +/// \param ignore_first_arg: boolean flag telling that the first argument should +/// not be part of the arguments of the call (but only used to be assigned the +/// result) +/// \return code for the String.(args) function: > cprover_string_length = +/// fun(arg).length; > cprover_string_array = fun(arg).data; > this->length = +/// cprover_string_length; > this->data = cprover_string_array; > +/// cprover_string = {.=cprover_string_length, .=cprover_string_array}; codet java_string_library_preprocesst::make_init_function_from_call( const irep_idt &function_name, const code_typet &type, @@ -1596,24 +1093,13 @@ codet java_string_library_preprocesst::make_init_function_from_call( return code; } -/*******************************************************************\ - -Function: java_string_library_preprocesst:: - make_assign_and_return_function_from_call - - Inputs: - function_name - name of the function to be called - type - the type of the function call - loc - location in program - symbol_table - the symbol table to populate - - Outputs: Code calling function with the given function name. - - Purpose: Call a cprover internal function, assign the result to - object `this` and return it. - -\*******************************************************************/ - +/// Call a cprover internal function, assign the result to object `this` and +/// return it. +/// \param function_name: name of the function to be called +/// \param type: the type of the function call +/// \param loc: location in program +/// \param symbol_table: the symbol table to populate +/// \return Code calling function with the given function name. codet java_string_library_preprocesst:: make_assign_and_return_function_from_call( const irep_idt &function_name, @@ -1632,24 +1118,13 @@ codet java_string_library_preprocesst:: return code; } -/*******************************************************************\ - -Function: java_string_library_preprocesst::make_assign_function_from_call - - Inputs: - function_name - name of the function to be called - type - the type of the function call - loc - location in program - symbol_table - the symbol table to populate - - Outputs: Code assigning result of a call to the function with given - function name. - - Purpose: Call a cprover internal function and assign the result to - object `this`. - -\*******************************************************************/ - +/// Call a cprover internal function and assign the result to object `this`. +/// \param function_name: name of the function to be called +/// \param type: the type of the function call +/// \param loc: location in program +/// \param symbol_table: the symbol table to populate +/// \return Code assigning result of a call to the function with given function +/// name. codet java_string_library_preprocesst::make_assign_function_from_call( const irep_idt &function_name, const code_typet &type, @@ -1663,25 +1138,13 @@ codet java_string_library_preprocesst::make_assign_function_from_call( return code; } -/*******************************************************************\ - -Function: java_string_library_preprocesst::make_string_to_char_array_code - - Inputs: - type - type of the function called - loc - location in the source - symbol_table - the symbol table - - Outputs: Code corresponding to - > return_tmp0 = malloc(array[char]); - > return_tmp0->data=&((s->data)[0]) - > return_tmp0->length=s->length - - Purpose: Used to provide our own implementation of the - java.lang.String.toCharArray:()[C function. - -\*******************************************************************/ - +/// Used to provide our own implementation of the +/// java.lang.String.toCharArray:()[C function. +/// \param type: type of the function called +/// \param loc: location in the source +/// \param symbol_table: the symbol table +/// \return Code corresponding to > return_tmp0 = malloc(array[char]); > +/// return_tmp0->data=&((s->data)[0]) > return_tmp0->length=s->length codet java_string_library_preprocesst::make_string_to_char_array_code( const code_typet &type, const source_locationt &loc, @@ -1721,24 +1184,13 @@ codet java_string_library_preprocesst::make_string_to_char_array_code( return code; } -/*******************************************************************\ - -Function: java_string_library_preprocesst::make_function_from_call - - Inputs: - function_name - name of the function to be called - type - type of the function - loc - location in the source - symbol_table - symbol table - - Outputs: Code corresponding to: - > return function_name(args); - - Purpose: Provide code for a function that calls a function from the - solver and simply returns it. - -\*******************************************************************/ - +/// Provide code for a function that calls a function from the solver and simply +/// returns it. +/// \param function_name: name of the function to be called +/// \param type: type of the function +/// \param loc: location in the source +/// \param symbol_table: symbol table +/// \return Code corresponding to: > return function_name(args); codet java_string_library_preprocesst::make_function_from_call( const irep_idt &function_name, const code_typet &type, @@ -1753,28 +1205,14 @@ codet java_string_library_preprocesst::make_function_from_call( return code; } -/*******************************************************************\ - -Function: - java_string_library_preprocesst::make_string_returning_function_from_call - - Inputs: - function_name - name of the function to be called - type - type of the function - loc - location in the source - symbol_table - symbol table - - Outputs: Code corresponding to: - > string_expr = function_name(args) - > string = new String - > string = string_expr_to_string(string) - > return string - - Purpose: Provide code for a function that calls a function from the - solver and return the string_expr result as a Java string. - -\*******************************************************************/ - +/// Provide code for a function that calls a function from the solver and return +/// the string_expr result as a Java string. +/// \param function_name: name of the function to be called +/// \param type: type of the function +/// \param loc: location in the source +/// \param symbol_table: symbol table +/// \return Code corresponding to: > string_expr = function_name(args) > string +/// = new String > string = string_expr_to_string(string) > return string codet java_string_library_preprocesst:: make_string_returning_function_from_call( const irep_idt &function_name, @@ -1807,28 +1245,14 @@ codet java_string_library_preprocesst:: return code; } -/*******************************************************************\ - -Function: - java_string_library_preprocesst::make_copy_string_code - - Inputs: - type - type of the function - loc - location in the source - symbol_table - symbol table - - Outputs: Code corresponding to: - > string_expr = string_to_string_expr(arg0) - > string_expr_sym = { string_expr.length; string_expr.content } - > str = new String - > str = string_expr_to_string(string_expr) - > return str - - Purpose: Generates code for a function which copies a string object to a new - string object. - -\*******************************************************************/ - +/// Generates code for a function which copies a string object to a new string +/// object. +/// \param type: type of the function +/// \param loc: location in the source +/// \param symbol_table: symbol table +/// \return Code corresponding to: > string_expr = string_to_string_expr(arg0) > +/// string_expr_sym = { string_expr.length; string_expr.content } > str = new +/// String > str = string_expr_to_string(string_expr) > return str codet java_string_library_preprocesst::make_copy_string_code( const code_typet &type, const source_locationt &loc, @@ -1860,26 +1284,14 @@ codet java_string_library_preprocesst::make_copy_string_code( return code; } -/*******************************************************************\ - -Function: - java_string_library_preprocesst::make_copy_constructor_code - - Inputs: - type - type of the function - loc - location in the source - symbol_table - symbol table - - Outputs: Code corresponding to: - > string_expr = java_string_to_string_expr(arg1) - > string_expr_sym = { string_expr.length; string_expr.content } - > this = string_expr_to_java_string(string_expr) - - Purpose: Generates code for a constructor of a string object from another - string object. - -\*******************************************************************/ - +/// Generates code for a constructor of a string object from another string +/// object. +/// \param type: type of the function +/// \param loc: location in the source +/// \param symbol_table: symbol table +/// \return Code corresponding to: > string_expr = +/// java_string_to_string_expr(arg1) > string_expr_sym = { string_expr.length; +/// string_expr.content } > this = string_expr_to_java_string(string_expr) codet java_string_library_preprocesst::make_copy_constructor_code( const code_typet &type, const source_locationt &loc, @@ -1909,25 +1321,14 @@ codet java_string_library_preprocesst::make_copy_constructor_code( return code; } -/*******************************************************************\ - -Function: java_string_library_preprocesst::code_for_function - - Inputs: - function_id - name of the function - type - its type - loc - location in the program - symbol_table - a symbol table - - Outputs: Code for the body of the String functions if they are part - of the supported String functions, nil_exprt otherwise. - - Purpose: Should be called to provide code for string functions that - are used in the code but for which no implementation is - provided. - -\*******************************************************************/ - +/// Should be called to provide code for string functions that are used in the +/// code but for which no implementation is provided. +/// \param function_id: name of the function +/// \param type: its type +/// \param loc: location in the program +/// \param symbol_table: a symbol table +/// \return Code for the body of the String functions if they are part of the +/// supported String functions, nil_exprt otherwise. exprt java_string_library_preprocesst::code_for_function( const irep_idt &function_id, const code_typet &type, @@ -1965,35 +1366,17 @@ exprt java_string_library_preprocesst::code_for_function( return nil_exprt(); } -/*******************************************************************\ - -Function: java_string_library_preprocesst::is_known_string_type - - Inputs: - class_name - name of the class - - Outputs: True if the type is one that is known to our preprocessing, - false otherwise - - Purpose: Check whether a class name is known as a string type. - -\*******************************************************************/ - +/// Check whether a class name is known as a string type. +/// \param class_name: name of the class +/// \return True if the type is one that is known to our preprocessing, false +/// otherwise bool java_string_library_preprocesst::is_known_string_type( irep_idt class_name) { return string_types.find(class_name)!=string_types.end(); } -/*******************************************************************\ - -Function: java_string_library_preprocesst::initialize_conversion_table - - Purpose: fill maps with correspondence from java method names to - conversion functions - -\*******************************************************************/ - +/// fill maps with correspondence from java method names to conversion functions void java_string_library_preprocesst::initialize_conversion_table() { character_preprocess.initialize_conversion_table(); diff --git a/src/java_bytecode/java_string_library_preprocess.h b/src/java_bytecode/java_string_library_preprocess.h index 16ab5cfc6a9..b9449e18cd6 100644 --- a/src/java_bytecode/java_string_library_preprocess.h +++ b/src/java_bytecode/java_string_library_preprocess.h @@ -8,6 +8,9 @@ Date: March 2017 \*******************************************************************/ +/// \file +/// Produce code for simple implementation of String Java libraries + #ifndef CPROVER_JAVA_BYTECODE_JAVA_STRING_LIBRARY_PREPROCESS_H #define CPROVER_JAVA_BYTECODE_JAVA_STRING_LIBRARY_PREPROCESS_H diff --git a/src/java_bytecode/java_types.cpp b/src/java_bytecode/java_types.cpp index 9d78c7a36a7..5e434b8a603 100644 --- a/src/java_bytecode/java_types.cpp +++ b/src/java_bytecode/java_types.cpp @@ -16,154 +16,46 @@ Author: Daniel Kroening, kroening@kroening.com #include "java_types.h" -/*******************************************************************\ - -Function: java_int_type - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - typet java_int_type() { return signedbv_typet(32); } -/*******************************************************************\ - -Function: java_void_type - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - typet java_void_type() { return void_typet(); } -/*******************************************************************\ - -Function: java_long_type - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - typet java_long_type() { return signedbv_typet(64); } -/*******************************************************************\ - -Function: java_short_type - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - typet java_short_type() { return signedbv_typet(16); } -/*******************************************************************\ - -Function: java_byte_type - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - typet java_byte_type() { return signedbv_typet(8); } -/*******************************************************************\ - -Function: java_char_type - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - typet java_char_type() { return unsignedbv_typet(16); } -/*******************************************************************\ - -Function: java_float_type - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - typet java_float_type() { return ieee_float_spect::single_precision().to_type(); } -/*******************************************************************\ - -Function: java_double_type - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - typet java_double_type() { return ieee_float_spect::double_precision().to_type(); } -/*******************************************************************\ - -Function: java_boolean_type - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - typet java_boolean_type() { // The Java standard doesn't really prescribe the width @@ -172,35 +64,11 @@ typet java_boolean_type() return c_bool_typet(8); } -/*******************************************************************\ - -Function: java_reference_type - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - reference_typet java_reference_type(const typet &subtype) { return reference_typet(subtype); } -/*******************************************************************\ - -Function: java_array_type - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - pointer_typet java_array_type(const char subtype) { std::string subtype_str; @@ -230,52 +98,19 @@ pointer_typet java_array_type(const char subtype) return pointer_typet(symbol_type); } -/*******************************************************************\ - -Function: is_java_array_tag - - Inputs: Struct tag 'tag' - - Outputs: True if the given struct is a Java array - - Purpose: See above - -\*******************************************************************/ - +/// See above +/// \par parameters: Struct tag 'tag' +/// \return True if the given struct is a Java array bool is_java_array_tag(const irep_idt& tag) { return has_prefix(id2string(tag), "java::array["); } -/*******************************************************************\ - -Function: is_reference_type - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool is_reference_type(const char t) { return 'a' == t; } -/*******************************************************************\ - -Function: java_type_from_char - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - typet java_type_from_char(char t) { switch(t) @@ -294,19 +129,7 @@ typet java_type_from_char(char t) } } -/*******************************************************************\ - -Function: java_bytecode_promotion - - Inputs: - - Outputs: - - Purpose: Java does not support byte/short return types. - These are always promoted. - -\*******************************************************************/ - +/// Java does not support byte/short return types. These are always promoted. typet java_bytecode_promotion(const typet &type) { if(type==java_boolean_type() || @@ -318,19 +141,7 @@ typet java_bytecode_promotion(const typet &type) return type; } -/*******************************************************************\ - -Function: java_bytecode_promotion - - Inputs: - - Outputs: - - Purpose: Java does not support byte/short return types. - These are always promoted. - -\*******************************************************************/ - +/// Java does not support byte/short return types. These are always promoted. exprt java_bytecode_promotion(const exprt &expr) { typet new_type=java_bytecode_promotion(expr.type()); @@ -341,18 +152,6 @@ exprt java_bytecode_promotion(const exprt &expr) return typecast_exprt(expr, new_type); } -/*******************************************************************\ - -Function: java_type_from_string - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - typet java_type_from_string(const std::string &src) { if(src.empty()) @@ -453,18 +252,6 @@ typet java_type_from_string(const std::string &src) } } -/*******************************************************************\ - -Function: java_char_from_type - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - char java_char_from_type(const typet &type) { const irep_idt &id=type.id(); @@ -497,18 +284,6 @@ char java_char_from_type(const typet &type) return 'a'; } -/*******************************************************************\ - -Function: java_classname - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - // java/lang/Object -> java.lang.Object static std::string slash_to_dot(const std::string &src) { @@ -519,18 +294,6 @@ static std::string slash_to_dot(const std::string &src) return result; } -/*******************************************************************\ - -Function: java_classname - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - symbol_typet java_classname(const std::string &id) { if(!id.empty() && id[0]=='[') diff --git a/src/jsil/expr2jsil.cpp b/src/jsil/expr2jsil.cpp index e100aa13432..811a9a1608b 100644 --- a/src/jsil/expr2jsil.cpp +++ b/src/jsil/expr2jsil.cpp @@ -6,6 +6,9 @@ Author: Michael Tautschnig, tautschn@amazon.com \*******************************************************************/ +/// \file +/// Jsil Language + #include #include "expr2jsil.h" @@ -18,18 +21,6 @@ class expr2jsilt:public expr2ct protected: }; -/*******************************************************************\ - -Function: expr2jsil - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string expr2jsil(const exprt &expr, const namespacet &ns) { expr2jsilt expr2jsil(ns); @@ -37,18 +28,6 @@ std::string expr2jsil(const exprt &expr, const namespacet &ns) return expr2jsil.convert(expr); } -/*******************************************************************\ - -Function: type2jsil - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string type2jsil(const typet &type, const namespacet &ns) { expr2jsilt expr2jsil(ns); diff --git a/src/jsil/expr2jsil.h b/src/jsil/expr2jsil.h index b1b41df2198..f8f99620380 100644 --- a/src/jsil/expr2jsil.h +++ b/src/jsil/expr2jsil.h @@ -6,6 +6,9 @@ Author: Michael Tautschnig, tautschn@amazon.com \*******************************************************************/ +/// \file +/// Jsil Language + #ifndef CPROVER_JSIL_EXPR2JSIL_H #define CPROVER_JSIL_EXPR2JSIL_H diff --git a/src/jsil/jsil_convert.cpp b/src/jsil/jsil_convert.cpp index 4e013b6f34e..aa4ff02fffc 100644 --- a/src/jsil/jsil_convert.cpp +++ b/src/jsil/jsil_convert.cpp @@ -6,6 +6,9 @@ Author: Michael Tautschnig, tautschn@amazon.com \*******************************************************************/ +/// \file +/// Jsil Language Conversion + #include #include @@ -31,18 +34,6 @@ class jsil_convertt:public messaget bool convert_code(const symbolt &symbol, codet &code); }; -/*******************************************************************\ - -Function: jsil_convertt::operator() - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool jsil_convertt::operator()(const jsil_parse_treet &parse_tree) { for(jsil_parse_treet::itemst::const_iterator @@ -74,18 +65,6 @@ bool jsil_convertt::operator()(const jsil_parse_treet &parse_tree) return false; } -/*******************************************************************\ - -Function: jsil_convertt::convert_code - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool jsil_convertt::convert_code(const symbolt &symbol, codet &code) { if(code.get_statement()==ID_block) @@ -137,18 +116,6 @@ bool jsil_convertt::convert_code(const symbolt &symbol, codet &code) return false; } -/*******************************************************************\ - -Function: jsil_convert - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool jsil_convert( const jsil_parse_treet &parse_tree, symbol_tablet &symbol_table, diff --git a/src/jsil/jsil_convert.h b/src/jsil/jsil_convert.h index 7c50b694ecd..601d64e1b35 100644 --- a/src/jsil/jsil_convert.h +++ b/src/jsil/jsil_convert.h @@ -6,6 +6,9 @@ Author: Michael Tautschnig, tautschn@amazon.com \*******************************************************************/ +/// \file +/// Jsil Language Conversion + #ifndef CPROVER_JSIL_JSIL_CONVERT_H #define CPROVER_JSIL_JSIL_CONVERT_H diff --git a/src/jsil/jsil_entry_point.cpp b/src/jsil/jsil_entry_point.cpp index 4959326bf02..ba1860ce6fc 100644 --- a/src/jsil/jsil_entry_point.cpp +++ b/src/jsil/jsil_entry_point.cpp @@ -6,6 +6,9 @@ Author: Michael Tautschnig, tautschn@amazon.com \*******************************************************************/ +/// \file +/// Jsil Language + #include #include #include @@ -19,18 +22,6 @@ Author: Michael Tautschnig, tautschn@amazon.com #define INITIALIZE CPROVER_PREFIX "initialize" -/*******************************************************************\ - -Function: create_initialize - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - static void create_initialize(symbol_tablet &symbol_table) { symbolt initialize; @@ -58,18 +49,6 @@ static void create_initialize(symbol_tablet &symbol_table) throw "failed to add " CPROVER_PREFIX "initialize"; } -/*******************************************************************\ - -Function: jsil_entry_point - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool jsil_entry_point( symbol_tablet &symbol_table, message_handlert &message_handler) diff --git a/src/jsil/jsil_entry_point.h b/src/jsil/jsil_entry_point.h index c374d395626..fd9453769da 100644 --- a/src/jsil/jsil_entry_point.h +++ b/src/jsil/jsil_entry_point.h @@ -6,6 +6,9 @@ Author: Michael Tautschnig, tautschn@amazon.com \*******************************************************************/ +/// \file +/// Jsil Language + #ifndef CPROVER_JSIL_JSIL_ENTRY_POINT_H #define CPROVER_JSIL_JSIL_ENTRY_POINT_H diff --git a/src/jsil/jsil_internal_additions.cpp b/src/jsil/jsil_internal_additions.cpp index 9f583fbb56b..e44195713c9 100644 --- a/src/jsil/jsil_internal_additions.cpp +++ b/src/jsil/jsil_internal_additions.cpp @@ -6,6 +6,9 @@ Author: Michael Tautschnig, tautschn@amazon.com \*******************************************************************/ +/// \file +/// Jsil Language + #include #include #include @@ -16,18 +19,6 @@ Author: Michael Tautschnig, tautschn@amazon.com #include "jsil_internal_additions.h" -/*******************************************************************\ - -Function: jsil_internal_additions - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void jsil_internal_additions(symbol_tablet &dest) { // add __CPROVER_rounding_mode diff --git a/src/jsil/jsil_internal_additions.h b/src/jsil/jsil_internal_additions.h index f57cc098189..1aed9edd692 100644 --- a/src/jsil/jsil_internal_additions.h +++ b/src/jsil/jsil_internal_additions.h @@ -6,6 +6,9 @@ Author: Michael Tautschnig, tautschn@amazon.com \*******************************************************************/ +/// \file +/// Jsil Language + #ifndef CPROVER_JSIL_JSIL_INTERNAL_ADDITIONS_H #define CPROVER_JSIL_JSIL_INTERNAL_ADDITIONS_H diff --git a/src/jsil/jsil_language.cpp b/src/jsil/jsil_language.cpp index 6c022e65069..baa9cebee0c 100644 --- a/src/jsil/jsil_language.cpp +++ b/src/jsil/jsil_language.cpp @@ -6,6 +6,9 @@ Author: Michael Tautschnig, tautschn@amazon.com \*******************************************************************/ +/// \file +/// Jsil Language + #include #include @@ -18,52 +21,17 @@ Author: Michael Tautschnig, tautschn@amazon.com #include "jsil_language.h" -/*******************************************************************\ - -Function: jsil_languaget::extensions - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::set jsil_languaget::extensions() const { return { "jsil" }; } -/*******************************************************************\ - -Function: jsil_languaget::modules_provided - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void jsil_languaget::modules_provided(std::set &modules) { modules.insert(get_base_name(parse_path, true)); } -/*******************************************************************\ - -Function: jsil_languaget::interfaces - - Inputs: - - Outputs: - - Purpose: Adding symbols for all procedure declarations - -\*******************************************************************/ - +/// Adding symbols for all procedure declarations bool jsil_languaget::interfaces(symbol_tablet &symbol_table) { if(jsil_convert(parse_tree, symbol_table, get_message_handler())) @@ -73,18 +41,6 @@ bool jsil_languaget::interfaces(symbol_tablet &symbol_table) return false; } -/*******************************************************************\ - -Function: jsil_languaget::preprocess - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool jsil_languaget::preprocess( std::istream &instream, const std::string &path, @@ -94,18 +50,6 @@ bool jsil_languaget::preprocess( return true; } -/*******************************************************************\ - -Function: jsil_languaget::parse - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool jsil_languaget::parse( std::istream &instream, const std::string &path) @@ -131,18 +75,7 @@ bool jsil_languaget::parse( return result; } -/*******************************************************************\ - -Function: jsil_languaget::typecheck - - Inputs: - - Outputs: - - Purpose: Converting from parse tree and type checking. - -\*******************************************************************/ - +/// Converting from parse tree and type checking. bool jsil_languaget::typecheck( symbol_tablet &symbol_table, const std::string &module) @@ -153,18 +86,6 @@ bool jsil_languaget::typecheck( return false; } -/*******************************************************************\ - -Function: jsil_languaget::final - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool jsil_languaget::final(symbol_tablet &symbol_table) { if(jsil_entry_point( @@ -175,52 +96,16 @@ bool jsil_languaget::final(symbol_tablet &symbol_table) return false; } -/*******************************************************************\ - -Function: jsil_languaget::show_parse - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void jsil_languaget::show_parse(std::ostream &out) { parse_tree.output(out); } -/*******************************************************************\ - -Function: new_jsil_language - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - languaget *new_jsil_language() { return new jsil_languaget; } -/*******************************************************************\ - -Function: jsil_languaget::from_expr - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool jsil_languaget::from_expr( const exprt &expr, std::string &code, @@ -230,18 +115,6 @@ bool jsil_languaget::from_expr( return false; } -/*******************************************************************\ - -Function: jsil_languaget::from_type - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool jsil_languaget::from_type( const typet &type, std::string &code, @@ -251,18 +124,6 @@ bool jsil_languaget::from_type( return false; } -/*******************************************************************\ - -Function: jsil_languaget::to_expr - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool jsil_languaget::to_expr( const std::string &code, const std::string &module, @@ -307,18 +168,6 @@ bool jsil_languaget::to_expr( return result; } -/*******************************************************************\ - -Function: jsil_languaget::~jsil_languaget - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - jsil_languaget::~jsil_languaget() { } diff --git a/src/jsil/jsil_language.h b/src/jsil/jsil_language.h index 349f0b58740..2f6f376525b 100644 --- a/src/jsil/jsil_language.h +++ b/src/jsil/jsil_language.h @@ -6,6 +6,9 @@ Author: Michael Tautschnig, tautschn@amazon.com \*******************************************************************/ +/// \file +/// Jsil Language + #ifndef CPROVER_JSIL_JSIL_LANGUAGE_H #define CPROVER_JSIL_JSIL_LANGUAGE_H diff --git a/src/jsil/jsil_parse_tree.cpp b/src/jsil/jsil_parse_tree.cpp index 874e36ccef6..75573ad0637 100644 --- a/src/jsil/jsil_parse_tree.cpp +++ b/src/jsil/jsil_parse_tree.cpp @@ -6,24 +6,15 @@ Author: Michael Tautschnig, tautschn@amazon.com \*******************************************************************/ +/// \file +/// Jsil Language + #include #include "jsil_types.h" #include "jsil_parse_tree.h" -/*******************************************************************\ - -Function: insert_at_label - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - static bool insert_at_label( const codet &code, const irep_idt &label, @@ -49,18 +40,6 @@ static bool insert_at_label( return true; } -/*******************************************************************\ - -Function: jsil_declarationt::to_symbol - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void jsil_declarationt::to_symbol(symbolt &symbol) const { symbol.clear(); @@ -101,18 +80,6 @@ void jsil_declarationt::to_symbol(symbolt &symbol) const symbol.value.swap(code); } -/*******************************************************************\ - -Function: jsil_declarationt::output - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void jsil_declarationt::output(std::ostream &out) const { out << "Declarator: " << find(ID_declarator).pretty() << "\n"; @@ -121,18 +88,6 @@ void jsil_declarationt::output(std::ostream &out) const out << "Value: " << find(ID_value).pretty() << "\n"; } -/*******************************************************************\ - -Function: jsil_parse_treet::output - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void jsil_parse_treet::output(std::ostream &out) const { for(itemst::const_iterator diff --git a/src/jsil/jsil_parse_tree.h b/src/jsil/jsil_parse_tree.h index 5a83cf18e8b..55ee57de51b 100644 --- a/src/jsil/jsil_parse_tree.h +++ b/src/jsil/jsil_parse_tree.h @@ -6,6 +6,9 @@ Author: Michael Tautschnig, tautschn@amazon.com \*******************************************************************/ +/// \file +/// Jsil Language + #ifndef CPROVER_JSIL_JSIL_PARSE_TREE_H #define CPROVER_JSIL_JSIL_PARSE_TREE_H diff --git a/src/jsil/jsil_parser.cpp b/src/jsil/jsil_parser.cpp index e6d17c1e13c..de11bc731e8 100644 --- a/src/jsil/jsil_parser.cpp +++ b/src/jsil/jsil_parser.cpp @@ -6,22 +6,13 @@ Author: Michael Tautschnig, tautschn@amazon.com \*******************************************************************/ +/// \file +/// Jsil Language + #include "jsil_parser.h" jsil_parsert jsil_parser; -/*******************************************************************\ - -Function: yyjsilerror - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - extern char *yyjsiltext; int yyjsilerror(const std::string &error) diff --git a/src/jsil/jsil_parser.h b/src/jsil/jsil_parser.h index 7cf55a32f69..2aad7767e34 100644 --- a/src/jsil/jsil_parser.h +++ b/src/jsil/jsil_parser.h @@ -6,6 +6,9 @@ Author: Michael Tautschnig, tautschn@amazon.com \*******************************************************************/ +/// \file +/// Jsil Language + #ifndef CPROVER_JSIL_JSIL_PARSER_H #define CPROVER_JSIL_JSIL_PARSER_H diff --git a/src/jsil/jsil_typecheck.cpp b/src/jsil/jsil_typecheck.cpp index a644f1acf99..e71c98a28c3 100644 --- a/src/jsil/jsil_typecheck.cpp +++ b/src/jsil/jsil_typecheck.cpp @@ -6,6 +6,9 @@ Author: Michael Tautschnig, tautschn@amazon.com \*******************************************************************/ +/// \file +/// Jsil Language + #include #include #include @@ -15,69 +18,22 @@ Author: Michael Tautschnig, tautschn@amazon.com #include "jsil_typecheck.h" -/*******************************************************************\ - -Function: java_bytecode_typecheckt::to_string - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string jsil_typecheckt::to_string(const exprt &expr) { return expr2jsil(expr, ns); } -/*******************************************************************\ - -Function: java_bytecode_typecheckt::to_string - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string jsil_typecheckt::to_string(const typet &type) { return type2jsil(type, ns); } -/*******************************************************************\ - -Function: jsil_typecheckt::add_prefix - - Inputs: - - Outputs: - - Purpose: Prefix parameters and variables with a procedure name - -\*******************************************************************/ - +/// Prefix parameters and variables with a procedure name irep_idt jsil_typecheckt::add_prefix(const irep_idt &ds) { return id2string(proc_name) + "::" + id2string(ds); } -/*******************************************************************\ - -Function: jsil_typecheckt::update_expr_type - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void jsil_typecheckt::update_expr_type(exprt &expr, const typet &type) { expr.type()=type; @@ -100,18 +56,6 @@ void jsil_typecheckt::update_expr_type(exprt &expr, const typet &type) } } -/*******************************************************************\ - -Function: jsil_typecheckt::make_type_compatible - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void jsil_typecheckt::make_type_compatible( exprt &expr, const typet &type, @@ -151,18 +95,6 @@ void jsil_typecheckt::make_type_compatible( } } -/*******************************************************************\ - -Function: jsil_typecheckt::typecheck_type - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void jsil_typecheckt::typecheck_type(typet &type) { if(type.id()==ID_code) @@ -201,18 +133,6 @@ void jsil_typecheckt::typecheck_type(typet &type) } } -/*******************************************************************\ - -Function: jsil_typecheckt::typecheck_type - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void jsil_typecheckt::typecheck_expr(exprt &expr) { // first do sub-nodes @@ -222,36 +142,12 @@ void jsil_typecheckt::typecheck_expr(exprt &expr) typecheck_expr_main(expr); } -/*******************************************************************\ - -Function: jsil_typecheckt::typecheck_expr_operands - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void jsil_typecheckt::typecheck_expr_operands(exprt &expr) { Forall_operands(it, expr) typecheck_expr(*it); } -/*******************************************************************\ - -Function: jsil_typecheckt::typecheck_expr_main - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void jsil_typecheckt::typecheck_expr_main(exprt &expr) { if(expr.id()==ID_code) @@ -369,18 +265,6 @@ void jsil_typecheckt::typecheck_expr_main(exprt &expr) } } -/*******************************************************************\ - -Function: jsil_typecheckt::typecheck_expr_side_effect_throw - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void jsil_typecheckt::typecheck_expr_side_effect_throw( side_effect_expr_throwt &expr) { @@ -390,18 +274,6 @@ void jsil_typecheckt::typecheck_expr_side_effect_throw( typecheck_symbol_expr(s); } -/*******************************************************************\ - -Function: jsil_typecheckt::typecheck_expr_constant - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void jsil_typecheckt::typecheck_expr_constant(exprt &expr) { if(expr.id()==ID_null) @@ -412,18 +284,6 @@ void jsil_typecheckt::typecheck_expr_constant(exprt &expr) expr.type()=jsil_empty_type(); } -/*******************************************************************\ - -Function: jsil_typecheck_baset::typecheck_expr_proto_field - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void jsil_typecheckt::typecheck_expr_proto_field(exprt &expr) { if(expr.operands().size()!=2) @@ -440,18 +300,6 @@ void jsil_typecheckt::typecheck_expr_proto_field(exprt &expr) expr.type()=jsil_value_or_empty_type(); } -/*******************************************************************\ - -Function: jsil_typecheck_baset::typecheck_expr_proto_field - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void jsil_typecheckt::typecheck_expr_proto_obj(exprt &expr) { if(expr.operands().size()!=2) @@ -468,18 +316,6 @@ void jsil_typecheckt::typecheck_expr_proto_obj(exprt &expr) expr.type()=bool_typet(); } -/*******************************************************************\ - -Function: jsil_typecheck_baset::typecheck_expr_delete - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void jsil_typecheckt::typecheck_expr_delete(exprt &expr) { if(expr.operands().size()!=2) @@ -496,18 +332,6 @@ void jsil_typecheckt::typecheck_expr_delete(exprt &expr) expr.type()=bool_typet(); } -/*******************************************************************\ - -Function: jsil_typecheck_baset::typecheck_expr_hasfield - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void jsil_typecheckt::typecheck_expr_index(exprt &expr) { if(expr.operands().size()!=2) @@ -528,18 +352,6 @@ void jsil_typecheckt::typecheck_expr_index(exprt &expr) expr.type()=jsil_value_type(); } -/*******************************************************************\ - -Function: jsil_typecheck_baset::typecheck_expr_hasfield - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void jsil_typecheckt::typecheck_expr_has_field(exprt &expr) { if(expr.operands().size()!=2) @@ -556,18 +368,6 @@ void jsil_typecheckt::typecheck_expr_has_field(exprt &expr) expr.type()=bool_typet(); } -/*******************************************************************\ - -Function: jsil_typecheck_baset::typecheck_expr_field - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void jsil_typecheckt::typecheck_expr_field(exprt &expr) { if(expr.operands().size()!=1) @@ -583,18 +383,6 @@ void jsil_typecheckt::typecheck_expr_field(exprt &expr) expr.type()=string_typet(); } -/*******************************************************************\ - -Function: jsil_typecheck_baset::typecheck_expr_base - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void jsil_typecheckt::typecheck_expr_base(exprt &expr) { if(expr.operands().size()!=1) @@ -610,18 +398,6 @@ void jsil_typecheckt::typecheck_expr_base(exprt &expr) expr.type()=jsil_value_type(); } -/*******************************************************************\ - -Function: jsil_typecheck_baset::typecheck_expr_ref - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void jsil_typecheckt::typecheck_expr_ref(exprt &expr) { if(expr.operands().size()!=3) @@ -652,18 +428,6 @@ void jsil_typecheckt::typecheck_expr_ref(exprt &expr) } } -/*******************************************************************\ - -Function: jsil_typecheck_baset::typecheck_expr_concatenation - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void jsil_typecheckt::typecheck_expr_concatenation(exprt &expr) { if(expr.operands().size()!=2) @@ -680,18 +444,6 @@ void jsil_typecheckt::typecheck_expr_concatenation(exprt &expr) expr.type()=string_typet(); } -/*******************************************************************\ - -Function: jsil_typecheck_baset::typecheck_expr_subtype - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void jsil_typecheckt::typecheck_expr_subtype(exprt &expr) { if(expr.operands().size()!=2) @@ -708,18 +460,6 @@ void jsil_typecheckt::typecheck_expr_subtype(exprt &expr) expr.type()=bool_typet(); } -/*******************************************************************\ - -Function: jsil_typecheck_baset::typecheck_expr_binary_boolean - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void jsil_typecheckt::typecheck_expr_binary_boolean(exprt &expr) { if(expr.operands().size()!=2) @@ -736,18 +476,6 @@ void jsil_typecheckt::typecheck_expr_binary_boolean(exprt &expr) expr.type()=bool_typet(); } -/*******************************************************************\ - -Function: jsil_typecheck_baset::typecheck_expr_binary_arith - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void jsil_typecheckt::typecheck_expr_binary_arith(exprt &expr) { if(expr.operands().size()!=2) @@ -765,18 +493,6 @@ void jsil_typecheckt::typecheck_expr_binary_arith(exprt &expr) expr.type()=floatbv_typet(); } -/*******************************************************************\ - -Function: jsil_typecheck_baset::typecheck_exp_binary_equal - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void jsil_typecheckt::typecheck_exp_binary_equal(exprt &expr) { if(expr.operands().size()!=2) @@ -792,18 +508,6 @@ void jsil_typecheckt::typecheck_exp_binary_equal(exprt &expr) expr.type()=bool_typet(); } -/*******************************************************************\ - -Function: jsil_typecheck_baset::typecheck_expr_binary_compare - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void jsil_typecheckt::typecheck_expr_binary_compare(exprt &expr) { if(expr.operands().size()!=2) @@ -820,18 +524,6 @@ void jsil_typecheckt::typecheck_expr_binary_compare(exprt &expr) expr.type()=bool_typet(); } -/*******************************************************************\ - -Function: jsil_typecheck_baset::typecheck_expr_unary_boolean - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void jsil_typecheckt::typecheck_expr_unary_boolean(exprt &expr) { if(expr.operands().size()!=1) @@ -847,18 +539,6 @@ void jsil_typecheckt::typecheck_expr_unary_boolean(exprt &expr) expr.type()=bool_typet(); } -/*******************************************************************\ - -Function: jsil_typecheck_baset::typecheck_expr_unary_string - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void jsil_typecheckt::typecheck_expr_unary_string(exprt &expr) { if(expr.operands().size()!=1) @@ -874,18 +554,6 @@ void jsil_typecheckt::typecheck_expr_unary_string(exprt &expr) expr.type()=floatbv_typet(); } -/*******************************************************************\ - -Function: jsil_typecheck_baset::typecheck_expr_unary_num - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void jsil_typecheckt::typecheck_expr_unary_num(exprt &expr) { if(expr.operands().size()!=1) @@ -899,18 +567,6 @@ void jsil_typecheckt::typecheck_expr_unary_num(exprt &expr) make_type_compatible(expr.op0(), floatbv_typet(), true); } -/*******************************************************************\ - -Function: jsil_typecheckt::typecheck_symbol_expr - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void jsil_typecheckt::typecheck_symbol_expr(symbol_exprt &symbol_expr) { irep_idt identifier=symbol_expr.get_identifier(); @@ -989,18 +645,6 @@ void jsil_typecheckt::typecheck_symbol_expr(symbol_exprt &symbol_expr) } } -/*******************************************************************\ - -Function: jsil_typecheckt::typecheck_code - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void jsil_typecheckt::typecheck_code(codet &code) { const irep_idt &statement=code.get_statement(); @@ -1049,54 +693,18 @@ void jsil_typecheckt::typecheck_code(codet &code) } } -/*******************************************************************\ - -Function: jsil_typecheckt::typecheck_return - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void jsil_typecheckt::typecheck_return(code_returnt &code) { if(code.has_return_value()) typecheck_expr(code.return_value()); } -/*******************************************************************\ - -Function: jsil_typecheckt::typecheck_block - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void jsil_typecheckt::typecheck_block(codet &code) { Forall_operands(it, code) typecheck_code(to_code(*it)); } -/*******************************************************************\ - -Function: jsil_typecheckt::typecheck_try_catch - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void jsil_typecheckt::typecheck_try_catch(code_try_catcht &code) { // A special case of try catch with one catch clause @@ -1115,18 +723,6 @@ void jsil_typecheckt::typecheck_try_catch(code_try_catcht &code) typecheck_code(code.get_catch_code(0)); } -/*******************************************************************\ - -Function: jsil_typecheckt::typecheck_function_call - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void jsil_typecheckt::typecheck_function_call( code_function_callt &call) { @@ -1229,18 +825,6 @@ void jsil_typecheckt::typecheck_function_call( } } -/*******************************************************************\ - -Function: jsil_typecheckt::typecheck_ifthenelse - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void jsil_typecheckt::typecheck_ifthenelse(code_ifthenelset &code) { exprt &cond=code.cond(); @@ -1253,18 +837,6 @@ void jsil_typecheckt::typecheck_ifthenelse(code_ifthenelset &code) typecheck_code(to_code(code.else_case())); } -/*******************************************************************\ - -Function: jsil_typecheckt::typecheck_assign - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void jsil_typecheckt::typecheck_assign(code_assignt &code) { typecheck_expr(code.op0()); @@ -1273,20 +845,9 @@ void jsil_typecheckt::typecheck_assign(code_assignt &code) make_type_compatible(code.op0(), code.op1().type(), false); } -/*******************************************************************\ - -Function: java_bytecode_typecheckt::typecheck_non_type_symbol - - Inputs: any symbol - - Outputs: - - Purpose: typecheking procedure declaration; any other symbols - should have been typechecked during typecheking of procedure - declaration - -\*******************************************************************/ - +/// typecheking procedure declaration; any other symbols should have been +/// typechecked during typecheking of procedure declaration +/// \par parameters: any symbol void jsil_typecheckt::typecheck_non_type_symbol(symbolt &symbol) { assert(!symbol.is_type); @@ -1319,18 +880,6 @@ void jsil_typecheckt::typecheck_non_type_symbol(symbolt &symbol) } } -/*******************************************************************\ - -Function: java_bytecode_typecheckt::typecheck - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void jsil_typecheckt::typecheck() { // The hash table iterators are not stable, @@ -1361,18 +910,6 @@ void jsil_typecheckt::typecheck() } } -/*******************************************************************\ - -Function: jsil_typecheck - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool jsil_typecheck( symbol_tablet &symbol_table, message_handlert &message_handler) @@ -1381,18 +918,6 @@ bool jsil_typecheck( return jsil_typecheck.typecheck_main(); } -/*******************************************************************\ - -Function: jsil_typecheck - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool jsil_typecheck( exprt &expr, message_handlert &message_handler, diff --git a/src/jsil/jsil_typecheck.h b/src/jsil/jsil_typecheck.h index 68988a80273..a1be82cfddb 100644 --- a/src/jsil/jsil_typecheck.h +++ b/src/jsil/jsil_typecheck.h @@ -6,6 +6,9 @@ Author: Michael Tautschnig, tautschn@amazon.com \*******************************************************************/ +/// \file +/// Jsil Language + #ifndef CPROVER_JSIL_JSIL_TYPECHECK_H #define CPROVER_JSIL_JSIL_TYPECHECK_H diff --git a/src/jsil/jsil_types.cpp b/src/jsil/jsil_types.cpp index ffccfd16bbe..68c75b8827a 100644 --- a/src/jsil/jsil_types.cpp +++ b/src/jsil/jsil_types.cpp @@ -6,22 +6,13 @@ Author: Daiva Naudziuniene, daivan@amazon.com \*******************************************************************/ +/// \file +/// Jsil Language + #include #include "jsil_types.h" -/*******************************************************************\ - -Function: jsil_any_type - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - typet jsil_any_type() { return jsil_union_typet({ // NOLINT(whitespace/braces) @@ -31,18 +22,6 @@ typet jsil_any_type() }); } -/*******************************************************************\ - -Function: jsil_value_or_empty_type - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - typet jsil_value_or_empty_type() { return jsil_union_typet({ // NOLINT(whitespace/braces) @@ -51,18 +30,6 @@ typet jsil_value_or_empty_type() }); } -/*******************************************************************\ - -Function: jsil_value_or_reference_type - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - typet jsil_value_or_reference_type() { return jsil_union_typet({ // NOLINT(whitespace/braces) @@ -71,18 +38,6 @@ typet jsil_value_or_reference_type() }); } -/*******************************************************************\ - -Function: jsil_value_type - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - typet jsil_value_type() { return jsil_union_typet({ // NOLINT(whitespace/braces) @@ -93,18 +48,6 @@ typet jsil_value_type() }); } -/*******************************************************************\ - -Function: jsil_prim_type - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - typet jsil_prim_type() { return jsil_union_typet({ // NOLINT(whitespace/braces) @@ -114,18 +57,6 @@ typet jsil_prim_type() }); } -/*******************************************************************\ - -Function: jsil_reference_type - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - typet jsil_reference_type() { return jsil_union_typet({ // NOLINT(whitespace/braces) @@ -134,52 +65,16 @@ typet jsil_reference_type() }); } -/*******************************************************************\ - -Function: jsil_member_reference_type - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - typet jsil_member_reference_type() { return typet("jsil_member_reference_type"); } -/*******************************************************************\ - -Function: jsil_variable_reference_type - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - typet jsil_variable_reference_type() { return typet("jsil_variable_reference_type"); } -/*******************************************************************\ - -Function: jsil_object_type - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - typet jsil_object_type() { return jsil_union_typet({ // NOLINT(whitespace/braces) @@ -188,120 +83,36 @@ typet jsil_object_type() }); } -/*******************************************************************\ - -Function: jsil_user_object_type - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - typet jsil_user_object_type() { return typet("jsil_user_object_type"); } -/*******************************************************************\ - -Function: jsil_builtin_object_type - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - typet jsil_builtin_object_type() { return typet("jsil_builtin_object_type"); } -/*******************************************************************\ - -Function: jsil_null_type - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - typet jsil_null_type() { return typet("jsil_null_type"); } -/*******************************************************************\ - -Function: jsil_undefined_type - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - typet jsil_undefined_type() { return typet("jsil_undefined_type"); } -/*******************************************************************\ - -Function: jsil_kind - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - typet jsil_kind() { return typet("jsil_kind"); } -/*******************************************************************\ - -Function: jsil_empty_type - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - typet jsil_empty_type() { return typet("jsil_empty_type"); } -/*******************************************************************\ - -Function: jsil_is_subtype - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool jsil_is_subtype(const typet &type1, const typet &type2) { if(type2.id()==ID_union) @@ -317,54 +128,18 @@ bool jsil_is_subtype(const typet &type1, const typet &type2) return type1.id()==type2.id(); } -/*******************************************************************\ - -Function: jsil_incompatible_types - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool jsil_incompatible_types(const typet &type1, const typet &type2) { return jsil_union_typet(type1).intersect_with( jsil_union_typet(type2)).components().empty(); } -/*******************************************************************\ - -Function: jsil_union - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - typet jsil_union(const typet &type1, const typet &type2) { return jsil_union_typet(type1) .union_with(jsil_union_typet(type2)).to_type(); } -/*******************************************************************\ - -Function: compare_components - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool compare_components( const union_typet::componentt &comp1, const union_typet::componentt &comp2) @@ -372,18 +147,6 @@ bool compare_components( return comp1.type().id() &types): union_typet() { @@ -402,18 +165,6 @@ jsil_union_typet::jsil_union_typet(const std::vector &types): std::sort(elements.begin(), elements.end(), compare_components); } -/*******************************************************************\ - -Function: jsil_union_typet::union_with - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - jsil_union_typet jsil_union_typet::union_with( const jsil_union_typet &other) const { @@ -431,17 +182,6 @@ jsil_union_typet jsil_union_typet::union_with( return result; } -/*******************************************************************\ - -Function: jsil_union_typet::intersect_with - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ jsil_union_typet jsil_union_typet::intersect_with( const jsil_union_typet &other) const { @@ -459,18 +199,6 @@ jsil_union_typet jsil_union_typet::intersect_with( return result; } -/*******************************************************************\ - -Function: jsil_union_typet::is_subtype - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool jsil_union_typet::is_subtype(const jsil_union_typet &other) const { auto it=components().begin(); @@ -504,18 +232,6 @@ bool jsil_union_typet::is_subtype(const jsil_union_typet &other) const return true; } -/*******************************************************************\ - -Function: jsil_union_typet::to_type() - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - const typet &jsil_union_typet::to_type() const { auto &elements=components(); diff --git a/src/jsil/jsil_types.h b/src/jsil/jsil_types.h index b27be7f3219..b3b5a159b40 100644 --- a/src/jsil/jsil_types.h +++ b/src/jsil/jsil_types.h @@ -6,6 +6,9 @@ Author: Daiva Naudziuniene, daivan@amazon.com \*******************************************************************/ +/// \file +/// Jsil Language + #ifndef CPROVER_JSIL_JSIL_TYPES_H #define CPROVER_JSIL_JSIL_TYPES_H diff --git a/src/json/json_parser.cpp b/src/json/json_parser.cpp index 04c6d7dbfde..6a654753f21 100644 --- a/src/json/json_parser.cpp +++ b/src/json/json_parser.cpp @@ -12,18 +12,6 @@ Author: Daniel Kroening, kroening@kroening.com json_parsert json_parser; -/*******************************************************************\ - -Function: parse_json - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - // 'do it all' function bool parse_json( std::istream &in, @@ -48,18 +36,6 @@ bool parse_json( return result; } -/*******************************************************************\ - -Function: parse_json - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - // 'do it all' function bool parse_json( const std::string &filename, diff --git a/src/langapi/language_ui.cpp b/src/langapi/language_ui.cpp index 73016a87874..bfd11c2db49 100644 --- a/src/langapi/language_ui.cpp +++ b/src/langapi/language_ui.cpp @@ -18,18 +18,7 @@ Author: Daniel Kroening, kroening@cs.cmu.edu #include "language_ui.h" #include "mode.h" -/*******************************************************************\ - -Function: language_uit::language_uit - - Inputs: - - Outputs: - - Purpose: Constructor - -\*******************************************************************/ - +/// Constructor language_uit::language_uit( const cmdlinet &cmdline, ui_message_handlert &_ui_message_handler): @@ -39,34 +28,11 @@ language_uit::language_uit( set_message_handler(ui_message_handler); } -/*******************************************************************\ - -Function: language_uit::~language_uit - - Inputs: - - Outputs: - - Purpose: Destructor - -\*******************************************************************/ - +/// Destructor language_uit::~language_uit() { } -/*******************************************************************\ - -Function: language_uit::parse() - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool language_uit::parse() { for(unsigned i=0; i<_cmdline.args.size(); i++) @@ -78,18 +44,6 @@ bool language_uit::parse() return false; } -/*******************************************************************\ - -Function: language_uit::parse() - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool language_uit::parse(const std::string &filename) { #ifdef _MSC_VER @@ -138,18 +92,6 @@ bool language_uit::parse(const std::string &filename) return false; } -/*******************************************************************\ - -Function: language_uit::typecheck - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool language_uit::typecheck() { status() << "Converting" << eom; @@ -165,18 +107,6 @@ bool language_uit::typecheck() return false; } -/*******************************************************************\ - -Function: language_uit::final - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool language_uit::final() { language_files.set_message_handler(*message_handler); @@ -194,18 +124,6 @@ bool language_uit::final() return false; } -/*******************************************************************\ - -Function: language_uit::show_symbol_table - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void language_uit::show_symbol_table(bool brief) { switch(get_ui()) @@ -223,35 +141,11 @@ void language_uit::show_symbol_table(bool brief) } } -/*******************************************************************\ - -Function: language_uit::show_symbol_table_xml_ui - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void language_uit::show_symbol_table_xml_ui(bool brief) { error() << "cannot show symbol table in this format" << eom; } -/*******************************************************************\ - -Function: language_uit::show_symbol_table_plain - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void language_uit::show_symbol_table_plain( std::ostream &out, bool brief) diff --git a/src/langapi/language_util.cpp b/src/langapi/language_util.cpp index d8c53ec9341..878c3943a32 100644 --- a/src/langapi/language_util.cpp +++ b/src/langapi/language_util.cpp @@ -16,18 +16,6 @@ Author: Daniel Kroening, kroening@cs.cmu.edu #include "language_util.h" #include "mode.h" -/*******************************************************************\ - -Function: get_language - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - static languaget* get_language( const namespacet &ns, const irep_idt &identifier) @@ -48,18 +36,6 @@ static languaget* get_language( return ptr; } -/*******************************************************************\ - -Function: from_expr - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string from_expr( const namespacet &ns, const irep_idt &identifier, @@ -73,18 +49,6 @@ std::string from_expr( return result; } -/*******************************************************************\ - -Function: from_type - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string from_type( const namespacet &ns, const irep_idt &identifier, @@ -98,18 +62,6 @@ std::string from_type( return result; } -/*******************************************************************\ - -Function: type_to_name - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string type_to_name( const namespacet &ns, const irep_idt &identifier, @@ -123,54 +75,18 @@ std::string type_to_name( return result; } -/*******************************************************************\ - -Function: from_expr - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string from_expr(const exprt &expr) { symbol_tablet symbol_table; return from_expr(namespacet(symbol_table), "", expr); } -/*******************************************************************\ - -Function: from_type - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string from_type(const typet &type) { symbol_tablet symbol_table; return from_type(namespacet(symbol_table), "", type); } -/*******************************************************************\ - -Function: to_expr - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - exprt to_expr( const namespacet &ns, const irep_idt &identifier, @@ -188,18 +104,6 @@ exprt to_expr( return expr; } -/*******************************************************************\ - -Function: type_to_name - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string type_to_name(const typet &type) { symbol_tablet symbol_table; diff --git a/src/langapi/languages.cpp b/src/langapi/languages.cpp index 31ab9d37e7a..2d83653f590 100644 --- a/src/langapi/languages.cpp +++ b/src/langapi/languages.cpp @@ -8,35 +8,11 @@ Author: Daniel Kroening, kroening@cs.cmu.edu #include "languages.h" -/*******************************************************************\ - -Function: languagest::languagest - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - languagest::languagest(const namespacet &_ns, languaget *_language):ns(_ns) { language=_language; } -/*******************************************************************\ - -Function: languagest::~languagest - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - languagest::~languagest() { delete language; diff --git a/src/langapi/mode.cpp b/src/langapi/mode.cpp index 525a9519afd..20801fb9ae8 100644 --- a/src/langapi/mode.cpp +++ b/src/langapi/mode.cpp @@ -28,18 +28,6 @@ struct language_entryt typedef std::list languagest; languagest languages; -/*******************************************************************\ - -Function: register_language - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void register_language(language_factoryt factory) { languages.push_back(language_entryt()); @@ -49,18 +37,6 @@ void register_language(language_factoryt factory) languages.back().mode=l->id(); } -/*******************************************************************\ - -Function: get_language_from_mode - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - languaget *get_language_from_mode(const irep_idt &mode) { for(languagest::const_iterator it=languages.begin(); @@ -72,18 +48,6 @@ languaget *get_language_from_mode(const irep_idt &mode) return NULL; } -/*******************************************************************\ - -Function: get_language_from_filename - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - languaget *get_language_from_filename(const std::string &filename) { std::size_t ext_pos=filename.rfind('.'); @@ -118,18 +82,6 @@ languaget *get_language_from_filename(const std::string &filename) return NULL; } -/*******************************************************************\ - -Function: get_default_language - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - languaget *get_default_language() { assert(!languages.empty()); diff --git a/src/linking/linking.cpp b/src/linking/linking.cpp index 173d5b2cf4c..5ce07f2a30c 100644 --- a/src/linking/linking.cpp +++ b/src/linking/linking.cpp @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// ANSI-C Linking + #include #include @@ -22,18 +25,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "linking.h" #include "linking_class.h" -/*******************************************************************\ - -Function: linkingt::expr_to_string - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string linkingt::expr_to_string( const namespacet &ns, const irep_idt &identifier, @@ -42,18 +33,6 @@ std::string linkingt::expr_to_string( return from_expr(ns, identifier, expr); } -/*******************************************************************\ - -Function: linkingt::type_to_string - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string linkingt::type_to_string( const namespacet &ns, const irep_idt &identifier, @@ -62,18 +41,6 @@ std::string linkingt::type_to_string( return from_type(ns, identifier, type); } -/*******************************************************************\ - -Function: follow_tags_symbols - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - static const typet &follow_tags_symbols( const namespacet &ns, const typet &type) @@ -90,18 +57,6 @@ static const typet &follow_tags_symbols( return type; } -/*******************************************************************\ - -Function: linkingt::type_to_string_verbose - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string linkingt::type_to_string_verbose( const namespacet &ns, const symbolt &symbol, @@ -156,18 +111,6 @@ std::string linkingt::type_to_string_verbose( return type_to_string(ns, symbol.name, type); } -/*******************************************************************\ - -Function: linkingt::detailed_conflict_report - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void linkingt::detailed_conflict_report_rec( const symbolt &old_symbol, const symbolt &new_symbol, @@ -422,18 +365,6 @@ void linkingt::detailed_conflict_report_rec( #endif } -/*******************************************************************\ - -Function: linkingt::link_error - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void linkingt::link_error( const symbolt &old_symbol, const symbolt &new_symbol, @@ -454,18 +385,6 @@ void linkingt::link_error( throw 0; } -/*******************************************************************\ - -Function: linkingt::link_warning - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void linkingt::link_warning( const symbolt &old_symbol, const symbolt &new_symbol, @@ -484,18 +403,6 @@ void linkingt::link_warning( << type_to_string_verbose(ns, new_symbol) << eom; } -/*******************************************************************\ - -Function: linkingt::rename - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - irep_idt linkingt::rename(const irep_idt id) { unsigned cnt=0; @@ -520,18 +427,6 @@ irep_idt linkingt::rename(const irep_idt id) } } -/*******************************************************************\ - -Function: linkingt::needs_renaming_non_type - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool linkingt::needs_renaming_non_type( const symbolt &old_symbol, const symbolt &new_symbol) @@ -546,18 +441,6 @@ bool linkingt::needs_renaming_non_type( return false; } -/*******************************************************************\ - -Function: linkingt::duplicate_code_symbol - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void linkingt::duplicate_code_symbol( symbolt &old_symbol, symbolt &new_symbol) @@ -853,18 +736,6 @@ void linkingt::duplicate_code_symbol( } } -/*******************************************************************\ - -Function: linkingt::adjust_object_type_rec - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool linkingt::adjust_object_type_rec( const typet &t1, const typet &t2, @@ -1019,18 +890,6 @@ bool linkingt::adjust_object_type_rec( return true; } -/*******************************************************************\ - -Function: linkingt::adjust_object_type - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool linkingt::adjust_object_type( const symbolt &old_symbol, const symbolt &new_symbol, @@ -1046,18 +905,6 @@ bool linkingt::adjust_object_type( return result; } -/*******************************************************************\ - -Function: linkingt::duplicate_object_symbol - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void linkingt::duplicate_object_symbol( symbolt &old_symbol, symbolt &new_symbol) @@ -1142,18 +989,6 @@ void linkingt::duplicate_object_symbol( } } -/*******************************************************************\ - -Function: linkingt::duplicate_non_type_symbol - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void linkingt::duplicate_non_type_symbol( symbolt &old_symbol, symbolt &new_symbol) @@ -1183,18 +1018,6 @@ void linkingt::duplicate_non_type_symbol( old_symbol.is_extern=old_symbol.is_extern && new_symbol.is_extern; } -/*******************************************************************\ - -Function: linkingt::duplicate_type_symbol - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void linkingt::duplicate_type_symbol( symbolt &old_symbol, symbolt &new_symbol) @@ -1272,18 +1095,6 @@ void linkingt::duplicate_type_symbol( "unexpected difference between type symbols"); } -/*******************************************************************\ - -Function: linkingt::needs_renaming_type - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool linkingt::needs_renaming_type( const symbolt &old_symbol, const symbolt &new_symbol) @@ -1328,18 +1139,6 @@ bool linkingt::needs_renaming_type( return true; // different } -/*******************************************************************\ - -Function: linkingt::do_type_dependencies - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void linkingt::do_type_dependencies(id_sett &needs_to_be_renamed) { // Any type that uses a symbol that will be renamed also @@ -1395,18 +1194,6 @@ void linkingt::do_type_dependencies(id_sett &needs_to_be_renamed) } } -/*******************************************************************\ - -Function: linkingt::rename_symbols - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void linkingt::rename_symbols(const id_sett &needs_to_be_renamed) { namespacet src_ns(src_symbol_table); @@ -1439,18 +1226,6 @@ void linkingt::rename_symbols(const id_sett &needs_to_be_renamed) } } -/*******************************************************************\ - -Function: linkingt::copy_symbols - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void linkingt::copy_symbols() { // First apply the renaming @@ -1503,18 +1278,6 @@ void linkingt::copy_symbols() } } -/*******************************************************************\ - -Function: linkingt::typecheck - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void linkingt::typecheck() { // We do this in three phases. We first figure out which symbols need to @@ -1551,18 +1314,6 @@ void linkingt::typecheck() copy_symbols(); } -/*******************************************************************\ - -Function: linking - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool linking( symbol_tablet &dest_symbol_table, symbol_tablet &new_symbol_table, diff --git a/src/linking/linking.h b/src/linking/linking.h index 22b54e55613..b565a65231e 100644 --- a/src/linking/linking.h +++ b/src/linking/linking.h @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// ANSI-C Linking + #ifndef CPROVER_LINKING_LINKING_H #define CPROVER_LINKING_LINKING_H diff --git a/src/linking/linking_class.h b/src/linking/linking_class.h index dba9481f3ab..274b430a709 100644 --- a/src/linking/linking_class.h +++ b/src/linking/linking_class.h @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// ANSI-C Linking + #ifndef CPROVER_LINKING_LINKING_CLASS_H #define CPROVER_LINKING_LINKING_CLASS_H diff --git a/src/linking/remove_internal_symbols.cpp b/src/linking/remove_internal_symbols.cpp index 5b4a7b13625..3aca40f8219 100644 --- a/src/linking/remove_internal_symbols.cpp +++ b/src/linking/remove_internal_symbols.cpp @@ -6,6 +6,9 @@ Author: Daniel Kroening \*******************************************************************/ +/// \file +/// Remove symbols that are internal only + #include #include #include @@ -15,18 +18,6 @@ Author: Daniel Kroening #include "remove_internal_symbols.h" -/*******************************************************************\ - -Function: get_symbols_rec - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void get_symbols_rec( const namespacet &ns, const symbolt &symbol, @@ -70,25 +61,15 @@ void get_symbols_rec( } } -/*******************************************************************\ - -Function: remove_internal_symbols - - Inputs: symbol table - - Outputs: symbol table, with internal symbols removed - - Purpose: A symbol is EXPORTED if it is a - * non-static function with body that is not extern inline - * symbol used in an EXPORTED symbol - * type used in an EXPORTED symbol - - Read - http://gcc.gnu.org/ml/gcc/2006-11/msg00006.html - on "extern inline" - -\*******************************************************************/ - +/// A symbol is EXPORTED if it is a * non-static function with body that is not +/// extern inline * symbol used in an EXPORTED symbol * type used in an EXPORTED +/// symbol +/// +/// Read +/// http://gcc.gnu.org/ml/gcc/2006-11/msg00006.html +/// on "extern inline" +/// \par parameters: symbol table +/// \return symbol table, with internal symbols removed void remove_internal_symbols( symbol_tablet &symbol_table) { diff --git a/src/linking/remove_internal_symbols.h b/src/linking/remove_internal_symbols.h index 40711162e73..f9d8a465162 100644 --- a/src/linking/remove_internal_symbols.h +++ b/src/linking/remove_internal_symbols.h @@ -6,6 +6,9 @@ Author: Daniel Kroening \*******************************************************************/ +/// \file +/// Remove symbols that are internal only + #ifndef CPROVER_LINKING_REMOVE_INTERNAL_SYMBOLS_H #define CPROVER_LINKING_REMOVE_INTERNAL_SYMBOLS_H diff --git a/src/linking/static_lifetime_init.cpp b/src/linking/static_lifetime_init.cpp index 29f5005d685..6428fa3b39d 100644 --- a/src/linking/static_lifetime_init.cpp +++ b/src/linking/static_lifetime_init.cpp @@ -23,18 +23,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "static_lifetime_init.h" #include "zero_initializer.h" -/*******************************************************************\ - -Function: static_lifetime_init - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool static_lifetime_init( symbol_tablet &symbol_table, const source_locationt &source_location, diff --git a/src/linking/zero_initializer.cpp b/src/linking/zero_initializer.cpp index 9e96c48480b..154b92217e2 100644 --- a/src/linking/zero_initializer.cpp +++ b/src/linking/zero_initializer.cpp @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Linking: Zero Initialization + #include #include @@ -56,18 +59,6 @@ class zero_initializert:public messaget const source_locationt &source_location); }; -/*******************************************************************\ - -Function: zero_initializert::zero_initializer_rec - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - exprt zero_initializert::zero_initializer_rec( const typet &type, const source_locationt &source_location) @@ -319,18 +310,6 @@ exprt zero_initializert::zero_initializer_rec( } } -/*******************************************************************\ - -Function: zero_initializer - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - exprt zero_initializer( const typet &type, const source_locationt &source_location, @@ -341,18 +320,6 @@ exprt zero_initializer( return z_i(type, source_location); } -/*******************************************************************\ - -Function: zero_initializer - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - exprt zero_initializer( const typet &type, const source_locationt &source_location, diff --git a/src/linking/zero_initializer.h b/src/linking/zero_initializer.h index 766fdf26784..3bb440b8b74 100644 --- a/src/linking/zero_initializer.h +++ b/src/linking/zero_initializer.h @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Linking: Zero Initialization + #ifndef CPROVER_LINKING_ZERO_INITIALIZER_H #define CPROVER_LINKING_ZERO_INITIALIZER_H diff --git a/src/memory-models/mm2cpp.cpp b/src/memory-models/mm2cpp.cpp index bc3eb0d9e18..03f5c7fc2d0 100644 --- a/src/memory-models/mm2cpp.cpp +++ b/src/memory-models/mm2cpp.cpp @@ -32,18 +32,6 @@ class mm2cppt void check_acyclic(const exprt &, unsigned indent); }; -/*******************************************************************\ - -Function: mm2cppt::text2c - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string mm2cppt::text2c(const irep_idt &src) { std::string result; @@ -61,18 +49,6 @@ std::string mm2cppt::text2c(const irep_idt &src) return result; } -/*******************************************************************\ - -Function: mm2cppt::check_acyclic - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void mm2cppt::check_acyclic(const exprt &expr, unsigned indent) { if(expr.id()==ID_symbol) @@ -154,18 +130,6 @@ void mm2cppt::check_acyclic(const exprt &expr, unsigned indent) throw "acyclic cannot do "+expr.id_string(); } -/*******************************************************************\ - -Function: mm2cppt::instruction2cpp - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void mm2cppt::instruction2cpp(const codet &code, unsigned indent) { const irep_idt &statement=code.get_statement(); @@ -216,18 +180,6 @@ void mm2cppt::instruction2cpp(const codet &code, unsigned indent) } } -/*******************************************************************\ - -Function: mm2cpp - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void mm2cppt::operator()(const irept &instruction) { out << "// Generated by mmcc\n"; @@ -248,18 +200,6 @@ void mm2cppt::operator()(const irept &instruction) out << '\n'; } -/*******************************************************************\ - -Function: mm2cpp - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void mm2cpp( const irep_idt &model_name, const irept &instruction, diff --git a/src/memory-models/mmcc_main.cpp b/src/memory-models/mmcc_main.cpp index a30d45515d5..9e73843b3ce 100644 --- a/src/memory-models/mmcc_main.cpp +++ b/src/memory-models/mmcc_main.cpp @@ -6,22 +6,13 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// mmcc Main Module + #include #include "mmcc_parse_options.h" -/*******************************************************************\ - -Function: main / wmain - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - #ifdef _MSC_VER int wmain(int argc, const wchar_t **argv_wide) { diff --git a/src/memory-models/mmcc_parse_options.cpp b/src/memory-models/mmcc_parse_options.cpp index 859393f9726..02eea99d74f 100644 --- a/src/memory-models/mmcc_parse_options.cpp +++ b/src/memory-models/mmcc_parse_options.cpp @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// mmcc Command Line Option Processing + #include #include @@ -17,35 +20,12 @@ Author: Daniel Kroening, kroening@kroening.com #include "mm2cpp.h" #include "mmcc_parse_options.h" -/*******************************************************************\ - -Function: mmcc_parse_optionst::mmcc_parse_optionst - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - mmcc_parse_optionst::mmcc_parse_optionst(int argc, const char **argv): parse_options_baset(MMCC_OPTIONS, argc, argv) { } -/*******************************************************************\ - -Function: mmcc_parse_optionst::doit - - Inputs: - - Outputs: - - Purpose: invoke main modules - -\*******************************************************************/ - +/// invoke main modules int mmcc_parse_optionst::doit() { if(cmdline.isset("version")) @@ -92,18 +72,6 @@ int mmcc_parse_optionst::doit() return 0; } -/*******************************************************************\ - -Function: mmcc_parse_optionst::convert - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - int mmcc_parse_optionst::convert( std::istream &in, const std::string &file) @@ -125,18 +93,7 @@ int mmcc_parse_optionst::convert( return 0; } -/*******************************************************************\ - -Function: mmcc_parse_optionst::help - - Inputs: - - Outputs: - - Purpose: display command line help - -\*******************************************************************/ - +/// display command line help void mmcc_parse_optionst::help() { std::cout << diff --git a/src/memory-models/mmcc_parse_options.h b/src/memory-models/mmcc_parse_options.h index 07745b47944..357ae91df20 100644 --- a/src/memory-models/mmcc_parse_options.h +++ b/src/memory-models/mmcc_parse_options.h @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// mmcc Command Line Option Processing + #ifndef CPROVER_MEMORY_MODELS_MMCC_PARSE_OPTIONS_H #define CPROVER_MEMORY_MODELS_MMCC_PARSE_OPTIONS_H diff --git a/src/musketeer/cycles_visitor.cpp b/src/musketeer/cycles_visitor.cpp index 762b667c6d2..89d68e13ad5 100644 --- a/src/musketeer/cycles_visitor.cpp +++ b/src/musketeer/cycles_visitor.cpp @@ -6,6 +6,9 @@ Author: Vincent Nimal \*******************************************************************/ +/// \file +/// cycles visitor for computing edges involved for fencing + #include #include @@ -17,18 +20,6 @@ class instrumentert; /* implemented: BTWN1, BTWN4 */ #define BTWN1 -/*******************************************************************\ - -Function: - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - /* po^+ /\ U{C_1, ..., C_n} \/ delays */ void cycles_visitort::po_edges(std::set &edges) { @@ -253,18 +244,6 @@ void cycles_visitort::po_edges(std::set &edges) } } -/*******************************************************************\ - -Function: - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - /* C_j /\ po^+ /\ poWR */ void cycles_visitort::powr_constraint( const event_grapht::critical_cyclet &C_j, @@ -285,18 +264,6 @@ void cycles_visitort::powr_constraint( } } -/*******************************************************************\ - -Function: - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - /* C_j /\ po^+ /\ poWW */ void cycles_visitort::poww_constraint( const event_grapht::critical_cyclet &C_j, @@ -317,18 +284,6 @@ void cycles_visitort::poww_constraint( } } -/*******************************************************************\ - -Function: - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - /* C_j /\ po^+ /\ poRW */ void cycles_visitort::porw_constraint( const event_grapht::critical_cyclet &C_j, @@ -349,18 +304,6 @@ void cycles_visitort::porw_constraint( } } -/*******************************************************************\ - -Function: - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - /* C_j /\ po^+ /\ poRR */ void cycles_visitort::porr_constraint( const event_grapht::critical_cyclet &C_j, @@ -381,18 +324,6 @@ void cycles_visitort::porr_constraint( } } -/*******************************************************************\ - -Function: - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - /* C_j /\ comWR */ void cycles_visitort::com_constraint( const event_grapht::critical_cyclet &C_j, diff --git a/src/musketeer/cycles_visitor.h b/src/musketeer/cycles_visitor.h index f125b511668..0b9b122eed8 100644 --- a/src/musketeer/cycles_visitor.h +++ b/src/musketeer/cycles_visitor.h @@ -6,6 +6,9 @@ Author: Vincent Nimal \*******************************************************************/ +/// \file +/// cycles visitor for computing edges involved for fencing + #ifndef CPROVER_MUSKETEER_CYCLES_VISITOR_H #define CPROVER_MUSKETEER_CYCLES_VISITOR_H diff --git a/src/musketeer/fence_assert.cpp b/src/musketeer/fence_assert.cpp index 06bea8537fc..d44faf74689 100644 --- a/src/musketeer/fence_assert.cpp +++ b/src/musketeer/fence_assert.cpp @@ -7,19 +7,10 @@ Author: Vincent Nimal \*******************************************************************/ -#include "fence_assert.h" - -/*******************************************************************\ - -Function: - - Inputs: +/// \file +/// ILP construction for cycles affecting user-assertions and resolution - Outputs: - - Purpose: - -\*******************************************************************/ +#include "fence_assert.h" bool fence_assert_insertert::find_assert( const event_grapht::critical_cyclet &cycle) const @@ -28,18 +19,6 @@ bool fence_assert_insertert::find_assert( return true; } -/*******************************************************************\ - -Function: - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void fence_assert_insertert::process_cycles_selection() { for(std::set::const_iterator diff --git a/src/musketeer/fence_assert.h b/src/musketeer/fence_assert.h index 7e18e1f8e56..bc21b8b5319 100644 --- a/src/musketeer/fence_assert.h +++ b/src/musketeer/fence_assert.h @@ -7,6 +7,9 @@ Author: Vincent Nimal \*******************************************************************/ +/// \file +/// ILP construction for cycles affecting user-assertions and resolution + #ifndef CPROVER_MUSKETEER_FENCE_ASSERT_H #define CPROVER_MUSKETEER_FENCE_ASSERT_H diff --git a/src/musketeer/fence_inserter.cpp b/src/musketeer/fence_inserter.cpp index 20236dfb956..ea8388aecf5 100644 --- a/src/musketeer/fence_inserter.cpp +++ b/src/musketeer/fence_inserter.cpp @@ -6,6 +6,9 @@ Author: Vincent Nimal \*******************************************************************/ +/// \file +/// ILP construction for all cycles and resolution + #include #include @@ -21,18 +24,6 @@ Author: Vincent Nimal class abstract_eventt; -/*******************************************************************\ - -Function: fence_insertert::fence_cost - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - unsigned fence_insertert::fence_cost(fence_typet f) const { switch(f) @@ -52,18 +43,6 @@ unsigned fence_insertert::fence_cost(fence_typet f) const return 0; } -/*******************************************************************\ - -Function: fence_insertert::compute - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void fence_insertert::compute() { compute_fence_options(); @@ -76,18 +55,6 @@ void fence_insertert::compute() instrumenter.message.result() << "no cycle concerned" << messaget::eom; } -/*******************************************************************\ - -Function: fence_insertert::preprocess - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void fence_insertert::preprocess() { process_cycles_selection(); @@ -239,18 +206,6 @@ void fence_insertert::preprocess() } } -/*******************************************************************\ - -Function: fence_insertert::mip_set_var - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void inline fence_insertert::mip_set_var( ilpt &ilp, unsigned &i) @@ -353,18 +308,6 @@ void inline fence_insertert::mip_set_var( #endif } -/*******************************************************************\ - -Function: fence_insertert::mip_set_cst - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void inline fence_insertert::mip_set_cst(ilpt &ilp, unsigned &i) { #ifdef HAVE_GLPK @@ -459,18 +402,6 @@ void inline fence_insertert::mip_set_cst(ilpt &ilp, unsigned &i) #endif } -/*******************************************************************\ - -Function: fence_insertert::mip_fill_matrix - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void inline fence_insertert::mip_fill_matrix( ilpt &ilp, unsigned &i, @@ -768,18 +699,6 @@ void inline fence_insertert::mip_fill_matrix( #endif } -/*******************************************************************\ - -Function: fence_insertert::solve() - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void fence_insertert::solve() { #ifdef HAVE_GLPK @@ -889,35 +808,11 @@ void fence_insertert::solve() #endif } -/*******************************************************************\ - -Function: fence_insertert::import_freq - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void fence_insertert::import_freq() { /* TODO */ } -/*******************************************************************\ - -Function: fence_insertert::print_to_file - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void fence_insertert::print_to_file() { /* removes redundant (due to several call to the same fenced function) */ @@ -944,18 +839,6 @@ void fence_insertert::print_to_file() results.close(); } -/*******************************************************************\ - -Function: fence_insertert::print_to_file_2 - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - /* prints final results */ void fence_insertert::print_to_file_2() { @@ -985,18 +868,6 @@ void fence_insertert::print_to_file_2() results.close(); } -/*******************************************************************\ - -Function: fence_insertert::print_to_file_3 - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - /* prints final results */ void fence_insertert::print_to_file_3() { @@ -1038,18 +909,6 @@ void fence_insertert::print_to_file_3() results.close(); } -/*******************************************************************\ - -Function: fence_insertert::print_to_file_4 - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - /* prints final results */ void fence_insertert::print_to_file_4() { @@ -1094,18 +953,6 @@ void fence_insertert::print_to_file_4() results.close(); } -/*******************************************************************\ - -Function: fence_insertert::to_string - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string fence_insertert::to_string(fence_typet f) const { switch(f) @@ -1119,35 +966,11 @@ std::string fence_insertert::to_string(fence_typet f) const assert(0); } -/*******************************************************************\ - -Function: fence_inserter::col_to_var - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - inline unsigned fence_insertert::col_to_var(unsigned u) const { return (u-u%fence_options)/fence_options+(u%fence_options!=0?1:0); } -/*******************************************************************\ - -Function: fence_insertert::col_to_fence - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - inline fence_insertert::fence_typet fence_insertert::col_to_fence(unsigned u) const { @@ -1162,18 +985,6 @@ inline fence_insertert::fence_typet fence_insertert::col_to_fence(unsigned u) assert(0); } -/*******************************************************************\ - -Function: fence_insertert::var_fence_to_col - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - inline unsigned fence_insertert::var_fence_to_col(fence_typet f, unsigned var) const { @@ -1188,18 +999,6 @@ inline unsigned fence_insertert::var_fence_to_col(fence_typet f, unsigned var) assert(0); } -/*******************************************************************\ - -Function: fence_insertert::compute_fence_options - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void fence_insertert::compute_fence_options() { switch(model) @@ -1218,18 +1017,6 @@ void fence_insertert::compute_fence_options() } } -/*******************************************************************\ - -Function: fence_insertert::print_vars - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void fence_insertert::print_vars() const { instrumenter.message.statistics() @@ -1249,18 +1036,6 @@ void fence_insertert::print_vars() const << messaget::eom; } -/*******************************************************************\ - -Function: fence_insertert::get_type - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - typet fence_insertert::get_type(const irep_idt &id) { std::string copy=id2string(id); @@ -1306,18 +1081,6 @@ typet fence_insertert::get_type(const irep_idt &id) } } -/*******************************************************************\ - -Function: fence_insertert::type_component - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - typet fence_insertert::type_component( std::list::const_iterator it, std::list::const_iterator end, diff --git a/src/musketeer/fence_inserter.h b/src/musketeer/fence_inserter.h index 4d867b1ea90..70676a01560 100644 --- a/src/musketeer/fence_inserter.h +++ b/src/musketeer/fence_inserter.h @@ -6,6 +6,9 @@ Author: Vincent Nimal \*******************************************************************/ +/// \file +/// ILP construction for all cycles and resolution + #ifndef CPROVER_MUSKETEER_FENCE_INSERTER_H #define CPROVER_MUSKETEER_FENCE_INSERTER_H diff --git a/src/musketeer/fence_shared.cpp b/src/musketeer/fence_shared.cpp index 61d3651baf1..d8de5c7e3b0 100644 --- a/src/musketeer/fence_shared.cpp +++ b/src/musketeer/fence_shared.cpp @@ -178,20 +178,9 @@ class fence_volatilet:public simple_insertiont {} }; -/*******************************************************************\ - -Function: is_volatile - - Inputs: - - Outputs: - - Purpose: we can determine whether an access is volatile just by looking at - the type of the variables involved in the expression. We assume that the - program is correctly typed (i.e., volatile-marked) - -\*******************************************************************/ - +/// we can determine whether an access is volatile just by looking at the type +/// of the variables involved in the expression. We assume that the program is +/// correctly typed (i.e., volatile-marked) bool fence_volatilet::is_volatile(const typet &src) const { if(src.get_bool(ID_C_volatile)) @@ -233,18 +222,6 @@ bool fence_volatilet::is_volatile(const typet &src) const return false; } -/*******************************************************************\ - -Function: - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void fence_volatilet::compute() { std::cout << "--------" << std::endl; @@ -318,18 +295,6 @@ void fence_volatilet::compute() } } -/*******************************************************************\ - -Function: - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void fence_all_sharedt::compute() { std::cout << "--------" << std::endl; @@ -447,18 +412,6 @@ void fence_all_sharedt::compute() } } -/*******************************************************************\ - -Function: - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void fence_all_shared_aegt::compute() { message.status() << "--------" << messaget::eom; @@ -609,18 +562,6 @@ void fence_all_shared_aegt::fence_all_shared_aeg_explore( } } -/*******************************************************************\ - -Function: - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void fence_all_shared( message_handlert &message_handler, value_setst &value_sets, @@ -633,18 +574,6 @@ void fence_all_shared( instrumenter.do_it(); } -/*******************************************************************\ - -Function: - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void fence_all_shared_aeg( message_handlert &message_handler, value_setst &value_sets, @@ -657,18 +586,6 @@ void fence_all_shared_aeg( instrumenter.do_it(); } -/*******************************************************************\ - -Function: - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void fence_volatile( message_handlert &message_handler, value_setst &value_sets, diff --git a/src/musketeer/fence_shared.h b/src/musketeer/fence_shared.h index ecfb5ff4746..370e39f817f 100644 --- a/src/musketeer/fence_shared.h +++ b/src/musketeer/fence_shared.h @@ -8,6 +8,9 @@ Author: Vincent Nimal \*******************************************************************/ +/// \file +/// (naive) Fence insertion + #ifndef CPROVER_MUSKETEER_FENCE_SHARED_H #define CPROVER_MUSKETEER_FENCE_SHARED_H diff --git a/src/musketeer/fence_user_def.cpp b/src/musketeer/fence_user_def.cpp index f543efa7e97..8bf57a99b8c 100644 --- a/src/musketeer/fence_user_def.cpp +++ b/src/musketeer/fence_user_def.cpp @@ -7,19 +7,10 @@ Author: Vincent Nimal \*******************************************************************/ -#include "fence_user_def.h" - -/*******************************************************************\ - -Function: - - Inputs: +/// \file +/// ILP construction for cycles affecting user-assertions and resolution - Outputs: - - Purpose: - -\*******************************************************************/ +#include "fence_user_def.h" bool fence_user_def_insertert::contains_user_def( const event_grapht::critical_cyclet &cycle) const @@ -40,18 +31,6 @@ bool fence_user_def_insertert::contains_user_def( return cycle.has_user_defined_fence; } -/*******************************************************************\ - -Function: - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void fence_user_def_insertert::process_cycles_selection() { for(std::set::const_iterator diff --git a/src/musketeer/fence_user_def.h b/src/musketeer/fence_user_def.h index 1f95a4c84cf..04a1236fd46 100644 --- a/src/musketeer/fence_user_def.h +++ b/src/musketeer/fence_user_def.h @@ -7,6 +7,9 @@ Author: Vincent Nimal \*******************************************************************/ +/// \file +/// ILP construction for cycles containing user-placed fences and resolution + #ifndef CPROVER_MUSKETEER_FENCE_USER_DEF_H #define CPROVER_MUSKETEER_FENCE_USER_DEF_H diff --git a/src/musketeer/fencer.cpp b/src/musketeer/fencer.cpp index 4fc213908d4..1f612d35e3b 100644 --- a/src/musketeer/fencer.cpp +++ b/src/musketeer/fencer.cpp @@ -6,6 +6,9 @@ Author: Vincent Nimal \*******************************************************************/ +/// \file +/// Fence inference: Main + #include #include @@ -18,18 +21,6 @@ Author: Vincent Nimal #include "fence_assert.h" #include "fencer.h" -/*******************************************************************\ - -Function: fencer - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void fence_weak_memory( memory_modelt model, value_setst &value_sets, diff --git a/src/musketeer/fencer.h b/src/musketeer/fencer.h index cc28d439497..b15cb631971 100644 --- a/src/musketeer/fencer.h +++ b/src/musketeer/fencer.h @@ -6,6 +6,9 @@ Author: Vincent Nimal \*******************************************************************/ +/// \file +/// Fence inference + #ifndef CPROVER_MUSKETEER_FENCER_H #define CPROVER_MUSKETEER_FENCER_H diff --git a/src/musketeer/graph_visitor.cpp b/src/musketeer/graph_visitor.cpp index a55a1bd22e5..2ecca9e8651 100644 --- a/src/musketeer/graph_visitor.cpp +++ b/src/musketeer/graph_visitor.cpp @@ -6,24 +6,15 @@ Author: Vincent Nimal \*******************************************************************/ +/// \file +/// graph visitor for computing edges involved for fencing + #include "fence_inserter.h" #include "graph_visitor.h" /* implemented: BTWN1, BTWN4 */ #define BTWN1 -/*******************************************************************\ - -Function: - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void const_graph_visitort::graph_explore( event_grapht &egraph, event_idt next, @@ -66,18 +57,6 @@ void const_graph_visitort::graph_explore( } } -/*******************************************************************\ - -Function: - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void const_graph_visitort::const_graph_explore( event_grapht &egraph, event_idt next, @@ -119,18 +98,6 @@ void const_graph_visitort::const_graph_explore( } } -/*******************************************************************\ - -Function: - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void const_graph_visitort::graph_explore_BC( event_grapht &egraph, event_idt next, @@ -193,18 +160,6 @@ void const_graph_visitort::graph_explore_BC( } } -/*******************************************************************\ - -Function: - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void const_graph_visitort::const_graph_explore_BC( event_grapht &egraph, event_idt next, @@ -260,18 +215,6 @@ void const_graph_visitort::const_graph_explore_BC( } } -/*******************************************************************\ - -Function: - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void const_graph_visitort::graph_explore_AC( event_grapht &egraph, event_idt next, @@ -332,18 +275,6 @@ void const_graph_visitort::graph_explore_AC( } } -/*******************************************************************\ - -Function: - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void const_graph_visitort::const_graph_explore_AC( event_grapht &egraph, event_idt next, @@ -400,18 +331,6 @@ void const_graph_visitort::const_graph_explore_AC( } } -/*******************************************************************\ - -Function: - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void const_graph_visitort::PT( const edget &e, std::set &edges) @@ -454,18 +373,8 @@ void const_graph_visitort::PT( edges.insert(fence_inserter.map_from_e[e]); } -/*******************************************************************\ - -Function: - - Inputs: e in comWR /\ C_j (invisible variables) - - Outputs: e's in po /\ C (problem variables) - - Purpose: - -\*******************************************************************/ - +/// \par parameters: e in comWR /\ C_j (invisible variables) +/// \return e's in po /\ C (problem variables) void const_graph_visitort::CT( const edget &edge, std::set &edges) @@ -519,18 +428,8 @@ void const_graph_visitort::CT( } } -/*******************************************************************\ - -Function: - - Inputs: e in comWR /\ C_j (invisible variables) - - Outputs: e's in poRW/\ C (problem variables) - - Purpose: - -\*******************************************************************/ - +/// \par parameters: e in comWR /\ C_j (invisible variables) +/// \return e's in poRW/\ C (problem variables) void const_graph_visitort::CT_not_powr( const edget &edge, std::set &edges) diff --git a/src/musketeer/graph_visitor.h b/src/musketeer/graph_visitor.h index 0574cae885f..2df40b7e1d3 100644 --- a/src/musketeer/graph_visitor.h +++ b/src/musketeer/graph_visitor.h @@ -6,6 +6,9 @@ Author: Vincent Nimal \*******************************************************************/ +/// \file +/// graph visitor for computing edges involved for fencing + #ifndef CPROVER_MUSKETEER_GRAPH_VISITOR_H #define CPROVER_MUSKETEER_GRAPH_VISITOR_H diff --git a/src/musketeer/ilp.h b/src/musketeer/ilp.h index cecc47fb0a8..b8cbe4e9202 100644 --- a/src/musketeer/ilp.h +++ b/src/musketeer/ilp.h @@ -6,6 +6,9 @@ Author: Vincent Nimal \*******************************************************************/ +/// \file +/// ILP structure + #ifdef HAVE_GLPK #include #endif diff --git a/src/musketeer/languages.cpp b/src/musketeer/languages.cpp index 92ceefa1a72..a7e4497a038 100644 --- a/src/musketeer/languages.cpp +++ b/src/musketeer/languages.cpp @@ -6,24 +6,15 @@ Module: Language Registration \*******************************************************************/ +/// \file +/// Language Registration + #include #include #include "musketeer_parse_options.h" -/*******************************************************************\ - -Function: goto_instrument_parse_optionst::register_languages - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_fence_inserter_parse_optionst::register_languages() { register_language(new_ansi_c_language); diff --git a/src/musketeer/musketeer_main.cpp b/src/musketeer/musketeer_main.cpp index 238283400f8..b233c0080a0 100644 --- a/src/musketeer/musketeer_main.cpp +++ b/src/musketeer/musketeer_main.cpp @@ -6,19 +6,10 @@ Author: Vincent Nimal \*******************************************************************/ -#include "musketeer_parse_options.h" - -/*******************************************************************\ - -Function: main - - Inputs: +/// \file +/// Main Module - Outputs: - - Purpose: - -\*******************************************************************/ +#include "musketeer_parse_options.h" int main(int argc, const char **argv) { diff --git a/src/musketeer/musketeer_parse_options.cpp b/src/musketeer/musketeer_parse_options.cpp index ae40a2f2318..cbebc767057 100644 --- a/src/musketeer/musketeer_parse_options.cpp +++ b/src/musketeer/musketeer_parse_options.cpp @@ -6,6 +6,9 @@ Module: Main Module \*******************************************************************/ +/// \file +/// Main Module + #include #include #include @@ -46,18 +49,6 @@ Module: Main Module #include "replace_async.h" #include "infer_mode.h" -/*******************************************************************\ - -Function: goto_fence_inserter_parse_optionst::set_verbosity - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_fence_inserter_parse_optionst::set_verbosity() { unsigned int v=8; // default @@ -72,18 +63,7 @@ void goto_fence_inserter_parse_optionst::set_verbosity() ui_message_handler.set_verbosity(v); } -/*******************************************************************\ - -Function: goto_fence_inserter_parse_optionst::doit - - Inputs: - - Outputs: - - Purpose: invoke main modules - -\*******************************************************************/ - +/// invoke main modules int goto_fence_inserter_parse_optionst::doit() { if(cmdline.isset("version")) @@ -150,18 +130,6 @@ int goto_fence_inserter_parse_optionst::doit() } } -/*******************************************************************\ - -Function: goto_fence_inserter_parse_optionst::get_goto_program - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_fence_inserter_parse_optionst::get_goto_program( goto_functionst &goto_functions) { @@ -174,18 +142,6 @@ void goto_fence_inserter_parse_optionst::get_goto_program( config.set_from_symbol_table(symbol_table); } -/*******************************************************************\ - -Function: goto_fence_inserter_parse_optionst::instrument_goto_program - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_fence_inserter_parse_optionst::instrument_goto_program( goto_functionst &goto_functions) { @@ -435,18 +391,7 @@ void goto_fence_inserter_parse_optionst::instrument_goto_program( label_properties(goto_functions); } -/*******************************************************************\ - -Function: goto_fence_inserter_parse_optionst::help - - Inputs: - - Outputs: - - Purpose: display command line help - -\*******************************************************************/ - +/// display command line help void goto_fence_inserter_parse_optionst::help() { std::cout << diff --git a/src/musketeer/musketeer_parse_options.h b/src/musketeer/musketeer_parse_options.h index ca93c9de488..13d0a07ef19 100644 --- a/src/musketeer/musketeer_parse_options.h +++ b/src/musketeer/musketeer_parse_options.h @@ -6,6 +6,9 @@ Module: Command Line Parsing \*******************************************************************/ +/// \file +/// Command Line Parsing + #ifndef CPROVER_MUSKETEER_MUSKETEER_PARSE_OPTIONS_H #define CPROVER_MUSKETEER_MUSKETEER_PARSE_OPTIONS_H diff --git a/src/musketeer/pensieve.cpp b/src/musketeer/pensieve.cpp index 649182e1696..a870ae16045 100644 --- a/src/musketeer/pensieve.cpp +++ b/src/musketeer/pensieve.cpp @@ -16,18 +16,6 @@ Author: Vincent Nimal #include "pensieve.h" -/*******************************************************************\ - -Function: fencer - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void fence_pensieve( value_setst &value_sets, symbol_tablet &symbol_table, diff --git a/src/musketeer/pensieve.h b/src/musketeer/pensieve.h index 298919f182f..9513a26c433 100644 --- a/src/musketeer/pensieve.h +++ b/src/musketeer/pensieve.h @@ -6,6 +6,9 @@ Author: Vincent Nimal \*******************************************************************/ +/// \file +/// Fence insertion following criteria of Pensieve (PPoPP'05) + #ifndef CPROVER_MUSKETEER_PENSIEVE_H #define CPROVER_MUSKETEER_PENSIEVE_H diff --git a/src/musketeer/propagate_const_function_pointers.cpp b/src/musketeer/propagate_const_function_pointers.cpp index 0fb2f0aad18..07838ce8d35 100644 --- a/src/musketeer/propagate_const_function_pointers.cpp +++ b/src/musketeer/propagate_const_function_pointers.cpp @@ -6,6 +6,9 @@ Author: Vincent Nimal \*******************************************************************/ +/// \file +/// Constant Function Pointer Propagation + #include #include #include @@ -140,20 +143,10 @@ class const_function_pointer_propagationt } }; -/*******************************************************************\ - -Function: - - Inputs: 'it' pointing to the callsite to update, 'function' the function - actually called, 'stack_scope' the place where the constant was - defined in the call stack - - Outputs: - - Purpose: - -\*******************************************************************/ - +/// \par parameters: 'it' pointing to the callsite to update, 'function' the +/// function +/// actually called, 'stack_scope' the place where the constant was +/// defined in the call stack void const_function_pointer_propagationt::dup_caller_and_inline_callee( const symbol_exprt &const_function, unsigned stack_scope) @@ -341,19 +334,8 @@ void const_function_pointer_propagationt::dup_caller_and_inline_callee( callsite_stack.swap(new_callsite_stack); } -/*******************************************************************\ - -Function: - - Inputs: - - Outputs: - - Purpose: adds const pointers (instantiated here or propagated) passed - as arguments in the map - -\*******************************************************************/ - +/// adds const pointers (instantiated here or propagated) passed as arguments in +/// the map void const_function_pointer_propagationt::arg_stackt::add_args( const symbol_exprt &const_function, goto_programt::instructionst::iterator it) @@ -431,18 +413,6 @@ void const_function_pointer_propagationt::arg_stackt::add_args( } } -/*******************************************************************\ - -Function: - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void const_function_pointer_propagationt::arg_stackt::remove_args() { /* remove the parameter names */ @@ -453,18 +423,6 @@ void const_function_pointer_propagationt::arg_stackt::remove_args() } } -/*******************************************************************\ - -Function: - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void const_function_pointer_propagationt::propagate( const irep_idt &function_id) { @@ -585,18 +543,6 @@ void const_function_pointer_propagationt::propagate( functions_met.erase(function_id); } -/*******************************************************************\ - -Function: - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void propagate_const_function_pointers( symbol_tablet &symbol_table, goto_functionst &goto_functions, diff --git a/src/musketeer/propagate_const_function_pointers.h b/src/musketeer/propagate_const_function_pointers.h index 0749a1ac4bd..af1b5497b41 100644 --- a/src/musketeer/propagate_const_function_pointers.h +++ b/src/musketeer/propagate_const_function_pointers.h @@ -6,6 +6,9 @@ Author: Vincent Nimal \*******************************************************************/ +/// \file +/// Constant Function Pointer Propagation + #ifndef CPROVER_MUSKETEER_PROPAGATE_CONST_FUNCTION_POINTERS_H #define CPROVER_MUSKETEER_PROPAGATE_CONST_FUNCTION_POINTERS_H diff --git a/src/path-symex/build_goto_trace.cpp b/src/path-symex/build_goto_trace.cpp index 4e7eafc2c94..fed73f16457 100644 --- a/src/path-symex/build_goto_trace.cpp +++ b/src/path-symex/build_goto_trace.cpp @@ -6,20 +6,12 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ -#include "build_goto_trace.h" - -/*******************************************************************\ - -Function: build_goto_trace - - Inputs: +/// \file +/// Build Goto Trace from State History - Outputs: - - Purpose: follow state history to build a goto trace - -\*******************************************************************/ +#include "build_goto_trace.h" +/// follow state history to build a goto trace void build_goto_trace( const path_symex_statet &state, const decision_proceduret &decision_procedure, diff --git a/src/path-symex/build_goto_trace.h b/src/path-symex/build_goto_trace.h index e6fd1a6d493..beb1a0e609d 100644 --- a/src/path-symex/build_goto_trace.h +++ b/src/path-symex/build_goto_trace.h @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Build Goto Trace from Path Symex History + // NOLINT(build/header_guard) as this file is also symlinked #ifndef CPROVER_PATH_SYMEX_BUILD_GOTO_TRACE_H #define CPROVER_PATH_SYMEX_BUILD_GOTO_TRACE_H diff --git a/src/path-symex/loc_ref.h b/src/path-symex/loc_ref.h index 9a8ea0dc341..8f192c79583 100644 --- a/src/path-symex/loc_ref.h +++ b/src/path-symex/loc_ref.h @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Program Locations + #ifndef CPROVER_PATH_SYMEX_LOC_REF_H #define CPROVER_PATH_SYMEX_LOC_REF_H diff --git a/src/path-symex/locs.cpp b/src/path-symex/locs.cpp index fa8e9c4cbbd..8827605768d 100644 --- a/src/path-symex/locs.cpp +++ b/src/path-symex/locs.cpp @@ -6,19 +6,10 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ -#include "locs.h" - -/*******************************************************************\ - -Function: locst::locst - - Inputs: - - Outputs: - - Purpose: +/// \file +/// Program Locations -\*******************************************************************/ +#include "locs.h" locst::locst( const namespacet &_ns): @@ -26,18 +17,6 @@ locst::locst( { } -/*******************************************************************\ - -Function: locst::build - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void locst::build(const goto_functionst &goto_functions) { // build locations @@ -102,18 +81,6 @@ void locst::build(const goto_functionst &goto_functions) } } -/*******************************************************************\ - -Function: locst::output - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void locst::output(std::ostream &out) const { irep_idt function; diff --git a/src/path-symex/locs.h b/src/path-symex/locs.h index 7f626a1d2bf..67f52da1584 100644 --- a/src/path-symex/locs.h +++ b/src/path-symex/locs.h @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// CFG made of Program Locations, built from goto_functionst + #ifndef CPROVER_PATH_SYMEX_LOCS_H #define CPROVER_PATH_SYMEX_LOCS_H diff --git a/src/path-symex/path_replay.cpp b/src/path-symex/path_replay.cpp index 9dcb0a0c920..6044692839c 100644 --- a/src/path-symex/path_replay.cpp +++ b/src/path-symex/path_replay.cpp @@ -6,19 +6,10 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ -#include "path_replay.h" - -/*******************************************************************\ - -Function: path_replayt::get_branches - - Inputs: +/// \file +/// Dense Data Structure for Path Replay - Outputs: - - Purpose: - -\*******************************************************************/ +#include "path_replay.h" void get_branches(path_symex_step_reft history) { diff --git a/src/path-symex/path_replay.h b/src/path-symex/path_replay.h index 70861e8e5a8..27b6359af9e 100644 --- a/src/path-symex/path_replay.h +++ b/src/path-symex/path_replay.h @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Dense Data Structure for Path Replay + #ifndef CPROVER_PATH_SYMEX_PATH_REPLAY_H #define CPROVER_PATH_SYMEX_PATH_REPLAY_H diff --git a/src/path-symex/path_symex.cpp b/src/path-symex/path_symex.cpp index eb58b330ab6..fe366e142dd 100644 --- a/src/path-symex/path_symex.cpp +++ b/src/path-symex/path_symex.cpp @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Concrete Symbolic Transformer + #include #include #include @@ -26,18 +29,6 @@ Author: Daniel Kroening, kroening@kroening.com #include #endif -/*******************************************************************\ - -Function: path_symext::propagate - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool path_symext::propagate(const exprt &src) { // propagate things that are 'simple enough' @@ -97,18 +88,6 @@ bool path_symext::propagate(const exprt &src) } } -/*******************************************************************\ - -Function: path_symext::assign - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void path_symext::assign( path_symex_statet &state, const exprt &lhs, @@ -152,18 +131,6 @@ void path_symext::assign( assign_rec(state, _guard, ssa_lhs, ssa_rhs); } -/*******************************************************************\ - -Function: path_symext::symex_malloc - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - inline static typet c_sizeof_type_rec(const exprt &expr) { const irept &sizeof_type=expr.find(ID_C_c_sizeof_type); @@ -300,18 +267,6 @@ void path_symext::symex_malloc( } -/*******************************************************************\ - -Function: get_old_va_symb - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - static irep_idt get_old_va_symbol( const path_symex_statet &state, const exprt &src) @@ -329,18 +284,6 @@ static irep_idt get_old_va_symbol( return irep_idt(); } -/*******************************************************************\ - -Function: path_symext::symex_va_arg_next - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void path_symext::symex_va_arg_next( path_symex_statet &state, const exprt &lhs, @@ -400,18 +343,6 @@ void path_symext::symex_va_arg_next( assign(state, lhs, rhs); } -/*******************************************************************\ - -Function: path_symext::assign_rec - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void path_symext::assign_rec( path_symex_statet &state, exprt::operandst &guard, @@ -679,18 +610,6 @@ void path_symext::assign_rec( } } -/*******************************************************************\ - -Function: path_symext::function_call_rec - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void path_symext::function_call_rec( path_symex_statet &state, const code_function_callt &call, @@ -874,18 +793,6 @@ void path_symext::function_call_rec( throw "TODO: function_call "+function.id_string(); } -/*******************************************************************\ - -Function: path_symext::return_from_function - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void path_symext::return_from_function(path_symex_statet &state) { path_symex_statet::threadt &thread=state.threads[state.get_current_thread()]; @@ -921,18 +828,6 @@ void path_symext::return_from_function(path_symex_statet &state) } } -/*******************************************************************\ - -Function: path_symext::set_return_value - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void path_symext::set_return_value( path_symex_statet &state, const exprt &v) @@ -945,18 +840,6 @@ void path_symext::set_return_value( thread.call_stack.back().return_rhs=v; } -/*******************************************************************\ - -Function: path_symext::do_goto - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void path_symext::do_goto( path_symex_statet &state, std::list &further_states) @@ -1002,18 +885,6 @@ void path_symext::do_goto( state.history->guard=negated_guard; } -/*******************************************************************\ - -Function: path_symext::do_goto - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void path_symext::do_goto( path_symex_statet &state, bool taken) @@ -1050,18 +921,6 @@ void path_symext::do_goto( } } -/*******************************************************************\ - -Function: path_symext::operator() - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void path_symext::operator()( path_symex_statet &state, std::list &further_states) @@ -1224,18 +1083,6 @@ void path_symext::operator()( } } -/*******************************************************************\ - -Function: path_symext::operator() - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void path_symext::operator()(path_symex_statet &state) { std::list further_states; @@ -1244,18 +1091,6 @@ void path_symext::operator()(path_symex_statet &state) throw "path_symext got unexpected further states"; } -/*******************************************************************\ - -Function: path_symex - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void path_symex( path_symex_statet &state, std::list &further_states) @@ -1264,36 +1099,12 @@ void path_symex( path_symex(state, further_states); } -/*******************************************************************\ - -Function: path_symex - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void path_symex(path_symex_statet &state) { path_symext path_symex; path_symex(state); } -/*******************************************************************\ - -Function: path_symex_goto - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void path_symex_goto( path_symex_statet &state, bool taken) @@ -1302,18 +1113,6 @@ void path_symex_goto( path_symex.do_goto(state, taken); } -/*******************************************************************\ - -Function: path_symex_assert_fail - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void path_symex_assert_fail(path_symex_statet &state) { path_symext path_symex; diff --git a/src/path-symex/path_symex.h b/src/path-symex/path_symex.h index 731ea87608e..cc7a8912783 100644 --- a/src/path-symex/path_symex.h +++ b/src/path-symex/path_symex.h @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Concrete Symbolic Transformer + // NOLINT(build/header_guard) as this file is also symlinked #ifndef CPROVER_PATH_SYMEX_PATH_SYMEX_H #define CPROVER_PATH_SYMEX_PATH_SYMEX_H diff --git a/src/path-symex/path_symex_class.h b/src/path-symex/path_symex_class.h index 4eec3d4ff4c..933b871e9fa 100644 --- a/src/path-symex/path_symex_class.h +++ b/src/path-symex/path_symex_class.h @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Concrete Symbolic Transformer + #ifndef CPROVER_PATH_SYMEX_PATH_SYMEX_CLASS_H #define CPROVER_PATH_SYMEX_PATH_SYMEX_CLASS_H diff --git a/src/path-symex/path_symex_history.cpp b/src/path-symex/path_symex_history.cpp index 7829f72c67a..502f3af19eb 100644 --- a/src/path-symex/path_symex_history.cpp +++ b/src/path-symex/path_symex_history.cpp @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// History of path-based symbolic simulator + #include #include @@ -14,18 +17,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "path_symex_history.h" -/*******************************************************************\ - -Function: path_symex_stept::output - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void path_symex_stept::output(std::ostream &out) const { out << "PCs:"; @@ -45,18 +36,6 @@ void path_symex_stept::output(std::ostream &out) const out << "\n"; } -/*******************************************************************\ - -Function: path_symex_stept::convert - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void path_symex_stept::convert(decision_proceduret &dest) const { if(ssa_rhs.is_not_nil()) @@ -66,18 +45,6 @@ void path_symex_stept::convert(decision_proceduret &dest) const dest << guard; } -/*******************************************************************\ - -Function: path_symex_step_reft::build_history - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void path_symex_step_reft::build_history( std::vector &dest) const { diff --git a/src/path-symex/path_symex_history.h b/src/path-symex/path_symex_history.h index 3847138dc71..35cfcb6d591 100644 --- a/src/path-symex/path_symex_history.h +++ b/src/path-symex/path_symex_history.h @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// History for path-based symbolic simulator + #ifndef CPROVER_PATH_SYMEX_PATH_SYMEX_HISTORY_H #define CPROVER_PATH_SYMEX_PATH_SYMEX_HISTORY_H diff --git a/src/path-symex/path_symex_state.cpp b/src/path-symex/path_symex_state.cpp index ebb7dda863a..55b7310e878 100644 --- a/src/path-symex/path_symex_state.cpp +++ b/src/path-symex/path_symex_state.cpp @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// State of path-based symbolic simulator + #include #include #include @@ -23,18 +26,6 @@ Author: Daniel Kroening, kroening@kroening.com #include #endif -/*******************************************************************\ - -Function: initial_state - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - path_symex_statet initial_state( var_mapt &var_map, const locst &locs, @@ -50,36 +41,12 @@ path_symex_statet initial_state( return s; } -/*******************************************************************\ - -Function: path_symex_statet::get_pc - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - loc_reft path_symex_statet::get_pc() const { assert(current_thread #include @@ -18,18 +21,6 @@ Author: Daniel Kroening, kroening@kroening.com #include #endif -/*******************************************************************\ - -Function: path_symex_statet::read - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - exprt path_symex_statet::read(const exprt &src, bool propagate) { #ifdef DEBUG @@ -55,18 +46,6 @@ exprt path_symex_statet::read(const exprt &src, bool propagate) return tmp5; } -/*******************************************************************\ - -Function: path_symex_statet::expand_structs_and_arrays - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - exprt path_symex_statet::expand_structs_and_arrays(const exprt &src) { #ifdef DEBUG @@ -180,18 +159,6 @@ exprt path_symex_statet::expand_structs_and_arrays(const exprt &src) return src; } -/*******************************************************************\ - -Function: path_symex_statet::array_theory - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - exprt path_symex_statet::array_theory(const exprt &src, bool propagate) { // top-level constant-sized arrays only right now @@ -244,18 +211,6 @@ exprt path_symex_statet::array_theory(const exprt &src, bool propagate) return src; } -/*******************************************************************\ - -Function: path_symex_statet::instantiate_rec - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - exprt path_symex_statet::instantiate_rec( const exprt &src, bool propagate) @@ -348,18 +303,6 @@ exprt path_symex_statet::instantiate_rec( return src2; } -/*******************************************************************\ - -Function: path_symex_statet::read_symbol_member_index - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - exprt path_symex_statet::read_symbol_member_index( const exprt &src, bool propagate) @@ -474,18 +417,6 @@ exprt path_symex_statet::read_symbol_member_index( } } -/*******************************************************************\ - -Function: path_symex_statet::is_symbol_member_index - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool path_symex_statet::is_symbol_member_index(const exprt &src) const { const typet final_type=src.type(); @@ -539,18 +470,6 @@ bool path_symex_statet::is_symbol_member_index(const exprt &src) const } } -/*******************************************************************\ - -Function: path_symex_statet::array_index_as_string - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string path_symex_statet::array_index_as_string(const exprt &src) const { exprt tmp=simplify_expr(src, var_map.ns); @@ -562,18 +481,6 @@ std::string path_symex_statet::array_index_as_string(const exprt &src) const return "[*]"; } -/*******************************************************************\ - -Function: path_symex_statet::dereference_rec - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - exprt path_symex_statet::dereference_rec( const exprt &src, bool propagate) @@ -610,18 +517,6 @@ exprt path_symex_statet::dereference_rec( return src2; } -/*******************************************************************\ - -Function: path_symex_statet::instantiate_rec_address - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - exprt path_symex_statet::instantiate_rec_address( const exprt &src, bool propagate) diff --git a/src/path-symex/var_map.cpp b/src/path-symex/var_map.cpp index d981cf1cca9..83193f4abc5 100644 --- a/src/path-symex/var_map.cpp +++ b/src/path-symex/var_map.cpp @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Variable Numbering + #include #include @@ -14,18 +17,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "var_map.h" -/*******************************************************************\ - -Function: var_mapt::var_infot::operator() - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - var_mapt::var_infot &var_mapt::operator()( const irep_idt &symbol, const irep_idt &suffix, @@ -53,18 +44,6 @@ var_mapt::var_infot &var_mapt::operator()( return result.first->second; } -/*******************************************************************\ - -Function: var_mapt::var_infot::output - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void var_mapt::var_infot::output(std::ostream &out) const { out << "full_identifier: " << full_identifier << "\n"; @@ -89,18 +68,6 @@ void var_mapt::var_infot::output(std::ostream &out) const out << "\n"; } -/*******************************************************************\ - -Function: var_mapt::init - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void var_mapt::init(var_infot &var_info) { if(has_prefix(id2string(var_info.symbol), "symex_dynamic::")) @@ -141,36 +108,12 @@ void var_mapt::init(var_infot &var_info) var_info.number=local_count++; } -/*******************************************************************\ - -Function: var_mapt::var_infot::ssa_identifier - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - irep_idt var_mapt::var_infot::ssa_identifier() const { return id2string(full_identifier)+ "#"+std::to_string(ssa_counter); } -/*******************************************************************\ - -Function: var_mapt::output - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void var_mapt::output(std::ostream &out) const { for(id_mapt::const_iterator diff --git a/src/path-symex/var_map.h b/src/path-symex/var_map.h index cb5c7c7d9f5..11ffcdbdc49 100644 --- a/src/path-symex/var_map.h +++ b/src/path-symex/var_map.h @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Variable Numbering + #ifndef CPROVER_PATH_SYMEX_VAR_MAP_H #define CPROVER_PATH_SYMEX_VAR_MAP_H diff --git a/src/pointer-analysis/add_failed_symbols.cpp b/src/pointer-analysis/add_failed_symbols.cpp index 0a8f757a6d8..ef8688285e7 100644 --- a/src/pointer-analysis/add_failed_symbols.cpp +++ b/src/pointer-analysis/add_failed_symbols.cpp @@ -6,41 +6,20 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Pointer Dereferencing + #include #include #include #include "add_failed_symbols.h" -/*******************************************************************\ - -Function: failed_symbol_id - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - irep_idt failed_symbol_id(const irep_idt &id) { return id2string(id)+"$object"; } -/*******************************************************************\ - -Function: add_failed_symbol - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void add_failed_symbol(symbolt &symbol, symbol_tablet &symbol_table) { if(!symbol.is_lvalue) @@ -70,18 +49,6 @@ void add_failed_symbol(symbolt &symbol, symbol_tablet &symbol_table) } } -/*******************************************************************\ - -Function: add_failed_symbols - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void add_failed_symbols(symbol_tablet &symbol_table) { // the symbol table iterators are not stable, and @@ -102,18 +69,6 @@ void add_failed_symbols(symbol_tablet &symbol_table) } } -/*******************************************************************\ - -Function: get_failed_symbol - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - exprt get_failed_symbol( const symbol_exprt &expr, const namespacet &ns) diff --git a/src/pointer-analysis/add_failed_symbols.h b/src/pointer-analysis/add_failed_symbols.h index ce1a3b97c9a..2ae2228f564 100644 --- a/src/pointer-analysis/add_failed_symbols.h +++ b/src/pointer-analysis/add_failed_symbols.h @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Pointer Dereferencing + #ifndef CPROVER_POINTER_ANALYSIS_ADD_FAILED_SYMBOLS_H #define CPROVER_POINTER_ANALYSIS_ADD_FAILED_SYMBOLS_H diff --git a/src/pointer-analysis/dereference.cpp b/src/pointer-analysis/dereference.cpp index 8638dff9e67..e17d628e4f7 100644 --- a/src/pointer-analysis/dereference.cpp +++ b/src/pointer-analysis/dereference.cpp @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Symbolic Execution of ANSI-C + #ifdef DEBUG #include #include @@ -22,18 +25,8 @@ Author: Daniel Kroening, kroening@kroening.com #include "dereference.h" -/*******************************************************************\ - -Function: dereferencet::operator() - - Inputs: expression, to be dereferenced - - Outputs: returns object after dereferencing - - Purpose: - -\*******************************************************************/ - +/// \par parameters: expression, to be dereferenced +/// \return returns object after dereferencing exprt dereferencet::operator()(const exprt &pointer) { if(pointer.type().id()!=ID_pointer) @@ -53,18 +46,6 @@ exprt dereferencet::operator()(const exprt &pointer) type); } -/*******************************************************************\ - -Function: dereferencet::read_object - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - exprt dereferencet::read_object( const exprt &object, const exprt &offset, @@ -169,18 +150,6 @@ exprt dereferencet::read_object( return binary_exprt(object, byte_extract_id(), simplified_offset, dest_type); } -/*******************************************************************\ - -Function: dereferencet::dereference_rec - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - exprt dereferencet::dereference_rec( const exprt &address, const exprt &offset, @@ -235,18 +204,6 @@ exprt dereferencet::dereference_rec( } } -/*******************************************************************\ - -Function: dereferencet::dereference_if - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - exprt dereferencet::dereference_if( const if_exprt &expr, const exprt &offset, @@ -259,18 +216,6 @@ exprt dereferencet::dereference_if( return if_exprt(expr.cond(), true_case, false_case); } -/*******************************************************************\ - -Function: dereferencet::dereference_plus - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - exprt dereferencet::dereference_plus( const exprt &expr, const exprt &offset, @@ -306,18 +251,6 @@ exprt dereferencet::dereference_plus( return dereference_rec(pointer, new_offset, type); } -/*******************************************************************\ - -Function: dereferencet::dereference_typecast - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - exprt dereferencet::dereference_typecast( const typecast_exprt &expr, const exprt &offset, @@ -350,18 +283,6 @@ exprt dereferencet::dereference_typecast( throw "dereferencet: unexpected cast"; } -/*******************************************************************\ - -Function: dereferencet::type_compatible - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool dereferencet::type_compatible( const typet &object_type, const typet &dereference_type) const diff --git a/src/pointer-analysis/dereference.h b/src/pointer-analysis/dereference.h index 5036f702cde..968395b604f 100644 --- a/src/pointer-analysis/dereference.h +++ b/src/pointer-analysis/dereference.h @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Pointer Dereferencing + #ifndef CPROVER_POINTER_ANALYSIS_DEREFERENCE_H #define CPROVER_POINTER_ANALYSIS_DEREFERENCE_H diff --git a/src/pointer-analysis/dereference_callback.cpp b/src/pointer-analysis/dereference_callback.cpp index c13e2f359e4..a28a51892e1 100644 --- a/src/pointer-analysis/dereference_callback.cpp +++ b/src/pointer-analysis/dereference_callback.cpp @@ -6,19 +6,10 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ -#include "dereference_callback.h" - -/*******************************************************************\ - -Function: dereference_callbackt::~dereference_callbackt - - Inputs: +/// \file +/// Pointer Dereferencing - Outputs: - - Purpose: - -\*******************************************************************/ +#include "dereference_callback.h" dereference_callbackt::~dereference_callbackt() { diff --git a/src/pointer-analysis/dereference_callback.h b/src/pointer-analysis/dereference_callback.h index 9d9d1b69449..d02ea726f4b 100644 --- a/src/pointer-analysis/dereference_callback.h +++ b/src/pointer-analysis/dereference_callback.h @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Pointer Dereferencing + #ifndef CPROVER_POINTER_ANALYSIS_DEREFERENCE_CALLBACK_H #define CPROVER_POINTER_ANALYSIS_DEREFERENCE_CALLBACK_H diff --git a/src/pointer-analysis/goto_program_dereference.cpp b/src/pointer-analysis/goto_program_dereference.cpp index 3370abe7635..5665816cf67 100644 --- a/src/pointer-analysis/goto_program_dereference.cpp +++ b/src/pointer-analysis/goto_program_dereference.cpp @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Dereferencing Operations on GOTO Programs + #include #include #include @@ -15,18 +18,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "goto_program_dereference.h" -/*******************************************************************\ - -Function: goto_program_dereferencet::has_failed_symbol - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool goto_program_dereferencet::has_failed_symbol( const exprt &expr, const symbolt *&symbol) @@ -50,18 +41,6 @@ bool goto_program_dereferencet::has_failed_symbol( return false; } -/*******************************************************************\ - -Function: goto_program_dereferencet::is_valid_object - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool goto_program_dereferencet::is_valid_object( const irep_idt &identifier) { @@ -84,18 +63,6 @@ bool goto_program_dereferencet::is_valid_object( return false; } -/*******************************************************************\ - -Function: goto_program_dereferencet::dereference_failure - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_program_dereferencet::dereference_failure( const std::string &property, const std::string &msg, @@ -125,18 +92,6 @@ void goto_program_dereferencet::dereference_failure( } } -/*******************************************************************\ - -Function: goto_program_dereferencet::dereference_rec - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_program_dereferencet::dereference_rec( exprt &expr, guardt &guard, @@ -274,18 +229,6 @@ void goto_program_dereferencet::dereference_rec( } } -/*******************************************************************\ - -Function: goto_program_dereferencet::get_value_set - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_program_dereferencet::get_value_set( const exprt &expr, value_setst::valuest &dest) @@ -293,18 +236,6 @@ void goto_program_dereferencet::get_value_set( value_sets.get_values(current_target, expr, dest); } -/*******************************************************************\ - -Function: goto_program_dereferencet::dereference_expr - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_program_dereferencet::dereference_expr( exprt &expr, const bool checks_only, @@ -321,18 +252,6 @@ void goto_program_dereferencet::dereference_expr( dereference_rec(expr, guard, mode); } -/*******************************************************************\ - -Function: goto_program_dereferencet::dereference_program - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_program_dereferencet::dereference_program( goto_programt &goto_program, bool checks_only) @@ -357,18 +276,6 @@ void goto_program_dereferencet::dereference_program( } } -/*******************************************************************\ - -Function: goto_program_dereferencet::dereference - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_program_dereferencet::dereference_program( goto_functionst &goto_functions, bool checks_only) @@ -380,18 +287,6 @@ void goto_program_dereferencet::dereference_program( dereference_program(it->second.body, checks_only); } -/*******************************************************************\ - -Function: goto_program_dereferencet::dereference - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_program_dereferencet::dereference_instruction( goto_programt::targett target, bool checks_only) @@ -457,18 +352,6 @@ void goto_program_dereferencet::dereference_instruction( } } -/*******************************************************************\ - -Function: goto_program_dereferencet::dereference - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_program_dereferencet::dereference_expression( goto_programt::const_targett target, exprt &expr) @@ -481,54 +364,18 @@ void goto_program_dereferencet::dereference_expression( dereference_expr(expr, false, value_set_dereferencet::modet::READ); } -/*******************************************************************\ - -Function: goto_program_dereferencet::pointer_checks - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_program_dereferencet::pointer_checks( goto_programt &goto_program) { dereference_program(goto_program, true); } -/*******************************************************************\ - -Function: goto_program_dereferencet::pointer_checks - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void goto_program_dereferencet::pointer_checks( goto_functionst &goto_functions) { dereference_program(goto_functions, true); } -/*******************************************************************\ - -Function: remove_pointers - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void remove_pointers( goto_programt &goto_program, symbol_tablet &symbol_table, @@ -544,18 +391,6 @@ void remove_pointers( goto_program_dereference.dereference_program(goto_program); } -/*******************************************************************\ - -Function: remove_pointers - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void remove_pointers( goto_functionst &goto_functions, symbol_tablet &symbol_table, @@ -572,18 +407,6 @@ void remove_pointers( goto_program_dereference.dereference_program(it->second.body); } -/*******************************************************************\ - -Function: pointer_checks - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void pointer_checks( goto_programt &goto_program, symbol_tablet &symbol_table, @@ -596,18 +419,6 @@ void pointer_checks( goto_program_dereference.pointer_checks(goto_program); } -/*******************************************************************\ - -Function: pointer_checks - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void pointer_checks( goto_functionst &goto_functions, symbol_tablet &symbol_table, @@ -620,18 +431,6 @@ void pointer_checks( goto_program_dereference.pointer_checks(goto_functions); } -/*******************************************************************\ - -Function: dereference - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void dereference( goto_programt::const_targett target, exprt &expr, diff --git a/src/pointer-analysis/goto_program_dereference.h b/src/pointer-analysis/goto_program_dereference.h index 33904035fdc..c2fb0e9a1ff 100644 --- a/src/pointer-analysis/goto_program_dereference.h +++ b/src/pointer-analysis/goto_program_dereference.h @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Value Set + #ifndef CPROVER_POINTER_ANALYSIS_GOTO_PROGRAM_DEREFERENCE_H #define CPROVER_POINTER_ANALYSIS_GOTO_PROGRAM_DEREFERENCE_H diff --git a/src/pointer-analysis/object_numbering.h b/src/pointer-analysis/object_numbering.h index beddfb76ab6..6e731bd072c 100644 --- a/src/pointer-analysis/object_numbering.h +++ b/src/pointer-analysis/object_numbering.h @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Value Set + #ifndef CPROVER_POINTER_ANALYSIS_OBJECT_NUMBERING_H #define CPROVER_POINTER_ANALYSIS_OBJECT_NUMBERING_H diff --git a/src/pointer-analysis/pointer_offset_sum.cpp b/src/pointer-analysis/pointer_offset_sum.cpp index e0fa65ab519..ba6a17d2074 100644 --- a/src/pointer-analysis/pointer_offset_sum.cpp +++ b/src/pointer-analysis/pointer_offset_sum.cpp @@ -6,19 +6,10 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ -#include "pointer_offset_sum.h" - -/*******************************************************************\ - -Function: pointer_offset_sum - - Inputs: +/// \file +/// Pointer Analysis - Outputs: - - Purpose: - -\*******************************************************************/ +#include "pointer_offset_sum.h" exprt pointer_offset_sum(const exprt &a, const exprt &b) { diff --git a/src/pointer-analysis/pointer_offset_sum.h b/src/pointer-analysis/pointer_offset_sum.h index c5569cf1685..e4e6dc238ff 100644 --- a/src/pointer-analysis/pointer_offset_sum.h +++ b/src/pointer-analysis/pointer_offset_sum.h @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Pointer Dereferencing + #ifndef CPROVER_POINTER_ANALYSIS_POINTER_OFFSET_SUM_H #define CPROVER_POINTER_ANALYSIS_POINTER_OFFSET_SUM_H diff --git a/src/pointer-analysis/rewrite_index.cpp b/src/pointer-analysis/rewrite_index.cpp index 61e10530738..1594267afbd 100644 --- a/src/pointer-analysis/rewrite_index.cpp +++ b/src/pointer-analysis/rewrite_index.cpp @@ -6,22 +6,14 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Pointer Dereferencing + #include #include "rewrite_index.h" -/*******************************************************************\ - -Function: rewrite_index - - Inputs: - - Outputs: - - Purpose: rewrite a[i] to *(a+i) - -\*******************************************************************/ - +/// rewrite a[i] to *(a+i) dereference_exprt rewrite_index(const index_exprt &index_expr) { dereference_exprt result; diff --git a/src/pointer-analysis/rewrite_index.h b/src/pointer-analysis/rewrite_index.h index ee5f3b9bbfa..26cf5b19513 100644 --- a/src/pointer-analysis/rewrite_index.h +++ b/src/pointer-analysis/rewrite_index.h @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Pointer Dereferencing + #ifndef CPROVER_POINTER_ANALYSIS_REWRITE_INDEX_H #define CPROVER_POINTER_ANALYSIS_REWRITE_INDEX_H diff --git a/src/pointer-analysis/show_value_sets.cpp b/src/pointer-analysis/show_value_sets.cpp index cd5f4c84e17..b764f9738c9 100644 --- a/src/pointer-analysis/show_value_sets.cpp +++ b/src/pointer-analysis/show_value_sets.cpp @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Show Value Sets + #include #include @@ -13,18 +16,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "value_set_analysis.h" #include "show_value_sets.h" -/*******************************************************************\ - -Function: show_value_sets - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void show_value_sets( ui_message_handlert::uit ui, const goto_functionst &goto_functions, @@ -50,18 +41,6 @@ void show_value_sets( } } -/*******************************************************************\ - -Function: show_value_sets - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void show_value_sets( ui_message_handlert::uit ui, const goto_programt &goto_program, diff --git a/src/pointer-analysis/show_value_sets.h b/src/pointer-analysis/show_value_sets.h index b98acbacd93..d25b7addd4e 100644 --- a/src/pointer-analysis/show_value_sets.h +++ b/src/pointer-analysis/show_value_sets.h @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Show Value Sets + #ifndef CPROVER_POINTER_ANALYSIS_SHOW_VALUE_SETS_H #define CPROVER_POINTER_ANALYSIS_SHOW_VALUE_SETS_H diff --git a/src/pointer-analysis/value_set.cpp b/src/pointer-analysis/value_set.cpp index b35952dc064..c2dce7b5e4e 100644 --- a/src/pointer-analysis/value_set.cpp +++ b/src/pointer-analysis/value_set.cpp @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Value Set + #include #include @@ -32,18 +35,6 @@ Author: Daniel Kroening, kroening@kroening.com const value_sett::object_map_dt value_sett::object_map_dt::blank; object_numberingt value_sett::object_numbering; -/*******************************************************************\ - -Function: value_sett::field_sensitive - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool value_sett::field_sensitive( const irep_idt &id, const typet &type, @@ -59,18 +50,6 @@ bool value_sett::field_sensitive( return ns.follow(type).id()==ID_struct; } -/*******************************************************************\ - -Function: value_sett::insert - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - value_sett::entryt &value_sett::get_entry( const entryt &e, const typet &type, @@ -89,18 +68,6 @@ value_sett::entryt &value_sett::get_entry( return r.first->second; } -/*******************************************************************\ - -Function: value_sett::insert - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool value_sett::insert( object_mapt &dest, unsigned n, @@ -126,18 +93,6 @@ bool value_sett::insert( } } -/*******************************************************************\ - -Function: value_sett::output - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void value_sett::output( const namespacet &ns, std::ostream &out) const @@ -228,18 +183,6 @@ void value_sett::output( } } -/*******************************************************************\ - -Function: value_sett::to_expr - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - exprt value_sett::to_expr(object_map_dt::const_iterator it) const { const exprt &object=object_numbering[it->first]; @@ -260,18 +203,6 @@ exprt value_sett::to_expr(object_map_dt::const_iterator it) const return od; } -/*******************************************************************\ - -Function: value_sett::make_union - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool value_sett::make_union(const value_sett::valuest &new_values) { bool result=false; @@ -311,18 +242,6 @@ bool value_sett::make_union(const value_sett::valuest &new_values) return result; } -/*******************************************************************\ - -Function: value_sett::make_union - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool value_sett::make_union(object_mapt &dest, const object_mapt &src) const { bool result=false; @@ -338,18 +257,6 @@ bool value_sett::make_union(object_mapt &dest, const object_mapt &src) const return result; } -/*******************************************************************\ - -Function: value_sett::eval_pointer_offset - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool value_sett::eval_pointer_offset( exprt &expr, const namespacet &ns) const @@ -403,18 +310,6 @@ bool value_sett::eval_pointer_offset( return mod; } -/*******************************************************************\ - -Function: value_sett::get_value_set - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void value_sett::get_value_set( const exprt &expr, value_setst::valuest &dest, @@ -436,18 +331,6 @@ void value_sett::get_value_set( #endif } -/*******************************************************************\ - -Function: value_sett::get_value_set - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void value_sett::get_value_set( const exprt &expr, object_mapt &dest, @@ -461,18 +344,6 @@ void value_sett::get_value_set( get_value_set_rec(tmp, dest, "", tmp.type(), ns); } -/*******************************************************************\ - -Function: value_sett::get_value_set_rec - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void value_sett::get_value_set_rec( const exprt &expr, object_mapt &dest, @@ -1003,18 +874,6 @@ void value_sett::get_value_set_rec( #endif } -/*******************************************************************\ - -Function: value_sett::dereference_rec - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void value_sett::dereference_rec( const exprt &src, exprt &dest) const @@ -1033,18 +892,6 @@ void value_sett::dereference_rec( dest=src; } -/*******************************************************************\ - -Function: value_sett::get_reference_set - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void value_sett::get_reference_set( const exprt &expr, value_setst::valuest &dest, @@ -1060,18 +907,6 @@ void value_sett::get_reference_set( dest.push_back(to_expr(it)); } -/*******************************************************************\ - -Function: value_sett::get_reference_set_rec - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void value_sett::get_reference_set_rec( const exprt &expr, object_mapt &dest, @@ -1230,18 +1065,6 @@ void value_sett::get_reference_set_rec( insert(dest, exprt(ID_unknown, expr.type())); } -/*******************************************************************\ - -Function: value_sett::assign - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void value_sett::assign( const exprt &lhs, const exprt &rhs, @@ -1363,18 +1186,6 @@ void value_sett::assign( } } -/*******************************************************************\ - -Function: value_sett::do_free - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void value_sett::do_free( const exprt &op, const namespacet &ns) @@ -1455,18 +1266,6 @@ void value_sett::do_free( } } -/*******************************************************************\ - -Function: value_sett::assign_rec - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void value_sett::assign_rec( const exprt &lhs, const object_mapt &values_rhs, @@ -1600,18 +1399,6 @@ void value_sett::assign_rec( throw "assign NYI: `"+lhs.id_string()+"'"; } -/*******************************************************************\ - -Function: value_sett::do_function_call - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void value_sett::do_function_call( const irep_idt &function, const exprt::operandst &arguments, @@ -1658,18 +1445,6 @@ void value_sett::do_function_call( // we could delete the dummy_arg_* now. } -/*******************************************************************\ - -Function: value_sett::do_end_function - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void value_sett::do_end_function( const exprt &lhs, const namespacet &ns) @@ -1682,18 +1457,6 @@ void value_sett::do_end_function( assign(lhs, rhs, ns, false, false); } -/*******************************************************************\ - -Function: value_sett::apply_code - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void value_sett::apply_code( const codet &code, const namespacet &ns) @@ -1826,18 +1589,6 @@ void value_sett::apply_code( } } -/*******************************************************************\ - -Function: value_sett::guard - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void value_sett::guard( const exprt &expr, const namespacet &ns) @@ -1872,18 +1623,6 @@ void value_sett::guard( } } -/*******************************************************************\ - -Function: value_sett::make_member - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - exprt value_sett::make_member( const exprt &src, const irep_idt &component_name, diff --git a/src/pointer-analysis/value_set.h b/src/pointer-analysis/value_set.h index 51bf74d48f2..8fc7c0218f4 100644 --- a/src/pointer-analysis/value_set.h +++ b/src/pointer-analysis/value_set.h @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Value Set + #ifndef CPROVER_POINTER_ANALYSIS_VALUE_SET_H #define CPROVER_POINTER_ANALYSIS_VALUE_SET_H diff --git a/src/pointer-analysis/value_set_analysis.cpp b/src/pointer-analysis/value_set_analysis.cpp index 4e98c10aee4..d1367f4e061 100644 --- a/src/pointer-analysis/value_set_analysis.cpp +++ b/src/pointer-analysis/value_set_analysis.cpp @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Value Set Propagation + #include #include #include @@ -15,54 +18,18 @@ Author: Daniel Kroening, kroening@kroening.com #include "value_set_analysis.h" -/*******************************************************************\ - -Function: value_set_analysist::initialize - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void value_set_analysist::initialize( const goto_programt &goto_program) { baset::initialize(goto_program); } -/*******************************************************************\ - -Function: value_set_analysist::initialize - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void value_set_analysist::initialize( const goto_functionst &goto_functions) { baset::initialize(goto_functions); } -/*******************************************************************\ - -Function: value_set_analysist::convert - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void value_set_analysist::convert( const goto_programt &goto_program, const irep_idt &identifier, @@ -114,18 +81,6 @@ void value_set_analysist::convert( } } } -/*******************************************************************\ - -Function: convert - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void convert( const goto_functionst &goto_functions, const value_set_analysist &value_set_analysis, @@ -144,18 +99,6 @@ void convert( } } -/*******************************************************************\ - -Function: convert - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void convert( const goto_programt &goto_program, const value_set_analysist &value_set_analysis, diff --git a/src/pointer-analysis/value_set_analysis.h b/src/pointer-analysis/value_set_analysis.h index 3437b34af2c..b41355abd73 100644 --- a/src/pointer-analysis/value_set_analysis.h +++ b/src/pointer-analysis/value_set_analysis.h @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Value Set Propagation + #ifndef CPROVER_POINTER_ANALYSIS_VALUE_SET_ANALYSIS_H #define CPROVER_POINTER_ANALYSIS_VALUE_SET_ANALYSIS_H diff --git a/src/pointer-analysis/value_set_analysis_fi.cpp b/src/pointer-analysis/value_set_analysis_fi.cpp index 3ed2a07bc7d..63aaa330ac9 100644 --- a/src/pointer-analysis/value_set_analysis_fi.cpp +++ b/src/pointer-analysis/value_set_analysis_fi.cpp @@ -7,6 +7,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Value Set Propagation (Flow Insensitive) + #include #include #include @@ -16,18 +19,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "value_set_analysis_fi.h" -/*******************************************************************\ - -Function: value_set_analysis_fit::initialize - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void value_set_analysis_fit::initialize( const goto_programt &goto_program) { @@ -35,18 +26,6 @@ void value_set_analysis_fit::initialize( add_vars(goto_program); } -/*******************************************************************\ - -Function: value_set_analysis_fit::initialize - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void value_set_analysis_fit::initialize( const goto_functionst &goto_functions) { @@ -54,18 +33,6 @@ void value_set_analysis_fit::initialize( add_vars(goto_functions); } -/*******************************************************************\ - -Function: value_set_analysis_fit::add_vars - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void value_set_analysis_fit::add_vars( const goto_programt &goto_program) { @@ -114,18 +81,6 @@ void value_set_analysis_fit::add_vars( } } -/*******************************************************************\ - -Function: value_set_analysis_fit::get_entries - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void value_set_analysis_fit::get_entries( const symbolt &symbol, std::list &dest) @@ -133,18 +88,6 @@ void value_set_analysis_fit::get_entries( get_entries_rec(symbol.name, "", symbol.type, dest); } -/*******************************************************************\ - -Function: value_set_analysis_fit::get_entries - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void value_set_analysis_fit::get_entries_rec( const irep_idt &identifier, const std::string &suffix, @@ -182,18 +125,6 @@ void value_set_analysis_fit::get_entries_rec( } } -/*******************************************************************\ - -Function: value_set_analysis_fit::add_vars - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void value_set_analysis_fit::add_vars( const goto_functionst &goto_functions) { @@ -221,18 +152,6 @@ void value_set_analysis_fit::add_vars( } } -/*******************************************************************\ - -Function: value_set_analysis_fit::get_globals - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void value_set_analysis_fit::get_globals( std::list &dest) { @@ -243,18 +162,6 @@ void value_set_analysis_fit::get_globals( get_entries(it->second, dest); } -/*******************************************************************\ - -Function: value_set_analysis_fit::check_type - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool value_set_analysis_fit::check_type(const typet &type) { if(type.id()==ID_pointer) diff --git a/src/pointer-analysis/value_set_analysis_fi.h b/src/pointer-analysis/value_set_analysis_fi.h index e1c8f320cab..da50d27357c 100644 --- a/src/pointer-analysis/value_set_analysis_fi.h +++ b/src/pointer-analysis/value_set_analysis_fi.h @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Value Set Propagation (flow insensitive) + #ifndef CPROVER_POINTER_ANALYSIS_VALUE_SET_ANALYSIS_FI_H #define CPROVER_POINTER_ANALYSIS_VALUE_SET_ANALYSIS_FI_H diff --git a/src/pointer-analysis/value_set_analysis_fivr.cpp b/src/pointer-analysis/value_set_analysis_fivr.cpp index 0180768250c..dab177cc5f4 100644 --- a/src/pointer-analysis/value_set_analysis_fivr.cpp +++ b/src/pointer-analysis/value_set_analysis_fivr.cpp @@ -7,6 +7,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Value Set Propagation (Flow Insensitive) + #include #include #include @@ -16,18 +19,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "value_set_analysis_fivr.h" -/*******************************************************************\ - -Function: value_set_analysis_fivrt::initialize - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void value_set_analysis_fivrt::initialize( const goto_programt &goto_program) { @@ -35,18 +26,6 @@ void value_set_analysis_fivrt::initialize( add_vars(goto_program); } -/*******************************************************************\ - -Function: value_set_analysis_fivrt::initialize - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void value_set_analysis_fivrt::initialize( const goto_functionst &goto_functions) { @@ -54,18 +33,6 @@ void value_set_analysis_fivrt::initialize( add_vars(goto_functions); } -/*******************************************************************\ - -Function: value_set_analysis_fivrt::add_vars - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void value_set_analysis_fivrt::add_vars( const goto_programt &goto_program) { @@ -104,18 +71,6 @@ void value_set_analysis_fivrt::add_vars( } } -/*******************************************************************\ - -Function: value_set_analysis_fivrt::get_entries - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void value_set_analysis_fivrt::get_entries( const symbolt &symbol, std::list &dest) @@ -123,18 +78,6 @@ void value_set_analysis_fivrt::get_entries( get_entries_rec(symbol.name, "", symbol.type, dest); } -/*******************************************************************\ - -Function: value_set_analysis_fivrt::get_entries - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void value_set_analysis_fivrt::get_entries_rec( const irep_idt &identifier, const std::string &suffix, @@ -172,18 +115,6 @@ void value_set_analysis_fivrt::get_entries_rec( } } -/*******************************************************************\ - -Function: value_set_analysis_fivrt::add_vars - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void value_set_analysis_fivrt::add_vars( const goto_functionst &goto_functions) { @@ -211,18 +142,6 @@ void value_set_analysis_fivrt::add_vars( } } -/*******************************************************************\ - -Function: value_set_analysis_fivrt::get_globals - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void value_set_analysis_fivrt::get_globals( std::list &dest) { @@ -233,18 +152,6 @@ void value_set_analysis_fivrt::get_globals( get_entries(it->second, dest); } -/*******************************************************************\ - -Function: value_set_analysis_fivrt::check_type - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool value_set_analysis_fivrt::check_type(const typet &type) { if(type.id()==ID_pointer) diff --git a/src/pointer-analysis/value_set_analysis_fivr.h b/src/pointer-analysis/value_set_analysis_fivr.h index e6e30cfb456..9161315f89a 100644 --- a/src/pointer-analysis/value_set_analysis_fivr.h +++ b/src/pointer-analysis/value_set_analysis_fivr.h @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Value Set Propagation + #ifndef CPROVER_POINTER_ANALYSIS_VALUE_SET_ANALYSIS_FIVR_H #define CPROVER_POINTER_ANALYSIS_VALUE_SET_ANALYSIS_FIVR_H diff --git a/src/pointer-analysis/value_set_analysis_fivrns.cpp b/src/pointer-analysis/value_set_analysis_fivrns.cpp index 1b7d2422186..5fbd77522bf 100644 --- a/src/pointer-analysis/value_set_analysis_fivrns.cpp +++ b/src/pointer-analysis/value_set_analysis_fivrns.cpp @@ -7,6 +7,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Value Set Propagation (Flow Insensitive, Validity Regions) + #include #include #include @@ -16,18 +19,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "value_set_analysis_fivrns.h" -/*******************************************************************\ - -Function: value_set_analysis_fivrnst::initialize - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void value_set_analysis_fivrnst::initialize( const goto_programt &goto_program) { @@ -35,18 +26,6 @@ void value_set_analysis_fivrnst::initialize( add_vars(goto_program); } -/*******************************************************************\ - -Function: value_set_analysis_fivrnst::initialize - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void value_set_analysis_fivrnst::initialize( const goto_functionst &goto_functions) { @@ -54,18 +33,6 @@ void value_set_analysis_fivrnst::initialize( add_vars(goto_functions); } -/*******************************************************************\ - -Function: value_set_analysis_fivrnst::add_vars - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void value_set_analysis_fivrnst::add_vars( const goto_programt &goto_program) { @@ -104,18 +71,6 @@ void value_set_analysis_fivrnst::add_vars( } } -/*******************************************************************\ - -Function: value_set_analysis_fivrnst::get_entries - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void value_set_analysis_fivrnst::get_entries( const symbolt &symbol, std::list &dest) @@ -123,18 +78,6 @@ void value_set_analysis_fivrnst::get_entries( get_entries_rec(symbol.name, "", symbol.type, dest); } -/*******************************************************************\ - -Function: value_set_analysis_fivrnst::get_entries - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void value_set_analysis_fivrnst::get_entries_rec( const irep_idt &identifier, const std::string &suffix, @@ -172,18 +115,6 @@ void value_set_analysis_fivrnst::get_entries_rec( } } -/*******************************************************************\ - -Function: value_set_analysis_fivrnst::add_vars - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void value_set_analysis_fivrnst::add_vars( const goto_functionst &goto_functions) { @@ -211,18 +142,6 @@ void value_set_analysis_fivrnst::add_vars( } } -/*******************************************************************\ - -Function: value_set_analysis_fivrnst::get_globals - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void value_set_analysis_fivrnst::get_globals( std::list &dest) { @@ -233,18 +152,6 @@ void value_set_analysis_fivrnst::get_globals( get_entries(it->second, dest); } -/*******************************************************************\ - -Function: value_set_analysis_fivrnst::check_type - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool value_set_analysis_fivrnst::check_type(const typet &type) { if(type.id()==ID_pointer) diff --git a/src/pointer-analysis/value_set_analysis_fivrns.h b/src/pointer-analysis/value_set_analysis_fivrns.h index b4d45524db2..e2a4e4d1306 100644 --- a/src/pointer-analysis/value_set_analysis_fivrns.h +++ b/src/pointer-analysis/value_set_analysis_fivrns.h @@ -7,6 +7,9 @@ Author: Daniel Kroening, kroening@kroening.com, \*******************************************************************/ +/// \file +/// Value Set Analysis (Flow Insensitive, Validity Regions) + #ifndef CPROVER_POINTER_ANALYSIS_VALUE_SET_ANALYSIS_FIVRNS_H #define CPROVER_POINTER_ANALYSIS_VALUE_SET_ANALYSIS_FIVRNS_H diff --git a/src/pointer-analysis/value_set_dereference.cpp b/src/pointer-analysis/value_set_dereference.cpp index 411adddbe8e..754c1a5e9e0 100644 --- a/src/pointer-analysis/value_set_dereference.cpp +++ b/src/pointer-analysis/value_set_dereference.cpp @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Symbolic Execution of ANSI-C + #ifdef DEBUG #include #endif @@ -42,35 +45,11 @@ Author: Daniel Kroening, kroening@kroening.com // global data, horrible unsigned int value_set_dereferencet::invalid_counter=0; -/*******************************************************************\ - -Function: value_set_dereferencet::has_dereference - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool value_set_dereferencet::has_dereference(const exprt &expr) { return has_subexpr(expr, ID_dereference); } -/*******************************************************************\ - -Function: value_set_dereferencet::get_symbol - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - const exprt &value_set_dereferencet::get_symbol(const exprt &expr) { if(expr.id()==ID_member || expr.id()==ID_index) @@ -79,19 +58,9 @@ const exprt &value_set_dereferencet::get_symbol(const exprt &expr) return expr; } -/*******************************************************************\ - -Function: value_set_dereferencet::dereference - - Inputs: expression dest, to be dereferenced under given guard, - and given mode - - Outputs: returns pointer after dereferencing - - Purpose: - -\*******************************************************************/ - +/// \par parameters: expression dest, to be dereferenced under given guard, +/// and given mode +/// \return returns pointer after dereferencing exprt value_set_dereferencet::dereference( const exprt &pointer, const guardt &guard, @@ -242,18 +211,6 @@ exprt value_set_dereferencet::dereference( return value; } -/*******************************************************************\ - -Function: value_set_dereferencet::dereference_type_compare - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool value_set_dereferencet::dereference_type_compare( const typet &object_type, const typet &dereference_type) const @@ -287,18 +244,6 @@ bool value_set_dereferencet::dereference_type_compare( return false; } -/*******************************************************************\ - -Function: value_set_dereferencet::invalid_pointer - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void value_set_dereferencet::invalid_pointer( const exprt &pointer, const guardt &guard) @@ -316,18 +261,6 @@ void value_set_dereferencet::invalid_pointer( tmp_guard); } -/*******************************************************************\ - -Function: value_set_dereferencet::build_reference_to - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - value_set_dereferencet::valuet value_set_dereferencet::build_reference_to( const exprt &what, const modet mode, @@ -634,18 +567,6 @@ value_set_dereferencet::valuet value_set_dereferencet::build_reference_to( return result; } -/*******************************************************************\ - -Function: value_set_dereferencet::valid_check - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void value_set_dereferencet::valid_check( const exprt &object, const guardt &guard, @@ -698,18 +619,6 @@ void value_set_dereferencet::valid_check( } } -/*******************************************************************\ - -Function: value_set_dereferencet::bounds_check - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void value_set_dereferencet::bounds_check( const index_exprt &expr, const guardt &guard) @@ -783,18 +692,6 @@ void value_set_dereferencet::bounds_check( } } -/*******************************************************************\ - -Function: value_set_dereferencet::memory_model - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - inline static unsigned bv_width( const typet &type, const namespacet &ns) @@ -864,18 +761,6 @@ bool value_set_dereferencet::memory_model( return memory_model_bytes(value, to_type, guard, offset); } -/*******************************************************************\ - -Function: value_set_dereferencet::memory_model_conversion - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool value_set_dereferencet::memory_model_conversion( exprt &value, const typet &to_type, @@ -903,18 +788,6 @@ bool value_set_dereferencet::memory_model_conversion( return true; } -/*******************************************************************\ - -Function: value_set_dereferencet::memory_model_bytes - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool value_set_dereferencet::memory_model_bytes( exprt &value, const typet &to_type, diff --git a/src/pointer-analysis/value_set_dereference.h b/src/pointer-analysis/value_set_dereference.h index 19dde8e0f16..4687d671ec6 100644 --- a/src/pointer-analysis/value_set_dereference.h +++ b/src/pointer-analysis/value_set_dereference.h @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Pointer Dereferencing + #ifndef CPROVER_POINTER_ANALYSIS_VALUE_SET_DEREFERENCE_H #define CPROVER_POINTER_ANALYSIS_VALUE_SET_DEREFERENCE_H diff --git a/src/pointer-analysis/value_set_domain.cpp b/src/pointer-analysis/value_set_domain.cpp index 74656d23fe6..7ddfd6deb29 100644 --- a/src/pointer-analysis/value_set_domain.cpp +++ b/src/pointer-analysis/value_set_domain.cpp @@ -6,22 +6,13 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Value Set + #include #include "value_set_domain.h" -/*******************************************************************\ - -Function: value_set_domaint::transform - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void value_set_domaint::transform( const namespacet &ns, locationt from_l, diff --git a/src/pointer-analysis/value_set_domain.h b/src/pointer-analysis/value_set_domain.h index df028b0d4e1..e59250a0bc0 100644 --- a/src/pointer-analysis/value_set_domain.h +++ b/src/pointer-analysis/value_set_domain.h @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Value Set + #ifndef CPROVER_POINTER_ANALYSIS_VALUE_SET_DOMAIN_H #define CPROVER_POINTER_ANALYSIS_VALUE_SET_DOMAIN_H diff --git a/src/pointer-analysis/value_set_domain_fi.cpp b/src/pointer-analysis/value_set_domain_fi.cpp index a5d0668fe90..98e7509df3f 100644 --- a/src/pointer-analysis/value_set_domain_fi.cpp +++ b/src/pointer-analysis/value_set_domain_fi.cpp @@ -7,22 +7,13 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Value Set Domain (Flow Insensitive) + #include #include "value_set_domain_fi.h" -/*******************************************************************\ - -Function: value_set_domain_fit::transform - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool value_set_domain_fit::transform( const namespacet &ns, locationt from_l, diff --git a/src/pointer-analysis/value_set_domain_fi.h b/src/pointer-analysis/value_set_domain_fi.h index ebcb9008f4c..24e2ac1be2c 100644 --- a/src/pointer-analysis/value_set_domain_fi.h +++ b/src/pointer-analysis/value_set_domain_fi.h @@ -7,6 +7,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Value Set (Flow Insensitive) + #ifndef CPROVER_POINTER_ANALYSIS_VALUE_SET_DOMAIN_FI_H #define CPROVER_POINTER_ANALYSIS_VALUE_SET_DOMAIN_FI_H diff --git a/src/pointer-analysis/value_set_domain_fivr.cpp b/src/pointer-analysis/value_set_domain_fivr.cpp index 51e63dfb91f..8aa82787aa4 100644 --- a/src/pointer-analysis/value_set_domain_fivr.cpp +++ b/src/pointer-analysis/value_set_domain_fivr.cpp @@ -7,22 +7,13 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Value Set Domain (Flow Insensitive, Sharing, Validity Regions) + #include #include "value_set_domain_fivr.h" -/*******************************************************************\ - -Function: value_set_domain_fivrt::transform - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool value_set_domain_fivrt::transform( const namespacet &ns, locationt from_l, diff --git a/src/pointer-analysis/value_set_domain_fivr.h b/src/pointer-analysis/value_set_domain_fivr.h index e1f82153191..4ecb8879517 100644 --- a/src/pointer-analysis/value_set_domain_fivr.h +++ b/src/pointer-analysis/value_set_domain_fivr.h @@ -7,6 +7,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Value Set (Flow Insensitive, Sharing, Validity Regions) + #ifndef CPROVER_POINTER_ANALYSIS_VALUE_SET_DOMAIN_FIVR_H #define CPROVER_POINTER_ANALYSIS_VALUE_SET_DOMAIN_FIVR_H diff --git a/src/pointer-analysis/value_set_domain_fivrns.cpp b/src/pointer-analysis/value_set_domain_fivrns.cpp index 8c8ef147dfa..3688db0227c 100644 --- a/src/pointer-analysis/value_set_domain_fivrns.cpp +++ b/src/pointer-analysis/value_set_domain_fivrns.cpp @@ -7,22 +7,13 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Value Set Domain (Flow Insensitive, Validity Regions) + #include #include "value_set_domain_fivrns.h" -/*******************************************************************\ - -Function: value_set_domain_fivrnst::transform - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool value_set_domain_fivrnst::transform( const namespacet &ns, locationt from_l, diff --git a/src/pointer-analysis/value_set_domain_fivrns.h b/src/pointer-analysis/value_set_domain_fivrns.h index 62d4aeedc3e..4e7827e4617 100644 --- a/src/pointer-analysis/value_set_domain_fivrns.h +++ b/src/pointer-analysis/value_set_domain_fivrns.h @@ -7,6 +7,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Value Set Domain (Flow Insensitive, Validity Regions) + #ifndef CPROVER_POINTER_ANALYSIS_VALUE_SET_DOMAIN_FIVRNS_H #define CPROVER_POINTER_ANALYSIS_VALUE_SET_DOMAIN_FIVRNS_H diff --git a/src/pointer-analysis/value_set_fi.cpp b/src/pointer-analysis/value_set_fi.cpp index 1add85c924d..55eed196b91 100644 --- a/src/pointer-analysis/value_set_fi.cpp +++ b/src/pointer-analysis/value_set_fi.cpp @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Value Set (Flow Insensitive, Sharing) + #include #include @@ -38,18 +41,6 @@ static const char *alloc_adapter_prefix="alloc_adaptor::"; (it)!=(map).end(); \ (it)++) -/*******************************************************************\ - -Function: value_set_fit::output - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void value_set_fit::output( const namespacet &ns, std::ostream &out) const @@ -144,18 +135,6 @@ void value_set_fit::output( } } -/*******************************************************************\ - -Function: value_set_fit::flatten - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void value_set_fit::flatten( const entryt &e, object_mapt &dest) const @@ -172,18 +151,6 @@ void value_set_fit::flatten( #endif } -/*******************************************************************\ - -Function: value_set_fit::flatten_rec - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void value_set_fit::flatten_rec( const entryt &e, object_mapt &dest, @@ -255,18 +222,6 @@ void value_set_fit::flatten_rec( seen.erase(identifier + e.suffix); } -/*******************************************************************\ - -Function: value_set_fit::to_expr - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - exprt value_set_fit::to_expr(object_map_dt::const_iterator it) const { const exprt &object=object_numbering[it->first]; @@ -287,18 +242,6 @@ exprt value_set_fit::to_expr(object_map_dt::const_iterator it) const return od; } -/*******************************************************************\ - -Function: value_set_fit::make_union - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool value_set_fit::make_union(const value_set_fit::valuest &new_values) { assert(0); @@ -338,18 +281,6 @@ bool value_set_fit::make_union(const value_set_fit::valuest &new_values) return result; } -/*******************************************************************\ - -Function: value_set_fit::make_union - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool value_set_fit::make_union(object_mapt &dest, const object_mapt &src) const { bool result=false; @@ -363,18 +294,6 @@ bool value_set_fit::make_union(object_mapt &dest, const object_mapt &src) const return result; } -/*******************************************************************\ - -Function: value_set_fit::get_value_set - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void value_set_fit::get_value_set( const exprt &expr, std::list &value_set, @@ -437,18 +356,6 @@ void value_set_fit::get_value_set( #endif } -/*******************************************************************\ - -Function: value_set_fit::get_value_set - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void value_set_fit::get_value_set( const exprt &expr, object_mapt &dest, @@ -461,18 +368,6 @@ void value_set_fit::get_value_set( get_value_set_rec(tmp, dest, "", tmp.type(), ns, recset); } -/*******************************************************************\ - -Function: value_set_fit::get_value_set_rec - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void value_set_fit::get_value_set_rec( const exprt &expr, object_mapt &dest, @@ -790,18 +685,6 @@ void value_set_fit::get_value_set_rec( insert(dest, exprt(ID_unknown, original_type)); } -/*******************************************************************\ - -Function: value_set_fit::dereference_rec - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void value_set_fit::dereference_rec( const exprt &src, exprt &dest) const @@ -820,18 +703,6 @@ void value_set_fit::dereference_rec( dest=src; } -/*******************************************************************\ - -Function: value_set_fit::get_reference_set - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void value_set_fit::get_reference_set( const exprt &expr, expr_sett &dest, @@ -881,18 +752,6 @@ void value_set_fit::get_reference_set( } } -/*******************************************************************\ - -Function: value_set_fit::get_reference_set_sharing - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void value_set_fit::get_reference_set_sharing( const exprt &expr, expr_sett &dest, @@ -905,18 +764,6 @@ void value_set_fit::get_reference_set_sharing( dest.insert(to_expr(it)); } -/*******************************************************************\ - -Function: value_set_fit::get_reference_set_sharing_rec - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void value_set_fit::get_reference_set_sharing_rec( const exprt &expr, object_mapt &dest, @@ -1115,18 +962,6 @@ void value_set_fit::get_reference_set_sharing_rec( insert(dest, exprt(ID_unknown, expr.type())); } -/*******************************************************************\ - -Function: value_set_fit::assign - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void value_set_fit::assign( const exprt &lhs, const exprt &rhs, @@ -1290,18 +1125,6 @@ void value_set_fit::assign( } } -/*******************************************************************\ - -Function: value_set_fit::do_free - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void value_set_fit::do_free( const exprt &op, const namespacet &ns) @@ -1379,18 +1202,6 @@ void value_set_fit::do_free( } } -/*******************************************************************\ - -Function: value_set_fit::assign_rec - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void value_set_fit::assign_rec( const exprt &lhs, const object_mapt &values_rhs, @@ -1541,18 +1352,6 @@ void value_set_fit::assign_rec( throw "assign NYI: `"+lhs.id_string()+"'"; } -/*******************************************************************\ - -Function: value_set_fit::do_function_call - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void value_set_fit::do_function_call( const irep_idt &function, const exprt::operandst &arguments, @@ -1602,18 +1401,6 @@ void value_set_fit::do_function_call( } } -/*******************************************************************\ - -Function: value_set_fit::do_end_function - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void value_set_fit::do_end_function( const exprt &lhs, const namespacet &ns) @@ -1627,18 +1414,6 @@ void value_set_fit::do_end_function( assign(lhs, rhs, ns); } -/*******************************************************************\ - -Function: value_set_fit::apply_code - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void value_set_fit::apply_code( const exprt &code, const namespacet &ns) diff --git a/src/pointer-analysis/value_set_fi.h b/src/pointer-analysis/value_set_fi.h index 13defa545ae..76f2666d836 100644 --- a/src/pointer-analysis/value_set_fi.h +++ b/src/pointer-analysis/value_set_fi.h @@ -7,6 +7,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Value Set (Flow Insensitive, Sharing) + #ifndef CPROVER_POINTER_ANALYSIS_VALUE_SET_FI_H #define CPROVER_POINTER_ANALYSIS_VALUE_SET_FI_H diff --git a/src/pointer-analysis/value_set_fivr.cpp b/src/pointer-analysis/value_set_fivr.cpp index 45e721137e0..1bcb61205df 100644 --- a/src/pointer-analysis/value_set_fivr.cpp +++ b/src/pointer-analysis/value_set_fivr.cpp @@ -7,6 +7,9 @@ Author: Daniel Kroening, kroening@kroening.com, \*******************************************************************/ +/// \file +/// Value Set (Flow Insensitive, Sharing, Validity Regions) + #include #include @@ -51,18 +54,6 @@ static const char *alloc_adapter_prefix="alloc_adaptor::"; (it)++) \ if((map).is_valid_at((it)->first, from_function, from_target_index)) /* NOLINT(*) */ -/*******************************************************************\ - -Function: value_set_fivrt::output - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void value_set_fivrt::output( const namespacet &ns, std::ostream &out) const @@ -221,18 +212,6 @@ void value_set_fivrt::output( } } -/*******************************************************************\ - -Function: value_set_fivrt::flatten - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void value_set_fivrt::flatten( const entryt &e, object_mapt &dest) const @@ -249,18 +228,6 @@ void value_set_fivrt::flatten( #endif } -/*******************************************************************\ - -Function: value_set_fivrt::flatten_rec - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void value_set_fivrt::flatten_rec( const entryt &e, object_mapt &dest, @@ -376,18 +343,6 @@ void value_set_fivrt::flatten_rec( seen.erase(identifier + e.suffix); } -/*******************************************************************\ - -Function: value_set_fivrt::to_expr - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - exprt value_set_fivrt::to_expr(object_map_dt::const_iterator it) const { const exprt &object=object_numbering[it->first]; @@ -408,18 +363,6 @@ exprt value_set_fivrt::to_expr(object_map_dt::const_iterator it) const return od; } -/*******************************************************************\ - -Function: value_set_fivrt::make_union - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool value_set_fivrt::make_union( object_mapt &dest, const object_mapt &src) const @@ -435,18 +378,6 @@ bool value_set_fivrt::make_union( return result; } -/*******************************************************************\ - -Function: value_set_fivrnst::make_valid_union - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool value_set_fivrt::make_valid_union( object_mapt &dest, const object_mapt &src) const @@ -462,18 +393,6 @@ bool value_set_fivrt::make_valid_union( return result; } -/*******************************************************************\ - -Function: value_set_fivrt::copy_objects - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void value_set_fivrt::copy_objects( object_mapt &dest, const object_mapt &src) const @@ -488,18 +407,6 @@ void value_set_fivrt::copy_objects( } } -/*******************************************************************\ - -Function: value_set_fivrt::get_value_set - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void value_set_fivrt::get_value_set( const exprt &expr, std::list &value_set, @@ -564,18 +471,6 @@ void value_set_fivrt::get_value_set( #endif } -/*******************************************************************\ - -Function: value_set_fivrt::get_value_set - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void value_set_fivrt::get_value_set( const exprt &expr, object_mapt &dest, @@ -588,18 +483,6 @@ void value_set_fivrt::get_value_set( get_value_set_rec(tmp, dest, "", tmp.type(), ns, recset); } -/*******************************************************************\ - -Function: value_set_fivrt::get_value_set_rec - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void value_set_fivrt::get_value_set_rec( const exprt &expr, object_mapt &dest, @@ -916,18 +799,6 @@ void value_set_fivrt::get_value_set_rec( insert_from(dest, exprt(ID_unknown, original_type)); } -/*******************************************************************\ - -Function: value_set_fivrt::dereference_rec - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void value_set_fivrt::dereference_rec( const exprt &src, exprt &dest) const @@ -946,18 +817,6 @@ void value_set_fivrt::dereference_rec( dest=src; } -/*******************************************************************\ - -Function: value_set_fivrt::get_reference_set - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void value_set_fivrt::get_reference_set( const exprt &expr, expr_sett &dest, @@ -1007,18 +866,6 @@ void value_set_fivrt::get_reference_set( } } -/*******************************************************************\ - -Function: value_set_fivrt::get_reference_set_sharing - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void value_set_fivrt::get_reference_set_sharing( const exprt &expr, expr_sett &dest, @@ -1031,18 +878,6 @@ void value_set_fivrt::get_reference_set_sharing( dest.insert(to_expr(it)); } -/*******************************************************************\ - -Function: value_set_fivrt::get_reference_set_sharing_rec - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void value_set_fivrt::get_reference_set_sharing_rec( const exprt &expr, object_mapt &dest, @@ -1243,18 +1078,6 @@ void value_set_fivrt::get_reference_set_sharing_rec( insert_from(dest, exprt(ID_unknown, expr.type())); } -/*******************************************************************\ - -Function: value_set_fivrt::assign - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void value_set_fivrt::assign( const exprt &lhs, const exprt &rhs, @@ -1414,18 +1237,6 @@ void value_set_fivrt::assign( } } -/*******************************************************************\ - -Function: value_set_fivrt::do_free - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void value_set_fivrt::do_free( const exprt &op, const namespacet &ns) @@ -1507,18 +1318,6 @@ void value_set_fivrt::do_free( } } -/*******************************************************************\ - -Function: value_set_fivrt::assign_rec - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void value_set_fivrt::assign_rec( const exprt &lhs, const object_mapt &values_rhs, @@ -1693,18 +1492,6 @@ void value_set_fivrt::assign_rec( throw "assign NYI: `"+lhs.id_string()+"'"; } -/*******************************************************************\ - -Function: value_set_fivrt::do_function_call - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void value_set_fivrt::do_function_call( const irep_idt &function, const exprt::operandst &arguments, @@ -1772,18 +1559,6 @@ void value_set_fivrt::do_function_call( } } -/*******************************************************************\ - -Function: value_set_fivrt::do_end_function - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void value_set_fivrt::do_end_function( const exprt &lhs, const namespacet &ns) @@ -1797,18 +1572,6 @@ void value_set_fivrt::do_end_function( assign(lhs, rhs, ns); } -/*******************************************************************\ - -Function: value_set_fivrt::apply_code - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void value_set_fivrt::apply_code( const exprt &code, const namespacet &ns) @@ -1905,18 +1668,6 @@ void value_set_fivrt::apply_code( "value_set_fivrt: unexpected statement: "+id2string(statement); } -/*******************************************************************\ - -Function: value_set_fivrt::insert_to - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool value_set_fivrt::insert_to( object_mapt &dest, unsigned n, @@ -1958,18 +1709,6 @@ bool value_set_fivrt::insert_to( } } -/*******************************************************************\ - -Function: value_set_fivrt::insert_from - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool value_set_fivrt::insert_from( object_mapt &dest, unsigned n, @@ -2011,18 +1750,6 @@ bool value_set_fivrt::insert_from( } } -/*******************************************************************\ - -Function: value_set_fivrt::object_map_dt::set_valid_at - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool value_set_fivrt::object_map_dt::set_valid_at( unsigned inx, const validity_ranget &vr) @@ -2036,18 +1763,6 @@ bool value_set_fivrt::object_map_dt::set_valid_at( return res; } -/*******************************************************************\ - -Function: value_set_fivrt::object_map_dt::set_valid_at - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool value_set_fivrt::object_map_dt::set_valid_at( unsigned inx, unsigned f, @@ -2119,18 +1834,6 @@ bool value_set_fivrt::object_map_dt::set_valid_at( return true; } -/*******************************************************************\ - -Function: value_set_fivrt::object_map_dt::is_valid_at - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool value_set_fivrt::object_map_dt::is_valid_at( unsigned inx, unsigned f, @@ -2161,18 +1864,6 @@ bool value_set_fivrt::object_map_dt::is_valid_at( return false; } -/*******************************************************************\ - -Function: value_set_fivrt::recursive_find - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool value_set_fivrt::recursive_find( const irep_idt &ident, const object_mapt &rhs, @@ -2212,18 +1903,6 @@ bool value_set_fivrt::recursive_find( return false; } -/*******************************************************************\ - -Function: value_set_fivrt::handover - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool value_set_fivrt::handover(void) { bool changed=false; diff --git a/src/pointer-analysis/value_set_fivr.h b/src/pointer-analysis/value_set_fivr.h index e12563252ae..92c5ab45b37 100644 --- a/src/pointer-analysis/value_set_fivr.h +++ b/src/pointer-analysis/value_set_fivr.h @@ -7,6 +7,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Value Set (Flow Insensitive, Sharing, Validity Regions) + #ifndef CPROVER_POINTER_ANALYSIS_VALUE_SET_FIVR_H #define CPROVER_POINTER_ANALYSIS_VALUE_SET_FIVR_H diff --git a/src/pointer-analysis/value_set_fivrns.cpp b/src/pointer-analysis/value_set_fivrns.cpp index c94afc8f95d..d3c81c945b5 100644 --- a/src/pointer-analysis/value_set_fivrns.cpp +++ b/src/pointer-analysis/value_set_fivrns.cpp @@ -7,6 +7,9 @@ Author: Daniel Kroening, kroening@kroening.com, \*******************************************************************/ +/// \file +/// Value Set (Flow Insensitive, Validity Regions) + #include #include @@ -51,18 +54,6 @@ static const char *alloc_adapter_prefix="alloc_adaptor::"; (it)++) \ if((map).is_valid_at((it)->first, from_function, from_target_index)) /* NOLINT(*) */ -/*******************************************************************\ - -Function: value_set_fivrnst::output - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void value_set_fivrnst::output( const namespacet &ns, std::ostream &out) const @@ -74,18 +65,6 @@ void value_set_fivrnst::output( output_entry(v_it->second, ns, out); } -/*******************************************************************\ - -Function: value_set_fivrnst::output_entry - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void value_set_fivrnst::output_entry( const entryt &e, const namespacet &ns, @@ -220,18 +199,6 @@ void value_set_fivrnst::output_entry( out << " } \n"; } -/*******************************************************************\ - -Function: value_set_fivrnst::to_expr - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - exprt value_set_fivrnst::to_expr(object_map_dt::const_iterator it) const { const exprt &object=object_numbering[it->first]; @@ -252,18 +219,6 @@ exprt value_set_fivrnst::to_expr(object_map_dt::const_iterator it) const return od; } -/*******************************************************************\ - -Function: value_set_fivrnst::make_union - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool value_set_fivrnst::make_union( object_mapt &dest, const object_mapt &src) const @@ -279,18 +234,6 @@ bool value_set_fivrnst::make_union( return result; } -/*******************************************************************\ - -Function: value_set_fivrnst::make_valid_union - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool value_set_fivrnst::make_valid_union( object_mapt &dest, const object_mapt &src) const @@ -306,18 +249,6 @@ bool value_set_fivrnst::make_valid_union( return result; } -/*******************************************************************\ - -Function: value_set_fivrnst::copy_objects - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void value_set_fivrnst::copy_objects( object_mapt &dest, const object_mapt &src) const @@ -332,18 +263,6 @@ void value_set_fivrnst::copy_objects( } } -/*******************************************************************\ - -Function: value_set_fivrnst::get_value_set - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void value_set_fivrnst::get_value_set( const exprt &expr, std::list &value_set, @@ -362,18 +281,6 @@ void value_set_fivrnst::get_value_set( #endif } -/*******************************************************************\ - -Function: value_set_fivrnst::get_value_set - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void value_set_fivrnst::get_value_set( const exprt &expr, object_mapt &dest, @@ -385,18 +292,6 @@ void value_set_fivrnst::get_value_set( get_value_set_rec(tmp, dest, "", tmp.type(), ns); } -/*******************************************************************\ - -Function: value_set_fivrnst::get_value_set_rec - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void value_set_fivrnst::get_value_set_rec( const exprt &expr, object_mapt &dest, @@ -690,18 +585,6 @@ void value_set_fivrnst::get_value_set_rec( insert_from(dest, exprt(ID_unknown, original_type)); } -/*******************************************************************\ - -Function: value_set_fivrnst::dereference_rec - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void value_set_fivrnst::dereference_rec( const exprt &src, exprt &dest) const @@ -720,18 +603,6 @@ void value_set_fivrnst::dereference_rec( dest=src; } -/*******************************************************************\ - -Function: value_set_fivrnst::get_reference_set - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void value_set_fivrnst::get_reference_set( const exprt &expr, expr_sett &dest, @@ -744,18 +615,6 @@ void value_set_fivrnst::get_reference_set( dest.insert(to_expr(it)); } -/*******************************************************************\ - -Function: value_set_fivrnst::get_reference_set_rec - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void value_set_fivrnst::get_reference_set_rec( const exprt &expr, object_mapt &dest, @@ -906,18 +765,6 @@ void value_set_fivrnst::get_reference_set_rec( insert_from(dest, exprt(ID_unknown, expr.type())); } -/*******************************************************************\ - -Function: value_set_fivrnst::assign - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void value_set_fivrnst::assign( const exprt &lhs, const exprt &rhs, @@ -1076,18 +923,6 @@ void value_set_fivrnst::assign( } } -/*******************************************************************\ - -Function: value_set_fivrnst::do_free - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void value_set_fivrnst::do_free( const exprt &op, const namespacet &ns) @@ -1166,18 +1001,6 @@ void value_set_fivrnst::do_free( } } -/*******************************************************************\ - -Function: value_set_fivrnst::assign_rec - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void value_set_fivrnst::assign_rec( const exprt &lhs, const object_mapt &values_rhs, @@ -1320,18 +1143,6 @@ void value_set_fivrnst::assign_rec( throw "assign NYI: `"+lhs.id_string()+"'"; } -/*******************************************************************\ - -Function: value_set_fivrnst::do_function_call - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void value_set_fivrnst::do_function_call( const irep_idt &function, const exprt::operandst &arguments, @@ -1399,18 +1210,6 @@ void value_set_fivrnst::do_function_call( } } -/*******************************************************************\ - -Function: value_set_fivrnst::do_end_function - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void value_set_fivrnst::do_end_function( const exprt &lhs, const namespacet &ns) @@ -1426,18 +1225,6 @@ void value_set_fivrnst::do_end_function( assign(lhs, rhs, ns); } -/*******************************************************************\ - -Function: value_set_fivrnst::apply_code - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void value_set_fivrnst::apply_code( const exprt &code, const namespacet &ns) @@ -1537,18 +1324,6 @@ void value_set_fivrnst::apply_code( } } -/*******************************************************************\ - -Function: value_set_fivrnst::insert - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool value_set_fivrnst::insert_to( object_mapt &dest, unsigned n, @@ -1590,18 +1365,6 @@ bool value_set_fivrnst::insert_to( } } -/*******************************************************************\ - -Function: value_set_fivrnst::insert - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool value_set_fivrnst::insert_from( object_mapt &dest, unsigned n, @@ -1643,18 +1406,6 @@ bool value_set_fivrnst::insert_from( } } -/*******************************************************************\ - -Function: value_set_fivrnst::object_map_dt::set_valid_at - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool value_set_fivrnst::object_map_dt::set_valid_at( unsigned inx, unsigned f, @@ -1726,18 +1477,6 @@ bool value_set_fivrnst::object_map_dt::set_valid_at( return true; } -/*******************************************************************\ - -Function: value_set_fivrnst::object_map_dt::is_valid_at - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool value_set_fivrnst::object_map_dt::is_valid_at( unsigned inx, unsigned f, @@ -1769,18 +1508,6 @@ bool value_set_fivrnst::object_map_dt::is_valid_at( return false; } -/*******************************************************************\ - -Function: value_set_fivrnst::handover - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool value_set_fivrnst::handover(void) { bool changed=false; diff --git a/src/pointer-analysis/value_set_fivrns.h b/src/pointer-analysis/value_set_fivrns.h index f3afc204ef2..5ce1d4464c6 100644 --- a/src/pointer-analysis/value_set_fivrns.h +++ b/src/pointer-analysis/value_set_fivrns.h @@ -7,6 +7,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Value Set (Flow Insensitive, Validity Regions) + #ifndef CPROVER_POINTER_ANALYSIS_VALUE_SET_FIVRNS_H #define CPROVER_POINTER_ANALYSIS_VALUE_SET_FIVRNS_H diff --git a/src/pointer-analysis/value_sets.h b/src/pointer-analysis/value_sets.h index 5e39997b7e1..e230f72ebe7 100644 --- a/src/pointer-analysis/value_sets.h +++ b/src/pointer-analysis/value_sets.h @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Value Set Propagation + #ifndef CPROVER_POINTER_ANALYSIS_VALUE_SETS_H #define CPROVER_POINTER_ANALYSIS_VALUE_SETS_H diff --git a/src/solvers/cvc/cvc_conv.cpp b/src/solvers/cvc/cvc_conv.cpp index 55c1815b182..66d7fd66088 100644 --- a/src/solvers/cvc/cvc_conv.cpp +++ b/src/solvers/cvc/cvc_conv.cpp @@ -22,18 +22,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "cvc_conv.h" -/*******************************************************************\ - -Function: cvc_convt::print_assignment - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void cvc_convt::print_assignment(std::ostream &out) const { // Boolean stuff @@ -44,18 +32,6 @@ void cvc_convt::print_assignment(std::ostream &out) const // others } -/*******************************************************************\ - -Function: cvc_convt::l_get - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - tvt cvc_convt::l_get(literalt l) const { if(l.is_true()) @@ -66,18 +42,6 @@ tvt cvc_convt::l_get(literalt l) const return tvt(boolean_assignment[l.var_no()]^l.sign()); } -/*******************************************************************\ - -Function: cvc_convt::convert_binary_expr - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void cvc_convt::convert_binary_expr(const exprt &expr, const exprt &op) { unsigned to_width= @@ -159,18 +123,6 @@ void cvc_convt::convert_binary_expr(const exprt &expr, const exprt &op) } } -/*******************************************************************\ - -Function: cvc_convt::convert_constant_expr - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void cvc_convt::convert_constant_expr(const exprt &expr) { if(expr.type().id()==ID_unsignedbv || @@ -255,18 +207,6 @@ void cvc_convt::convert_constant_expr(const exprt &expr) throw "unknown constant: "+expr.type().id_string(); } -/*******************************************************************\ - -Function: cvc_convt::convert_plus_expr - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void cvc_convt::convert_plus_expr(const exprt &expr) { if(expr.operands().size()>=2) @@ -323,18 +263,6 @@ void cvc_convt::convert_plus_expr(const exprt &expr) assert(false); } -/*******************************************************************\ - -Function: cvc_convt::convert_typecast_expr - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void cvc_convt::convert_typecast_expr(const exprt &expr) { assert(expr.operands().size()==1); @@ -373,18 +301,6 @@ void cvc_convt::convert_typecast_expr(const exprt &expr) throw "todo typecast4 ? -> "+expr.type().id_string(); } -/*******************************************************************\ - -Function: cvc_convt::convert_struct_expr - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void cvc_convt::convert_struct_expr(const exprt &expr) { out << "(# "; @@ -411,18 +327,6 @@ void cvc_convt::convert_struct_expr(const exprt &expr) out << " #)"; } -/*******************************************************************\ - -Function: cvc_convt::convert_equality_expr - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void cvc_convt::convert_equality_expr(const exprt &expr) { assert(expr.operands().size()==2); @@ -453,18 +357,6 @@ void cvc_convt::convert_equality_expr(const exprt &expr) } } -/*******************************************************************\ - -Function: cvc_convt::convert_comparison_expr - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void cvc_convt::convert_comparison_expr(const exprt &expr) { assert(expr.operands().size()==2); @@ -512,18 +404,6 @@ void cvc_convt::convert_comparison_expr(const exprt &expr) } } -/*******************************************************************\ - -Function: cvc_convt::convert_minus_expr - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void cvc_convt::convert_minus_expr(const exprt &expr) { if(expr.operands().size()==2) @@ -548,18 +428,6 @@ void cvc_convt::convert_minus_expr(const exprt &expr) assert(false); } -/*******************************************************************\ - -Function: cvc_convt::convert_with_expr - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void cvc_convt::convert_with_expr(const exprt &expr) { assert(expr.operands().size()>=1); @@ -603,18 +471,6 @@ void cvc_convt::convert_with_expr(const exprt &expr) } } -/*******************************************************************\ - -Function: cvc_convt::convert_literal - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void cvc_convt::convert_literal(const literalt l) { if(l==const_literal(false)) @@ -631,18 +487,6 @@ void cvc_convt::convert_literal(const literalt l) out << ")"; } -/*******************************************************************\ - -Function: cvc_convt::bin_zero - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string cvc_convt::bin_zero(unsigned bits) { assert(bits!=0); @@ -655,18 +499,6 @@ std::string cvc_convt::bin_zero(unsigned bits) return result; } -/*******************************************************************\ - -Function: cvc_convt::cvc_pointer_type - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string cvc_convt::cvc_pointer_type() { assert(config.ansi_c.pointer_width!=0); @@ -674,36 +506,12 @@ std::string cvc_convt::cvc_pointer_type() std::to_string(config.ansi_c.pointer_width)+") #]"; } -/*******************************************************************\ - -Function: cvc_convt::array_index_type - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string cvc_convt::array_index_type() { return std::string("BITVECTOR(")+ std::to_string(32)+")"; } -/*******************************************************************\ - -Function: cvc_convt::gen_array_index_type - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - typet cvc_convt::gen_array_index_type() { typet t(ID_signedbv); @@ -711,35 +519,11 @@ typet cvc_convt::gen_array_index_type() return t; } -/*******************************************************************\ - -Function: cvc_convt::array_index - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string cvc_convt::array_index(unsigned i) { return "0bin"+integer2binary(i, config.ansi_c.int_width); } -/*******************************************************************\ - -Function: cvc_convt::convert_array_index - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void cvc_convt::convert_array_index(const exprt &expr) { if(expr.type()==gen_array_index_type()) @@ -754,18 +538,6 @@ void cvc_convt::convert_array_index(const exprt &expr) } } -/*******************************************************************\ - -Function: cvc_convt::convert_address_of_rec - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void cvc_convt::convert_address_of_rec(const exprt &expr) { if(expr.id()==ID_symbol || @@ -851,18 +623,6 @@ void cvc_convt::convert_address_of_rec(const exprt &expr) throw "don't know how to take address of: "+expr.id_string(); } -/*******************************************************************\ - -Function: cvc_convt::convert - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - literalt cvc_convt::convert(const exprt &expr) { if(expr.type().id()!=ID_bool) @@ -900,18 +660,6 @@ literalt cvc_convt::convert(const exprt &expr) return l; } -/*******************************************************************\ - -Function: cvc_convt::convert_identifier - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void cvc_convt::convert_identifier(const std::string &identifier) { for(std::string::const_iterator @@ -948,18 +696,6 @@ void cvc_convt::convert_identifier(const std::string &identifier) } } -/*******************************************************************\ - -Function: cvc_convt::convert_as_bv - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void cvc_convt::convert_as_bv(const exprt &expr) { if(expr.type().id()==ID_bool) @@ -979,35 +715,11 @@ void cvc_convt::convert_as_bv(const exprt &expr) convert_expr(expr); } -/*******************************************************************\ - -Function: cvc_convt::convert_array_value - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void cvc_convt::convert_array_value(const exprt &expr) { convert_as_bv(expr); } -/*******************************************************************\ - -Function: cvc_convt::convert_expr - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void cvc_convt::convert_expr(const exprt &expr) { const exprt::operandst &op=expr.operands(); @@ -1446,18 +1158,6 @@ void cvc_convt::convert_expr(const exprt &expr) throw "convert_expr: "+expr.id_string()+" is unsupported"; } -/*******************************************************************\ - -Function: cvc_convt::set_to - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void cvc_convt::set_to(const exprt &expr, bool value) { if(value && expr.id()==ID_and) @@ -1519,18 +1219,6 @@ void cvc_convt::set_to(const exprt &expr, bool value) out << ";" << std::endl << std::endl; } -/*******************************************************************\ - -Function: cvc_convt::find_symbols - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void cvc_convt::find_symbols(const exprt &expr) { find_symbols(expr.type()); @@ -1578,18 +1266,6 @@ void cvc_convt::find_symbols(const exprt &expr) } } -/*******************************************************************\ - -Function: cvc_convt::convert_type - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void cvc_convt::convert_type(const typet &type) { if(type.id()==ID_array) @@ -1662,18 +1338,6 @@ void cvc_convt::convert_type(const typet &type) throw "unsupported type: "+type.id_string(); } -/*******************************************************************\ - -Function: cvc_convt::find_symbols - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void cvc_convt::find_symbols(const typet &type) { if(type.id()==ID_array) diff --git a/src/solvers/cvc/cvc_dec.cpp b/src/solvers/cvc/cvc_dec.cpp index a30fdb2e614..86ee88b5c13 100644 --- a/src/solvers/cvc/cvc_dec.cpp +++ b/src/solvers/cvc/cvc_dec.cpp @@ -29,18 +29,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "cvc_dec.h" -/*******************************************************************\ - -Function: cvc_temp_filet::cvc_temp_filet - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - cvc_temp_filet::cvc_temp_filet() { temp_out_filename="cvc_dec_out_"+std::to_string(getpid())+".tmp"; @@ -50,18 +38,6 @@ cvc_temp_filet::cvc_temp_filet() std::ios_base::out | std::ios_base::trunc); } -/*******************************************************************\ - -Function: cvc_temp_filet::~cvc_temp_filet - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - cvc_temp_filet::~cvc_temp_filet() { temp_out.close(); @@ -73,18 +49,6 @@ cvc_temp_filet::~cvc_temp_filet() unlink(temp_result_filename.c_str()); } -/*******************************************************************\ - -Function: cvc_dect::dec_solve - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - decision_proceduret::resultt cvc_dect::dec_solve() { out << "QUERY FALSE;" << std::endl; @@ -106,18 +70,6 @@ decision_proceduret::resultt cvc_dect::dec_solve() return read_cvcl_result(); } -/*******************************************************************\ - -Function: cvc_dect::read_assert - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void cvc_dect::read_assert(std::istream &in, std::string &line) { // strip ASSERT @@ -178,18 +130,6 @@ void cvc_dect::read_assert(std::istream &in, std::string &line) } } -/*******************************************************************\ - -Function: cvc_dect::read_cvcl_result - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - decision_proceduret::resultt cvc_dect::read_cvcl_result() { std::ifstream in(temp_result_filename.c_str()); diff --git a/src/solvers/cvc/cvc_prop.cpp b/src/solvers/cvc/cvc_prop.cpp index 27c499620ea..44ebd6b2137 100644 --- a/src/solvers/cvc/cvc_prop.cpp +++ b/src/solvers/cvc/cvc_prop.cpp @@ -12,51 +12,15 @@ Author: Daniel Kroening, kroening@kroening.com #include "cvc_prop.h" -/*******************************************************************\ - -Function: cvc_propt::cvc_propt - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - explicit cvc_propt::cvc_propt(std::ostream &_out):out(_out) { _no_variables=0; } -/*******************************************************************\ - -Function: cvc_propt::~cvc_propt - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - cvc_propt::~cvc_propt() { } -/*******************************************************************\ - -Function: cvc_propt::land - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void cvc_propt::land(literalt a, literalt b, literalt o) { out << "%% land" << std::endl; @@ -65,18 +29,6 @@ void cvc_propt::land(literalt a, literalt b, literalt o) << ";" << std::endl << std::endl; } -/*******************************************************************\ - -Function: cvc_propt::lor - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void cvc_propt::lor(literalt a, literalt b, literalt o) { out << "%% lor" << std::endl; @@ -85,18 +37,6 @@ void cvc_propt::lor(literalt a, literalt b, literalt o) << ";" << std::endl << std::endl; } -/*******************************************************************\ - -Function: cvc_propt::lxor - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void cvc_propt::lxor(literalt a, literalt b, literalt o) { out << "%% lxor" << std::endl; @@ -105,18 +45,6 @@ void cvc_propt::lxor(literalt a, literalt b, literalt o) << ";" << std::endl << std::endl; } -/*******************************************************************\ - -Function: cvc_propt::lnand - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void cvc_propt::lnand(literalt a, literalt b, literalt o) { out << "%% lnand" << std::endl; @@ -125,18 +53,6 @@ void cvc_propt::lnand(literalt a, literalt b, literalt o) << ";" << std::endl << std::endl; } -/*******************************************************************\ - -Function: cvc_propt::lnor - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void cvc_propt::lnor(literalt a, literalt b, literalt o) { out << "%% lnor" << std::endl; @@ -145,18 +61,6 @@ void cvc_propt::lnor(literalt a, literalt b, literalt o) << ";" << std::endl << std::endl; } -/*******************************************************************\ - -Function: cvc_propt::lequal - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void cvc_propt::lequal(literalt a, literalt b, literalt o) { out << "%% lequal" << std::endl; @@ -165,18 +69,6 @@ void cvc_propt::lequal(literalt a, literalt b, literalt o) << ";" << std::endl << std::endl; } -/*******************************************************************\ - -Function: cvc_propt::limplies - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void cvc_propt::limplies(literalt a, literalt b, literalt o) { out << "%% limplies" << std::endl; @@ -185,18 +77,6 @@ void cvc_propt::limplies(literalt a, literalt b, literalt o) << ";" << std::endl << std::endl; } -/*******************************************************************\ - -Function: cvc_propt::land - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - literalt cvc_propt::land(const bvt &bv) { out << "%% land" << std::endl; @@ -215,18 +95,6 @@ literalt cvc_propt::land(const bvt &bv) return literal; } -/*******************************************************************\ - -Function: cvc_propt::lor - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - literalt cvc_propt::lor(const bvt &bv) { out << "%% lor" << std::endl; @@ -245,18 +113,6 @@ literalt cvc_propt::lor(const bvt &bv) return literal; } -/*******************************************************************\ - -Function: cvc_propt::lxor - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - literalt cvc_propt::lxor(const bvt &bv) { if(bv.empty()) @@ -274,18 +130,6 @@ literalt cvc_propt::lxor(const bvt &bv) return literal; } -/*******************************************************************\ - -Function: cvc_propt::land - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - literalt cvc_propt::land(literalt a, literalt b) { if(a==const_literal(true)) @@ -309,18 +153,6 @@ literalt cvc_propt::land(literalt a, literalt b) return o; } -/*******************************************************************\ - -Function: cvc_propt::lor - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - literalt cvc_propt::lor(literalt a, literalt b) { if(a==const_literal(false)) @@ -344,18 +176,6 @@ literalt cvc_propt::lor(literalt a, literalt b) return o; } -/*******************************************************************\ - -Function: cvc_propt::lxor - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - literalt cvc_propt::lxor(literalt a, literalt b) { if(a==const_literal(false)) @@ -377,86 +197,26 @@ literalt cvc_propt::lxor(literalt a, literalt b) return o; } -/*******************************************************************\ - -Function: cvc_propt::lnand - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - literalt cvc_propt::lnand(literalt a, literalt b) { return !land(a, b); } -/*******************************************************************\ - -Function: cvc_propt::lnor - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - literalt cvc_propt::lnor(literalt a, literalt b) { return !lor(a, b); } -/*******************************************************************\ - -Function: cvc_propt::lequal - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - literalt cvc_propt::lequal(literalt a, literalt b) { return !lxor(a, b); } -/*******************************************************************\ - -Function: cvc_propt::limplies - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - literalt cvc_propt::limplies(literalt a, literalt b) { return lor(!a, b); } -/*******************************************************************\ - -Function: cvc_propt::lselect - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - literalt cvc_propt::lselect(literalt a, literalt b, literalt c) { if(a==const_literal(true)) @@ -478,18 +238,6 @@ literalt cvc_propt::lselect(literalt a, literalt b, literalt c) return o; } -/*******************************************************************\ - -Function: cvc_propt::new_variable - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - literalt cvc_propt::new_variable() { out << "l" << _no_variables << ": BOOLEAN;" << std::endl; @@ -499,18 +247,6 @@ literalt cvc_propt::new_variable() return l; } -/*******************************************************************\ - -Function: cvc_propt::def_cvc_literal - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - literalt cvc_propt::def_cvc_literal() { out << "l" << _no_variables << ": BOOLEAN = "; @@ -520,18 +256,6 @@ literalt cvc_propt::def_cvc_literal() return l; } -/*******************************************************************\ - -Function: cvc_propt::lcnf - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void cvc_propt::lcnf(const bvt &bv) { if(bv.empty()) @@ -568,18 +292,6 @@ void cvc_propt::lcnf(const bvt &bv) out << ";" << std::endl << std::endl; } -/*******************************************************************\ - -Function: cvc_propt::cvc_literal - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string cvc_propt::cvc_literal(literalt l) { if(l==const_literal(false)) @@ -593,18 +305,6 @@ std::string cvc_propt::cvc_literal(literalt l) return "l"+std::to_string(l.var_no()); } -/*******************************************************************\ - -Function: cvc_propt::prop_solve - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - propt::resultt cvc_propt::prop_solve() { out << "QUERY FALSE;" << std::endl; diff --git a/src/solvers/dplib/dplib_conv.cpp b/src/solvers/dplib/dplib_conv.cpp index d9d7eefbb11..8fa0a6c0305 100644 --- a/src/solvers/dplib/dplib_conv.cpp +++ b/src/solvers/dplib/dplib_conv.cpp @@ -21,18 +21,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "dplib_conv.h" -/*******************************************************************\ - -Function: dplib_convt::bin_zero - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string dplib_convt::bin_zero(unsigned bits) { assert(bits!=0); @@ -41,18 +29,6 @@ std::string dplib_convt::bin_zero(unsigned bits) return result; } -/*******************************************************************\ - -Function: dplib_convt::dplib_pointer_type - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string dplib_convt::dplib_pointer_type() { assert(config.ansi_c.pointer_width!=0); @@ -60,35 +36,11 @@ std::string dplib_convt::dplib_pointer_type() std::to_string(config.ansi_c.pointer_width)+") #]"; } -/*******************************************************************\ - -Function: dplib_convt::array_index_type - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string dplib_convt::array_index_type() { return std::string("SIGNED [")+std::to_string(32)+"]"; } -/*******************************************************************\ - -Function: dplib_convt::gen_array_index_type - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - typet dplib_convt::gen_array_index_type() { typet t(ID_signedbv); @@ -96,35 +48,11 @@ typet dplib_convt::gen_array_index_type() return t; } -/*******************************************************************\ - -Function: dplib_convt::array_index - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string dplib_convt::array_index(unsigned i) { return "0bin"+integer2binary(i, config.ansi_c.int_width); } -/*******************************************************************\ - -Function: dplib_convt::convert_array_index - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void dplib_convt::convert_array_index(const exprt &expr) { if(expr.type()==gen_array_index_type()) @@ -139,18 +67,6 @@ void dplib_convt::convert_array_index(const exprt &expr) } } -/*******************************************************************\ - -Function: dplib_convt::convert_address_of_rec - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void dplib_convt::convert_address_of_rec(const exprt &expr) { if(expr.id()==ID_symbol || @@ -234,18 +150,6 @@ void dplib_convt::convert_address_of_rec(const exprt &expr) throw "don't know how to take address of: "+expr.id_string(); } -/*******************************************************************\ - -Function: dplib_convt::convert_rest - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - literalt dplib_convt::convert_rest(const exprt &expr) { // dplib_prop.out << "%% E: " << expr << std::endl; @@ -268,18 +172,6 @@ literalt dplib_convt::convert_rest(const exprt &expr) return l; } -/*******************************************************************\ - -Function: dplib_convt::convert_identifier - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void dplib_convt::convert_identifier(const std::string &identifier) { for(std::string::const_iterator @@ -316,18 +208,6 @@ void dplib_convt::convert_identifier(const std::string &identifier) } } -/*******************************************************************\ - -Function: dplib_convt::convert_as_bv - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void dplib_convt::convert_as_bv(const exprt &expr) { if(expr.type().id()==ID_bool) @@ -340,35 +220,11 @@ void dplib_convt::convert_as_bv(const exprt &expr) convert_dplib_expr(expr); } -/*******************************************************************\ - -Function: dplib_convt::convert_array_value - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void dplib_convt::convert_array_value(const exprt &expr) { convert_as_bv(expr); } -/*******************************************************************\ - -Function: dplib_convt::convert_dplib_expr - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void dplib_convt::convert_dplib_expr(const exprt &expr) { if(expr.id()==ID_symbol) @@ -1105,18 +961,6 @@ void dplib_convt::convert_dplib_expr(const exprt &expr) throw "convert_dplib_expr: "+expr.id_string()+" is unsupported"; } -/*******************************************************************\ - -Function: dplib_convt::set_to - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void dplib_convt::set_to(const exprt &expr, bool value) { if(value && expr.id()==ID_and) @@ -1181,18 +1025,6 @@ void dplib_convt::set_to(const exprt &expr, bool value) dplib_prop.out << ";" << std::endl << std::endl; } -/*******************************************************************\ - -Function: dplib_convt::find_symbols - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void dplib_convt::find_symbols(const exprt &expr) { find_symbols(expr.type()); @@ -1240,18 +1072,6 @@ void dplib_convt::find_symbols(const exprt &expr) } } -/*******************************************************************\ - -Function: dplib_convt::convert_dplib_type - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void dplib_convt::convert_dplib_type(const typet &type) { if(type.id()==ID_array) @@ -1335,18 +1155,6 @@ void dplib_convt::convert_dplib_type(const typet &type) throw "unsupported type: "+type.id_string(); } -/*******************************************************************\ - -Function: dplib_convt::find_symbols - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void dplib_convt::find_symbols(const typet &type) { if(type.id()==ID_array) diff --git a/src/solvers/dplib/dplib_dec.cpp b/src/solvers/dplib/dplib_dec.cpp index 66369bdc1ff..fc101ded4ea 100644 --- a/src/solvers/dplib/dplib_dec.cpp +++ b/src/solvers/dplib/dplib_dec.cpp @@ -28,18 +28,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "dplib_dec.h" -/*******************************************************************\ - -Function: dplib_temp_filet::dplib_temp_filet - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - dplib_temp_filet::dplib_temp_filet() { temp_out_filename="dplib_dec_out_"+std::to_string(getpid())+".tmp"; @@ -49,18 +37,6 @@ dplib_temp_filet::dplib_temp_filet() std::ios_base::out | std::ios_base::trunc); } -/*******************************************************************\ - -Function: dplib_temp_filet::~dplib_temp_filet - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - dplib_temp_filet::~dplib_temp_filet() { temp_out.close(); @@ -72,18 +48,6 @@ dplib_temp_filet::~dplib_temp_filet() unlink(temp_result_filename.c_str()); } -/*******************************************************************\ - -Function: dplib_dect::dec_solve - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - decision_proceduret::resultt dplib_dect::dec_solve() { dplib_prop.out << "QUERY FALSE;" << std::endl; @@ -107,18 +71,6 @@ decision_proceduret::resultt dplib_dect::dec_solve() return read_dplib_result(); } -/*******************************************************************\ - -Function: dplib_dect::read_assert - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void dplib_dect::read_assert(std::istream &in, std::string &line) { // strip ASSERT @@ -178,18 +130,6 @@ void dplib_dect::read_assert(std::istream &in, std::string &line) } } -/*******************************************************************\ - -Function: dplib_dect::read_dplib_result - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - decision_proceduret::resultt dplib_dect::read_dplib_result() { std::ifstream in(temp_result_filename.c_str()); diff --git a/src/solvers/dplib/dplib_prop.cpp b/src/solvers/dplib/dplib_prop.cpp index 5153b6874de..751cfe48060 100644 --- a/src/solvers/dplib/dplib_prop.cpp +++ b/src/solvers/dplib/dplib_prop.cpp @@ -13,36 +13,12 @@ Author: Daniel Kroening, kroening@kroening.com #include "dplib_prop.h" -/*******************************************************************\ - -Function: dplib_propt::dplib_propt - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - dplib_propt::dplib_propt(std::ostream &_out):out(_out) { // we skip index 0 _no_variables=1; } -/*******************************************************************\ - -Function: dplib_propt::land - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void dplib_propt::land(literalt a, literalt b, literalt o) { out << "// land" << std::endl; @@ -51,18 +27,6 @@ void dplib_propt::land(literalt a, literalt b, literalt o) << ";" << std::endl << std::endl; } -/*******************************************************************\ - -Function: dplib_propt::lor - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void dplib_propt::lor(literalt a, literalt b, literalt o) { out << "// lor" << std::endl; @@ -71,18 +35,6 @@ void dplib_propt::lor(literalt a, literalt b, literalt o) << ";" << std::endl << std::endl; } -/*******************************************************************\ - -Function: dplib_propt::lxor - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void dplib_propt::lxor(literalt a, literalt b, literalt o) { out << "// lxor" << std::endl; @@ -91,18 +43,6 @@ void dplib_propt::lxor(literalt a, literalt b, literalt o) << ";" << std::endl << std::endl; } -/*******************************************************************\ - -Function: dplib_propt::lnand - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void dplib_propt::lnand(literalt a, literalt b, literalt o) { out << "// lnand" << std::endl; @@ -111,18 +51,6 @@ void dplib_propt::lnand(literalt a, literalt b, literalt o) << ";" << std::endl << std::endl; } -/*******************************************************************\ - -Function: dplib_propt::lnor - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void dplib_propt::lnor(literalt a, literalt b, literalt o) { out << "// lnor" << std::endl; @@ -131,18 +59,6 @@ void dplib_propt::lnor(literalt a, literalt b, literalt o) << ";" << std::endl << std::endl; } -/*******************************************************************\ - -Function: dplib_propt::lequal - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void dplib_propt::lequal(literalt a, literalt b, literalt o) { out << "// lequal" << std::endl; @@ -151,18 +67,6 @@ void dplib_propt::lequal(literalt a, literalt b, literalt o) << ";" << std::endl << std::endl; } -/*******************************************************************\ - -Function: dplib_propt::limplies - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void dplib_propt::limplies(literalt a, literalt b, literalt o) { out << "// limplies" << std::endl; @@ -171,18 +75,6 @@ void dplib_propt::limplies(literalt a, literalt b, literalt o) << ";" << std::endl << std::endl; } -/*******************************************************************\ - -Function: dplib_propt::land - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - literalt dplib_propt::land(const bvt &bv) { out << "// land" << std::endl; @@ -201,18 +93,6 @@ literalt dplib_propt::land(const bvt &bv) return literal; } -/*******************************************************************\ - -Function: dplib_propt::lor - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - literalt dplib_propt::lor(const bvt &bv) { out << "// lor" << std::endl; @@ -231,18 +111,6 @@ literalt dplib_propt::lor(const bvt &bv) return literal; } -/*******************************************************************\ - -Function: dplib_propt::lxor - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - literalt dplib_propt::lxor(const bvt &bv) { if(bv.empty()) @@ -260,18 +128,6 @@ literalt dplib_propt::lxor(const bvt &bv) return literal; } -/*******************************************************************\ - -Function: dplib_propt::land - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - literalt dplib_propt::land(literalt a, literalt b) { if(a==const_literal(true)) @@ -292,18 +148,6 @@ literalt dplib_propt::land(literalt a, literalt b) return o; } -/*******************************************************************\ - -Function: dplib_propt::lor - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - literalt dplib_propt::lor(literalt a, literalt b) { if(a==const_literal(false)) @@ -324,18 +168,6 @@ literalt dplib_propt::lor(literalt a, literalt b) return o; } -/*******************************************************************\ - -Function: dplib_propt::lxor - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - literalt dplib_propt::lxor(literalt a, literalt b) { if(a==const_literal(false)) @@ -354,86 +186,26 @@ literalt dplib_propt::lxor(literalt a, literalt b) return o; } -/*******************************************************************\ - -Function: dplib_propt::lnand - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - literalt dplib_propt::lnand(literalt a, literalt b) { return !land(a, b); } -/*******************************************************************\ - -Function: dplib_propt::lnor - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - literalt dplib_propt::lnor(literalt a, literalt b) { return !lor(a, b); } -/*******************************************************************\ - -Function: dplib_propt::lequal - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - literalt dplib_propt::lequal(literalt a, literalt b) { return !lxor(a, b); } -/*******************************************************************\ - -Function: dplib_propt::limplies - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - literalt dplib_propt::limplies(literalt a, literalt b) { return lor(!a, b); } -/*******************************************************************\ - -Function: dplib_propt::lselect - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - literalt dplib_propt::lselect(literalt a, literalt b, literalt c) { if(a==const_literal(true)) @@ -455,18 +227,6 @@ literalt dplib_propt::lselect(literalt a, literalt b, literalt c) return o; } -/*******************************************************************\ - -Function: dplib_propt::new_variable - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - literalt dplib_propt::new_variable() { _no_variables++; @@ -476,18 +236,6 @@ literalt dplib_propt::new_variable() return l; } -/*******************************************************************\ - -Function: dplib_propt::def_dplib_literal - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - literalt dplib_propt::def_dplib_literal() { _no_variables++; @@ -497,18 +245,6 @@ literalt dplib_propt::def_dplib_literal() return l; } -/*******************************************************************\ - -Function: dplib_propt::lcnf - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void dplib_propt::lcnf(const bvt &bv) { if(bv.empty()) @@ -545,18 +281,6 @@ void dplib_propt::lcnf(const bvt &bv) out << ";" << std::endl << std::endl; } -/*******************************************************************\ - -Function: dplib_propt::dplib_literal - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string dplib_propt::dplib_literal(literalt l) { if(l==const_literal(false)) @@ -570,36 +294,12 @@ std::string dplib_propt::dplib_literal(literalt l) return "l"+std::to_string(l.var_no()); } -/*******************************************************************\ - -Function: dplib_propt::finish - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void dplib_propt::finish() { // we want satisfiability out << "THEOREM false;" << std::endl; } -/*******************************************************************\ - -Function: dplib_propt::prop_solve - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - propt::resultt dplib_propt::prop_solve() { finish(); diff --git a/src/solvers/flattening/arrays.cpp b/src/solvers/flattening/arrays.cpp index 10c29c2ae76..92d7cee6ff3 100644 --- a/src/solvers/flattening/arrays.cpp +++ b/src/solvers/flattening/arrays.cpp @@ -21,18 +21,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "arrays.h" -/*******************************************************************\ - -Function: arrayst::arrayst - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - arrayst::arrayst( const namespacet &_ns, propt &_prop):equalityt(_ns, _prop) @@ -41,18 +29,6 @@ arrayst::arrayst( incremental_cache = false; // for incremental solving } -/*******************************************************************\ - -Function: arrayst::record_array_index - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void arrayst::record_array_index(const index_exprt &index) { // we are not allowed to put the index directly in the @@ -63,18 +39,6 @@ void arrayst::record_array_index(const index_exprt &index) update_indices.insert(number); } -/*******************************************************************\ - -Function: arrayst::record_array_equality - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - literalt arrayst::record_array_equality( const equal_exprt &equality) { @@ -103,18 +67,6 @@ literalt arrayst::record_array_equality( return array_equalities.back().l; } -/*******************************************************************\ - -Function: arrayst::collect_indices - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void arrayst::collect_indices() { for(std::size_t i=0; isecond; } -/*******************************************************************\ - -Function: boolbvt::conversion_failed - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bvt boolbvt::conversion_failed(const exprt &expr) { ignoring(expr); @@ -186,18 +150,6 @@ bvt boolbvt::conversion_failed(const exprt &expr) return prop.new_variables(width); } -/*******************************************************************\ - -Function: boolbvt::convert_bitvector - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bvt boolbvt::convert_bitvector(const exprt &expr) { if(expr.type().id()==ID_bool) @@ -354,18 +306,6 @@ bvt boolbvt::convert_bitvector(const exprt &expr) return conversion_failed(expr); } -/*******************************************************************\ - -Function: boolbvt::convert_lambda - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bvt boolbvt::convert_lambda(const exprt &expr) { std::size_t width=boolbv_width(expr.type()); @@ -413,18 +353,6 @@ bvt boolbvt::convert_lambda(const exprt &expr) return bv; } -/*******************************************************************\ - -Function: boolbvt::convert_bv_literals - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bvt boolbvt::convert_bv_literals(const exprt &expr) { std::size_t width=boolbv_width(expr.type()); @@ -446,18 +374,6 @@ bvt boolbvt::convert_bv_literals(const exprt &expr) return bv; } -/*******************************************************************\ - -Function: boolbvt::convert_symbol - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bvt boolbvt::convert_symbol(const exprt &expr) { const typet &type=expr.type(); @@ -493,18 +409,6 @@ bvt boolbvt::convert_symbol(const exprt &expr) } -/*******************************************************************\ - -Function: boolbvt::convert_function_application - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bvt boolbvt::convert_function_application( const function_application_exprt &expr) { @@ -516,18 +420,6 @@ bvt boolbvt::convert_function_application( } -/*******************************************************************\ - -Function: boolbvt::convert_rest - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - literalt boolbvt::convert_rest(const exprt &expr) { if(expr.type().id()!=ID_bool) @@ -694,18 +586,6 @@ literalt boolbvt::convert_rest(const exprt &expr) return SUB::convert_rest(expr); } -/*******************************************************************\ - -Function: boolbvt::boolbv_set_equality_to_true - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool boolbvt::boolbv_set_equality_to_true(const equal_exprt &expr) { if(!equality_propagation) @@ -737,18 +617,6 @@ bool boolbvt::boolbv_set_equality_to_true(const equal_exprt &expr) return true; } -/*******************************************************************\ - -Function: boolbvt::set_to - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void boolbvt::set_to(const exprt &expr, bool value) { if(expr.type().id()!=ID_bool) @@ -770,18 +638,6 @@ void boolbvt::set_to(const exprt &expr, bool value) return SUB::set_to(expr, value); } -/*******************************************************************\ - -Function: boolbvt::make_bv_expr - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void boolbvt::make_bv_expr(const typet &type, const bvt &bv, exprt &dest) { dest=exprt(ID_bv_literals, type); @@ -793,18 +649,6 @@ void boolbvt::make_bv_expr(const typet &type, const bvt &bv, exprt &dest) bv_sub[i].id(std::to_string(bv[i].get())); } -/*******************************************************************\ - -Function: boolbvt::make_bv_expr - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void boolbvt::make_free_bv_expr(const typet &type, exprt &dest) { std::size_t width=boolbv_width(type); @@ -825,18 +669,6 @@ void boolbvt::make_free_bv_expr(const typet &type, exprt &dest) make_bv_expr(type, bv, dest); } -/*******************************************************************\ - -Function: boolbvt::is_unbounded_array - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool boolbvt::is_unbounded_array(const typet &type) const { if(type.id()==ID_symbol) @@ -861,18 +693,6 @@ bool boolbvt::is_unbounded_array(const typet &type) const return false; } -/*******************************************************************\ - -Function: boolbvt::print_assignment - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void boolbvt::print_assignment(std::ostream &out) const { for(boolbv_mapt::mappingt::const_iterator it=map.mapping.begin(); @@ -884,18 +704,6 @@ void boolbvt::print_assignment(std::ostream &out) const } } -/*******************************************************************\ - -Function: boolbvt::build_offset_map - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void boolbvt::build_offset_map(const struct_typet &src, offset_mapt &dest) { const struct_typet::componentst &components= diff --git a/src/solvers/flattening/boolbv_abs.cpp b/src/solvers/flattening/boolbv_abs.cpp index 7c93353b45b..8ee988ec68b 100644 --- a/src/solvers/flattening/boolbv_abs.cpp +++ b/src/solvers/flattening/boolbv_abs.cpp @@ -13,18 +13,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "../floatbv/float_utils.h" -/*******************************************************************\ - -Function: boolbvt::convert_abs - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bvt boolbvt::convert_abs(const exprt &expr) { std::size_t width=boolbv_width(expr.type()); diff --git a/src/solvers/flattening/boolbv_add_sub.cpp b/src/solvers/flattening/boolbv_add_sub.cpp index 9bcb6281be6..b1ba7878aa4 100644 --- a/src/solvers/flattening/boolbv_add_sub.cpp +++ b/src/solvers/flattening/boolbv_add_sub.cpp @@ -14,18 +14,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "../floatbv/float_utils.h" -/*******************************************************************\ - -Function: boolbvt::convert_add_sub - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bvt boolbvt::convert_add_sub(const exprt &expr) { const typet &type=ns.follow(expr.type()); diff --git a/src/solvers/flattening/boolbv_array.cpp b/src/solvers/flattening/boolbv_array.cpp index e6a44279684..b06a48fbba1 100644 --- a/src/solvers/flattening/boolbv_array.cpp +++ b/src/solvers/flattening/boolbv_array.cpp @@ -8,18 +8,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "boolbv.h" -/*******************************************************************\ - -Function: boolbvt::convert_array - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bvt boolbvt::convert_array(const exprt &expr) { std::size_t width=boolbv_width(expr.type()); diff --git a/src/solvers/flattening/boolbv_array_of.cpp b/src/solvers/flattening/boolbv_array_of.cpp index 74056d2df50..96618a81633 100644 --- a/src/solvers/flattening/boolbv_array_of.cpp +++ b/src/solvers/flattening/boolbv_array_of.cpp @@ -11,18 +11,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "boolbv.h" -/*******************************************************************\ - -Function: boolbvt::convert_array_of - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bvt boolbvt::convert_array_of(const array_of_exprt &expr) { if(expr.type().id()!=ID_array) diff --git a/src/solvers/flattening/boolbv_bitwise.cpp b/src/solvers/flattening/boolbv_bitwise.cpp index 52d48b19c77..9e97115d80e 100644 --- a/src/solvers/flattening/boolbv_bitwise.cpp +++ b/src/solvers/flattening/boolbv_bitwise.cpp @@ -8,18 +8,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "boolbv.h" -/*******************************************************************\ - -Function: boolbvt::convert_bitwise - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bvt boolbvt::convert_bitwise(const exprt &expr) { std::size_t width=boolbv_width(expr.type()); diff --git a/src/solvers/flattening/boolbv_bv_rel.cpp b/src/solvers/flattening/boolbv_bv_rel.cpp index 8b2984e2343..ab9a1df8b0c 100644 --- a/src/solvers/flattening/boolbv_bv_rel.cpp +++ b/src/solvers/flattening/boolbv_bv_rel.cpp @@ -13,18 +13,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "../floatbv/float_utils.h" -/*******************************************************************\ - -Function: boolbvt::convert_bv_rel - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - literalt boolbvt::convert_bv_rel(const exprt &expr) { const exprt::operandst &operands=expr.operands(); diff --git a/src/solvers/flattening/boolbv_byte_extract.cpp b/src/solvers/flattening/boolbv_byte_extract.cpp index 2dd32ba35f7..a19e77b9f04 100644 --- a/src/solvers/flattening/boolbv_byte_extract.cpp +++ b/src/solvers/flattening/boolbv_byte_extract.cpp @@ -16,18 +16,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "boolbv.h" #include "flatten_byte_operators.h" -/*******************************************************************\ - -Function: map_bv - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bvt map_bv(const endianness_mapt &map, const bvt &src) { assert(map.number_of_bits()==src.size()); @@ -45,18 +33,6 @@ bvt map_bv(const endianness_mapt &map, const bvt &src) return result; } -/*******************************************************************\ - -Function: boolbvt::convert_byte_extract - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bvt boolbvt::convert_byte_extract(const byte_extract_exprt &expr) { if(expr.operands().size()!=2) diff --git a/src/solvers/flattening/boolbv_byte_update.cpp b/src/solvers/flattening/boolbv_byte_update.cpp index 7ff0408a661..92ef6dd2a4c 100644 --- a/src/solvers/flattening/boolbv_byte_update.cpp +++ b/src/solvers/flattening/boolbv_byte_update.cpp @@ -15,18 +15,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "boolbv.h" -/*******************************************************************\ - -Function: boolbvt::convert_byte_update - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bvt boolbvt::convert_byte_update(const byte_update_exprt &expr) { if(expr.operands().size()!=3) diff --git a/src/solvers/flattening/boolbv_case.cpp b/src/solvers/flattening/boolbv_case.cpp index 6a56f35fa7f..849d982ee94 100644 --- a/src/solvers/flattening/boolbv_case.cpp +++ b/src/solvers/flattening/boolbv_case.cpp @@ -10,18 +10,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "boolbv.h" -/*******************************************************************\ - -Function: boolbvt::convert_case - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bvt boolbvt::convert_case(const exprt &expr) { const std::vector &operands=expr.operands(); diff --git a/src/solvers/flattening/boolbv_complex.cpp b/src/solvers/flattening/boolbv_complex.cpp index 3d5407537a2..592dc53c77f 100644 --- a/src/solvers/flattening/boolbv_complex.cpp +++ b/src/solvers/flattening/boolbv_complex.cpp @@ -8,18 +8,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "boolbv.h" -/*******************************************************************\ - -Function: boolbvt::convert_complex - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bvt boolbvt::convert_complex(const exprt &expr) { std::size_t width=boolbv_width(expr.type()); @@ -56,18 +44,6 @@ bvt boolbvt::convert_complex(const exprt &expr) return conversion_failed(expr); } -/*******************************************************************\ - -Function: boolbvt::convert_complex_real - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bvt boolbvt::convert_complex_real(const exprt &expr) { std::size_t width=boolbv_width(expr.type()); @@ -86,18 +62,6 @@ bvt boolbvt::convert_complex_real(const exprt &expr) return bv; } -/*******************************************************************\ - -Function: boolbvt::convert_complex_imag - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bvt boolbvt::convert_complex_imag(const exprt &expr) { std::size_t width=boolbv_width(expr.type()); diff --git a/src/solvers/flattening/boolbv_concatenation.cpp b/src/solvers/flattening/boolbv_concatenation.cpp index ef3896053fe..fae48e3a9cc 100644 --- a/src/solvers/flattening/boolbv_concatenation.cpp +++ b/src/solvers/flattening/boolbv_concatenation.cpp @@ -8,18 +8,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "boolbv.h" -/*******************************************************************\ - -Function: boolbvt::convert_concatenation - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bvt boolbvt::convert_concatenation(const exprt &expr) { std::size_t width=boolbv_width(expr.type()); diff --git a/src/solvers/flattening/boolbv_cond.cpp b/src/solvers/flattening/boolbv_cond.cpp index 4e966a69440..90c6a6133f3 100644 --- a/src/solvers/flattening/boolbv_cond.cpp +++ b/src/solvers/flattening/boolbv_cond.cpp @@ -10,18 +10,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "boolbv.h" -/*******************************************************************\ - -Function: boolbvt::convert_cond - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bvt boolbvt::convert_cond(const exprt &expr) { const exprt::operandst &operands=expr.operands(); diff --git a/src/solvers/flattening/boolbv_constant.cpp b/src/solvers/flattening/boolbv_constant.cpp index ebeb3a5a1db..e714651ead7 100644 --- a/src/solvers/flattening/boolbv_constant.cpp +++ b/src/solvers/flattening/boolbv_constant.cpp @@ -8,18 +8,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "boolbv.h" -/*******************************************************************\ - -Function: boolbvt::convert_constant - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bvt boolbvt::convert_constant(const constant_exprt &expr) { std::size_t width=boolbv_width(expr.type()); diff --git a/src/solvers/flattening/boolbv_constraint_select_one.cpp b/src/solvers/flattening/boolbv_constraint_select_one.cpp index c6c9b53bd50..cae2d16dfe6 100644 --- a/src/solvers/flattening/boolbv_constraint_select_one.cpp +++ b/src/solvers/flattening/boolbv_constraint_select_one.cpp @@ -8,18 +8,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "boolbv.h" -/*******************************************************************\ - -Function: boolbvt::convert_constraint_select_one - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bvt boolbvt::convert_constraint_select_one(const exprt &expr) { const exprt::operandst &operands=expr.operands(); diff --git a/src/solvers/flattening/boolbv_div.cpp b/src/solvers/flattening/boolbv_div.cpp index 4689829c53f..c8d6317c689 100644 --- a/src/solvers/flattening/boolbv_div.cpp +++ b/src/solvers/flattening/boolbv_div.cpp @@ -10,18 +10,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "boolbv.h" -/*******************************************************************\ - -Function: boolbvt::convert_div - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bvt boolbvt::convert_div(const div_exprt &expr) { if(expr.type().id()!=ID_unsignedbv && diff --git a/src/solvers/flattening/boolbv_equality.cpp b/src/solvers/flattening/boolbv_equality.cpp index 53cbb624815..574e8f94d92 100644 --- a/src/solvers/flattening/boolbv_equality.cpp +++ b/src/solvers/flattening/boolbv_equality.cpp @@ -16,18 +16,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "flatten_byte_operators.h" #include "boolbv.h" -/*******************************************************************\ - -Function: boolbvt::convert_equality - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - literalt boolbvt::convert_equality(const equal_exprt &expr) { if(!base_type_eq(expr.lhs().type(), expr.rhs().type(), ns)) @@ -73,18 +61,6 @@ literalt boolbvt::convert_equality(const equal_exprt &expr) return bv_utils.equal(bv0, bv1); } -/*******************************************************************\ - -Function: boolbvt::convert_verilog_case_equality - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - literalt boolbvt::convert_verilog_case_equality( const binary_relation_exprt &expr) { diff --git a/src/solvers/flattening/boolbv_extractbit.cpp b/src/solvers/flattening/boolbv_extractbit.cpp index cdccc52f578..c7ef6816c44 100644 --- a/src/solvers/flattening/boolbv_extractbit.cpp +++ b/src/solvers/flattening/boolbv_extractbit.cpp @@ -15,18 +15,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "boolbv.h" -/*******************************************************************\ - -Function: boolbvt::convert_extractbit - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - literalt boolbvt::convert_extractbit(const extractbit_exprt &expr) { const exprt::operandst &operands=expr.operands(); diff --git a/src/solvers/flattening/boolbv_extractbits.cpp b/src/solvers/flattening/boolbv_extractbits.cpp index 5bf2ac0f4c4..50f0a3b7b3d 100644 --- a/src/solvers/flattening/boolbv_extractbits.cpp +++ b/src/solvers/flattening/boolbv_extractbits.cpp @@ -10,18 +10,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "boolbv.h" -/*******************************************************************\ - -Function: boolbvt::convert_extractbits - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bvt boolbvt::convert_extractbits(const extractbits_exprt &expr) { std::size_t width=boolbv_width(expr.type()); diff --git a/src/solvers/flattening/boolbv_floatbv_op.cpp b/src/solvers/flattening/boolbv_floatbv_op.cpp index e4926dc617e..f77b7a306d2 100644 --- a/src/solvers/flattening/boolbv_floatbv_op.cpp +++ b/src/solvers/flattening/boolbv_floatbv_op.cpp @@ -15,18 +15,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "../floatbv/float_utils.h" -/*******************************************************************\ - -Function: boolbvt::convert_floatbv_typecast - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bvt boolbvt::convert_floatbv_typecast(const floatbv_typecast_exprt &expr) { const exprt &op0=expr.op(); // number to convert @@ -84,18 +72,6 @@ bvt boolbvt::convert_floatbv_typecast(const floatbv_typecast_exprt &expr) return conversion_failed(expr); } -/*******************************************************************\ - -Function: boolbvt::convert_floatbv_op - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bvt boolbvt::convert_floatbv_op(const exprt &expr) { const exprt::operandst &operands=expr.operands(); diff --git a/src/solvers/flattening/boolbv_get.cpp b/src/solvers/flattening/boolbv_get.cpp index 4eb285a0d9c..799bf269627 100644 --- a/src/solvers/flattening/boolbv_get.cpp +++ b/src/solvers/flattening/boolbv_get.cpp @@ -17,18 +17,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "boolbv.h" #include "boolbv_type.h" -/*******************************************************************\ - -Function: boolbvt::get - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - exprt boolbvt::get(const exprt &expr) const { if(expr.id()==ID_symbol || @@ -76,18 +64,6 @@ exprt boolbvt::get(const exprt &expr) const return SUB::get(expr); } -/*******************************************************************\ - -Function: boolbvt::bv_get_rec - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - exprt boolbvt::bv_get_rec( const bvt &bv, const std::vector &unknown, @@ -300,18 +276,6 @@ exprt boolbvt::bv_get_rec( return nil_exprt(); } -/*******************************************************************\ - -Function: boolbvt::bv_get - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - exprt boolbvt::bv_get(const bvt &bv, const typet &type) const { std::vector unknown; @@ -319,18 +283,6 @@ exprt boolbvt::bv_get(const bvt &bv, const typet &type) const return bv_get_rec(bv, unknown, 0, type); } -/*******************************************************************\ - -Function: boolbvt::bv_get_cache - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - exprt boolbvt::bv_get_cache(const exprt &expr) const { if(expr.type().id()==ID_bool) // boolean? @@ -344,18 +296,6 @@ exprt boolbvt::bv_get_cache(const exprt &expr) const return bv_get(it->second, expr.type()); } -/*******************************************************************\ - -Function: boolbvt::bv_get_unbounded_array - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - exprt boolbvt::bv_get_unbounded_array(const exprt &expr) const { // first, try to get size @@ -473,18 +413,6 @@ exprt boolbvt::bv_get_unbounded_array(const exprt &expr) const return result; } -/*******************************************************************\ - -Function: boolbvt::get_value - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - mp_integer boolbvt::get_value( const bvt &bv, std::size_t offset, diff --git a/src/solvers/flattening/boolbv_ieee_float_rel.cpp b/src/solvers/flattening/boolbv_ieee_float_rel.cpp index e97203566a8..5694f1e029d 100644 --- a/src/solvers/flattening/boolbv_ieee_float_rel.cpp +++ b/src/solvers/flattening/boolbv_ieee_float_rel.cpp @@ -13,18 +13,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "../floatbv/float_utils.h" -/*******************************************************************\ - -Function: boolbvt::convert_ieee_float_rel - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - literalt boolbvt::convert_ieee_float_rel(const exprt &expr) { const exprt::operandst &operands=expr.operands(); diff --git a/src/solvers/flattening/boolbv_if.cpp b/src/solvers/flattening/boolbv_if.cpp index 97563633c5b..8f73309d9db 100644 --- a/src/solvers/flattening/boolbv_if.cpp +++ b/src/solvers/flattening/boolbv_if.cpp @@ -8,18 +8,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "boolbv.h" -/*******************************************************************\ - -Function: boolbvt::convert_if - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bvt boolbvt::convert_if(const if_exprt &expr) { std::size_t width=boolbv_width(expr.type()); diff --git a/src/solvers/flattening/boolbv_index.cpp b/src/solvers/flattening/boolbv_index.cpp index ec1ef27dd98..199b067ba2b 100644 --- a/src/solvers/flattening/boolbv_index.cpp +++ b/src/solvers/flattening/boolbv_index.cpp @@ -14,18 +14,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "boolbv.h" -/*******************************************************************\ - -Function: boolbvt::convert_index - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bvt boolbvt::convert_index(const index_exprt &expr) { if(expr.id()!=ID_index) @@ -301,18 +289,7 @@ bvt boolbvt::convert_index(const index_exprt &expr) return bv; } -/*******************************************************************\ - -Function: boolbvt::convert_index - - Inputs: - - Outputs: - - Purpose: index operator with constant index - -\*******************************************************************/ - +/// index operator with constant index bvt boolbvt::convert_index( const exprt &array, const mp_integer &index) diff --git a/src/solvers/flattening/boolbv_map.cpp b/src/solvers/flattening/boolbv_map.cpp index 6c6e647a31c..2eeaa6fc8fc 100644 --- a/src/solvers/flattening/boolbv_map.cpp +++ b/src/solvers/flattening/boolbv_map.cpp @@ -17,18 +17,6 @@ Author: Daniel Kroening, kroening@kroening.com #include #endif -/*******************************************************************\ - -Function: boolbv_mapt::map_entryt::get_value - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string boolbv_mapt::map_entryt::get_value(const propt &prop) const { std::string result; @@ -57,18 +45,6 @@ std::string boolbv_mapt::map_entryt::get_value(const propt &prop) const return result; } -/*******************************************************************\ - -Function: boolbv_mapt::get_map_entry - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - boolbv_mapt::map_entryt &boolbv_mapt::get_map_entry( const irep_idt &identifier, const typet &type) @@ -95,18 +71,6 @@ boolbv_mapt::map_entryt &boolbv_mapt::get_map_entry( return map_entry; } -/*******************************************************************\ - -Function: boolbv_mapt::show - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void boolbv_mapt::show() const { for(mappingt::const_iterator it=mapping.begin(); @@ -116,18 +80,6 @@ void boolbv_mapt::show() const } } -/*******************************************************************\ - -Function: boolbv_mapt::get_literals - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void boolbv_mapt::get_literals( const irep_idt &identifier, const typet &type, @@ -165,18 +117,6 @@ void boolbv_mapt::get_literals( } } -/*******************************************************************\ - -Function: boolbv_mapt::set_literals - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void boolbv_mapt::set_literals( const irep_idt &identifier, const typet &type, diff --git a/src/solvers/flattening/boolbv_member.cpp b/src/solvers/flattening/boolbv_member.cpp index c5c0a697e1e..93194bcd0b0 100644 --- a/src/solvers/flattening/boolbv_member.cpp +++ b/src/solvers/flattening/boolbv_member.cpp @@ -12,18 +12,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "boolbv.h" -/*******************************************************************\ - -Function: boolbvt::convert_member - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bvt boolbvt::convert_member(const member_exprt &expr) { const exprt &struct_op=expr.struct_op(); diff --git a/src/solvers/flattening/boolbv_mod.cpp b/src/solvers/flattening/boolbv_mod.cpp index a81e30e0fae..9603c9edc5a 100644 --- a/src/solvers/flattening/boolbv_mod.cpp +++ b/src/solvers/flattening/boolbv_mod.cpp @@ -8,18 +8,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "boolbv.h" -/*******************************************************************\ - -Function: boolbvt::convert_mod - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bvt boolbvt::convert_mod(const mod_exprt &expr) { #if 0 diff --git a/src/solvers/flattening/boolbv_mult.cpp b/src/solvers/flattening/boolbv_mult.cpp index 4f7e91056bc..d97fe0d9b7d 100644 --- a/src/solvers/flattening/boolbv_mult.cpp +++ b/src/solvers/flattening/boolbv_mult.cpp @@ -10,18 +10,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "boolbv.h" -/*******************************************************************\ - -Function: boolbvt::convert_mult - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bvt boolbvt::convert_mult(const exprt &expr) { std::size_t width=boolbv_width(expr.type()); diff --git a/src/solvers/flattening/boolbv_not.cpp b/src/solvers/flattening/boolbv_not.cpp index a5d0b2e4468..1a7d81ef901 100644 --- a/src/solvers/flattening/boolbv_not.cpp +++ b/src/solvers/flattening/boolbv_not.cpp @@ -8,18 +8,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "boolbv.h" -/*******************************************************************\ - -Function: boolbvt::convert_not - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bvt boolbvt::convert_not(const not_exprt &expr) { const bvt &op_bv=convert_bv(expr.op()); diff --git a/src/solvers/flattening/boolbv_onehot.cpp b/src/solvers/flattening/boolbv_onehot.cpp index d6af04966f8..0a8983de949 100644 --- a/src/solvers/flattening/boolbv_onehot.cpp +++ b/src/solvers/flattening/boolbv_onehot.cpp @@ -8,18 +8,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "boolbv.h" -/*******************************************************************\ - -Function: boolbvt::convert_onehot - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - literalt boolbvt::convert_onehot(const unary_exprt &expr) { bvt op=convert_bv(expr.op()); diff --git a/src/solvers/flattening/boolbv_overflow.cpp b/src/solvers/flattening/boolbv_overflow.cpp index 72b65dfe1a0..dc9c7235b3b 100644 --- a/src/solvers/flattening/boolbv_overflow.cpp +++ b/src/solvers/flattening/boolbv_overflow.cpp @@ -13,18 +13,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "boolbv.h" -/*******************************************************************\ - -Function: boolbvt::convert_overflow - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - literalt boolbvt::convert_overflow(const exprt &expr) { const exprt::operandst &operands=expr.operands(); diff --git a/src/solvers/flattening/boolbv_power.cpp b/src/solvers/flattening/boolbv_power.cpp index 5b843a9fabb..a84c744b831 100644 --- a/src/solvers/flattening/boolbv_power.cpp +++ b/src/solvers/flattening/boolbv_power.cpp @@ -8,18 +8,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "boolbv.h" -/*******************************************************************\ - -Function: boolbvt::convert_power - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bvt boolbvt::convert_power(const binary_exprt &expr) { const typet &type=ns.follow(expr.type()); diff --git a/src/solvers/flattening/boolbv_quantifier.cpp b/src/solvers/flattening/boolbv_quantifier.cpp index 7cfc7f9e03e..1d09818455c 100644 --- a/src/solvers/flattening/boolbv_quantifier.cpp +++ b/src/solvers/flattening/boolbv_quantifier.cpp @@ -14,19 +14,7 @@ Author: Daniel Kroening, kroening@kroening.com #include "boolbv.h" -/*******************************************************************\ - -Function: expr_eq - - Inputs: - - Outputs: - - Purpose: A method to detect equivalence between experts that can - contain typecast - -\*******************************************************************/ - +/// A method to detect equivalence between experts that can contain typecast bool expr_eq(const exprt &expr1, const exprt &expr2) { exprt e1=expr1, e2=expr2; @@ -37,20 +25,9 @@ bool expr_eq(const exprt &expr1, const exprt &expr2) return e1==e2; } -/*******************************************************************\ - -Function: get_quantifier_var_min - - Inputs: - - Outputs: - - Purpose: To obtain the min value for the quantifier variable - of the specified forall/exists operator. The min variable - is in the form of "!(var_expr > constant)". - -\*******************************************************************/ - +/// To obtain the min value for the quantifier variable of the specified +/// forall/exists operator. The min variable is in the form of "!(var_expr > +/// constant)". exprt get_quantifier_var_min( const exprt &var_expr, const exprt &quantifier_expr) @@ -97,19 +74,8 @@ exprt get_quantifier_var_min( return res; } -/*******************************************************************\ - -Function: get_quantifier_var_max - - Inputs: - - Outputs: - - Purpose: To obtain the max value for the quantifier variable - of the specified forall/exists operator. - -\*******************************************************************/ - +/// To obtain the max value for the quantifier variable of the specified +/// forall/exists operator. exprt get_quantifier_var_max( const exprt &var_expr, const exprt &quantifier_expr) @@ -171,18 +137,6 @@ exprt get_quantifier_var_max( return res; } -/*******************************************************************\ - -Function: instantiate_quantifier - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool instantiate_quantifier(exprt &expr, const namespacet &ns) { @@ -247,18 +201,6 @@ bool instantiate_quantifier(exprt &expr, return res; } -/*******************************************************************\ - -Function: boolbvt::convert_quantifier - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - literalt boolbvt::convert_quantifier(const exprt &src) { exprt expr(src); @@ -275,18 +217,6 @@ literalt boolbvt::convert_quantifier(const exprt &src) return l; } -/*******************************************************************\ - -Function: boolbvt::post_process_quantifiers - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void boolbvt::post_process_quantifiers() { std::set instances; diff --git a/src/solvers/flattening/boolbv_reduction.cpp b/src/solvers/flattening/boolbv_reduction.cpp index e863657066b..6557c37af1e 100644 --- a/src/solvers/flattening/boolbv_reduction.cpp +++ b/src/solvers/flattening/boolbv_reduction.cpp @@ -8,18 +8,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "boolbv.h" -/*******************************************************************\ - -Function: boolbvt::convert_reduction - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - literalt boolbvt::convert_reduction(const unary_exprt &expr) { const bvt &op_bv=convert_bv(expr.op()); @@ -60,18 +48,6 @@ literalt boolbvt::convert_reduction(const unary_exprt &expr) return l; } -/*******************************************************************\ - -Function: boolbvt::convert_bv_reduction - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bvt boolbvt::convert_bv_reduction(const unary_exprt &expr) { const bvt &op_bv=convert_bv(expr.op()); diff --git a/src/solvers/flattening/boolbv_replication.cpp b/src/solvers/flattening/boolbv_replication.cpp index 5983a1ae759..41c1ec42949 100644 --- a/src/solvers/flattening/boolbv_replication.cpp +++ b/src/solvers/flattening/boolbv_replication.cpp @@ -10,18 +10,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "boolbv.h" -/*******************************************************************\ - -Function: boolbvt::convert_replication - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bvt boolbvt::convert_replication(const replication_exprt &expr) { std::size_t width=boolbv_width(expr.type()); diff --git a/src/solvers/flattening/boolbv_shift.cpp b/src/solvers/flattening/boolbv_shift.cpp index f63be04c4a1..e55a0e3e07f 100644 --- a/src/solvers/flattening/boolbv_shift.cpp +++ b/src/solvers/flattening/boolbv_shift.cpp @@ -12,18 +12,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "boolbv.h" -/*******************************************************************\ - -Function: boolbvt::convert_shift - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bvt boolbvt::convert_shift(const binary_exprt &expr) { const irep_idt &type_id=expr.type().id(); diff --git a/src/solvers/flattening/boolbv_struct.cpp b/src/solvers/flattening/boolbv_struct.cpp index e1b0b29593a..91d19fd4e25 100644 --- a/src/solvers/flattening/boolbv_struct.cpp +++ b/src/solvers/flattening/boolbv_struct.cpp @@ -11,18 +11,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "boolbv.h" -/*******************************************************************\ - -Function: boolbvt::convert_struct - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bvt boolbvt::convert_struct(const struct_exprt &expr) { const struct_typet &struct_type=to_struct_type(ns.follow(expr.type())); diff --git a/src/solvers/flattening/boolbv_type.cpp b/src/solvers/flattening/boolbv_type.cpp index 2f0d2a43e59..60607b023fe 100644 --- a/src/solvers/flattening/boolbv_type.cpp +++ b/src/solvers/flattening/boolbv_type.cpp @@ -8,18 +8,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "boolbv_type.h" -/*******************************************************************\ - -Function: get_bvtype - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bvtypet get_bvtype(const typet &type) { if(type.id()==ID_signedbv) diff --git a/src/solvers/flattening/boolbv_typecast.cpp b/src/solvers/flattening/boolbv_typecast.cpp index c0c2b9abb81..afea6ee8698 100644 --- a/src/solvers/flattening/boolbv_typecast.cpp +++ b/src/solvers/flattening/boolbv_typecast.cpp @@ -16,18 +16,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "../floatbv/float_utils.h" -/*******************************************************************\ - -Function: boolbvt::convert_bv_typecast - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bvt boolbvt::convert_bv_typecast(const typecast_exprt &expr) { const typet &expr_type=ns.follow(expr.type()); @@ -43,18 +31,6 @@ bvt boolbvt::convert_bv_typecast(const typecast_exprt &expr) return bv; } -/*******************************************************************\ - -Function: boolbvt::type_conversion - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool boolbvt::type_conversion( const typet &src_type, const bvt &src, const typet &dest_type, bvt &dest) @@ -612,18 +588,7 @@ bool boolbvt::type_conversion( return true; } -/*******************************************************************\ - -Function: boolbvt::convert_typecast - - Inputs: - - Outputs: - - Purpose: conversion from bitvector types to boolean - -\*******************************************************************/ - +/// conversion from bitvector types to boolean literalt boolbvt::convert_typecast(const typecast_exprt &expr) { assert(expr.operands().size()==1); diff --git a/src/solvers/flattening/boolbv_unary_minus.cpp b/src/solvers/flattening/boolbv_unary_minus.cpp index 032d453a877..64154ac7528 100644 --- a/src/solvers/flattening/boolbv_unary_minus.cpp +++ b/src/solvers/flattening/boolbv_unary_minus.cpp @@ -13,18 +13,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "../floatbv/float_utils.h" -/*******************************************************************\ - -Function: boolbvt::convert_unary_minus - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bvt boolbvt::convert_unary_minus(const unary_exprt &expr) { const typet &type=ns.follow(expr.type()); diff --git a/src/solvers/flattening/boolbv_union.cpp b/src/solvers/flattening/boolbv_union.cpp index 92ac97d0c2c..62ce2ab760d 100644 --- a/src/solvers/flattening/boolbv_union.cpp +++ b/src/solvers/flattening/boolbv_union.cpp @@ -12,18 +12,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "boolbv.h" -/*******************************************************************\ - -Function: boolbvt::convert_union - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bvt boolbvt::convert_union(const union_exprt &expr) { std::size_t width=boolbv_width(expr.type()); diff --git a/src/solvers/flattening/boolbv_update.cpp b/src/solvers/flattening/boolbv_update.cpp index 2b485781f6b..62e887d5e04 100644 --- a/src/solvers/flattening/boolbv_update.cpp +++ b/src/solvers/flattening/boolbv_update.cpp @@ -17,18 +17,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "boolbv.h" -/*******************************************************************\ - -Function: boolbvt::convert_update - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bvt boolbvt::convert_update(const exprt &expr) { const exprt::operandst &ops=expr.operands(); @@ -53,18 +41,6 @@ bvt boolbvt::convert_update(const exprt &expr) return bv; } -/*******************************************************************\ - -Function: boolbvt::convert_update_rec - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void boolbvt::convert_update_rec( const exprt::operandst &designators, std::size_t d, diff --git a/src/solvers/flattening/boolbv_vector.cpp b/src/solvers/flattening/boolbv_vector.cpp index 499b79abe7b..8a7b11739f5 100644 --- a/src/solvers/flattening/boolbv_vector.cpp +++ b/src/solvers/flattening/boolbv_vector.cpp @@ -8,18 +8,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "boolbv.h" -/*******************************************************************\ - -Function: boolbvt::convert_vector - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bvt boolbvt::convert_vector(const exprt &expr) { std::size_t width=boolbv_width(expr.type()); diff --git a/src/solvers/flattening/boolbv_width.cpp b/src/solvers/flattening/boolbv_width.cpp index b52ea11fc8a..57fce3ccbc7 100644 --- a/src/solvers/flattening/boolbv_width.cpp +++ b/src/solvers/flattening/boolbv_width.cpp @@ -14,50 +14,14 @@ Author: Daniel Kroening, kroening@kroening.com #include "boolbv_width.h" -/*******************************************************************\ - -Function: boolbv_widtht::boolbv_widtht - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - boolbv_widtht::boolbv_widtht(const namespacet &_ns):ns(_ns) { } -/*******************************************************************\ - -Function: boolbv_widtht::~boolbv_widtht - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - boolbv_widtht::~boolbv_widtht() { } -/*******************************************************************\ - -Function: boolbv_widtht::get_entry - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - const boolbv_widtht::entryt &boolbv_widtht::get_entry(const typet &type) const { // check cache first @@ -252,18 +216,6 @@ const boolbv_widtht::entryt &boolbv_widtht::get_entry(const typet &type) const return entry; } -/*******************************************************************\ - -Function: boolbv_widtht::get_member - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - const boolbv_widtht::membert &boolbv_widtht::get_member( const struct_typet &type, const irep_idt &member) const diff --git a/src/solvers/flattening/boolbv_with.cpp b/src/solvers/flattening/boolbv_with.cpp index d98cd6be3b9..0e6079ebc6e 100644 --- a/src/solvers/flattening/boolbv_with.cpp +++ b/src/solvers/flattening/boolbv_with.cpp @@ -15,18 +15,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "boolbv.h" -/*******************************************************************\ - -Function: boolbvt::convert_with - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bvt boolbvt::convert_with(const exprt &expr) { if(expr.operands().size()<3) @@ -77,18 +65,6 @@ bvt boolbvt::convert_with(const exprt &expr) return bv; } -/*******************************************************************\ - -Function: boolbvt::convert_with - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void boolbvt::convert_with( const typet &type, const exprt &op1, @@ -119,18 +95,6 @@ void boolbvt::convert_with( throw 0; } -/*******************************************************************\ - -Function: boolbvt::convert_with_array - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void boolbvt::convert_with_array( const array_typet &type, const exprt &op1, @@ -200,18 +164,6 @@ void boolbvt::convert_with_array( } } -/*******************************************************************\ - -Function: boolbvt::convert_with_bv - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void boolbvt::convert_with_bv( const typet &type, const exprt &op1, @@ -244,18 +196,6 @@ void boolbvt::convert_with_bv( } } -/*******************************************************************\ - -Function: boolbvt::convert_with - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void boolbvt::convert_with_struct( const struct_typet &type, const exprt &op1, @@ -312,18 +252,6 @@ void boolbvt::convert_with_struct( } } -/*******************************************************************\ - -Function: boolbvt::convert_with_union - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void boolbvt::convert_with_union( const union_typet &type, const exprt &op1, diff --git a/src/solvers/flattening/bv_minimize.cpp b/src/solvers/flattening/bv_minimize.cpp index 9798f129ff8..c21426f64f5 100644 --- a/src/solvers/flattening/bv_minimize.cpp +++ b/src/solvers/flattening/bv_minimize.cpp @@ -12,18 +12,6 @@ Author: Georg Weissenbacher, georg.weissenbacher@inf.ethz.ch #include "bv_minimize.h" -/*******************************************************************\ - -Function: bv_minimizet::add_objective - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void bv_minimizet::add_objective( prop_minimizet &prop_minimize, const exprt &objective) @@ -66,18 +54,6 @@ void bv_minimizet::add_objective( } } -/*******************************************************************\ - -Function: bv_minimizet::operator() - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void bv_minimizet::operator()(const minimization_listt &symbols) { // build bit-wise objective function diff --git a/src/solvers/flattening/bv_minimize.h b/src/solvers/flattening/bv_minimize.h index 03ba354e0d8..c6c8023501b 100644 --- a/src/solvers/flattening/bv_minimize.h +++ b/src/solvers/flattening/bv_minimize.h @@ -11,6 +11,9 @@ Purpose: Find a satisfying assignment that minimizes a given set \*******************************************************************/ +/// \file +/// SAT-optimizer for minimizing expressions + #ifndef CPROVER_SOLVERS_FLATTENING_BV_MINIMIZE_H #define CPROVER_SOLVERS_FLATTENING_BV_MINIMIZE_H diff --git a/src/solvers/flattening/bv_pointers.cpp b/src/solvers/flattening/bv_pointers.cpp index e026b6c3de7..4ac54b262c6 100644 --- a/src/solvers/flattening/bv_pointers.cpp +++ b/src/solvers/flattening/bv_pointers.cpp @@ -15,18 +15,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "bv_pointers.h" -/*******************************************************************\ - -Function: bv_pointerst::convert_rest - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - literalt bv_pointerst::convert_rest(const exprt &expr) { if(expr.type().id()!=ID_bool) @@ -100,18 +88,6 @@ literalt bv_pointerst::convert_rest(const exprt &expr) return SUB::convert_rest(expr); } -/*******************************************************************\ - -Function: bv_pointerst::bv_pointerst - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bv_pointerst::bv_pointerst( const namespacet &_ns, propt &_prop): @@ -123,18 +99,6 @@ bv_pointerst::bv_pointerst( bits=config.ansi_c.pointer_width; } -/*******************************************************************\ - -Function: bv_pointerst::convert_address_of_rec - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool bv_pointerst::convert_address_of_rec( const exprt &expr, bvt &bv) @@ -247,18 +211,6 @@ bool bv_pointerst::convert_address_of_rec( return true; } -/*******************************************************************\ - -Function: bv_pointerst::convert_pointer_type - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bvt bv_pointerst::convert_pointer_type(const exprt &expr) { if(!is_ptr(expr.type())) @@ -478,18 +430,6 @@ bvt bv_pointerst::convert_pointer_type(const exprt &expr) return conversion_failed(expr); } -/*******************************************************************\ - -Function: bv_pointerst::convert_bitvector - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bvt bv_pointerst::convert_bitvector(const exprt &expr) { if(is_ptr(expr.type())) @@ -603,18 +543,6 @@ bvt bv_pointerst::convert_bitvector(const exprt &expr) return SUB::convert_bitvector(expr); } -/*******************************************************************\ - -Function: bv_pointerst::bv_get_rec - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - exprt bv_pointerst::bv_get_rec( const bvt &bv, const std::vector &unknown, @@ -669,18 +597,6 @@ exprt bv_pointerst::bv_get_rec( return result; } -/*******************************************************************\ - -Function: bv_pointerst::encode - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void bv_pointerst::encode(std::size_t addr, bvt &bv) { bv.resize(bits); @@ -694,18 +610,6 @@ void bv_pointerst::encode(std::size_t addr, bvt &bv) bv[offset_bits+i]=const_literal((addr&(std::size_t(1)< &pps) { assert(!pps.empty()); @@ -953,18 +611,6 @@ bvt bv_utilst::wallace_tree(const std::vector &pps) } } -/*******************************************************************\ - -Function: bv_utilst::unsigned_multiplier - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bvt bv_utilst::unsigned_multiplier(const bvt &_op0, const bvt &_op1) { #if 1 @@ -1035,18 +681,6 @@ bvt bv_utilst::unsigned_multiplier(const bvt &_op0, const bvt &_op1) #endif } -/*******************************************************************\ - -Function: bv_utilst::unsigned_multiplier_no_overflow - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bvt bv_utilst::unsigned_multiplier_no_overflow( const bvt &op0, const bvt &op1) @@ -1086,18 +720,6 @@ bvt bv_utilst::unsigned_multiplier_no_overflow( return product; } -/*******************************************************************\ - -Function: bv_utilst::signed_multiplier - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bvt bv_utilst::signed_multiplier(const bvt &op0, const bvt &op1) { if(op0.empty() || op1.empty()) @@ -1116,18 +738,6 @@ bvt bv_utilst::signed_multiplier(const bvt &op0, const bvt &op1) return cond_negate(result, result_sign); } -/*******************************************************************\ - -Function: bv_utilst::cond_negate - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bvt bv_utilst::cond_negate(const bvt &bv, const literalt cond) { bvt neg_bv=negate(bv); @@ -1141,36 +751,12 @@ bvt bv_utilst::cond_negate(const bvt &bv, const literalt cond) return result; } -/*******************************************************************\ - -Function: bv_utilst::absolute_value - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bvt bv_utilst::absolute_value(const bvt &bv) { assert(!bv.empty()); return cond_negate(bv, bv[bv.size()-1]); } -/*******************************************************************\ - -Function: bv_utilst::cond_negate_no_overflow - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bvt bv_utilst::cond_negate_no_overflow(const bvt &bv, literalt cond) { prop.l_set_to( @@ -1180,18 +766,6 @@ bvt bv_utilst::cond_negate_no_overflow(const bvt &bv, literalt cond) return cond_negate(bv, cond); } -/*******************************************************************\ - -Function: bv_utilst::signed_multiplier_no_overflow - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bvt bv_utilst::signed_multiplier_no_overflow( const bvt &op0, const bvt &op1) @@ -1214,18 +788,6 @@ bvt bv_utilst::signed_multiplier_no_overflow( return cond_negate_no_overflow(result, result_sign); } -/*******************************************************************\ - -Function: bv_utilst::multiplier - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bvt bv_utilst::multiplier( const bvt &op0, const bvt &op1, @@ -1239,18 +801,6 @@ bvt bv_utilst::multiplier( } } -/*******************************************************************\ - -Function: bv_utilst::multiplier_no_overflow - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bvt bv_utilst::multiplier_no_overflow( const bvt &op0, const bvt &op1, @@ -1266,18 +816,6 @@ bvt bv_utilst::multiplier_no_overflow( } } -/*******************************************************************\ - -Function: bv_utilst::signed_divider - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void bv_utilst::signed_divider( const bvt &op0, const bvt &op1, @@ -1313,18 +851,6 @@ void bv_utilst::signed_divider( rem[i]=prop.lselect(sign_0, neg_rem[i], rem[i]); } -/*******************************************************************\ - -Function: bv_utilst::divider - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void bv_utilst::divider( const bvt &op0, const bvt &op1, @@ -1344,18 +870,6 @@ void bv_utilst::divider( } } -/*******************************************************************\ - -Function: bv_utilst::unsigned_divider - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void bv_utilst::unsigned_divider( const bvt &op0, const bvt &op1, @@ -1445,18 +959,9 @@ void bv_utilst::unsigned_divider( #ifdef COMPACT_EQUAL_CONST // TODO : use for lt_or_le as well -/*******************************************************************\ - -Function: bv_utilst::equal_const_rec - - Inputs: A bit-vector of a variable that is to be registered. - - Outputs: None. - - Purpose: The equal_const optimisation will be used on this bit-vector. - -\*******************************************************************/ - +/// The equal_const optimisation will be used on this bit-vector. +/// \par parameters: A bit-vector of a variable that is to be registered. +/// \return None. void bv_utilst::equal_const_register(const bvt &var) { assert(!is_constant(var)); @@ -1465,21 +970,12 @@ void bv_utilst::equal_const_register(const bvt &var) } -/*******************************************************************\ - -Function: bv_utilst::equal_const_rec - - Inputs: Bit-vectors for a variable and a const to compare, note that - to avoid significant amounts of copying these are mutable and consumed. - - Outputs: The literal that is true if and only if all the bits in var - and const are equal. - - Purpose: The obvious recursive comparison, the interesting thing is - that it is cached so the literals are shared between constants. - -\*******************************************************************/ - +/// The obvious recursive comparison, the interesting thing is that it is cached +/// so the literals are shared between constants. +/// \param Bit:vectors for a variable and a const to compare, note that +/// to avoid significant amounts of copying these are mutable and consumed. +/// \return The literal that is true if and only if all the bits in var and +/// const are equal. literalt bv_utilst::equal_const_rec(bvt &var, bvt &constant) { std::size_t size = var.size(); @@ -1522,24 +1018,14 @@ literalt bv_utilst::equal_const_rec(bvt &var, bvt &constant) } } -/*******************************************************************\ - -Function: bv_utilst::equal_const - - Inputs: Bit-vectors for a variable and a const to compare. - - Outputs: The literal that is true if and only if they are equal. - - Purpose: An experimental encoding, aimed primarily at variable - position access to constant arrays. These generate a lot of - comparisons of the form var = small_const . It will introduce some - additional literals and for variables that have only a few - comparisons with constants this may result in a net increase in - formula size. It is hoped that a 'sufficently advanced preprocessor' - will remove these. - -\*******************************************************************/ - +/// An experimental encoding, aimed primarily at variable position access to +/// constant arrays. These generate a lot of comparisons of the form var = +/// small_const . It will introduce some additional literals and for variables +/// that have only a few comparisons with constants this may result in a net +/// increase in formula size. It is hoped that a 'sufficently advanced +/// preprocessor' will remove these. +/// \param Bit:vectors for a variable and a const to compare. +/// \return The literal that is true if and only if they are equal. literalt bv_utilst::equal_const(const bvt &var, const bvt &constant) { std::size_t size = constant.size(); @@ -1597,18 +1083,9 @@ literalt bv_utilst::equal_const(const bvt &var, const bvt &constant) #endif -/*******************************************************************\ - -Function: bv_utilst::equal - - Inputs: Bit-vectors for the two things to compare. - - Outputs: The literal that is true if and only if they are equal. - - Purpose: Bit-blasting ID_equal and use in other encodings. - -\*******************************************************************/ - +/// Bit-blasting ID_equal and use in other encodings. +/// \param Bit:vectors for the two things to compare. +/// \return The literal that is true if and only if they are equal. literalt bv_utilst::equal(const bvt &op0, const bvt &op1) { assert(op0.size()==op1.size()); @@ -1633,20 +1110,10 @@ literalt bv_utilst::equal(const bvt &op0, const bvt &op1) return prop.land(equal_bv); } -/*******************************************************************\ - -Function: bv_utilst::lt_or_le - - Inputs: bvts for each input and whether they are signed and whether - a model of < or <= is required. - - Outputs: A literalt that models the value of the comparison. - - Purpose: To provide a bitwise model of < or <=. - -\*******************************************************************/ - - +/// To provide a bitwise model of < or <=. +/// \par parameters: bvts for each input and whether they are signed and whether +/// a model of < or <= is required. +/// \return A literalt that models the value of the comparison. /* Some clauses are not needed for correctness but they remove models (effectively setting "don't care" bits) and so may be worth including.*/ @@ -1773,18 +1240,6 @@ literalt bv_utilst::lt_or_le( } } -/*******************************************************************\ - -Function: bv_utilst::unsigned_less_than - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - literalt bv_utilst::unsigned_less_than( const bvt &op0, const bvt &op1) @@ -1797,18 +1252,6 @@ literalt bv_utilst::unsigned_less_than( #endif } -/*******************************************************************\ - -Function: bv_utilst::signed_less_than - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - literalt bv_utilst::signed_less_than( const bvt &bv0, const bvt &bv1) @@ -1816,18 +1259,6 @@ literalt bv_utilst::signed_less_than( return lt_or_le(false, bv0, bv1, representationt::SIGNED); } -/*******************************************************************\ - -Function: bv_utilst::rel - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - literalt bv_utilst::rel( const bvt &bv0, irep_idt id, @@ -1850,18 +1281,6 @@ literalt bv_utilst::rel( assert(false); } -/*******************************************************************\ - -Function: bv_utilst::is_constant - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool bv_utilst::is_constant(const bvt &bv) { forall_literals(it, bv) @@ -1871,18 +1290,6 @@ bool bv_utilst::is_constant(const bvt &bv) return true; } -/*******************************************************************\ - -Function: bv_utilst::cond_implies_equal - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void bv_utilst::cond_implies_equal( literalt cond, const bvt &a, @@ -1906,18 +1313,6 @@ void bv_utilst::cond_implies_equal( return; } -/*******************************************************************\ - -Function: bv_utilst::verilog_bv_has_x_or_z - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - literalt bv_utilst::verilog_bv_has_x_or_z(const bvt &src) { bvt odd_bits; @@ -1933,18 +1328,6 @@ literalt bv_utilst::verilog_bv_has_x_or_z(const bvt &src) return prop.lor(odd_bits); } -/*******************************************************************\ - -Function: bv_utilst::verilog_bv_normal_bits - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bvt bv_utilst::verilog_bv_normal_bits(const bvt &src) { bvt even_bits; diff --git a/src/solvers/flattening/c_bit_field_replacement_type.cpp b/src/solvers/flattening/c_bit_field_replacement_type.cpp index 5a81dc085d5..a9876ac88de 100644 --- a/src/solvers/flattening/c_bit_field_replacement_type.cpp +++ b/src/solvers/flattening/c_bit_field_replacement_type.cpp @@ -8,18 +8,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "c_bit_field_replacement_type.h" -/*******************************************************************\ - -Function: c_bit_field_replacement_type - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - typet c_bit_field_replacement_type( const c_bit_field_typet &src, const namespacet &ns) diff --git a/src/solvers/flattening/equality.cpp b/src/solvers/flattening/equality.cpp index 63ca7e2e147..1cb03e9e753 100644 --- a/src/solvers/flattening/equality.cpp +++ b/src/solvers/flattening/equality.cpp @@ -13,18 +13,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "equality.h" #include "bv_utils.h" -/*******************************************************************\ - -Function: equalityt::equality - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - literalt equalityt::equality(const exprt &e1, const exprt &e2) { if(e1second); } -/*******************************************************************\ - -Function: equalityt::add_equality_constraints - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void equalityt::add_equality_constraints(const typestructt &typestruct) { std::size_t no_elements=typestruct.elements.size(); diff --git a/src/solvers/flattening/flatten_byte_operators.cpp b/src/solvers/flattening/flatten_byte_operators.cpp index 68ad4b9197e..df7435a26e9 100644 --- a/src/solvers/flattening/flatten_byte_operators.cpp +++ b/src/solvers/flattening/flatten_byte_operators.cpp @@ -16,19 +16,8 @@ Author: Daniel Kroening, kroening@kroening.com #include "flatten_byte_operators.h" -/*******************************************************************\ - -Function: flatten_byte_extract - - Inputs: - - Outputs: - - Purpose: rewrite byte extraction from an array to byte extraction - from a concatenation of array index expressions - -\*******************************************************************/ - +/// rewrite byte extraction from an array to byte extraction from a +/// concatenation of array index expressions exprt flatten_byte_extract( const byte_extract_exprt &src, const namespacet &ns) @@ -176,18 +165,6 @@ exprt flatten_byte_extract( } } -/*******************************************************************\ - -Function: flatten_byte_update - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - exprt flatten_byte_update( const byte_update_exprt &src, const namespacet &ns, @@ -441,18 +418,6 @@ exprt flatten_byte_update( } } -/*******************************************************************\ - -Function: flatten_byte_update - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - exprt flatten_byte_update( const byte_update_exprt &src, const namespacet &ns) @@ -460,18 +425,6 @@ exprt flatten_byte_update( return flatten_byte_update(src, ns, false); } -/*******************************************************************\ - -Function: has_byte_operators - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool has_byte_operator(const exprt &src) { if(src.id()==ID_byte_update_little_endian || @@ -487,18 +440,6 @@ bool has_byte_operator(const exprt &src) return false; } -/*******************************************************************\ - -Function: flatten_byte_operators - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - exprt flatten_byte_operators( const exprt &src, const namespacet &ns) diff --git a/src/solvers/flattening/functions.cpp b/src/solvers/flattening/functions.cpp index 6b23229c958..161ec973c7f 100644 --- a/src/solvers/flattening/functions.cpp +++ b/src/solvers/flattening/functions.cpp @@ -13,18 +13,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "functions.h" -/*******************************************************************\ - -Function: functionst::record - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void functionst::record( const function_application_exprt &function_application) { @@ -32,18 +20,6 @@ void functionst::record( insert(function_application); } -/*******************************************************************\ - -Function: functionst::add_function_constraints - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void functionst::add_function_constraints() { for(function_mapt::const_iterator it= @@ -53,18 +29,6 @@ void functionst::add_function_constraints() add_function_constraints(it->second); } -/*******************************************************************\ - -Function: functionst::add_function_constraints - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - exprt functionst::arguments_equal(const exprt::operandst &o1, const exprt::operandst &o2) { @@ -91,18 +55,6 @@ exprt functionst::arguments_equal(const exprt::operandst &o1, return and_expr; } -/*******************************************************************\ - -Function: functionst::add_function_constraints - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void functionst::add_function_constraints(const function_infot &info) { // Do Ackermann's function reduction. diff --git a/src/solvers/flattening/functions.h b/src/solvers/flattening/functions.h index 1708862e946..0403e34189f 100644 --- a/src/solvers/flattening/functions.h +++ b/src/solvers/flattening/functions.h @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Uninterpreted Functions + #ifndef CPROVER_SOLVERS_FLATTENING_FUNCTIONS_H #define CPROVER_SOLVERS_FLATTENING_FUNCTIONS_H diff --git a/src/solvers/flattening/pointer_logic.cpp b/src/solvers/flattening/pointer_logic.cpp index c2b9d1175d0..b5f82567440 100644 --- a/src/solvers/flattening/pointer_logic.cpp +++ b/src/solvers/flattening/pointer_logic.cpp @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Pointer Logic + #include #include @@ -15,18 +18,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "pointer_logic.h" -/*******************************************************************\ - -Function: pointer_logict::is_dynamic_object - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool pointer_logict::is_dynamic_object(const exprt &expr) const { if(expr.type().get_bool("#dynamic")) @@ -40,18 +31,6 @@ bool pointer_logict::is_dynamic_object(const exprt &expr) const return false; } -/*******************************************************************\ - -Function: pointer_logict::get_dynamic_objects - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void pointer_logict::get_dynamic_objects(std::vector &o) const { o.clear(); @@ -65,18 +44,6 @@ void pointer_logict::get_dynamic_objects(std::vector &o) const o.push_back(nr); } -/*******************************************************************\ - -Function: pointer_logict::add_object - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::size_t pointer_logict::add_object(const exprt &expr) { // remove any index/member @@ -95,18 +62,6 @@ std::size_t pointer_logict::add_object(const exprt &expr) return objects.number(expr); } -/*******************************************************************\ - -Function: pointer_logict::pointer_expr - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - exprt pointer_logict::pointer_expr( std::size_t object, const typet &type) const @@ -115,18 +70,6 @@ exprt pointer_logict::pointer_expr( return pointer_expr(pointer, type); } -/*******************************************************************\ - -Function: pointer_logict::pointer_expr - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - exprt pointer_logict::pointer_expr( const pointert &pointer, const typet &type) const @@ -178,18 +121,6 @@ exprt pointer_logict::pointer_expr( return result; } -/*******************************************************************\ - -Function: pointer_logict::object_rec - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - exprt pointer_logict::object_rec( const mp_integer &offset, const typet &pointer_type, @@ -260,18 +191,6 @@ exprt pointer_logict::object_rec( return src; } -/*******************************************************************\ - -Function: pointer_logict::pointer_logict - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - pointer_logict::pointer_logict(const namespacet &_ns):ns(_ns) { // add NULL @@ -282,18 +201,6 @@ pointer_logict::pointer_logict(const namespacet &_ns):ns(_ns) invalid_object=objects.number(exprt("INVALID")); } -/*******************************************************************\ - -Function: pointer_logict::~pointer_logict - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - pointer_logict::~pointer_logict() { } diff --git a/src/solvers/flattening/pointer_logic.h b/src/solvers/flattening/pointer_logic.h index bcf18ca69f7..a0dc8b7fb50 100644 --- a/src/solvers/flattening/pointer_logic.h +++ b/src/solvers/flattening/pointer_logic.h @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Pointer Logic + #ifndef CPROVER_SOLVERS_FLATTENING_POINTER_LOGIC_H #define CPROVER_SOLVERS_FLATTENING_POINTER_LOGIC_H diff --git a/src/solvers/floatbv/float_approximation.cpp b/src/solvers/floatbv/float_approximation.cpp index 08e65162647..9cb84dd52e4 100644 --- a/src/solvers/floatbv/float_approximation.cpp +++ b/src/solvers/floatbv/float_approximation.cpp @@ -10,34 +10,10 @@ Author: Daniel Kroening, kroening@kroening.com #include "float_approximation.h" -/*******************************************************************\ - -Function: float_approximationt::~float_approximationt - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - float_approximationt::~float_approximationt() { } -/*******************************************************************\ - -Function: float_approximationt::round_fraction - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void float_approximationt::normalization_shift(bvt &fraction, bvt &exponent) { // this thing is quadratic! @@ -87,18 +63,6 @@ void float_approximationt::normalization_shift(bvt &fraction, bvt &exponent) exponent=new_exponent; } -/*******************************************************************\ - -Function: float_approximationt::overapproximating_left_shift - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bvt float_approximationt::overapproximating_left_shift( const bvt &src, unsigned dist) { diff --git a/src/solvers/floatbv/float_approximation.h b/src/solvers/floatbv/float_approximation.h index c0a266b8fb6..daaaac8c7f3 100644 --- a/src/solvers/floatbv/float_approximation.h +++ b/src/solvers/floatbv/float_approximation.h @@ -6,6 +6,9 @@ Module: Floating Point with under/over-approximation \*******************************************************************/ +/// \file +/// Floating Point with under/over-approximation + #ifndef CPROVER_SOLVERS_FLOATBV_FLOAT_APPROXIMATION_H #define CPROVER_SOLVERS_FLOATBV_FLOAT_APPROXIMATION_H diff --git a/src/solvers/floatbv/float_bv.cpp b/src/solvers/floatbv/float_bv.cpp index 0d07a9d8ee9..83121b75c78 100644 --- a/src/solvers/floatbv/float_bv.cpp +++ b/src/solvers/floatbv/float_bv.cpp @@ -14,18 +14,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "float_bv.h" -/*******************************************************************\ - -Function: float_bvt::convert - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - exprt float_bvt::convert(const exprt &expr) { if(expr.id()==ID_abs) @@ -107,36 +95,12 @@ exprt float_bvt::convert(const exprt &expr) return nil_exprt(); } -/*******************************************************************\ - -Function: float_bvt::get_spec - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - ieee_float_spect float_bvt::get_spec(const exprt &expr) { const floatbv_typet &type=to_floatbv_type(expr.type()); return ieee_float_spect(type); } -/*******************************************************************\ - -Function: float_bvt::abs - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - exprt float_bvt::abs(const exprt &op, const ieee_float_spect &spec) { // we mask away the sign bit, which is the most significand bit @@ -148,18 +112,6 @@ exprt float_bvt::abs(const exprt &op, const ieee_float_spect &spec) return bitand_exprt(op, mask); } -/*******************************************************************\ - -Function: float_bvt::negation - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - exprt float_bvt::negation(const exprt &op, const ieee_float_spect &spec) { // we flip the sign bit with an xor @@ -171,18 +123,6 @@ exprt float_bvt::negation(const exprt &op, const ieee_float_spect &spec) return bitxor_exprt(op, mask); } -/*******************************************************************\ - -Function: float_bvt::is_equal - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - exprt float_bvt::is_equal( const exprt &src0, const exprt &src1, @@ -205,18 +145,6 @@ exprt float_bvt::is_equal( not_exprt(nan)); } -/*******************************************************************\ - -Function: float_bvt::is_zero - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - exprt float_bvt::is_zero( const exprt &src, const ieee_float_spect &spec) @@ -236,18 +164,6 @@ exprt float_bvt::is_zero( return equal_exprt(bitand_exprt(src, mask), z.to_expr()); } -/*******************************************************************\ - -Function: float_bvt::exponent_all_ones - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - exprt float_bvt::exponent_all_ones( const exprt &src, const ieee_float_spect &spec) @@ -257,18 +173,6 @@ exprt float_bvt::exponent_all_ones( return equal_exprt(exponent, all_ones); } -/*******************************************************************\ - -Function: float_bvt::exponent_all_zeros - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - exprt float_bvt::exponent_all_zeros( const exprt &src, const ieee_float_spect &spec) @@ -278,18 +182,6 @@ exprt float_bvt::exponent_all_zeros( return equal_exprt(exponent, all_zeros); } -/*******************************************************************\ - -Function: float_bvt::fraction_all_zeros - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - exprt float_bvt::fraction_all_zeros( const exprt &src, const ieee_float_spect &spec) @@ -300,18 +192,6 @@ exprt float_bvt::fraction_all_zeros( return equal_exprt(fraction, all_zeros); } -/*******************************************************************\ - -Function: float_bvt::rounding_mode_bitst::get - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void float_bvt::rounding_mode_bitst::get(const exprt &rm) { exprt round_to_even_const=from_integer(ieee_floatt::ROUND_TO_EVEN, rm.type()); @@ -327,18 +207,6 @@ void float_bvt::rounding_mode_bitst::get(const exprt &rm) round_to_zero=equal_exprt(rm, round_to_zero_const); } -/*******************************************************************\ - -Function: float_bvt::sign_bit - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - exprt float_bvt::sign_bit(const exprt &op) { const bitvector_typet &bv_type=to_bitvector_type(op.type()); @@ -346,18 +214,6 @@ exprt float_bvt::sign_bit(const exprt &op) return extractbit_exprt(op, width-1); } -/*******************************************************************\ - -Function: float_bvt::from_signed_integer - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - exprt float_bvt::from_signed_integer( const exprt &src, const exprt &rm, @@ -382,18 +238,6 @@ exprt float_bvt::from_signed_integer( return rounder(result, rm, spec); } -/*******************************************************************\ - -Function: float_bvt::from_unsigned_integer - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - exprt float_bvt::from_unsigned_integer( const exprt &src, const exprt &rm, @@ -416,18 +260,6 @@ exprt float_bvt::from_unsigned_integer( return rounder(result, rm, spec); } -/*******************************************************************\ - -Function: float_bvt::to_signed_integer - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - exprt float_bvt::to_signed_integer( const exprt &src, std::size_t dest_width, @@ -437,18 +269,6 @@ exprt float_bvt::to_signed_integer( return to_integer(src, dest_width, true, rm, spec); } -/*******************************************************************\ - -Function: float_bvt::to_unsigned_integer - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - exprt float_bvt::to_unsigned_integer( const exprt &src, std::size_t dest_width, @@ -458,18 +278,6 @@ exprt float_bvt::to_unsigned_integer( return to_integer(src, dest_width, false, rm, spec); } -/*******************************************************************\ - -Function: float_bvt::to_integer - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - exprt float_bvt::to_integer( const exprt &src, std::size_t dest_width, @@ -518,18 +326,6 @@ exprt float_bvt::to_integer( return result; } -/*******************************************************************\ - -Function: float_bvt::conversion - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - exprt float_bvt::conversion( const exprt &src, const exprt &rm, @@ -595,18 +391,6 @@ exprt float_bvt::conversion( } } -/*******************************************************************\ - -Function: float_bvt::isnormal - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - exprt float_bvt::isnormal( const exprt &src, const ieee_float_spect &spec) @@ -616,18 +400,7 @@ exprt float_bvt::isnormal( not_exprt(exponent_all_ones(src, spec))); } -/*******************************************************************\ - -Function: float_bvt::subtract_exponents - - Inputs: - - Outputs: - - Purpose: Subtracts the exponents - -\*******************************************************************/ - +/// Subtracts the exponents exprt float_bvt::subtract_exponents( const unbiased_floatt &src1, const unbiased_floatt &src2) @@ -648,18 +421,6 @@ exprt float_bvt::subtract_exponents( return minus_exprt(extended_exponent1, extended_exponent2); } -/*******************************************************************\ - -Function: float_bvt::add_sub - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - exprt float_bvt::add_sub( bool subtract, const exprt &op0, @@ -807,18 +568,7 @@ exprt float_bvt::add_sub( return rounder(result, rm, spec); } -/*******************************************************************\ - -Function: float_bvt::limit_distance - - Inputs: - - Outputs: - - Purpose: Limits the shift distance - -\*******************************************************************/ - +/// Limits the shift distance exprt float_bvt::limit_distance( const exprt &dist, mp_integer limit) @@ -845,18 +595,6 @@ exprt float_bvt::limit_distance( unsignedbv_typet(nb_bits).largest_expr()); } -/*******************************************************************\ - -Function: float_bvt::mul - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - exprt float_bvt::mul( const exprt &src1, const exprt &src2, @@ -912,18 +650,6 @@ exprt float_bvt::mul( return rounder(result, rm, spec); } -/*******************************************************************\ - -Function: float_bvt::div - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - exprt float_bvt::div( const exprt &src1, const exprt &src2, @@ -1016,18 +742,6 @@ exprt float_bvt::div( return rounder(result, rm, spec); } -/*******************************************************************\ - -Function: float_bvt::relation - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - exprt float_bvt::relation( const exprt &src1, relt rel, @@ -1119,18 +833,6 @@ exprt float_bvt::relation( return false_exprt(); } -/*******************************************************************\ - -Function: float_bvt::isinf - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - exprt float_bvt::isinf( const exprt &src, const ieee_float_spect &spec) @@ -1140,18 +842,6 @@ exprt float_bvt::isinf( fraction_all_zeros(src, spec)); } -/*******************************************************************\ - -Function: float_bvt::isfinite - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - exprt float_bvt::isfinite( const exprt &src, const ieee_float_spect &spec) @@ -1159,18 +849,7 @@ exprt float_bvt::isfinite( return not_exprt(or_exprt(isinf(src, spec), isnan(src, spec))); } -/*******************************************************************\ - -Function: float_bvt::get_exponent - - Inputs: - - Outputs: - - Purpose: Gets the unbiased exponent in a floating-point bit-vector - -\*******************************************************************/ - +/// Gets the unbiased exponent in a floating-point bit-vector exprt float_bvt::get_exponent( const exprt &src, const ieee_float_spect &spec) @@ -1180,19 +859,7 @@ exprt float_bvt::get_exponent( unsignedbv_typet(spec.e)); } -/*******************************************************************\ - -Function: float_bvt::get_fraction - - Inputs: - - Outputs: - - Purpose: Gets the fraction without hidden bit in a floating-point - bit-vector src - -\*******************************************************************/ - +/// Gets the fraction without hidden bit in a floating-point bit-vector src exprt float_bvt::get_fraction( const exprt &src, const ieee_float_spect &spec) @@ -1202,18 +869,6 @@ exprt float_bvt::get_fraction( unsignedbv_typet(spec.f)); } -/*******************************************************************\ - -Function: float_bvt::isnan - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - exprt float_bvt::isnan( const exprt &src, const ieee_float_spect &spec) @@ -1222,19 +877,7 @@ exprt float_bvt::isnan( not_exprt(fraction_all_zeros(src, spec))); } -/*******************************************************************\ - -Function: float_bvt::normalization_shift - - Inputs: - - Outputs: - - Purpose: normalize fraction/exponent pair - returns 'zero' if fraction is zero - -\*******************************************************************/ - +/// normalize fraction/exponent pair returns 'zero' if fraction is zero void float_bvt::normalization_shift( exprt &fraction, exprt &exponent) @@ -1283,19 +926,7 @@ void float_bvt::normalization_shift( exponent=minus_exprt(exponent, exponent_delta); } -/*******************************************************************\ - -Function: float_bvt::denormalization_shift - - Inputs: - - Outputs: - - Purpose: make sure exponent is not too small; - the exponent is unbiased - -\*******************************************************************/ - +/// make sure exponent is not too small; the exponent is unbiased void float_bvt::denormalization_shift( exprt &fraction, exprt &exponent, @@ -1375,18 +1006,6 @@ void float_bvt::denormalization_shift( exponent); } -/*******************************************************************\ - -Function: float_bvt::rounder - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - exprt float_bvt::rounder( const unbiased_floatt &src, const exprt &rm, @@ -1431,18 +1050,7 @@ exprt float_bvt::rounder( return pack(bias(result, spec), spec); } -/*******************************************************************\ - -Function: float_bvt::fraction_rounding_decision - - Inputs: - - Outputs: - - Purpose: rounding decision for fraction using sticky bit - -\*******************************************************************/ - +/// rounding decision for fraction using sticky bit exprt float_bvt::fraction_rounding_decision( const std::size_t dest_bits, const exprt sign, @@ -1506,18 +1114,6 @@ exprt float_bvt::fraction_rounding_decision( false_exprt())))); // otherwise zero } -/*******************************************************************\ - -Function: float_bvt::round_fraction - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void float_bvt::round_fraction( unbiased_floatt &result, const rounding_mode_bitst &rounding_mode_bits, @@ -1628,18 +1224,6 @@ void float_bvt::round_fraction( } } -/*******************************************************************\ - -Function: float_bvt::round_exponent - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void float_bvt::round_exponent( unbiased_floatt &result, const rounding_mode_bitst &rounding_mode_bits, @@ -1714,18 +1298,7 @@ void float_bvt::round_exponent( } } -/*******************************************************************\ - -Function: float_bvt::bias - - Inputs: - - Outputs: - - Purpose: takes an unbiased float, and applies the bias - -\*******************************************************************/ - +/// takes an unbiased float, and applies the bias float_bvt::biased_floatt float_bvt::bias( const unbiased_floatt &src, const ieee_float_spect &spec) @@ -1759,18 +1332,6 @@ float_bvt::biased_floatt float_bvt::bias( return result; } -/*******************************************************************\ - -Function: float_bvt::add_bias - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - exprt float_bvt::add_bias( const exprt &src, const ieee_float_spect &spec) @@ -1781,18 +1342,6 @@ exprt float_bvt::add_bias( from_integer(spec.bias(), t)); } -/*******************************************************************\ - -Function: float_bvt::sub_bias - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - exprt float_bvt::sub_bias( const exprt &src, const ieee_float_spect &spec) @@ -1803,18 +1352,6 @@ exprt float_bvt::sub_bias( from_integer(spec.bias(), t)); } -/*******************************************************************\ - -Function: float_bvt::unpack - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - float_bvt::unbiased_floatt float_bvt::unpack( const exprt &src, const ieee_float_spect &spec) @@ -1848,18 +1385,6 @@ float_bvt::unbiased_floatt float_bvt::unpack( return result; } -/*******************************************************************\ - -Function: float_bvt::pack - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - exprt float_bvt::pack( const biased_floatt &src, const ieee_float_spect &spec) @@ -1895,18 +1420,6 @@ exprt float_bvt::pack( spec.to_type()); } -/*******************************************************************\ - -Function: float_bvt::sticky_right_shift - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - exprt float_bvt::sticky_right_shift( const exprt &op, const exprt &dist, diff --git a/src/solvers/floatbv/float_utils.cpp b/src/solvers/floatbv/float_utils.cpp index 3660aced265..35cb12de2ab 100644 --- a/src/solvers/floatbv/float_utils.cpp +++ b/src/solvers/floatbv/float_utils.cpp @@ -13,18 +13,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "float_utils.h" -/*******************************************************************\ - -Function: float_utilst::set_rounding_mode - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void float_utilst::set_rounding_mode(const bvt &src) { bvt round_to_even= @@ -42,18 +30,6 @@ void float_utilst::set_rounding_mode(const bvt &src) rounding_mode_bits.round_to_zero=bv_utils.equal(src, round_to_zero); } -/*******************************************************************\ - -Function: float_utilst::from_signed_integer - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bvt float_utilst::from_signed_integer(const bvt &src) { unbiased_floatt result; @@ -72,18 +48,6 @@ bvt float_utilst::from_signed_integer(const bvt &src) return rounder(result); } -/*******************************************************************\ - -Function: float_utilst::from_unsigned_integer - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bvt float_utilst::from_unsigned_integer(const bvt &src) { unbiased_floatt result; @@ -101,18 +65,6 @@ bvt float_utilst::from_unsigned_integer(const bvt &src) return rounder(result); } -/*******************************************************************\ - -Function: float_utilst::to_signed_integer - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bvt float_utilst::to_signed_integer( const bvt &src, std::size_t dest_width) @@ -120,18 +72,6 @@ bvt float_utilst::to_signed_integer( return to_integer(src, dest_width, true); } -/*******************************************************************\ - -Function: float_utilst::to_unsigned_integer - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bvt float_utilst::to_unsigned_integer( const bvt &src, std::size_t dest_width) @@ -139,18 +79,6 @@ bvt float_utilst::to_unsigned_integer( return to_integer(src, dest_width, false); } -/*******************************************************************\ - -Function: float_utilst::to_integer - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bvt float_utilst::to_integer( const bvt &src, std::size_t dest_width, @@ -210,18 +138,6 @@ bvt float_utilst::to_integer( throw "unsupported rounding mode"; } -/*******************************************************************\ - -Function: float_utilst::build_constant - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bvt float_utilst::build_constant(const ieee_floatt &src) { unbiased_floatt result; @@ -235,18 +151,6 @@ bvt float_utilst::build_constant(const ieee_floatt &src) return pack(bias(result)); } -/*******************************************************************\ - -Function: float_utilst::conversion - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bvt float_utilst::conversion( const bvt &src, const ieee_float_spect &dest_spec) @@ -314,18 +218,6 @@ bvt float_utilst::conversion( } } -/*******************************************************************\ - -Function: float_utilst::is_normal - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - literalt float_utilst::is_normal(const bvt &src) { return prop.land( @@ -333,18 +225,7 @@ literalt float_utilst::is_normal(const bvt &src) !exponent_all_ones(src)); } -/*******************************************************************\ - -Function: float_utilst::subtract_exponents - - Inputs: - - Outputs: - - Purpose: Subtracts the exponents - -\*******************************************************************/ - +/// Subtracts the exponents bvt float_utilst::subtract_exponents( const unbiased_floatt &src1, const unbiased_floatt &src2) @@ -361,18 +242,6 @@ bvt float_utilst::subtract_exponents( return bv_utils.sub(extended_exponent1, extended_exponent2); } -/*******************************************************************\ - -Function: float_utilst::add_sub - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bvt float_utilst::add_sub( const bvt &src1, const bvt &src2, @@ -514,18 +383,7 @@ bvt float_utilst::add_sub( return rounder(result); } -/*******************************************************************\ - -Function: float_utilst::limit_distance - - Inputs: - - Outputs: - - Purpose: Limits the shift distance - -\*******************************************************************/ - +/// Limits the shift distance bvt float_utilst::limit_distance( const bvt &dist, mp_integer limit) @@ -549,18 +407,6 @@ bvt float_utilst::limit_distance( return result; } -/*******************************************************************\ - -Function: float_utilst::mul - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bvt float_utilst::mul(const bvt &src1, const bvt &src2) { // unpack @@ -613,18 +459,6 @@ bvt float_utilst::mul(const bvt &src1, const bvt &src2) return rounder(result); } -/*******************************************************************\ - -Function: float_utilst::div - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bvt float_utilst::div(const bvt &src1, const bvt &src2) { // unpack @@ -704,18 +538,6 @@ bvt float_utilst::div(const bvt &src1, const bvt &src2) return rounder(result); } -/*******************************************************************\ - -Function: float_utilst::rem - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bvt float_utilst::rem(const bvt &src1, const bvt &src2) { /* The semantics of floating-point remainder implemented as below @@ -731,18 +553,6 @@ bvt float_utilst::rem(const bvt &src1, const bvt &src2) return sub(src1, mul(div(src1, src2), src2)); } -/*******************************************************************\ - -Function: float_utilst::negate - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bvt float_utilst::negate(const bvt &src) { bvt result=src; @@ -752,18 +562,6 @@ bvt float_utilst::negate(const bvt &src) return result; } -/*******************************************************************\ - -Function: float_utilst::abs - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bvt float_utilst::abs(const bvt &src) { bvt result=src; @@ -772,18 +570,6 @@ bvt float_utilst::abs(const bvt &src) return result; } -/*******************************************************************\ - -Function: float_utilst::relation - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - literalt float_utilst::relation( const bvt &src1, relt rel, @@ -866,18 +652,6 @@ literalt float_utilst::relation( return const_literal(false); } -/*******************************************************************\ - -Function: float_utilst::is_zero - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - literalt float_utilst::is_zero(const bvt &src) { assert(!src.empty()); @@ -887,18 +661,6 @@ literalt float_utilst::is_zero(const bvt &src) return bv_utils.is_zero(all_but_sign); } -/*******************************************************************\ - -Function: float_utilst::is_plus_inf - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - literalt float_utilst::is_plus_inf(const bvt &src) { bvt and_bv; @@ -908,18 +670,6 @@ literalt float_utilst::is_plus_inf(const bvt &src) return prop.land(and_bv); } -/*******************************************************************\ - -Function: float_utilst::infinity - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - literalt float_utilst::is_infinity(const bvt &src) { return prop.land( @@ -927,53 +677,18 @@ literalt float_utilst::is_infinity(const bvt &src) fraction_all_zeros(src)); } -/*******************************************************************\ - -Function: float_utilst::get_exponent - - Inputs: - - Outputs: - - Purpose: Gets the unbiased exponent in a floating-point bit-vector - -\*******************************************************************/ - +/// Gets the unbiased exponent in a floating-point bit-vector bvt float_utilst::get_exponent(const bvt &src) { return bv_utils.extract(src, spec.f, spec.f+spec.e-1); } -/*******************************************************************\ - -Function: float_utilst::get_fraction - - Inputs: - - Outputs: - - Purpose: Gets the fraction without hidden bit in a floating-point - bit-vector src - -\*******************************************************************/ - +/// Gets the fraction without hidden bit in a floating-point bit-vector src bvt float_utilst::get_fraction(const bvt &src) { return bv_utils.extract(src, 0, spec.f-1); } -/*******************************************************************\ - -Function: float_utilst::is_minus_inf - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - literalt float_utilst::is_minus_inf(const bvt &src) { bvt and_bv; @@ -983,36 +698,12 @@ literalt float_utilst::is_minus_inf(const bvt &src) return prop.land(and_bv); } -/*******************************************************************\ - -Function: float_utilst::is_NaN - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - literalt float_utilst::is_NaN(const bvt &src) { return prop.land(exponent_all_ones(src), !fraction_all_zeros(src)); } -/*******************************************************************\ - -Function: float_utilst::exponent_all_ones - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - literalt float_utilst::exponent_all_ones(const bvt &src) { bvt exponent=src; @@ -1026,18 +717,6 @@ literalt float_utilst::exponent_all_ones(const bvt &src) return bv_utils.is_all_ones(exponent); } -/*******************************************************************\ - -Function: float_utilst::exponent_all_zeros - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - literalt float_utilst::exponent_all_zeros(const bvt &src) { bvt exponent=src; @@ -1051,18 +730,6 @@ literalt float_utilst::exponent_all_zeros(const bvt &src) return bv_utils.is_zero(exponent); } -/*******************************************************************\ - -Function: float_utilst::fraction_all_zeros - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - literalt float_utilst::fraction_all_zeros(const bvt &src) { // does not include hidden bit @@ -1072,19 +739,7 @@ literalt float_utilst::fraction_all_zeros(const bvt &src) return bv_utils.is_zero(tmp); } -/*******************************************************************\ - -Function: float_utilst::normalization_shift - - Inputs: - - Outputs: - - Purpose: normalize fraction/exponent pair - returns 'zero' if fraction is zero - -\*******************************************************************/ - +/// normalize fraction/exponent pair returns 'zero' if fraction is zero void float_utilst::normalization_shift(bvt &fraction, bvt &exponent) { #if 0 @@ -1169,19 +824,7 @@ void float_utilst::normalization_shift(bvt &fraction, bvt &exponent) #endif } -/*******************************************************************\ - -Function: float_utilst::denormalization_shift - - Inputs: - - Outputs: - - Purpose: make sure exponent is not too small; - the exponent is unbiased - -\*******************************************************************/ - +/// make sure exponent is not too small; the exponent is unbiased void float_utilst::denormalization_shift(bvt &fraction, bvt &exponent) { mp_integer bias=spec.bias(); @@ -1250,18 +893,6 @@ void float_utilst::denormalization_shift(bvt &fraction, bvt &exponent) exponent); } -/*******************************************************************\ - -Function: float_utilst::rounder - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bvt float_utilst::rounder(const unbiased_floatt &src) { // incoming: some fraction (with explicit 1), @@ -1302,18 +933,7 @@ bvt float_utilst::rounder(const unbiased_floatt &src) return pack(bias(result)); } -/*******************************************************************\ - -Function: float_utilst::fraction_rounding_decision - - Inputs: - - Outputs: - - Purpose: rounding decision for fraction using sticky bit - -\*******************************************************************/ - +/// rounding decision for fraction using sticky bit literalt float_utilst::fraction_rounding_decision( const std::size_t dest_bits, const literalt sign, @@ -1371,18 +991,6 @@ literalt float_utilst::fraction_rounding_decision( prop.new_variable())))); // otherwise non-det } -/*******************************************************************\ - -Function: float_utilst::round_fraction - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void float_utilst::round_fraction(unbiased_floatt &result) { std::size_t fraction_size=spec.f+1; @@ -1475,18 +1083,6 @@ void float_utilst::round_fraction(unbiased_floatt &result) } } -/*******************************************************************\ - -Function: float_utilst::round_exponent - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void float_utilst::round_exponent(unbiased_floatt &result) { // do we need to enlarge the exponent? @@ -1552,18 +1148,7 @@ void float_utilst::round_exponent(unbiased_floatt &result) } } -/*******************************************************************\ - -Function: float_utilst::bias - - Inputs: - - Outputs: - - Purpose: takes an unbiased float, and applies the bias - -\*******************************************************************/ - +/// takes an unbiased float, and applies the bias float_utilst::biased_floatt float_utilst::bias(const unbiased_floatt &src) { biased_floatt result; @@ -1593,18 +1178,6 @@ float_utilst::biased_floatt float_utilst::bias(const unbiased_floatt &src) return result; } -/*******************************************************************\ - -Function: float_utilst::add_bias - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bvt float_utilst::add_bias(const bvt &src) { assert(src.size()==spec.e); @@ -1614,18 +1187,6 @@ bvt float_utilst::add_bias(const bvt &src) bv_utils.build_constant(spec.bias(), spec.e)); } -/*******************************************************************\ - -Function: float_utilst::sub_bias - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bvt float_utilst::sub_bias(const bvt &src) { assert(src.size()==spec.e); @@ -1635,18 +1196,6 @@ bvt float_utilst::sub_bias(const bvt &src) bv_utils.build_constant(spec.bias(), spec.e)); } -/*******************************************************************\ - -Function: float_utilst::unpack - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - float_utilst::unbiased_floatt float_utilst::unpack(const bvt &src) { assert(src.size()==spec.width()); @@ -1676,18 +1225,6 @@ float_utilst::unbiased_floatt float_utilst::unpack(const bvt &src) return result; } -/*******************************************************************\ - -Function: float_utilst::pack - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bvt float_utilst::pack(const biased_floatt &src) { assert(src.fraction.size()==spec.f); @@ -1719,18 +1256,6 @@ bvt float_utilst::pack(const biased_floatt &src) return result; } -/*******************************************************************\ - -Function: float_utilst::get - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - ieee_floatt float_utilst::get(const bvt &src) const { mp_integer int_value=0; @@ -1745,18 +1270,6 @@ ieee_floatt float_utilst::get(const bvt &src) const return result; } -/*******************************************************************\ - -Function: float_utilst::sticky_right_shift - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bvt float_utilst::sticky_right_shift( const bvt &op, const bvt &dist, @@ -1792,18 +1305,6 @@ bvt float_utilst::sticky_right_shift( return result; } -/*******************************************************************\ - -Function: float_utilst::debug1 - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bvt float_utilst::debug1( const bvt &src1, const bvt &src2) @@ -1811,18 +1312,6 @@ bvt float_utilst::debug1( return src1; } -/*******************************************************************\ - -Function: float_utilst::debug1 - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bvt float_utilst::debug2( const bvt &op0, const bvt &op1) diff --git a/src/solvers/miniBDD/example.cpp b/src/solvers/miniBDD/example.cpp index 2dddc990d5a..4918b89a601 100644 --- a/src/solvers/miniBDD/example.cpp +++ b/src/solvers/miniBDD/example.cpp @@ -7,6 +7,10 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// A minimalistic BDD library, following Bryant's original paper and Andersen's +/// lecture notes + #include #include "miniBDD.h" diff --git a/src/solvers/miniBDD/miniBDD.cpp b/src/solvers/miniBDD/miniBDD.cpp index 756a9dc6e52..2b337c2ec15 100644 --- a/src/solvers/miniBDD/miniBDD.cpp +++ b/src/solvers/miniBDD/miniBDD.cpp @@ -7,6 +7,10 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// A minimalistic BDD library, following Bryant's original paper and Andersen's +/// lecture notes + #include #include diff --git a/src/solvers/miniBDD/miniBDD.h b/src/solvers/miniBDD/miniBDD.h index aab378edbae..f7dde020fe6 100644 --- a/src/solvers/miniBDD/miniBDD.h +++ b/src/solvers/miniBDD/miniBDD.h @@ -7,6 +7,10 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// A minimalistic BDD library, following Bryant's original paper and Andersen's +/// lecture notes + #ifndef CPROVER_SOLVERS_MINIBDD_MINIBDD_H #define CPROVER_SOLVERS_MINIBDD_MINIBDD_H diff --git a/src/solvers/prop/aig.cpp b/src/solvers/prop/aig.cpp index 791436646f9..1134e39c3bd 100644 --- a/src/solvers/prop/aig.cpp +++ b/src/solvers/prop/aig.cpp @@ -12,70 +12,22 @@ Author: Daniel Kroening, kroening@kroening.com #include "aig.h" -/*******************************************************************\ - -Function: aigt::label - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string aigt::label(nodest::size_type v) const { return "var("+std::to_string(v)+")"; } -/*******************************************************************\ - -Function: aigt::dot_label - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string aigt::dot_label(nodest::size_type v) const { return "var("+std::to_string(v)+")"; } -/*******************************************************************\ - -Function: aigt::get_terminals - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void aigt::get_terminals(terminalst &terminals) const { for(nodest::size_type n=0; n &n_pos, std::vector &n_neg) @@ -400,18 +223,9 @@ void aig_prop_solvert::compute_phase( } -/*******************************************************************\ - -Function: aig_prop_solvert::usage_count - - Inputs: Two vectors of unsigned of size aig.nodes.size() - - Outputs: These vectors filled in with per node usage information - - Purpose: Compact encoding for single usage variable - -\*******************************************************************/ - +/// Compact encoding for single usage variable +/// \par parameters: Two vectors of unsigned of size aig.nodes.size() +/// \return These vectors filled in with per node usage information void aig_prop_solvert::usage_count( std::vector &p_usage_count, std::vector &n_usage_count) @@ -519,18 +333,10 @@ void aig_prop_solvert::usage_count( #endif } -/*******************************************************************\ - -Function: aig_prop_solvert::convert_node - - Inputs: The node to convert, the phases required and the usage counts. - - Outputs: The node converted to CNF in the solver object. - - Purpose: Convert one AIG node, including special handling of a couple of cases - -\*******************************************************************/ - +/// Convert one AIG node, including special handling of a couple of cases +/// \par parameters: The node to convert, the phases required and the usage +/// counts. +/// \return The node converted to CNF in the solver object. void aig_prop_solvert::convert_node( unsigned n, const aigt::nodet &node, @@ -742,18 +548,6 @@ void aig_prop_solvert::convert_node( } } -/*******************************************************************\ - -Function: aig_prop_solvert::convert_aig - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void aig_prop_solvert::convert_aig() { // 1. Do variables diff --git a/src/solvers/prop/bdd_expr.cpp b/src/solvers/prop/bdd_expr.cpp index 91e06dfb08a..9a885c031b7 100644 --- a/src/solvers/prop/bdd_expr.cpp +++ b/src/solvers/prop/bdd_expr.cpp @@ -6,6 +6,9 @@ Author: Michael Tautschnig, michael.tautschnig@qmul.ac.uk \*******************************************************************/ +/// \file +/// Conversion between exprt and miniBDD + #include #include @@ -13,18 +16,6 @@ Author: Michael Tautschnig, michael.tautschnig@qmul.ac.uk #include "bdd_expr.h" -/*******************************************************************\ - -Function: bdd_exprt::from_expr_rec - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - mini_bddt bdd_exprt::from_expr_rec(const exprt &expr) { assert(expr.type().id()==ID_bool); @@ -103,35 +94,11 @@ mini_bddt bdd_exprt::from_expr_rec(const exprt &expr) } } -/*******************************************************************\ - -Function: bdd_exprt::from_expr - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void bdd_exprt::from_expr(const exprt &expr) { root=from_expr_rec(expr); } -/*******************************************************************\ - -Function: bdd_exprt::as_expr - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - exprt bdd_exprt::as_expr(const mini_bddt &r) const { if(r.is_constant()) @@ -168,18 +135,6 @@ exprt bdd_exprt::as_expr(const mini_bddt &r) const return if_exprt(n_expr, as_expr(r.high()), as_expr(r.low())); } -/*******************************************************************\ - -Function: bdd_exprt::as_expr - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - exprt bdd_exprt::as_expr() const { if(!root.is_initialized()) diff --git a/src/solvers/prop/bdd_expr.h b/src/solvers/prop/bdd_expr.h index 3c35aa5dc21..c462a17e669 100644 --- a/src/solvers/prop/bdd_expr.h +++ b/src/solvers/prop/bdd_expr.h @@ -6,6 +6,9 @@ Author: Michael Tautschnig, michael.tautschnig@qmul.ac.uk \*******************************************************************/ +/// \file +/// Conversion between exprt and miniBDD + #ifndef CPROVER_SOLVERS_PROP_BDD_EXPR_H #define CPROVER_SOLVERS_PROP_BDD_EXPR_H diff --git a/src/solvers/prop/cover_goals.cpp b/src/solvers/prop/cover_goals.cpp index b4f2e614bf3..1783983ccf9 100644 --- a/src/solvers/prop/cover_goals.cpp +++ b/src/solvers/prop/cover_goals.cpp @@ -6,39 +6,19 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Cover a set of goals incrementally + #include #include "literal_expr.h" #include "cover_goals.h" -/*******************************************************************\ - -Function: cover_goalst::~cover_goalst - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - cover_goalst::~cover_goalst() { } -/*******************************************************************\ - -Function: cover_goalst::mark - - Inputs: - - Outputs: - - Purpose: Mark goals that are covered - -\*******************************************************************/ - +/// Mark goals that are covered void cover_goalst::mark() { // notify observers @@ -58,18 +38,7 @@ void cover_goalst::mark() } } -/*******************************************************************\ - -Function: cover_goalst::constaint - - Inputs: - - Outputs: - - Purpose: Build clause - -\*******************************************************************/ - +/// Build clause void cover_goalst::constraint() { exprt::operandst disjuncts; @@ -88,18 +57,7 @@ void cover_goalst::constraint() prop_conv.set_to_true(disjunction(disjuncts)); } -/*******************************************************************\ - -Function: cover_goalst::freeze_goal_variables - - Inputs: - - Outputs: - - Purpose: Build clause - -\*******************************************************************/ - +/// Build clause void cover_goalst::freeze_goal_variables() { for(std::list::const_iterator @@ -110,18 +68,7 @@ void cover_goalst::freeze_goal_variables() prop_conv.set_frozen(g_it->condition); } -/*******************************************************************\ - -Function: cover_goalst::operator() - - Inputs: - - Outputs: - - Purpose: Try to cover all goals - -\*******************************************************************/ - +/// Try to cover all goals decision_proceduret::resultt cover_goalst::operator()() { _iterations=_number_covered=0; diff --git a/src/solvers/prop/cover_goals.h b/src/solvers/prop/cover_goals.h index afb93c9e534..8851e188347 100644 --- a/src/solvers/prop/cover_goals.h +++ b/src/solvers/prop/cover_goals.h @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Cover a set of goals incrementally + #ifndef CPROVER_SOLVERS_PROP_COVER_GOALS_H #define CPROVER_SOLVERS_PROP_COVER_GOALS_H @@ -13,16 +16,8 @@ Author: Daniel Kroening, kroening@kroening.com #include "prop_conv.h" -/*******************************************************************\ - - Class: cover_gooalst - - Purpose: Try to cover some given set of goals incrementally. - This can be seen as a heuristic variant of - SAT-based set-cover. No minimality guarantee. - -\*******************************************************************/ - +/// Try to cover some given set of goals incrementally. This can be seen as a +/// heuristic variant of SAT-based set-cover. No minimality guarantee. class cover_goalst:public messaget { public: diff --git a/src/solvers/prop/literal.cpp b/src/solvers/prop/literal.cpp index d57da3e91a3..e00f3bb37be 100644 --- a/src/solvers/prop/literal.cpp +++ b/src/solvers/prop/literal.cpp @@ -6,22 +6,13 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Literals + #include #include "literal.h" -/*******************************************************************\ - -Function: operator << - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::ostream &operator << (std::ostream &out, literalt l) { if(l.is_constant()) diff --git a/src/solvers/prop/minimize.cpp b/src/solvers/prop/minimize.cpp index bdbc6661159..8ae18a1787c 100644 --- a/src/solvers/prop/minimize.cpp +++ b/src/solvers/prop/minimize.cpp @@ -6,23 +6,15 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Minimize some target function incrementally + #include #include "literal_expr.h" #include "minimize.h" -/*******************************************************************\ - -Function: prop_minimizet::objective - - Inputs: - - Outputs: - - Purpose: Add an objective - -\*******************************************************************/ - +/// Add an objective void prop_minimizet::objective( const literalt condition, const weightt weight) @@ -39,18 +31,7 @@ void prop_minimizet::objective( } } -/*******************************************************************\ - -Function: prop_minimizet::fix - - Inputs: - - Outputs: - - Purpose: Fix objectives that are satisfied - -\*******************************************************************/ - +/// Fix objectives that are satisfied void prop_minimizet::fix_objectives() { std::vector &entry=current->second; @@ -75,19 +56,7 @@ void prop_minimizet::fix_objectives() assert(found); } -/*******************************************************************\ - -Function: prop_minimizet::constaint - - Inputs: - - Outputs: - - Purpose: Build constraints that require us to improve on - at least one goal, greedily. - -\*******************************************************************/ - +/// Build constraints that require us to improve on at least one goal, greedily. literalt prop_minimizet::constraint() { std::vector &entry=current->second; @@ -119,18 +88,7 @@ literalt prop_minimizet::constraint() } } -/*******************************************************************\ - -Function: prop_minimizet::operator() - - Inputs: - - Outputs: - - Purpose: Try to cover all objectives - -\*******************************************************************/ - +/// Try to cover all objectives void prop_minimizet::operator()() { // we need to use assumptions diff --git a/src/solvers/prop/minimize.h b/src/solvers/prop/minimize.h index f546f8442ee..3818a76b114 100644 --- a/src/solvers/prop/minimize.h +++ b/src/solvers/prop/minimize.h @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// SAT Minimizer + #ifndef CPROVER_SOLVERS_PROP_MINIMIZE_H #define CPROVER_SOLVERS_PROP_MINIMIZE_H @@ -15,15 +18,8 @@ Author: Daniel Kroening, kroening@kroening.com #include "prop_conv.h" -/*******************************************************************\ - - Class: prop_minimizet - - Purpose: Computes a satisfying assignment of minimal cost - according to a const function using incremental SAT - -\*******************************************************************/ - +/// Computes a satisfying assignment of minimal cost according to a const +/// function using incremental SAT class prop_minimizet:public messaget { public: diff --git a/src/solvers/prop/prop.cpp b/src/solvers/prop/prop.cpp index cb17cc9ce11..223f1bfe6f2 100644 --- a/src/solvers/prop/prop.cpp +++ b/src/solvers/prop/prop.cpp @@ -10,88 +10,32 @@ Author: Daniel Kroening, kroening@kroening.com #include "prop.h" -/*******************************************************************\ - -Function: propt::set_equal - - Inputs: - - Outputs: - - Purpose: asserts a==b in the propositional formula - -\*******************************************************************/ - +/// asserts a==b in the propositional formula void propt::set_equal(literalt a, literalt b) { lcnf(a, !b); lcnf(!a, b); } -/*******************************************************************\ - -Function: propt::set_assignment - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void propt::set_assignment(literalt a, bool value) { assert(false); } -/*******************************************************************\ - -Function: propt::copy_assignment_from - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void propt::copy_assignment_from(const propt &src) { assert(false); } -/*******************************************************************\ - -Function: propt::is_in_conflict - - Inputs: - - Outputs: true iff the given literal is part of the final conflict - - Purpose: - -\*******************************************************************/ - +/// \return true iff the given literal is part of the final conflict bool propt::is_in_conflict(literalt l) const { assert(false); return false; } -/*******************************************************************\ - -Function: propt::new_variables - - Inputs: width - - Outputs: bitvector - - Purpose: generates a bitvector of given width with new variables - -\*******************************************************************/ - +/// generates a bitvector of given width with new variables +/// \return bitvector bvt propt::new_variables(std::size_t width) { bvt result; diff --git a/src/solvers/prop/prop_assignment.cpp b/src/solvers/prop/prop_assignment.cpp index f191a4c6c55..96e2ec18296 100644 --- a/src/solvers/prop/prop_assignment.cpp +++ b/src/solvers/prop/prop_assignment.cpp @@ -8,18 +8,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "prop_assignment.h" -/*******************************************************************\ - -Function: prop_assignmentt::~prop_assignmentt - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - prop_assignmentt::~prop_assignmentt() { } diff --git a/src/solvers/prop/prop_conv.cpp b/src/solvers/prop/prop_conv.cpp index eac517bf2b6..2356700a6f1 100644 --- a/src/solvers/prop/prop_conv.cpp +++ b/src/solvers/prop/prop_conv.cpp @@ -18,70 +18,23 @@ Author: Daniel Kroening, kroening@kroening.com #include "prop_conv.h" #include "literal_expr.h" -/*******************************************************************\ - -Function: prop_convt::is_in_conflict - - Inputs: - - Outputs: - - Purpose: determine whether a variable is in the final conflict - -\*******************************************************************/ - +/// determine whether a variable is in the final conflict bool prop_convt::is_in_conflict(literalt l) const { assert(false); return false; } -/*******************************************************************\ - -Function: prop_convt::set_assumptions - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void prop_convt::set_assumptions(const bvt &) { assert(false); } -/*******************************************************************\ - -Function: prop_convt::set_frozen - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void prop_convt::set_frozen(const literalt) { assert(false); } -/*******************************************************************\ - -Function: prop_convt::set_frozen - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void prop_convt::set_frozen(const bvt &bv) { for(unsigned i=0; i result= @@ -153,18 +82,7 @@ literalt prop_conv_solvert::get_literal(const irep_idt &identifier) return literal; } -/*******************************************************************\ - -Function: prop_conv_solvert::get_bool - - Inputs: - - Outputs: - - Purpose: get a boolean value from counter example if not valid - -\*******************************************************************/ - +/// get a boolean value from counter example if not valid bool prop_conv_solvert::get_bool(const exprt &expr, tvt &value) const { // trivial cases @@ -253,18 +171,6 @@ bool prop_conv_solvert::get_bool(const exprt &expr, tvt &value) const return false; } -/*******************************************************************\ - -Function: prop_conv_solvert::convert - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - literalt prop_conv_solvert::convert(const exprt &expr) { if(!use_cache || @@ -299,18 +205,6 @@ literalt prop_conv_solvert::convert(const exprt &expr) return literal; } -/*******************************************************************\ - -Function: prop_conv_solvert::convert_bool - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - literalt prop_conv_solvert::convert_bool(const exprt &expr) { if(expr.type().id()!=ID_bool) @@ -439,18 +333,6 @@ literalt prop_conv_solvert::convert_bool(const exprt &expr) return convert_rest(expr); } -/*******************************************************************\ - -Function: prop_conv_solvert::convert_rest - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - literalt prop_conv_solvert::convert_rest(const exprt &expr) { // fall through @@ -458,18 +340,6 @@ literalt prop_conv_solvert::convert_rest(const exprt &expr) return prop.new_variable(); } -/*******************************************************************\ - -Function: prop_conv_solvert::set_equality_to_true - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool prop_conv_solvert::set_equality_to_true(const equal_exprt &expr) { if(!equality_propagation) @@ -497,18 +367,6 @@ bool prop_conv_solvert::set_equality_to_true(const equal_exprt &expr) return true; } -/*******************************************************************\ - -Function: prop_conv_solvert::set_to - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void prop_conv_solvert::set_to(const exprt &expr, bool value) { if(expr.type().id()!=ID_bool) @@ -608,18 +466,6 @@ void prop_conv_solvert::set_to(const exprt &expr, bool value) prop.l_set_to(convert(expr), value); } -/*******************************************************************\ - -Function: prop_conv_solvert::ignoring - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void prop_conv_solvert::ignoring(const exprt &expr) { // fall through @@ -629,34 +475,10 @@ void prop_conv_solvert::ignoring(const exprt &expr) print(2, msg); } -/*******************************************************************\ - -Function: prop_conv_solvert::post_process - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void prop_conv_solvert::post_process() { } -/*******************************************************************\ - -Function: prop_conv_solvert::solve - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - decision_proceduret::resultt prop_conv_solvert::dec_solve() { // post-processing isn't incremental yet @@ -681,18 +503,6 @@ decision_proceduret::resultt prop_conv_solvert::dec_solve() return resultt::D_ERROR; } -/*******************************************************************\ - -Function: prop_conv_solvert::get - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - exprt prop_conv_solvert::get(const exprt &expr) const { tvt value; @@ -719,18 +529,6 @@ exprt prop_conv_solvert::get(const exprt &expr) const return tmp; } -/*******************************************************************\ - -Function: prop_conv_solvert::print_assignment - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void prop_conv_solvert::print_assignment(std::ostream &out) const { for(symbolst::const_iterator it=symbols.begin(); diff --git a/src/solvers/prop/prop_conv_store.cpp b/src/solvers/prop/prop_conv_store.cpp index 9fb2c09a414..d4428482367 100644 --- a/src/solvers/prop/prop_conv_store.cpp +++ b/src/solvers/prop/prop_conv_store.cpp @@ -10,18 +10,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "prop_conv_store.h" -/*******************************************************************\ - -Function: prop_conv_storet::set_to - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void prop_conv_storet::set_to(const exprt &expr, bool value) { constraintt &constraint=constraints.add_constraint(); @@ -30,18 +18,6 @@ void prop_conv_storet::set_to(const exprt &expr, bool value) constraint.value=value; } -/*******************************************************************\ - -Function: prop_conv_storet::convert_rest - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - literalt prop_conv_storet::convert(const exprt &expr) { constraintt &constraint=constraints.add_constraint(); @@ -53,18 +29,6 @@ literalt prop_conv_storet::convert(const exprt &expr) return constraint.literal; } -/*******************************************************************\ - -Function: prop_conv_storet::constraintst::replay - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void prop_conv_storet::constraintst::replay(prop_convt &dest) const { for(constraint_listt::const_iterator @@ -74,18 +38,6 @@ void prop_conv_storet::constraintst::replay(prop_convt &dest) const it->replay(dest); } -/*******************************************************************\ - -Function: prop_conv_storet::constraintst::print - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void prop_conv_storet::constraintst::print(std::ostream &out) const { for(constraint_listt::const_iterator @@ -95,18 +47,6 @@ void prop_conv_storet::constraintst::print(std::ostream &out) const it->print(out); } -/*******************************************************************\ - -Function: prop_conv_storet::constraintt::replay - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void prop_conv_storet::constraintt::replay(prop_convt &dest) const { switch(type) @@ -124,18 +64,6 @@ void prop_conv_storet::constraintt::replay(prop_convt &dest) const } } -/*******************************************************************\ - -Function: prop_conv_storet::constraintt::print - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void prop_conv_storet::constraintt::print(std::ostream &out) const { switch(type) diff --git a/src/solvers/qbf/qbf_bdd_core.cpp b/src/solvers/qbf/qbf_bdd_core.cpp index 9fa58639ad0..202e7026658 100644 --- a/src/solvers/qbf/qbf_bdd_core.cpp +++ b/src/solvers/qbf/qbf_bdd_core.cpp @@ -21,18 +21,6 @@ Author: CM Wintersteiger /*! \cond */ // FIX FOR THE CUDD LIBRARY -/*******************************************************************\ - -Function: DD::getNode - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - inline DdNode *DD::getNode() const { return node; @@ -42,35 +30,11 @@ inline DdNode *DD::getNode() const #include "qbf_bdd_core.h" -/*******************************************************************\ - -Function: qbf_bdd_certificatet::qbf_bdd_certificatet - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - qbf_bdd_certificatet::qbf_bdd_certificatet(void) : qdimacs_coret() { bdd_manager=new Cudd(0, 0); } -/*******************************************************************\ - -Function: qbf_bdd_certificatet::~qbf_bdd_certificatet - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - qbf_bdd_certificatet::~qbf_bdd_certificatet(void) { for(const BDD* model : model_bdds) @@ -84,18 +48,6 @@ qbf_bdd_certificatet::~qbf_bdd_certificatet(void) bdd_manager=NULL; } -/*******************************************************************\ - -Function: qbf_bdd_certificatet::new_variable - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - literalt qbf_bdd_certificatet::new_variable(void) { literalt l=qdimacs_coret::new_variable(); @@ -106,36 +58,12 @@ literalt qbf_bdd_certificatet::new_variable(void) return l; } -/*******************************************************************\ - -Function: qbf_bdd_coret::qbf_bdd_coret - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - qbf_bdd_coret::qbf_bdd_coret() : qbf_bdd_certificatet() { matrix=new BDD(); *matrix=bdd_manager->bddOne(); } -/*******************************************************************\ - -Function: qbf_bdd_coret::~qbf_bdd_coret - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - qbf_bdd_coret::~qbf_bdd_coret() { for(const BDD* variable : bdd_variable_map) @@ -152,53 +80,17 @@ qbf_bdd_coret::~qbf_bdd_coret() } } -/*******************************************************************\ - -Function: qbf_bdd_coret::l_get - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - tvt qbf_bdd_coret::l_get(literalt a) const { assert(false); return tvt(false); } -/*******************************************************************\ - -Function: qbf_bdd_coret::solver_text - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - const std::string qbf_bdd_coret::solver_text() { return "QBF/BDD/CORE"; } -/*******************************************************************\ - -Function: qbf_bdd_coret::prop_solve - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - propt::resultt qbf_bdd_coret::prop_solve() { { @@ -259,52 +151,16 @@ propt::resultt qbf_bdd_coret::prop_solve() return P_ERROR; } -/*******************************************************************\ - -Function: qbf_bdd_coret::is_in_core - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool qbf_bdd_coret::is_in_core(literalt l) const { throw "nyi"; } -/*******************************************************************\ - -Function: qbf_bdd_coret::m_get - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - qdimacs_coret::modeltypet qbf_bdd_coret::m_get(literalt a) const { throw "nyi"; } -/*******************************************************************\ - -Function: qbf_bdd_coret::new_variable - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - literalt qbf_bdd_coret::new_variable() { literalt res=qbf_bdd_certificatet::new_variable(); @@ -317,18 +173,6 @@ literalt qbf_bdd_coret::new_variable() return res; } -/*******************************************************************\ - -Function: qbf_bdd_coret::lcnf - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void qbf_bdd_coret::lcnf(const bvt &bv) { bvt new_bv; @@ -351,18 +195,6 @@ void qbf_bdd_coret::lcnf(const bvt &bv) *matrix&=clause; } -/*******************************************************************\ - -Function: qbf_bdd_coret::lor - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - literalt qbf_bdd_coret::lor(literalt a, literalt b) { literalt nl=new_variable(); @@ -380,18 +212,6 @@ literalt qbf_bdd_coret::lor(literalt a, literalt b) return nl; } -/*******************************************************************\ - -Function: qbf_bdd_coret::lor - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - literalt qbf_bdd_coret::lor(const bvt &bv) { for(const literalt &literal : bv) @@ -419,18 +239,6 @@ literalt qbf_bdd_coret::lor(const bvt &bv) return nl; } -/*******************************************************************\ - -Function: qbf_bdd_coret::compress_certificate - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void qbf_bdd_coret::compress_certificate(void) { status() << "Compressing Certificate" << eom; @@ -459,18 +267,6 @@ void qbf_bdd_coret::compress_certificate(void) } } -/*******************************************************************\ - -Function: qbf_bdd_certificatet::f_get - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - const exprt qbf_bdd_certificatet::f_get(literalt l) { quantifiert q; @@ -592,18 +388,6 @@ const exprt qbf_bdd_certificatet::f_get(literalt l) } } -/*******************************************************************\ - -Function: qbf_bdd_certificatet::l_get - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - tvt qbf_bdd_certificatet::l_get(literalt a) const { const BDD &model=*model_bdds[a.var_no()]; diff --git a/src/solvers/qbf/qbf_quantor.cpp b/src/solvers/qbf/qbf_quantor.cpp index a1ed0fa70e5..e5385c05ea5 100644 --- a/src/solvers/qbf/qbf_quantor.cpp +++ b/src/solvers/qbf/qbf_quantor.cpp @@ -12,85 +12,25 @@ Author: Daniel Kroening, kroening@kroening.com #include "qbf_quantor.h" -/*******************************************************************\ - -Function: qbf_quantort::qbf_quantort - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - qbf_quantort::qbf_quantort() { } -/*******************************************************************\ - -Function: qbf_quantort::~qbf_quantort - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - qbf_quantort::~qbf_quantort() { } -/*******************************************************************\ - -Function: qbf_quantort::l_get - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - tvt qbf_quantort::l_get(literalt a) const { assert(false); return tvt::unknown(); } -/*******************************************************************\ - -Function: qbf_quantort::solver_text - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - const std::string qbf_quantort::solver_text() { return "Quantor"; } -/*******************************************************************\ - -Function: qbf_quantort::prop_solve - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - propt::resultt qbf_quantort::prop_solve() { { diff --git a/src/solvers/qbf/qbf_qube.cpp b/src/solvers/qbf/qbf_qube.cpp index a52c99bac33..1c0c421cb8f 100644 --- a/src/solvers/qbf/qbf_qube.cpp +++ b/src/solvers/qbf/qbf_qube.cpp @@ -12,87 +12,27 @@ Author: CM Wintersteiger #include "qbf_qube.h" -/*******************************************************************\ - -Function: qbf_qubet::qbf_qubet - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - qbf_qubet::qbf_qubet() { // skizzo crashes on broken lines break_lines=false; } -/*******************************************************************\ - -Function: qbf_qubet::~qbf_qubet - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - qbf_qubet::~qbf_qubet() { } -/*******************************************************************\ - -Function: qbf_qubet::l_get - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - tvt qbf_qubet::l_get(literalt a) const { assert(false); return tvt(false); } -/*******************************************************************\ - -Function: qbf_qubet::solver_text - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - const std::string qbf_qubet::solver_text() { return "QuBE"; } -/*******************************************************************\ - -Function: qbf_qubet::prop_solve - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - propt::resultt qbf_qubet::prop_solve() { // sKizzo crashes on empty instances diff --git a/src/solvers/qbf/qbf_qube_core.cpp b/src/solvers/qbf/qbf_qube_core.cpp index f5ea1d76610..c90424538c9 100644 --- a/src/solvers/qbf/qbf_qube_core.cpp +++ b/src/solvers/qbf/qbf_qube_core.cpp @@ -14,69 +14,21 @@ Author: CM Wintersteiger #include "qbf_qube_core.h" -/*******************************************************************\ - -Function: qbf_qube_coret::qbf_qube_coret - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - qbf_qube_coret::qbf_qube_coret() : qdimacs_coret() { break_lines=false; qbf_tmp_file="qube.qdimacs"; } -/*******************************************************************\ - -Function: qbf_qube_coret::~qbf_qube_coret - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - qbf_qube_coret::~qbf_qube_coret() { } -/*******************************************************************\ - -Function: qbf_qube_coret::solver_text - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - const std::string qbf_qube_coret::solver_text() { return "QuBE w/ toplevel assignments"; } -/*******************************************************************\ - -Function: qbf_qube_coret::prop_solve - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - propt::resultt qbf_qube_coret::prop_solve() { if(no_clauses()==0) @@ -165,35 +117,11 @@ propt::resultt qbf_qube_coret::prop_solve() } } -/*******************************************************************\ - -Function: qbf_qube_coret::is_in_core - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool qbf_qube_coret::is_in_core(literalt l) const { throw "not supported"; } -/*******************************************************************\ - -Function: qbf_qube_coret::m_get - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - qdimacs_coret::modeltypet qbf_qube_coret::m_get(literalt a) const { throw "not supported"; diff --git a/src/solvers/qbf/qbf_skizzo.cpp b/src/solvers/qbf/qbf_skizzo.cpp index 1b665567323..e89aa7ebcb3 100644 --- a/src/solvers/qbf/qbf_skizzo.cpp +++ b/src/solvers/qbf/qbf_skizzo.cpp @@ -12,87 +12,27 @@ Author: Daniel Kroening, kroening@kroening.com #include "qbf_skizzo.h" -/*******************************************************************\ - -Function: qbf_skizzot::qbf_skizzot - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - qbf_skizzot::qbf_skizzot() { // skizzo crashes on broken lines break_lines=false; } -/*******************************************************************\ - -Function: qbf_skizzot::~qbf_skizzot - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - qbf_skizzot::~qbf_skizzot() { } -/*******************************************************************\ - -Function: qbf_skizzot::l_get - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - tvt qbf_skizzot::l_get(literalt a) const { assert(false); return tvt(false); } -/*******************************************************************\ - -Function: qbf_skizzot::solver_text - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - const std::string qbf_skizzot::solver_text() { return "Skizzo"; } -/*******************************************************************\ - -Function: qbf_skizzot::prop_solve - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - propt::resultt qbf_skizzot::prop_solve() { // sKizzo crashes on empty instances diff --git a/src/solvers/qbf/qbf_skizzo_core.cpp b/src/solvers/qbf/qbf_skizzo_core.cpp index 0b79ca216a6..39bd481833b 100644 --- a/src/solvers/qbf/qbf_skizzo_core.cpp +++ b/src/solvers/qbf/qbf_skizzo_core.cpp @@ -16,18 +16,6 @@ Author: CM Wintersteiger /*! \cond */ // FIX FOR THE CUDD LIBRARY -/*******************************************************************\ - -Function: DD::getNode - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - inline DdNode *DD::getNode() const { return node; @@ -38,18 +26,6 @@ inline DdNode *DD::getNode() const #include "qbf_skizzo_core.h" -/*******************************************************************\ - -Function: qbf_skizzo_coret::qbf_skizzo_coret - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - qbf_skizzo_coret::qbf_skizzo_coret(): qbf_bdd_certificatet() { @@ -58,51 +34,15 @@ qbf_skizzo_coret::qbf_skizzo_coret(): qbf_tmp_file="sKizzo.qdimacs"; } -/*******************************************************************\ - -Function: qbf_skizzo_coret::~qbf_skizzo_coret - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - qbf_skizzo_coret::~qbf_skizzo_coret() { } -/*******************************************************************\ - -Function: qbf_skizzo_coret::solver_text - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - const std::string qbf_skizzo_coret::solver_text() { return "Skizzo/Core"; } -/*******************************************************************\ - -Function: qbf_skizzo_coret::prop_solve - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - propt::resultt qbf_skizzo_coret::prop_solve() { // sKizzo crashes on empty instances @@ -189,52 +129,16 @@ propt::resultt qbf_skizzo_coret::prop_solve() } } -/*******************************************************************\ - -Function: qbf_skizzo_coret::is_in_core - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool qbf_skizzo_coret::is_in_core(literalt l) const { throw "nyi"; } -/*******************************************************************\ - -Function: qbf_skizzo_coret::m_get - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - qdimacs_coret::modeltypet qbf_skizzo_coret::m_get(literalt a) const { throw "nyi"; } -/*******************************************************************\ - -Function: qbf_skizzo_coret::get_certificate - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool qbf_skizzo_coret::get_certificate(void) { std::string result_tmp_file="ozziKs.out"; diff --git a/src/solvers/qbf/qbf_squolem.cpp b/src/solvers/qbf/qbf_squolem.cpp index a869603a737..6724a3f189e 100644 --- a/src/solvers/qbf/qbf_squolem.cpp +++ b/src/solvers/qbf/qbf_squolem.cpp @@ -7,88 +7,31 @@ Author: CM Wintersteiger \*******************************************************************/ -#include "qbf_squolem.h" - -/*******************************************************************\ - -Function: qbf_squolemt::qbf_squolemt - - Inputs: +/// \file +/// Squolem Backend - Outputs: - - Purpose: - -\*******************************************************************/ +#include "qbf_squolem.h" qbf_squolemt::qbf_squolemt(): early_decision(false) { } -/*******************************************************************\ - -Function: qbf_squolemt::~qbf_squolemt - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - qbf_squolemt::~qbf_squolemt() { squolem.reset(); } -/*******************************************************************\ - -Function: qbf_squolemt::l_get - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - tvt qbf_squolemt::l_get(literalt a) const { assert(false); } -/*******************************************************************\ - -Function: qbf_squolemt::solver_text - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - const std::string qbf_squolemt::solver_text() { return "Squolem"; } -/*******************************************************************\ - -Function: qbf_squolemt::prop_solve - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - propt::resultt qbf_squolemt::prop_solve() { { @@ -126,18 +69,6 @@ propt::resultt qbf_squolemt::prop_solve() return P_ERROR; } -/*******************************************************************\ - -Function: qbf_squolemt::lcnf - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void qbf_squolemt::lcnf(const bvt &bv) { if(early_decision) @@ -167,18 +98,6 @@ void qbf_squolemt::lcnf(const bvt &bv) early_decision=true; } -/*******************************************************************\ - -Function: qbf_squolemt::add_quantifier - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void qbf_squolemt::add_quantifier(const quantifiert &quantifier) { squolem.quantifyVariableInner( @@ -188,36 +107,12 @@ void qbf_squolemt::add_quantifier(const quantifiert &quantifier) qdimacs_cnft::add_quantifier(quantifier); // necessary? } -/*******************************************************************\ - -Function: qbf_squolemt::set_no_variables - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void qbf_squolemt::set_no_variables(unsigned no) { squolem.setLastVariable(no+1); cnft::set_no_variables(no); } -/*******************************************************************\ - -Function: qbf_squolemt::set_quantifier - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void qbf_squolemt::set_quantifier( const quantifiert::typet type, const literalt l) diff --git a/src/solvers/qbf/qbf_squolem.h b/src/solvers/qbf/qbf_squolem.h index 1780528fb32..7210436fd4c 100644 --- a/src/solvers/qbf/qbf_squolem.h +++ b/src/solvers/qbf/qbf_squolem.h @@ -6,6 +6,9 @@ Author: CM Wintersteiger \*******************************************************************/ +/// \file +/// Squolem Backend + #ifndef CPROVER_SOLVERS_QBF_QBF_SQUOLEM_H #define CPROVER_SOLVERS_QBF_QBF_SQUOLEM_H diff --git a/src/solvers/qbf/qbf_squolem_core.cpp b/src/solvers/qbf/qbf_squolem_core.cpp index 00229cd8fee..79d5476e421 100644 --- a/src/solvers/qbf/qbf_squolem_core.cpp +++ b/src/solvers/qbf/qbf_squolem_core.cpp @@ -6,6 +6,9 @@ Author: CM Wintersteiger \*******************************************************************/ +/// \file +/// Squolem Backend (with proofs) + #include #include @@ -15,35 +18,11 @@ Author: CM Wintersteiger #include "qbf_squolem_core.h" -/*******************************************************************\ - -Function: qbf_squolem_coret::qbf_squolem_coret - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - qbf_squolem_coret::qbf_squolem_coret() : squolem(NULL) { setup(); } -/*******************************************************************\ - -Function: qbf_squolem_coret::setup - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void qbf_squolem_coret::setup(void) { quantifiers.clear(); @@ -65,18 +44,6 @@ void qbf_squolem_coret::setup(void) // squolem->options.set_predictOnLiteralBound(true); } -/*******************************************************************\ - -Function: qbf_squolem_coret::reset - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void qbf_squolem_coret::reset(void) { squolem->reset(); @@ -85,18 +52,6 @@ void qbf_squolem_coret::reset(void) setup(); } -/*******************************************************************\ - -Function: qbf_squolem_coret::~qbf_squolem_coret - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - qbf_squolem_coret::~qbf_squolem_coret() { squolem->reset(); @@ -104,18 +59,6 @@ qbf_squolem_coret::~qbf_squolem_coret() squolem=NULL; } -/*******************************************************************\ - -Function: qbf_squolem_coret::l_get - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - tvt qbf_squolem_coret::l_get(literalt a) const { if(a.is_true()) @@ -131,35 +74,11 @@ tvt qbf_squolem_coret::l_get(literalt a) const return tvt(tvt::tv_enumt::TV_UNKNOWN); } -/*******************************************************************\ - -Function: qbf_squolem_coret::solver_text - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - const std::string qbf_squolem_coret::solver_text() { return "Squolem (Certifying)"; } -/*******************************************************************\ - -Function: qbf_squolem_coret::prop_solve - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - propt::resultt qbf_squolem_coret::prop_solve() { { @@ -187,35 +106,11 @@ propt::resultt qbf_squolem_coret::prop_solve() return P_ERROR; } -/*******************************************************************\ - -Function: qbf_squolem_coret::is_in_core - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool qbf_squolem_coret::is_in_core(literalt l) const { return squolem->inCore(l.var_no()); } -/*******************************************************************\ - -Function: qbf_squolem_coret::m_get - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - qbf_squolem_coret::modeltypet qbf_squolem_coret::m_get(literalt a) const { if(squolem->modelIsTrue(a.var_no())) @@ -228,18 +123,6 @@ qbf_squolem_coret::modeltypet qbf_squolem_coret::m_get(literalt a) const return M_DONTCARE; } -/*******************************************************************\ - -Function: qbf_squolem_coret::lcnf - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void qbf_squolem_coret::lcnf(const bvt &bv) { if(early_decision) @@ -269,18 +152,6 @@ void qbf_squolem_coret::lcnf(const bvt &bv) early_decision=true; } -/*******************************************************************\ - -Function: qbf_squolem_coret::add_quantifier - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void qbf_squolem_coret::add_quantifier(const quantifiert &quantifier) { squolem->quantifyVariableInner( @@ -290,36 +161,12 @@ void qbf_squolem_coret::add_quantifier(const quantifiert &quantifier) qdimacs_cnft::add_quantifier(quantifier); // necessary? } -/*******************************************************************\ - -Function: qbf_squolem_coret::set_no_variables - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void qbf_squolem_coret::set_no_variables(unsigned no) { squolem->setLastVariable(no+1); cnft::set_no_variables(no); } -/*******************************************************************\ - -Function: qbf_squolem_coret::set_quantifier - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void qbf_squolem_coret::set_quantifier( const quantifiert::typet type, const literalt l) @@ -328,52 +175,16 @@ void qbf_squolem_coret::set_quantifier( squolem->requantifyVariable(l.var_no(), type==quantifiert::UNIVERSAL); } -/*******************************************************************\ - -Function: qbf_squolem_coret::set_debug_filename - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void qbf_squolem_coret::set_debug_filename(const std::string &str) { squolem->options.set_debugFilename(str.c_str()); } -/*******************************************************************\ - -Function: qbf_squolem_coret::write_qdimacs_cnf - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void qbf_squolem_coret::write_qdimacs_cnf(std::ostream &out) { squolem->saveQCNF(out); } -/*******************************************************************\ - -Function: qbf_squolem_coret::f_get - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - const exprt qbf_squolem_coret::f_get(literalt l) { if(squolem->isUniversal(l.var_no())) @@ -435,18 +246,6 @@ const exprt qbf_squolem_coret::f_get(literalt l) } } -/*******************************************************************\ - -Function: qbf_squolem_coret::f_get_cnf - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - const exprt qbf_squolem_coret::f_get_cnf(WitnessStack *wsp) { Clause *p=wsp->negWits; @@ -489,18 +288,6 @@ const exprt qbf_squolem_coret::f_get_cnf(WitnessStack *wsp) return and_exprt(operands); } -/*******************************************************************\ - -Function: qbf_squolem_coret::f_get_dnf - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - const exprt qbf_squolem_coret::f_get_dnf(WitnessStack *wsp) { Clause *p=wsp->posWits; diff --git a/src/solvers/qbf/qbf_squolem_core.h b/src/solvers/qbf/qbf_squolem_core.h index 3c6e96252b4..f00e00a79ac 100644 --- a/src/solvers/qbf/qbf_squolem_core.h +++ b/src/solvers/qbf/qbf_squolem_core.h @@ -6,6 +6,9 @@ Author: CM Wintersteiger \*******************************************************************/ +/// \file +/// Squolem Backend (with Proofs) + #ifndef CPROVER_SOLVERS_QBF_QBF_SQUOLEM_CORE_H #define CPROVER_SOLVERS_QBF_QBF_SQUOLEM_CORE_H diff --git a/src/solvers/qbf/qdimacs_cnf.cpp b/src/solvers/qbf/qdimacs_cnf.cpp index 41e5484c369..cd5e43c59de 100644 --- a/src/solvers/qbf/qdimacs_cnf.cpp +++ b/src/solvers/qbf/qdimacs_cnf.cpp @@ -11,18 +11,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "qdimacs_cnf.h" -/*******************************************************************\ - -Function: qdimacs_cnft::write_qdimacs_cnf - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void qdimacs_cnft::write_qdimacs_cnf(std::ostream &out) { write_problem_line(out); @@ -30,18 +18,6 @@ void qdimacs_cnft::write_qdimacs_cnf(std::ostream &out) write_clauses(out); } -/*******************************************************************\ - -Function: qdimacs_cnft::write_prefix - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void qdimacs_cnft::write_prefix(std::ostream &out) const { std::vector quantified; @@ -85,35 +61,11 @@ void qdimacs_cnft::write_prefix(std::ostream &out) const out << "e " << i << " 0" << std::endl; } -/*******************************************************************\ - -Function: qdimacs_cnft::operator== - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool qdimacs_cnft::operator==(const qdimacs_cnft &other) const { return quantifiers==other.quantifiers && clauses==other.clauses; } -/*******************************************************************\ - -Function: qdimacs_cnft::set_quantifier - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void qdimacs_cnft::set_quantifier( const quantifiert::typet type, const literalt l) @@ -131,18 +83,6 @@ void qdimacs_cnft::set_quantifier( add_quantifier(type, l); } -/*******************************************************************\ - -Function: qdimacs_cnft::copy_to - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void qdimacs_cnft::copy_to(qdimacs_cnft &cnf) const { cnf.set_no_variables(_no_variables); @@ -160,18 +100,6 @@ void qdimacs_cnft::copy_to(qdimacs_cnft &cnf) const cnf.lcnf(*it); } -/*******************************************************************\ - -Function: qdimacs_cnft::hash - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - size_t qdimacs_cnft::hash() const { size_t result=0; @@ -184,18 +112,6 @@ size_t qdimacs_cnft::hash() const return result^cnf_clause_listt::hash(); } -/*******************************************************************\ - -Function: qdimacs_cnft::is_quantified - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool qdimacs_cnft::is_quantified(const literalt l) const { for(quantifierst::const_iterator it=quantifiers.begin(); @@ -207,18 +123,6 @@ bool qdimacs_cnft::is_quantified(const literalt l) const return false; } -/*******************************************************************\ - -Function: qdimacs_cnft::find_quantifier - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool qdimacs_cnft::find_quantifier(const literalt l, quantifiert &q) const { for(quantifierst::const_iterator it=quantifiers.begin(); diff --git a/src/solvers/qbf/qdimacs_core.cpp b/src/solvers/qbf/qdimacs_core.cpp index 3ffb8ec6db2..a3e445dbc6d 100644 --- a/src/solvers/qbf/qdimacs_core.cpp +++ b/src/solvers/qbf/qdimacs_core.cpp @@ -11,18 +11,6 @@ Author: CM Wintersteiger #include "qdimacs_core.h" -/*******************************************************************\ - -Function: qdimacs_coret::simplify_extractbits - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void qdimacs_coret::simplify_extractbits(exprt &expr) const { if(expr.id()==ID_and) diff --git a/src/solvers/refinement/bv_refinement.h b/src/solvers/refinement/bv_refinement.h index cc96bfccf45..cbfef19d3a8 100644 --- a/src/solvers/refinement/bv_refinement.h +++ b/src/solvers/refinement/bv_refinement.h @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Abstraction Refinement Loop + #ifndef CPROVER_SOLVERS_REFINEMENT_BV_REFINEMENT_H #define CPROVER_SOLVERS_REFINEMENT_BV_REFINEMENT_H diff --git a/src/solvers/refinement/bv_refinement_loop.cpp b/src/solvers/refinement/bv_refinement_loop.cpp index 3d39c16ac80..844752a2137 100644 --- a/src/solvers/refinement/bv_refinement_loop.cpp +++ b/src/solvers/refinement/bv_refinement_loop.cpp @@ -12,18 +12,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "bv_refinement.h" -/*******************************************************************\ - -Function: bv_refinementt::bv_refinementt - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bv_refinementt::bv_refinementt( const namespacet &_ns, propt &_prop): bv_pointerst(_ns, _prop), @@ -37,34 +25,10 @@ bv_refinementt::bv_refinementt( assert(prop.has_is_in_conflict()); } -/*******************************************************************\ - -Function: bv_refinementt::~bv_refinementt - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bv_refinementt::~bv_refinementt() { } -/*******************************************************************\ - -Function: bv_refinementt::dec_solve - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - decision_proceduret::resultt bv_refinementt::dec_solve() { // do the usual post-processing @@ -125,18 +89,6 @@ decision_proceduret::resultt bv_refinementt::dec_solve() } } -/*******************************************************************\ - -Function: bv_refinementt::prop_solve - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - decision_proceduret::resultt bv_refinementt::prop_solve() { // this puts the underapproximations into effect @@ -167,18 +119,6 @@ decision_proceduret::resultt bv_refinementt::prop_solve() } } -/*******************************************************************\ - -Function: bv_refinementt::check_SAT - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void bv_refinementt::check_SAT() { progress=false; @@ -192,18 +132,6 @@ void bv_refinementt::check_SAT() check_SAT(*a_it); } -/*******************************************************************\ - -Function: bv_refinementt::check_UNSAT - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void bv_refinementt::check_UNSAT() { progress=false; @@ -215,18 +143,6 @@ void bv_refinementt::check_UNSAT() check_UNSAT(*a_it); } -/*******************************************************************\ - -Function: bv_refinementt::set_to - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void bv_refinementt::set_to(const exprt &expr, bool value) { #if 0 @@ -245,18 +161,6 @@ void bv_refinementt::set_to(const exprt &expr, bool value) #endif } -/*******************************************************************\ - -Function: bv_refinementt::set_assumptions - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void bv_refinementt::set_assumptions(const bvt &_assumptions) { parent_assumptions=_assumptions; diff --git a/src/solvers/refinement/refine_arithmetic.cpp b/src/solvers/refinement/refine_arithmetic.cpp index 1f08874abfa..6bbd1439cba 100644 --- a/src/solvers/refinement/refine_arithmetic.cpp +++ b/src/solvers/refinement/refine_arithmetic.cpp @@ -21,18 +21,6 @@ Author: Daniel Kroening, kroening@kroening.com #define MAX_INTEGER_UNDERAPPROX 3 #define MAX_FLOAT_UNDERAPPROX 10 -/*******************************************************************\ - -Function: bv_refinementt::approximationt::add_over_assumption - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void bv_refinementt::approximationt::add_over_assumption(literalt l) { // if it's a constant already, give up @@ -40,18 +28,6 @@ void bv_refinementt::approximationt::add_over_assumption(literalt l) over_assumptions.push_back(l); } -/*******************************************************************\ - -Function: bv_refinementt::approximationt::add_under_assumption - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void bv_refinementt::approximationt::add_under_assumption(literalt l) { // if it's a constant already, give up @@ -59,18 +35,6 @@ void bv_refinementt::approximationt::add_under_assumption(literalt l) under_assumptions.push_back(l); } -/*******************************************************************\ - -Function: bv_refinementt::convert_floatbv_op - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bvt bv_refinementt::convert_floatbv_op(const exprt &expr) { if(!do_arithmetic_refinement) @@ -85,18 +49,6 @@ bvt bv_refinementt::convert_floatbv_op(const exprt &expr) return bv; } -/*******************************************************************\ - -Function: bv_refinementt::convert_mult - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bvt bv_refinementt::convert_mult(const exprt &expr) { if(!do_arithmetic_refinement || expr.type().id()==ID_fixedbv) @@ -145,18 +97,6 @@ bvt bv_refinementt::convert_mult(const exprt &expr) return bv; } -/*******************************************************************\ - -Function: bv_refinementt::convert_div - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bvt bv_refinementt::convert_div(const div_exprt &expr) { if(!do_arithmetic_refinement || expr.type().id()==ID_fixedbv) @@ -175,18 +115,6 @@ bvt bv_refinementt::convert_div(const div_exprt &expr) return bv; } -/*******************************************************************\ - -Function: bv_refinementt::convert_mod - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bvt bv_refinementt::convert_mod(const mod_exprt &expr) { if(!do_arithmetic_refinement || expr.type().id()==ID_fixedbv) @@ -205,18 +133,6 @@ bvt bv_refinementt::convert_mod(const mod_exprt &expr) return bv; } -/*******************************************************************\ - -Function: bv_refinementt::get_values - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void bv_refinementt::get_values(approximationt &a) { std::size_t o=a.expr.operands().size(); @@ -240,19 +156,8 @@ void bv_refinementt::get_values(approximationt &a) a.result_value=get_value(a.result_bv); } -/*******************************************************************\ - -Function: bv_refinementt::check_SAT - - Inputs: - - Outputs: - - Purpose: inspect if satisfying assignment extends to original - formula, otherwise refine overapproximation - -\*******************************************************************/ - +/// inspect if satisfying assignment extends to original formula, otherwise +/// refine overapproximation void bv_refinementt::check_SAT(approximationt &a) { // get values @@ -458,19 +363,8 @@ void bv_refinementt::check_SAT(approximationt &a) a.over_state++; } -/*******************************************************************\ - -Function: bv_refinementt::check_UNSAT - - Inputs: - - Outputs: - - Purpose: inspect if proof holds on original formula, - otherwise refine underapproximation - -\*******************************************************************/ - +/// inspect if proof holds on original formula, otherwise refine +/// underapproximation void bv_refinementt::check_UNSAT(approximationt &a) { // part of the conflict? @@ -558,18 +452,7 @@ void bv_refinementt::check_UNSAT(approximationt &a) progress=true; } -/*******************************************************************\ - -Function: bv_refinementt::is_in_conflict - - Inputs: - - Outputs: - - Purpose: check if an under-approximation is part of the conflict - -\*******************************************************************/ - +/// check if an under-approximation is part of the conflict bool bv_refinementt::is_in_conflict(approximationt &a) { for(std::size_t i=0; i -/*******************************************************************\ - -Function: bv_refinementt::post_process_arrays - - Inputs: - - Outputs: - - Purpose: generate array constraints - -\*******************************************************************/ - +/// generate array constraints void bv_refinementt::post_process_arrays() { collect_indices(); @@ -43,18 +32,7 @@ void bv_refinementt::post_process_arrays() freeze_lazy_constraints(); } -/*******************************************************************\ - -Function: bv_refinementt::arrays_overapproximated - - Inputs: - - Outputs: - - Purpose: check whether counterexample is spurious - -\*******************************************************************/ - +/// check whether counterexample is spurious void bv_refinementt::arrays_overapproximated() { if(!do_array_refinement) @@ -125,18 +103,7 @@ void bv_refinementt::arrays_overapproximated() } -/*******************************************************************\ - -Function: bv_refinementt::freeze_lazy_constraints - - Inputs: - - Outputs: - - Purpose: freeze symbols for incremental solving - -\*******************************************************************/ - +/// freeze symbols for incremental solving void bv_refinementt::freeze_lazy_constraints() { if(!lazy_arrays) diff --git a/src/solvers/refinement/string_constraint.h b/src/solvers/refinement/string_constraint.h index 1bb460349b7..c83d63cc69a 100644 --- a/src/solvers/refinement/string_constraint.h +++ b/src/solvers/refinement/string_constraint.h @@ -10,6 +10,13 @@ Author: Romain Brenguier, romain.brenguier@diffblue.com \*******************************************************************/ +/// \file +/// Defines string constraints. These are formulas talking about strings. We +/// implemented two forms of constraints: `string_constraintt` are formulas +/// of the form $\forall univ_var \in [lb,ub[. prem => body$, and +/// not_contains_constraintt of the form: $\forall x in [lb,ub[. p(x) => +/// \exists y in [lb,ub[. s1[x+y] != s2[y]$. + #ifndef CPROVER_SOLVERS_REFINEMENT_STRING_CONSTRAINT_H #define CPROVER_SOLVERS_REFINEMENT_STRING_CONSTRAINT_H diff --git a/src/solvers/refinement/string_constraint_generator.h b/src/solvers/refinement/string_constraint_generator.h index 94234b810de..533e41a4212 100644 --- a/src/solvers/refinement/string_constraint_generator.h +++ b/src/solvers/refinement/string_constraint_generator.h @@ -10,6 +10,13 @@ Author: Romain Brenguier, romain.brenguier@diffblue.com \*******************************************************************/ +/// \file +/// Generates string constraints to link results from string functions with +/// their arguments. This is inspired by the PASS paper at HVC'13: "PASS: +/// String Solving with Parameterized Array and Interval Automaton" by Guodong +/// Li and Indradeep Ghosh, which gives examples of constraints for several +/// functions. + #ifndef CPROVER_SOLVERS_REFINEMENT_STRING_CONSTRAINT_GENERATOR_H #define CPROVER_SOLVERS_REFINEMENT_STRING_CONSTRAINT_GENERATOR_H diff --git a/src/solvers/refinement/string_constraint_generator_code_points.cpp b/src/solvers/refinement/string_constraint_generator_code_points.cpp index 16763dfc97c..ad44469d51e 100644 --- a/src/solvers/refinement/string_constraint_generator_code_points.cpp +++ b/src/solvers/refinement/string_constraint_generator_code_points.cpp @@ -7,6 +7,9 @@ Author: Romain Brenguier, romain.brenguier@diffblue.com \*******************************************************************/ +/// \file +/// Generates string constraints for Java functions dealing with code points + #include /******************************************************************* \ @@ -70,21 +73,12 @@ string_exprt string_constraint_generatort::add_axioms_for_code_point( return res; } -/*******************************************************************\ - -Function: string_constraint_generatort::is_high_surrogate - - Inputs: a character expression - - Outputs: a Boolean expression - - Purpose: the output is true when the character is a high surrogate for - UTF-16 encoding, see https://en.wikipedia.org/wiki/UTF-16 for - more explenation about the encoding; - this is true when the character is in the range 0xD800..0xDBFF - -\*******************************************************************/ - +/// the output is true when the character is a high surrogate for UTF-16 +/// encoding, see https://en.wikipedia.org/wiki/UTF-16 for more explenation +/// about the encoding; this is true when the character is in the range +/// 0xD800..0xDBFF +/// \par parameters: a character expression +/// \return a Boolean expression exprt string_constraint_generatort::is_high_surrogate(const exprt &chr) const { return and_exprt( @@ -92,21 +86,12 @@ exprt string_constraint_generatort::is_high_surrogate(const exprt &chr) const binary_relation_exprt(chr, ID_le, constant_char(0xDBFF, chr.type()))); } -/*******************************************************************\ - -Function: string_constraint_generatort::is_low_surrogate - - Inputs: a character expression - - Outputs: a Boolean expression - - Purpose: the output is true when the character is a low surrogate for - UTF-16 encoding, see https://en.wikipedia.org/wiki/UTF-16 for - more explenation about the encoding; - this is true when the character is in the range 0xDC00..0xDFFF - -\*******************************************************************/ - +/// the output is true when the character is a low surrogate for UTF-16 +/// encoding, see https://en.wikipedia.org/wiki/UTF-16 for more explenation +/// about the encoding; this is true when the character is in the range +/// 0xDC00..0xDFFF +/// \par parameters: a character expression +/// \return a Boolean expression exprt string_constraint_generatort::is_low_surrogate(const exprt &chr) const { return and_exprt( @@ -114,24 +99,14 @@ exprt string_constraint_generatort::is_low_surrogate(const exprt &chr) const binary_relation_exprt(chr, ID_le, constant_char(0xDFFF, chr.type()))); } -/*******************************************************************\ - -Function: string_constraint_generatort::pair_value - - Inputs: two character expressions and a return type - char1 and char2 should be of type return_type - - Outputs: an integer expression of type return_type - - Purpose: the output corresponds to the unicode character given by the - pair of characters of inputs assuming it has been encoded in - UTF-16, see https://en.wikipedia.org/wiki/UTF-16 for - more explenation about the encoding; - the operation we perform is: - pair_value=0x10000+(((char1%0x0800)*0x0400)+char2%0x0400) - -\*******************************************************************/ - +/// the output corresponds to the unicode character given by the pair of +/// characters of inputs assuming it has been encoded in UTF-16, see +/// https://en.wikipedia.org/wiki/UTF-16 for more explenation about the +/// encoding; the operation we perform is: +/// pair_value=0x10000+(((char1%0x0800)*0x0400)+char2%0x0400) +/// \par parameters: two character expressions and a return type +/// char1 and char2 should be of type return_type +/// \return an integer expression of type return_type exprt pair_value(exprt char1, exprt char2, typet return_type) { exprt hex010000=from_integer(0x010000, return_type); @@ -143,18 +118,10 @@ exprt pair_value(exprt char1, exprt char2, typet return_type) return pair_value; } -/*******************************************************************\ - -Function: string_constraint_generatort::add_axioms_for_code_point_at - - Inputs: function application with two arguments: a string and an index - - Outputs: a integer expression corresponding to a code point - - Purpose: add axioms corresponding to the String.codePointAt java function - -\*******************************************************************/ - +/// add axioms corresponding to the String.codePointAt java function +/// \par parameters: function application with two arguments: a string and an +/// index +/// \return a integer expression corresponding to a code point exprt string_constraint_generatort::add_axioms_for_code_point_at( const function_application_exprt &f) { @@ -180,18 +147,10 @@ exprt string_constraint_generatort::add_axioms_for_code_point_at( return result; } -/*******************************************************************\ - -Function: string_constraint_generatort::add_axioms_for_code_point_before - - Inputs: function application with two arguments: a string and an index - - Outputs: a integer expression corresponding to a code point - - Purpose: add axioms corresponding to the String.codePointBefore java function - -\*******************************************************************/ - +/// add axioms corresponding to the String.codePointBefore java function +/// \par parameters: function application with two arguments: a string and an +/// index +/// \return a integer expression corresponding to a code point exprt string_constraint_generatort::add_axioms_for_code_point_before( const function_application_exprt &f) { @@ -219,19 +178,11 @@ exprt string_constraint_generatort::add_axioms_for_code_point_before( return result; } -/*******************************************************************\ - -Function: string_constraint_generatort::add_axioms_for_code_point_count - - Inputs: function application with three arguments: a string and two indexes - - Outputs: an integer expression - - Purpose: add axioms giving approximate bounds on the result of the - String.codePointCount java function - -\*******************************************************************/ - +/// add axioms giving approximate bounds on the result of the +/// String.codePointCount java function +/// \par parameters: function application with three arguments: a string and two +/// indexes +/// \return an integer expression exprt string_constraint_generatort::add_axioms_for_code_point_count( const function_application_exprt &f) { @@ -248,21 +199,12 @@ exprt string_constraint_generatort::add_axioms_for_code_point_count( return result; } -/*******************************************************************\ - -Function: string_constraint_generatort::add_axioms_for_offset_by_code_point - - Inputs: function application with three arguments: a string and two indexes - - Outputs: a new string expression - - Purpose: add axioms giving approximate bounds on the result of the - String.offsetByCodePointCount java function. - We approximate the result by saying the result is - between index + offset and index + 2 * offset - -\*******************************************************************/ - +/// add axioms giving approximate bounds on the result of the +/// String.offsetByCodePointCount java function. We approximate the result by +/// saying the result is between index + offset and index + 2 * offset +/// \par parameters: function application with three arguments: a string and two +/// indexes +/// \return a new string expression exprt string_constraint_generatort::add_axioms_for_offset_by_code_point( const function_application_exprt &f) { diff --git a/src/solvers/refinement/string_constraint_generator_comparison.cpp b/src/solvers/refinement/string_constraint_generator_comparison.cpp index a51e2abe3cd..f926147d1d4 100644 --- a/src/solvers/refinement/string_constraint_generator_comparison.cpp +++ b/src/solvers/refinement/string_constraint_generator_comparison.cpp @@ -7,23 +7,18 @@ Author: Romain Brenguier, romain.brenguier@diffblue.com \*******************************************************************/ -#include - -/*******************************************************************\ - -Function: string_constraint_generatort::add_axioms_for_equals - - Inputs: function application with two string arguments - - Outputs: a expression of Boolean type - - Purpose: add axioms stating that the result is true exactly when the strings - represented by the arguments are equal. - the variable ending in `witness_unequal` is -1 if the length differs - or an index at which the strings are different +/// \file +/// Generates string constraints for function comparing strings, such as: +/// equals, equalsIgnoreCase, compareTo, hashCode, intern -\*******************************************************************/ +#include +/// add axioms stating that the result is true exactly when the strings +/// represented by the arguments are equal. the variable ending in +/// `witness_unequal` is -1 if the length differs or an index at which the +/// strings are different +/// \par parameters: function application with two string arguments +/// \return a expression of Boolean type exprt string_constraint_generatort::add_axioms_for_equals( const function_application_exprt &f) { @@ -65,20 +60,12 @@ exprt string_constraint_generatort::add_axioms_for_equals( return tc_eq; } -/*******************************************************************\ - -Function: string_constraint_generatort::character_equals_ignore_case - - Inputs: two character expressions and constant character expressions - representing 'a', 'A' and 'Z' - - Outputs: a expression of Boolean type - - Purpose: returns an expression which is true when the two given - characters are equal when ignoring case for ASCII - -\*******************************************************************/ - +/// returns an expression which is true when the two given characters are equal +/// when ignoring case for ASCII +/// \par parameters: two character expressions and constant character +/// expressions +/// representing 'a', 'A' and 'Z' +/// \return a expression of Boolean type exprt string_constraint_generatort::character_equals_ignore_case( exprt char1, exprt char2, exprt char_a, exprt char_A, exprt char_Z) { @@ -105,18 +92,9 @@ exprt string_constraint_generatort::character_equals_ignore_case( return or_exprt(or_exprt(p1, p2), p3); } -/*******************************************************************\ - -Function: string_constraint_generatort::add_axioms_for_equals_ignore_case - - Inputs: function application with two string arguments - - Outputs: a Boolean expression - - Purpose: add axioms corresponding to the String.equalsIgnoreCase java function - -\*******************************************************************/ - +/// add axioms corresponding to the String.equalsIgnoreCase java function +/// \par parameters: function application with two string arguments +/// \return a Boolean expression exprt string_constraint_generatort::add_axioms_for_equals_ignore_case( const function_application_exprt &f) { @@ -166,19 +144,10 @@ exprt string_constraint_generatort::add_axioms_for_equals_ignore_case( return tc_eq; } -/*******************************************************************\ - -Function: string_constraint_generatort::add_axioms_for_hash_code - - Inputs: function application with a string argument - - Outputs: a integer expression corresponding to the hash code of the string - - Purpose: add axioms stating that if two strings are equal then their hash - codes are equals - -\*******************************************************************/ - +/// add axioms stating that if two strings are equal then their hash codes are +/// equals +/// \par parameters: function application with a string argument +/// \return a integer expression corresponding to the hash code of the string exprt string_constraint_generatort::add_axioms_for_hash_code( const function_application_exprt &f) { @@ -213,18 +182,9 @@ exprt string_constraint_generatort::add_axioms_for_hash_code( return hash; } -/*******************************************************************\ - -Function: string_constraint_generatort::add_axioms_for_compare_to - - Inputs: function application with two string arguments - - Outputs: a integer expression - - Purpose: add axioms corresponding to the String.compareTo java function - -\*******************************************************************/ - +/// add axioms corresponding to the String.compareTo java function +/// \par parameters: function application with two string arguments +/// \return a integer expression exprt string_constraint_generatort::add_axioms_for_compare_to( const function_application_exprt &f) { @@ -296,19 +256,10 @@ exprt string_constraint_generatort::add_axioms_for_compare_to( return res; } -/*******************************************************************\ - -Function: string_constraint_generatort::add_axioms_for_intern - - Inputs: function application with one string argument - - Outputs: a string expression - - Purpose: add axioms stating that the return value for two equal string - should be the same - -\*******************************************************************/ - +/// add axioms stating that the return value for two equal string should be the +/// same +/// \par parameters: function application with one string argument +/// \return a string expression symbol_exprt string_constraint_generatort::add_axioms_for_intern( const function_application_exprt &f) { diff --git a/src/solvers/refinement/string_constraint_generator_concat.cpp b/src/solvers/refinement/string_constraint_generator_concat.cpp index e6f360585bb..311427ec771 100644 --- a/src/solvers/refinement/string_constraint_generator_concat.cpp +++ b/src/solvers/refinement/string_constraint_generator_concat.cpp @@ -7,21 +7,16 @@ Author: Romain Brenguier, romain.brenguier@diffblue.com \*******************************************************************/ -#include - -/*******************************************************************\ - -Function: string_constraint_generatort::add_axioms_for_concat - - Inputs: two string expressions +/// \file +/// Generates string constraints for functions adding content add the end of +/// strings - Outputs: a new string expression - - Purpose: add axioms to say that the returned string expression is equal to - the concatenation of the two string expressions given as input - -\*******************************************************************/ +#include +/// add axioms to say that the returned string expression is equal to the +/// concatenation of the two string expressions given as input +/// \par parameters: two string expressions +/// \return a new string expression string_exprt string_constraint_generatort::add_axioms_for_concat( const string_exprt &s1, const string_exprt &s2) { @@ -53,20 +48,10 @@ string_exprt string_constraint_generatort::add_axioms_for_concat( return res; } -/*******************************************************************\ - -Function: string_constraint_generatort::add_axioms_for_concat - - Inputs: function application with two arguments which are strings - - Outputs: a new string expression - - Purpose: add axioms to say that the returned string expression is equal to - the concatenation of the two string arguments of - the function application - -\*******************************************************************/ - +/// add axioms to say that the returned string expression is equal to the +/// concatenation of the two string arguments of the function application +/// \par parameters: function application with two arguments which are strings +/// \return a new string expression string_exprt string_constraint_generatort::add_axioms_for_concat( const function_application_exprt &f) { @@ -79,18 +64,10 @@ string_exprt string_constraint_generatort::add_axioms_for_concat( return add_axioms_for_concat(s1, s2); } -/*******************************************************************\ - -Function: string_constraint_generatort::add_axioms_for_concat_int - - Inputs: function application with two arguments: a string and an integer - - Outputs: a new string expression - - Purpose: add axioms corresponding to the StringBuilder.append(I) java function - -\*******************************************************************/ - +/// add axioms corresponding to the StringBuilder.append(I) java function +/// \par parameters: function application with two arguments: a string and an +/// integer +/// \return a new string expression string_exprt string_constraint_generatort::add_axioms_for_concat_int( const function_application_exprt &f) { @@ -101,19 +78,10 @@ string_exprt string_constraint_generatort::add_axioms_for_concat_int( return add_axioms_for_concat(s1, s2); } -/*******************************************************************\ - -Function: string_constraint_generatort::add_axioms_for_long - - Inputs: function application with two arguments: a string and a - integer of type long - - Outputs: a new string expression - - Purpose: Add axioms corresponding to the StringBuilder.append(J) java function - -\*******************************************************************/ - +/// Add axioms corresponding to the StringBuilder.append(J) java function +/// \par parameters: function application with two arguments: a string and a +/// integer of type long +/// \return a new string expression string_exprt string_constraint_generatort::add_axioms_for_concat_long( const function_application_exprt &f) { @@ -123,18 +91,9 @@ string_exprt string_constraint_generatort::add_axioms_for_concat_long( return add_axioms_for_concat(s1, s2); } -/*******************************************************************\ - -Function: string_constraint_generatort::add_axioms_for_concat_bool - - Inputs: function application two arguments: a string and a bool - - Outputs: a new string expression - - Purpose: add axioms corresponding to the StringBuilder.append(Z) java function - -\*******************************************************************/ - +/// add axioms corresponding to the StringBuilder.append(Z) java function +/// \par parameters: function application two arguments: a string and a bool +/// \return a new string expression string_exprt string_constraint_generatort::add_axioms_for_concat_bool( const function_application_exprt &f) { @@ -144,18 +103,10 @@ string_exprt string_constraint_generatort::add_axioms_for_concat_bool( return add_axioms_for_concat(s1, s2); } -/*******************************************************************\ - -Function: string_constraint_generatort::add_axioms_for_concat_char - - Inputs: function application with two arguments: a string and a char - - Outputs: a new string expression - - Purpose: add axioms corresponding to the StringBuilder.append(C) java function - -\*******************************************************************/ - +/// add axioms corresponding to the StringBuilder.append(C) java function +/// \par parameters: function application with two arguments: a string and a +/// char +/// \return a new string expression string_exprt string_constraint_generatort::add_axioms_for_concat_char( const function_application_exprt &f) { @@ -165,18 +116,10 @@ string_exprt string_constraint_generatort::add_axioms_for_concat_char( return add_axioms_for_concat(s1, s2); } -/*******************************************************************\ - -Function: string_constraint_generatort::add_axioms_for_concat_double - - Inputs: function application with two arguments: a string and a double - - Outputs: a new string expression - - Purpose: add axioms corresponding to the StringBuilder.append(D) java function - -\*******************************************************************/ - +/// add axioms corresponding to the StringBuilder.append(D) java function +/// \par parameters: function application with two arguments: a string and a +/// double +/// \return a new string expression string_exprt string_constraint_generatort::add_axioms_for_concat_double( const function_application_exprt &f) { @@ -187,18 +130,10 @@ string_exprt string_constraint_generatort::add_axioms_for_concat_double( return add_axioms_for_concat(s1, s2); } -/*******************************************************************\ - -Function: string_constraint_generatort::add_axioms_for_concat_float - - Inputs: function application with two arguments: a string and a float - - Outputs: a new string expression - - Purpose: add axioms corresponding to the StringBuilder.append(F) java function - -\*******************************************************************/ - +/// add axioms corresponding to the StringBuilder.append(F) java function +/// \par parameters: function application with two arguments: a string and a +/// float +/// \return a new string expression string_exprt string_constraint_generatort::add_axioms_for_concat_float( const function_application_exprt &f) { @@ -209,19 +144,10 @@ string_exprt string_constraint_generatort::add_axioms_for_concat_float( return add_axioms_for_concat(s1, s2); } -/*******************************************************************\ - -Function: string_constraint_generatort::add_axioms_for_concat_code_point - - Inputs: function application with two arguments: a string and a code point - - Outputs: a new string expression - - Purpose: Add axioms corresponding to the StringBuilder.appendCodePoint(I) - function - -\*******************************************************************/ - +/// Add axioms corresponding to the StringBuilder.appendCodePoint(I) function +/// \par parameters: function application with two arguments: a string and a +/// code point +/// \return a new string expression string_exprt string_constraint_generatort::add_axioms_for_concat_code_point( const function_application_exprt &f) { diff --git a/src/solvers/refinement/string_constraint_generator_constants.cpp b/src/solvers/refinement/string_constraint_generator_constants.cpp index 2905c6a5f21..c5fb56658fb 100644 --- a/src/solvers/refinement/string_constraint_generator_constants.cpp +++ b/src/solvers/refinement/string_constraint_generator_constants.cpp @@ -6,24 +6,18 @@ Author: Romain Brenguier, romain.brenguier@diffblue.com \*******************************************************************/ +/// \file +/// Generates string constraints for constant strings + #include #include #include #include -/*******************************************************************\ - -Function: string_constraint_generatort::extract_java_string - - Inputs: a symbol expression representing a java literal - - Outputs: a string constant - - Purpose: extract java string from symbol expression when they are encoded - inside the symbol name - -\*******************************************************************/ - +/// extract java string from symbol expression when they are encoded inside the +/// symbol name +/// \par parameters: a symbol expression representing a java literal +/// \return a string constant irep_idt string_constraint_generatort::extract_java_string( const symbol_exprt &s) { @@ -34,19 +28,10 @@ irep_idt string_constraint_generatort::extract_java_string( return irep_idt(value); } -/*******************************************************************\ - -Function: string_constraint_generatort::add_axioms_for_constant - - Inputs: a string constant - - Outputs: a string expression - - Purpose: add axioms saying the returned string expression should be equal - to the string constant - -\*******************************************************************/ - +/// add axioms saying the returned string expression should be equal to the +/// string constant +/// \par parameters: a string constant +/// \return a string expression string_exprt string_constraint_generatort::add_axioms_for_constant( irep_idt sval, const refined_string_typet &ref_type) { @@ -77,18 +62,9 @@ string_exprt string_constraint_generatort::add_axioms_for_constant( return res; } -/*******************************************************************\ - -Function: string_constraint_generatort::add_axioms_for_empty_string - - Inputs: function application without argument - - Outputs: string expression - - Purpose: add axioms to say that the returned string expression is empty - -\*******************************************************************/ - +/// add axioms to say that the returned string expression is empty +/// \par parameters: function application without argument +/// \return string expression string_exprt string_constraint_generatort::add_axioms_for_empty_string( const function_application_exprt &f) { @@ -103,19 +79,11 @@ string_exprt string_constraint_generatort::add_axioms_for_empty_string( return res; } -/*******************************************************************\ - -Function: string_constraint_generatort::add_axioms_from_literal - - Inputs: function application with an argument which is a string literal - - Outputs: string expression - - Purpose: add axioms to say that the returned string expression is equal to - the string literal - -\*******************************************************************/ - +/// add axioms to say that the returned string expression is equal to the string +/// literal +/// \par parameters: function application with an argument which is a string +/// literal +/// \return string expression string_exprt string_constraint_generatort::add_axioms_from_literal( const function_application_exprt &f) { diff --git a/src/solvers/refinement/string_constraint_generator_indexof.cpp b/src/solvers/refinement/string_constraint_generator_indexof.cpp index 9386639e594..2e3e6424c36 100644 --- a/src/solvers/refinement/string_constraint_generator_indexof.cpp +++ b/src/solvers/refinement/string_constraint_generator_indexof.cpp @@ -7,25 +7,19 @@ Author: Romain Brenguier, romain.brenguier@diffblue.com \*******************************************************************/ -#include - -/*******************************************************************\ - -Function: string_constraint_generatort::add_axioms_for_index_of - - Inputs: - str - a string expression - c - an expression representing a character - from_index - an expression representing an index in the string - - Outputs: a integer expression - - Purpose: Add axioms stating that the returned value is the index within - str of the first occurence of c starting the search at from_index, - or -1 if no such character occurs at or after position from_index. +/// \file +/// Generates string constraints for the family of indexOf and lastIndexOf java +/// functions -\*******************************************************************/ +#include +/// Add axioms stating that the returned value is the index within str of the +/// first occurence of c starting the search at from_index, or -1 if no such +/// character occurs at or after position from_index. +/// \param str: a string expression +/// \param c: an expression representing a character +/// \param from_index: an expression representing an index in the string +/// \return a integer expression exprt string_constraint_generatort::add_axioms_for_index_of( const string_exprt &str, const exprt &c, const exprt &from_index) { @@ -73,25 +67,14 @@ exprt string_constraint_generatort::add_axioms_for_index_of( return index; } -/*******************************************************************\ - -Function: string_constraint_generatort::add_axioms_for_index_of_string - - Inputs: - haystack - a string expression - needle - a string expression - from_index - an expression representing an index in strings - - Outputs: an integer expression representing the first index of needle in - haystack after from_index, or -1 if there is none - - Purpose: Add axioms stating that the returned value is the index within - haystack of the first occurence of needle starting the search at - from_index, or -1 if needle does not occur at or after position - from_index. - -\*******************************************************************/ - +/// Add axioms stating that the returned value is the index within haystack of +/// the first occurence of needle starting the search at from_index, or -1 if +/// needle does not occur at or after position from_index. +/// \param haystack: a string expression +/// \param needle: a string expression +/// \param from_index: an expression representing an index in strings +/// \return an integer expression representing the first index of needle in +/// haystack after from_index, or -1 if there is none exprt string_constraint_generatort::add_axioms_for_index_of_string( const string_exprt &haystack, const string_exprt &needle, @@ -191,25 +174,15 @@ exprt string_constraint_generatort::add_axioms_for_index_of_string( return offset; } -/*******************************************************************\ - -Function: string_constraint_generatort::add_axioms_for_last_index_of_string - - Inputs: - haystack - a string expression - needle - a string expression - from_index - an expression representing an index in strings - - Outputs: an integer expression representing the last index of needle in - haystack before or at from_index, or -1 if there is none - - Purpose: Add axioms stating that the returned value is the index within - haystack of the last occurence of needle starting the search - backward at from_index (ie the index is smaller or equal to - from_index), or -1 if needle does not occur before from_index. - -\*******************************************************************/ - +/// Add axioms stating that the returned value is the index within haystack of +/// the last occurence of needle starting the search backward at from_index (ie +/// the index is smaller or equal to from_index), or -1 if needle does not occur +/// before from_index. +/// \param haystack: a string expression +/// \param needle: a string expression +/// \param from_index: an expression representing an index in strings +/// \return an integer expression representing the last index of needle in +/// haystack before or at from_index, or -1 if there is none exprt string_constraint_generatort::add_axioms_for_last_index_of_string( const string_exprt &haystack, const string_exprt &needle, @@ -312,20 +285,10 @@ exprt string_constraint_generatort::add_axioms_for_last_index_of_string( return offset; } -/*******************************************************************\ - -Function: string_constraint_generatort::add_axioms_for_index_of - - Inputs: function application with 2 or 3 arguments - - Outputs: a integer expression - - Purpose: add axioms corresponding to the String.indexOf:(C), - String.indexOf:(CI), String.indexOf:(String), and - String.indexOf:(String,I) java functions - -\*******************************************************************/ - +/// add axioms corresponding to the String.indexOf:(C), String.indexOf:(CI), +/// String.indexOf:(String), and String.indexOf:(String,I) java functions +/// \par parameters: function application with 2 or 3 arguments +/// \return a integer expression exprt string_constraint_generatort::add_axioms_for_index_of( const function_application_exprt &f) { @@ -356,25 +319,14 @@ exprt string_constraint_generatort::add_axioms_for_index_of( } } -/*******************************************************************\ - -Function: string_constraint_generatort::add_axioms_for_last_index_of - - Inputs: - str - a string expression - c - an expression representing a character - from_index - an expression representing an index in the string - - Outputs: an integer expression representing the last index of c in - str before or at from_index, or -1 if there is none - - Purpose: Add axioms stating that the returned value is the index within - str of the last occurence of c starting the search backward at - from_index, or -1 if no such character occurs at or before - position from_index. - -\*******************************************************************/ - +/// Add axioms stating that the returned value is the index within str of the +/// last occurence of c starting the search backward at from_index, or -1 if no +/// such character occurs at or before position from_index. +/// \param str: a string expression +/// \param c: an expression representing a character +/// \param from_index: an expression representing an index in the string +/// \return an integer expression representing the last index of c in str before +/// or at from_index, or -1 if there is none exprt string_constraint_generatort::add_axioms_for_last_index_of( const string_exprt &str, const exprt &c, const exprt &from_index) { @@ -428,20 +380,11 @@ exprt string_constraint_generatort::add_axioms_for_last_index_of( return index; } -/*******************************************************************\ - -Function: string_constraint_generatort::add_axioms_for_last_index_of - - Inputs: function application with 2 or 3 arguments - - Outputs: a integer expression - - Purpose: add axioms corresponding to the String.lastIndexOf:(C), - String.lastIndexOf:(CI), String.lastIndexOf:(String), and - String.lastIndexOf:(String,I) java functions - -\*******************************************************************/ - +/// add axioms corresponding to the String.lastIndexOf:(C), +/// String.lastIndexOf:(CI), String.lastIndexOf:(String), and +/// String.lastIndexOf:(String,I) java functions +/// \par parameters: function application with 2 or 3 arguments +/// \return a integer expression exprt string_constraint_generatort::add_axioms_for_last_index_of( const function_application_exprt &f) { diff --git a/src/solvers/refinement/string_constraint_generator_insert.cpp b/src/solvers/refinement/string_constraint_generator_insert.cpp index 7a63279699e..0fb39e8a658 100644 --- a/src/solvers/refinement/string_constraint_generator_insert.cpp +++ b/src/solvers/refinement/string_constraint_generator_insert.cpp @@ -6,21 +6,15 @@ Author: Romain Brenguier, romain.brenguier@diffblue.com \*******************************************************************/ -#include - -/*******************************************************************\ - -Function: string_constraint_generatort::add_axioms_for_insert - - Inputs: two string expression and an integer offset +/// \file +/// Generates string constraints for the family of insert Java functions - Outputs: a new string expression - - Purpose: add axioms stating that the result correspond to the first string - where we inserted the second one at possition offset - -\*******************************************************************/ +#include +/// add axioms stating that the result correspond to the first string where we +/// inserted the second one at possition offset +/// \par parameters: two string expression and an integer offset +/// \return a new string expression string_exprt string_constraint_generatort::add_axioms_for_insert( const string_exprt &s1, const string_exprt &s2, const exprt &offset) { @@ -32,21 +26,11 @@ string_exprt string_constraint_generatort::add_axioms_for_insert( return add_axioms_for_concat(concat1, suf); } -/*******************************************************************\ - -Function: string_constraint_generatort::add_axioms_for_insert - - Inputs: function application with three arguments: two strings and an index - - Outputs: a new string expression - - Purpose: add axioms corresponding to the - StringBuilder.insert(int, CharSequence) - and StringBuilder.insert(int, CharSequence, int, int) - java functions - -\*******************************************************************/ - +/// add axioms corresponding to the StringBuilder.insert(int, CharSequence) and +/// StringBuilder.insert(int, CharSequence, int, int) java functions +/// \par parameters: function application with three arguments: two strings and +/// an index +/// \return a new string expression string_exprt string_constraint_generatort::add_axioms_for_insert( const function_application_exprt &f) { @@ -68,19 +52,11 @@ string_exprt string_constraint_generatort::add_axioms_for_insert( } } -/*******************************************************************\ - -Function: string_constraint_generatort::add_axioms_for_insert_int - - Inputs: function application with three arguments: a string, an integer - offset, and an integer - - Outputs: a new string expression - - Purpose: add axioms corresponding to the StringBuilder.insert(I) java function - -\*******************************************************************/ - +/// add axioms corresponding to the StringBuilder.insert(I) java function +/// \par parameters: function application with three arguments: a string, an +/// integer +/// offset, and an integer +/// \return a new string expression string_exprt string_constraint_generatort::add_axioms_for_insert_int( const function_application_exprt &f) { @@ -91,19 +67,11 @@ string_exprt string_constraint_generatort::add_axioms_for_insert_int( return add_axioms_for_insert(s1, s2, args(f, 3)[1]); } -/*******************************************************************\ - -Function: string_constraint_generatort::add_axioms_for_insert_long - - Inputs: function application with three arguments: a string, an integer - offset and a long - - Outputs: a new string expression - - Purpose: add axioms corresponding to the StringBuilder.insert(J) java function - -\*******************************************************************/ - +/// add axioms corresponding to the StringBuilder.insert(J) java function +/// \par parameters: function application with three arguments: a string, an +/// integer +/// offset and a long +/// \return a new string expression string_exprt string_constraint_generatort::add_axioms_for_insert_long( const function_application_exprt &f) { @@ -113,19 +81,11 @@ string_exprt string_constraint_generatort::add_axioms_for_insert_long( return add_axioms_for_insert(s1, s2, args(f, 3)[1]); } -/*******************************************************************\ - -Function: string_constraint_generatort::add_axioms_for_insert_bool - - Inputs: function application with three arguments: a string, an integer - offset, and a Boolean - - Outputs: a new string expression - - Purpose: add axioms corresponding to the StringBuilder.insert(Z) java function - -\*******************************************************************/ - +/// add axioms corresponding to the StringBuilder.insert(Z) java function +/// \par parameters: function application with three arguments: a string, an +/// integer +/// offset, and a Boolean +/// \return a new string expression string_exprt string_constraint_generatort::add_axioms_for_insert_bool( const function_application_exprt &f) { @@ -135,19 +95,11 @@ string_exprt string_constraint_generatort::add_axioms_for_insert_bool( return add_axioms_for_insert(s1, s2, args(f, 3)[1]); } -/*******************************************************************\ - -Function: string_constraint_generatort::add_axioms_for_insert_char - - Inputs: function application with three arguments: a string, an integer - offset, and a character - - Outputs: a new string expression - - Purpose: add axioms corresponding to the StringBuilder.insert(C) java function - -\*******************************************************************/ - +/// add axioms corresponding to the StringBuilder.insert(C) java function +/// \par parameters: function application with three arguments: a string, an +/// integer +/// offset, and a character +/// \return a new string expression string_exprt string_constraint_generatort::add_axioms_for_insert_char( const function_application_exprt &f) { @@ -157,19 +109,11 @@ string_exprt string_constraint_generatort::add_axioms_for_insert_char( return add_axioms_for_insert(s1, s2, args(f, 3)[1]); } -/*******************************************************************\ - -Function: string_constraint_generatort::add_axioms_for_insert_double - - Inputs: function application with three arguments: a string, an integer - offset, and a double - - Outputs: a new string expression - - Purpose: add axioms corresponding to the StringBuilder.insert(D) java function - -\*******************************************************************/ - +/// add axioms corresponding to the StringBuilder.insert(D) java function +/// \par parameters: function application with three arguments: a string, an +/// integer +/// offset, and a double +/// \return a new string expression string_exprt string_constraint_generatort::add_axioms_for_insert_double( const function_application_exprt &f) { @@ -179,19 +123,11 @@ string_exprt string_constraint_generatort::add_axioms_for_insert_double( return add_axioms_for_insert(s1, s2, args(f, 3)[1]); } -/*******************************************************************\ - -Function: string_constraint_generatort::add_axioms_for_insert_float - - Inputs: function application with three arguments: a string, an integer - offset, and a float - - Outputs: a new string expression - - Purpose: add axioms corresponding to the StringBuilder.insert(F) java function - -\*******************************************************************/ - +/// add axioms corresponding to the StringBuilder.insert(F) java function +/// \par parameters: function application with three arguments: a string, an +/// integer +/// offset, and a float +/// \return a new string expression string_exprt string_constraint_generatort::add_axioms_for_insert_float( const function_application_exprt &f) { @@ -201,21 +137,13 @@ string_exprt string_constraint_generatort::add_axioms_for_insert_float( return add_axioms_for_insert(s1, s2, args(f, 3)[1]); } -/*******************************************************************\ - -Function: string_constraint_generatort::add_axioms_for_insert_char_array - - Inputs: function application with 4 arguments plus two optional arguments: - a string, an offset index, a length, data array, an offset and a - count - - Outputs: a new string expression - - Purpose: add axioms corresponding to the StringBuilder.insert:(I[CII) - and StringBuilder.insert:(I[C) java functions - -\*******************************************************************/ - +/// add axioms corresponding to the StringBuilder.insert:(I[CII) and +/// StringBuilder.insert:(I[C) java functions +/// \par parameters: function application with 4 arguments plus two optional +/// arguments: +/// a string, an offset index, a length, data array, an offset and a +/// count +/// \return a new string expression string_exprt string_constraint_generatort::add_axioms_for_insert_char_array( const function_application_exprt &f) { diff --git a/src/solvers/refinement/string_constraint_generator_main.cpp b/src/solvers/refinement/string_constraint_generator_main.cpp index 796b0554696..b7d8ad878e3 100644 --- a/src/solvers/refinement/string_constraint_generator_main.cpp +++ b/src/solvers/refinement/string_constraint_generator_main.cpp @@ -10,6 +10,13 @@ Author: Romain Brenguier, romain.brenguier@diffblue.com \*******************************************************************/ +/// \file +/// Generates string constraints to link results from string functions with +/// their arguments. This is inspired by the PASS paper at HVC'13: "PASS: +/// String Solving with Parameterized Array and Interval Automaton" by Guodong +/// Li and Indradeep Ghosh, which gives examples of constraints for several +/// functions. + #include #include #include @@ -20,39 +27,22 @@ Author: Romain Brenguier, romain.brenguier@diffblue.com unsigned string_constraint_generatort::next_symbol_id=1; -/*******************************************************************\ - -Function: string_constraint_generatort::constant_char - - Inputs: integer representing a character, and a type for characters; - we do not use char type here because in some languages - (for instance java) characters use more than 8 bits. - - Outputs: constant expression corresponding to the character. - - Purpose: generate constant character expression with character type. - -\*******************************************************************/ - +/// generate constant character expression with character type. +/// \par parameters: integer representing a character, and a type for +/// characters; +/// we do not use char type here because in some languages +/// (for instance java) characters use more than 8 bits. +/// \return constant expression corresponding to the character. constant_exprt string_constraint_generatort::constant_char( int i, const typet &char_type) { return from_integer(i, char_type); } -/*******************************************************************\ - -Function: string_constraint_generator::fresh_symbol - - Inputs: a prefix and a type - - Outputs: a symbol of type tp whose name starts with - "string_refinement#" followed by prefix - - Purpose: generate a new symbol expression of the given type with some prefix - -\*******************************************************************/ - +/// generate a new symbol expression of the given type with some prefix +/// \par parameters: a prefix and a type +/// \return a symbol of type tp whose name starts with "string_refinement#" +/// followed by prefix symbol_exprt string_constraint_generatort::fresh_symbol( const irep_idt &prefix, const typet &type) { @@ -62,37 +52,18 @@ symbol_exprt string_constraint_generatort::fresh_symbol( return symbol_exprt(name, type); } -/*******************************************************************\ - -Function: string_constraint_generatort::fresh_univ_index - - Inputs: a prefix - - Outputs: a symbol of index type whose name starts with the prefix - - Purpose: generate an index symbol to be used as an universaly quantified - variable - -\*******************************************************************/ - +/// generate an index symbol to be used as an universaly quantified variable +/// \par parameters: a prefix +/// \return a symbol of index type whose name starts with the prefix symbol_exprt string_constraint_generatort::fresh_univ_index( const irep_idt &prefix, const typet &type) { return fresh_symbol(prefix, type); } -/*******************************************************************\ - -Function: string_constraint_generatort::fresh_exist_index - - Inputs: a prefix - - Outputs: a symbol of index type whose name starts with the prefix - - Purpose: generate an index symbol which is existentially quantified - -\*******************************************************************/ - +/// generate an index symbol which is existentially quantified +/// \par parameters: a prefix +/// \return a symbol of index type whose name starts with the prefix symbol_exprt string_constraint_generatort::fresh_exist_index( const irep_idt &prefix, const typet &type) { @@ -101,18 +72,9 @@ symbol_exprt string_constraint_generatort::fresh_exist_index( return s; } -/*******************************************************************\ - -Function: string_constraint_generatort::fresh_boolean - - Inputs: a prefix - - Outputs: a symbol of index type whose name starts with the prefix - - Purpose: generate a Boolean symbol which is existentially quantified - -\*******************************************************************/ - +/// generate a Boolean symbol which is existentially quantified +/// \par parameters: a prefix +/// \return a symbol of index type whose name starts with the prefix symbol_exprt string_constraint_generatort::fresh_boolean( const irep_idt &prefix) { @@ -121,20 +83,11 @@ symbol_exprt string_constraint_generatort::fresh_boolean( return b; } -/*******************************************************************\ - -Function: string_constraint_generatort::plus_exprt_with_overflow_check - - Inputs: - op1 - First term of the sum - op2 - Second term of the sum - - Outputs: A plus expression representing the sum of the arguments - - Purpose: Create a plus expression while adding extra constraints to - axioms in order to prevent overflows. - -\*******************************************************************/ +/// Create a plus expression while adding extra constraints to axioms in order +/// to prevent overflows. +/// \param op1: First term of the sum +/// \param op2: Second term of the sum +/// \return A plus expression representing the sum of the arguments plus_exprt string_constraint_generatort::plus_exprt_with_overflow_check( const exprt &op1, const exprt &op2) { @@ -157,19 +110,9 @@ plus_exprt string_constraint_generatort::plus_exprt_with_overflow_check( return sum; } -/*******************************************************************\ - -Function: string_constraint_generatort::fresh_string - - Inputs: a type for string - - Outputs: a string expression - - Purpose: construct a string expression whose length and content are new - variables - -\*******************************************************************/ - +/// construct a string expression whose length and content are new variables +/// \par parameters: a type for string +/// \return a string expression string_exprt string_constraint_generatort::fresh_string( const refined_string_typet &type) { @@ -181,19 +124,10 @@ string_exprt string_constraint_generatort::fresh_string( return str; } -/*******************************************************************\ - -Function: string_constraint_generatort::get_string_expr - - Inputs: an expression of refined string type - - Outputs: a string expression - - Purpose: casts an expression to a string expression, or fetches the - actual string_exprt in the case of a symbol. - -\*******************************************************************/ - +/// casts an expression to a string expression, or fetches the actual +/// string_exprt in the case of a symbol. +/// \par parameters: an expression of refined string type +/// \return a string expression string_exprt string_constraint_generatort::get_string_expr(const exprt &expr) { assert(refined_string_typet::is_refined_string_type(expr.type())); @@ -210,18 +144,9 @@ string_exprt string_constraint_generatort::get_string_expr(const exprt &expr) } } -/*******************************************************************\ - -Function: string_constraint_generatort::convert_java_string_to_string_exprt - - Inputs: a java string - - Outputs: a string expression - - Purpose: create a new string_exprt as a conversion of a java string - -\*******************************************************************/ - +/// create a new string_exprt as a conversion of a java string +/// \par parameters: a java string +/// \return a string expression string_exprt string_constraint_generatort::convert_java_string_to_string_exprt( const exprt &jls) { @@ -245,26 +170,13 @@ string_exprt string_constraint_generatort::convert_java_string_to_string_exprt( return string_exprt(length, java_content, type); } -/*******************************************************************\ - -Function: string_constraint_generatort::add_default_axioms - - Inputs: - s - a string expression - - Outputs: a string expression that is linked to the argument through - axioms that are added to the list - - Purpose: adds standard axioms about the length of the string and - its content: - * its length should be positive - * it should not exceed max_string_length - * if force_printable_characters is true then all characters - should belong to the range of ASCII characters between ' ' and '~' - - -\*******************************************************************/ - +/// adds standard axioms about the length of the string and its content: * its +/// length should be positive * it should not exceed max_string_length * if +/// force_printable_characters is true then all characters should belong to the +/// range of ASCII characters between ' ' and '~' +/// \param s: a string expression +/// \return a string expression that is linked to the argument through axioms +/// that are added to the list void string_constraint_generatort::add_default_axioms( const string_exprt &s) { @@ -285,20 +197,11 @@ void string_constraint_generatort::add_default_axioms( } } -/*******************************************************************\ - -Function: string_constraint_generatort::add_axioms_for_refined_string - - Inputs: an expression of refined string type - - Outputs: a string expression that is linked to the argument through - axioms that are added to the list - - Purpose: obtain a refined string expression corresponding to a expression - of type string - -\*******************************************************************/ - +/// obtain a refined string expression corresponding to a expression of type +/// string +/// \par parameters: an expression of refined string type +/// \return a string expression that is linked to the argument through axioms +/// that are added to the list string_exprt string_constraint_generatort::add_axioms_for_refined_string( const exprt &string) { @@ -339,18 +242,9 @@ string_exprt string_constraint_generatort::add_axioms_for_refined_string( } } -/*******************************************************************\ - -Function: string_constraint_generatort::add_axioms_for_if - - Inputs: an if expression - - Outputs: a string expression - - Purpose: add axioms for an if expression which should return a string - -\*******************************************************************/ - +/// add axioms for an if expression which should return a string +/// \par parameters: an if expression +/// \return a string expression string_exprt string_constraint_generatort::add_axioms_for_if( const if_exprt &expr) { @@ -378,21 +272,12 @@ string_exprt string_constraint_generatort::add_axioms_for_if( return res; } -/*******************************************************************\ - -Function: string_constraint_generatort::find_or_add_string_of_symbol - - Inputs: a symbol expression - - Outputs: a string expression - - Purpose: if a symbol representing a string is present in the symbol_to_string - table, returns the corresponding string, if the symbol is not yet - present, creates a new string with the correct type depending on - whether the mode is java or c, adds it to the table and returns it. - -\*******************************************************************/ - +/// if a symbol representing a string is present in the symbol_to_string table, +/// returns the corresponding string, if the symbol is not yet present, creates +/// a new string with the correct type depending on whether the mode is java or +/// c, adds it to the table and returns it. +/// \par parameters: a symbol expression +/// \return a string expression string_exprt string_constraint_generatort::find_or_add_string_of_symbol( const symbol_exprt &sym, const refined_string_typet &ref_type) { @@ -402,20 +287,11 @@ string_exprt string_constraint_generatort::find_or_add_string_of_symbol( return entry.first->second; } -/*******************************************************************\ - -Function: string_constraint_generatort::add_axioms_for_function_application - - Inputs: an expression containing a function application - - Outputs: expression corresponding to the result of the function application - - Purpose: strings contained in this call are converted to objects of type - `string_exprt`, through adding axioms. Axioms are then added to - enforce that the result corresponds to the function application. - -\*******************************************************************/ - +/// strings contained in this call are converted to objects of type +/// `string_exprt`, through adding axioms. Axioms are then added to enforce that +/// the result corresponds to the function application. +/// \par parameters: an expression containing a function application +/// \return expression corresponding to the result of the function application exprt string_constraint_generatort::add_axioms_for_function_application( const function_application_exprt &expr) { @@ -609,20 +485,11 @@ exprt string_constraint_generatort::add_axioms_for_function_application( return res; } -/*******************************************************************\ - -Function: string_constraint_generatort::add_axioms_for_copy - - Inputs: function application with one argument, which is a string, - or three arguments: string, integer offset and count - - Outputs: a new string expression - - Purpose: add axioms to say that the returned string expression is equal to - the argument of the function application - -\*******************************************************************/ - +/// add axioms to say that the returned string expression is equal to the +/// argument of the function application +/// \par parameters: function application with one argument, which is a string, +/// or three arguments: string, integer offset and count +/// \return a new string expression string_exprt string_constraint_generatort::add_axioms_for_copy( const function_application_exprt &f) { @@ -642,18 +509,10 @@ string_exprt string_constraint_generatort::add_axioms_for_copy( } } -/*******************************************************************\ - -Function: string_constraint_generatort::add_axioms_for_java_char_array - - Inputs: an expression corresponding to a java object of type char array - - Outputs: a new string expression - - Purpose: add axioms corresponding to the String.valueOf([C) java function - -\*******************************************************************/ - +/// add axioms corresponding to the String.valueOf([C) java function +/// \par parameters: an expression corresponding to a java object of type char +/// array +/// \return a new string expression string_exprt string_constraint_generatort::add_axioms_for_java_char_array( const exprt &char_array) { @@ -667,18 +526,9 @@ string_exprt string_constraint_generatort::add_axioms_for_java_char_array( return res; } -/*******************************************************************\ - -Function: string_constraint_generatort::add_axioms_for_char_pointer - - Inputs: an expression of type char - - Outputs: an array expression - - Purpose: for an expression of the form `array[0]` returns `array` - -\*******************************************************************/ - +/// for an expression of the form `array[0]` returns `array` +/// \par parameters: an expression of type char +/// \return an array expression exprt string_constraint_generatort::add_axioms_for_char_pointer( const function_application_exprt &fun) { @@ -690,18 +540,9 @@ exprt string_constraint_generatort::add_axioms_for_char_pointer( return exprt(); } -/*******************************************************************\ - -Function: string_constraint_generatort::add_axioms_for_length - - Inputs: function application with one string argument - - Outputs: a string expression of index type - - Purpose: add axioms corresponding to the String.length java function - -\*******************************************************************/ - +/// add axioms corresponding to the String.length java function +/// \par parameters: function application with one string argument +/// \return a string expression of index type exprt string_constraint_generatort::add_axioms_for_length( const function_application_exprt &f) { @@ -709,21 +550,13 @@ exprt string_constraint_generatort::add_axioms_for_length( return str.length(); } -/*******************************************************************\ - -Function: string_constraint_generatort::add_axioms_from_char_array - - Inputs: a length expression, an array expression, a offset index, and a - count index - - Outputs: a new string expression - - Purpose: add axioms stating that the content of the returned string - equals to the content of the array argument, starting at offset and - with `count` characters - -\*******************************************************************/ - +/// add axioms stating that the content of the returned string equals to the +/// content of the array argument, starting at offset and with `count` +/// characters +/// \par parameters: a length expression, an array expression, a offset index, +/// and a +/// count index +/// \return a new string expression string_exprt string_constraint_generatort::add_axioms_from_char_array( const exprt &length, const exprt &data, @@ -752,20 +585,11 @@ string_exprt string_constraint_generatort::add_axioms_from_char_array( return str; } -/*******************************************************************\ - -Function: string_constraint_generatort::add_axioms_from_char_array - - Inputs: function application with 2 arguments and 2 additional optional - arguments: length, char array, offset and count - - Outputs: a new string expression - - Purpose: add axioms corresponding to the String.:(I[CII) - and String.:(I[C) java functions - -\*******************************************************************/ - +/// add axioms corresponding to the String.:(I[CII) and +/// String.:(I[C) java functions +/// function application with 2 arguments and 2 additional optional +/// \param arguments: length, char array, offset and count +/// \return a new string expression string_exprt string_constraint_generatort::add_axioms_from_char_array( const function_application_exprt &f) { @@ -788,36 +612,18 @@ string_exprt string_constraint_generatort::add_axioms_from_char_array( return add_axioms_from_char_array(tab_length, data, offset, count); } -/*******************************************************************\ - -Function: string_constraint_generatort::add_axioms_for_is_positive_index - - Inputs: an index expression - - Outputs: a Boolean expression - - Purpose: expression true exactly when the index is positive - -\*******************************************************************/ - +/// expression true exactly when the index is positive +/// \par parameters: an index expression +/// \return a Boolean expression exprt string_constraint_generatort::axiom_for_is_positive_index(const exprt &x) { return binary_relation_exprt( x, ID_ge, from_integer(0, x.type())); } -/*******************************************************************\ - -Function: string_constraint_generatort::add_axioms_for_char_literal - - Inputs: function application with one character argument - - Outputs: a new character expression - - Purpose: add axioms stating that the returned value is equal to the argument - -\*******************************************************************/ - +/// add axioms stating that the returned value is equal to the argument +/// \par parameters: function application with one character argument +/// \return a new character expression exprt string_constraint_generatort::add_axioms_for_char_literal( const function_application_exprt &f) { @@ -843,19 +649,11 @@ exprt string_constraint_generatort::add_axioms_for_char_literal( } } -/*******************************************************************\ - -Function: string_constraint_generatort::add_axioms_for_char_at - - Inputs: function application with two arguments: a string and an integer - - Outputs: a character expression - - Purpose: add axioms stating that the character of the string at the given - position is equal to the returned value - -\*******************************************************************/ - +/// add axioms stating that the character of the string at the given position is +/// equal to the returned value +/// \par parameters: function application with two arguments: a string and an +/// integer +/// \return a character expression exprt string_constraint_generatort::add_axioms_for_char_at( const function_application_exprt &f) { @@ -866,18 +664,9 @@ exprt string_constraint_generatort::add_axioms_for_char_at( return char_sym; } -/*******************************************************************\ - -Function: string_constraint_generatort::add_axioms_for_to_char_array - - Inputs: function application with one string argument - - Outputs: a char array expression - - Purpose: add axioms corresponding to the String.toCharArray java function - -\*******************************************************************/ - +/// add axioms corresponding to the String.toCharArray java function +/// \par parameters: function application with one string argument +/// \return a char array expression exprt string_constraint_generatort::add_axioms_for_to_char_array( const function_application_exprt &f) { diff --git a/src/solvers/refinement/string_constraint_generator_testing.cpp b/src/solvers/refinement/string_constraint_generator_testing.cpp index 55a6f45f4f7..878441cd0d1 100644 --- a/src/solvers/refinement/string_constraint_generator_testing.cpp +++ b/src/solvers/refinement/string_constraint_generator_testing.cpp @@ -7,22 +7,15 @@ Author: Romain Brenguier, romain.brenguier@diffblue.com \*******************************************************************/ -#include - -/*******************************************************************\ - -Function: string_constraint_generatort::add_axioms_for_is_prefix - - Inputs: a prefix string, a string and an integer offset - - Outputs: a Boolean expression - - Purpose: add axioms stating that the returned expression is true exactly - when the first string is a prefix of the second one, starting at - position offset +/// \file +/// Generates string constraints for string functions that return Boolean values -\*******************************************************************/ +#include +/// add axioms stating that the returned expression is true exactly when the +/// first string is a prefix of the second one, starting at position offset +/// \par parameters: a prefix string, a string and an integer offset +/// \return a Boolean expression exprt string_constraint_generatort::add_axioms_for_is_prefix( const string_exprt &prefix, const string_exprt &str, const exprt &offset) { @@ -69,20 +62,12 @@ exprt string_constraint_generatort::add_axioms_for_is_prefix( return isprefix; } -/*******************************************************************\ - -Function: string_constraint_generatort::add_axioms_for_is_prefix - - Inputs: a function application with 2 or 3 arguments and a Boolean telling - whether the prefix is the second argument (when swap_arguments is - true) or the first argument - - Outputs: a Boolean expression - - Purpose: add axioms corresponding to the String.isPrefix java function - -\*******************************************************************/ - +/// add axioms corresponding to the String.isPrefix java function +/// \par parameters: a function application with 2 or 3 arguments and a Boolean +/// telling +/// whether the prefix is the second argument (when swap_arguments is +/// true) or the first argument +/// \return a Boolean expression exprt string_constraint_generatort::add_axioms_for_is_prefix( const function_application_exprt &f, bool swap_arguments) { @@ -98,19 +83,10 @@ exprt string_constraint_generatort::add_axioms_for_is_prefix( return typecast_exprt(add_axioms_for_is_prefix(s0, s1, offset), f.type()); } -/*******************************************************************\ - -Function: string_constraint_generatort::add_axioms_for_is_empty - - Inputs: function application with a string argument - - Outputs: a Boolean expression - - Purpose: add axioms stating that the returned value is true exactly when - the argument string is empty - -\*******************************************************************/ - +/// add axioms stating that the returned value is true exactly when the argument +/// string is empty +/// \par parameters: function application with a string argument +/// \return a Boolean expression exprt string_constraint_generatort::add_axioms_for_is_empty( const function_application_exprt &f) { @@ -127,20 +103,12 @@ exprt string_constraint_generatort::add_axioms_for_is_empty( return typecast_exprt(is_empty, f.type()); } -/*******************************************************************\ - -Function: string_constraint_generatort::add_axioms_for_is_suffix - - Inputs: a function application with 2 or 3 arguments and a Boolean telling - whether the suffix is the second argument (when swap_arguments is - true) or the first argument - - Outputs: a Boolean expression - - Purpose: add axioms corresponding to the String.isSuffix java function - -\*******************************************************************/ - +/// add axioms corresponding to the String.isSuffix java function +/// \par parameters: a function application with 2 or 3 arguments and a Boolean +/// telling +/// whether the suffix is the second argument (when swap_arguments is +/// true) or the first argument +/// \return a Boolean expression exprt string_constraint_generatort::add_axioms_for_is_suffix( const function_application_exprt &f, bool swap_arguments) { @@ -190,19 +158,9 @@ exprt string_constraint_generatort::add_axioms_for_is_suffix( return tc_issuffix; } -/*******************************************************************\ - -Function: string_constraint_generatort::is_constant_string - - Inputs: - expr - a string expression - - Outputs: a Boolean - - Purpose: tells whether the given string is a constant - -\*******************************************************************/ - +/// tells whether the given string is a constant +/// \param expr: a string expression +/// \return a Boolean bool string_constraint_generatort::is_constant_string( const string_exprt &expr) const { @@ -219,18 +177,9 @@ bool string_constraint_generatort::is_constant_string( return true; } -/*******************************************************************\ - -Function: string_constraint_generatort::add_axioms_for_contains - - Inputs: function application with two string arguments - - Outputs: a Boolean expression - - Purpose: add axioms corresponding to the String.contains java function - -\*******************************************************************/ - +/// add axioms corresponding to the String.contains java function +/// \par parameters: function application with two string arguments +/// \return a Boolean expression exprt string_constraint_generatort::add_axioms_for_contains( const function_application_exprt &f) { diff --git a/src/solvers/refinement/string_constraint_generator_transformation.cpp b/src/solvers/refinement/string_constraint_generator_transformation.cpp index c110f636c43..599ae3af9dd 100644 --- a/src/solvers/refinement/string_constraint_generator_transformation.cpp +++ b/src/solvers/refinement/string_constraint_generator_transformation.cpp @@ -7,25 +7,20 @@ Author: Romain Brenguier, romain.brenguier@diffblue.com \*******************************************************************/ -#include - -/*******************************************************************\ - -Function: string_constraint_generatort::add_axioms_for_set_length - - Inputs: function application with two arguments, the first of which is - a string and the second an integer which should have same type has - return by get_index_type() - - Outputs: a new string expression +/// \file +/// Generates string constraints for string transformations, that is, functions +/// taking one string and returning another - Purpose: add axioms to say that the returned string expression has length - given by the second argument and whose characters are equal to - those of the first argument for the positions which are defined in - both strings - -\*******************************************************************/ +#include +/// add axioms to say that the returned string expression has length given by +/// the second argument and whose characters are equal to those of the first +/// argument for the positions which are defined in both strings +/// \par parameters: function application with two arguments, the first of which +/// is +/// a string and the second an integer which should have same type has +/// return by get_index_type() +/// \return a new string expression string_exprt string_constraint_generatort::add_axioms_for_set_length( const function_application_exprt &f) { @@ -63,21 +58,13 @@ string_exprt string_constraint_generatort::add_axioms_for_set_length( } -/*******************************************************************\ - -Function: string_constraint_generatort::add_axioms_for_substring - - Inputs: function application with one string argument, one start index - argument and an optional end index argument - - Outputs: a new string expression - - Purpose: add axioms corresponding to the String.substring java function - Warning: the specification may not be correct for the case where the - string is shorter than the end index - -\*******************************************************************/ - +/// add axioms corresponding to the String.substring java function Warning: the +/// specification may not be correct for the case where the string is shorter +/// than the end index +/// \par parameters: function application with one string argument, one start +/// index +/// argument and an optional end index argument +/// \return a new string expression string_exprt string_constraint_generatort::add_axioms_for_substring( const function_application_exprt &f) { @@ -98,20 +85,12 @@ string_exprt string_constraint_generatort::add_axioms_for_substring( return add_axioms_for_substring(str, i, j); } -/*******************************************************************\ - -Function: string_constraint_generatort::add_axioms_for_substring - - Inputs: a string expression, an expression for the start index, and an - expression for the end index - - Outputs: a new string expression - - Purpose: add axioms stating that the returned string expression is equal - to the input one starting at `start` and ending before `end` - -\*******************************************************************/ - +/// add axioms stating that the returned string expression is equal to the input +/// one starting at `start` and ending before `end` +/// \par parameters: a string expression, an expression for the start index, and +/// an +/// expression for the end index +/// \return a new string expression string_exprt string_constraint_generatort::add_axioms_for_substring( const string_exprt &str, const exprt &start, const exprt &end) { @@ -148,18 +127,9 @@ string_exprt string_constraint_generatort::add_axioms_for_substring( return res; } -/*******************************************************************\ - -Function: string_constraint_generatort::add_axioms_for_trim - - Inputs: function application with one string argument - - Outputs: a new string expression - - Purpose: add axioms corresponding to the String.trim java function - -\*******************************************************************/ - +/// add axioms corresponding to the String.trim java function +/// \par parameters: function application with one string argument +/// \return a new string expression string_exprt string_constraint_generatort::add_axioms_for_trim( const function_application_exprt &expr) { @@ -233,18 +203,9 @@ string_exprt string_constraint_generatort::add_axioms_for_trim( return res; } -/*******************************************************************\ - -Function: string_constraint_generatort::add_axioms_for_to_lower_case - - Inputs: function application with one string argument - - Outputs: a new string expression - - Purpose: add axioms corresponding to the String.toLowerCase java function - -\*******************************************************************/ - +/// add axioms corresponding to the String.toLowerCase java function +/// \par parameters: function application with one string argument +/// \return a new string expression string_exprt string_constraint_generatort::add_axioms_for_to_lower_case( const function_application_exprt &expr) { @@ -286,18 +247,9 @@ string_exprt string_constraint_generatort::add_axioms_for_to_lower_case( return res; } -/*******************************************************************\ - -Function: string_constraint_generatort::add_axioms_for_to_upper_case - - Inputs: function application with one string argument - - Outputs: a new string expression - - Purpose: add axioms corresponding to the String.toUpperCase java function - -\*******************************************************************/ - +/// add axioms corresponding to the String.toUpperCase java function +/// \par parameters: function application with one string argument +/// \return a new string expression string_exprt string_constraint_generatort::add_axioms_for_to_upper_case( const function_application_exprt &expr) { @@ -338,22 +290,13 @@ string_exprt string_constraint_generatort::add_axioms_for_to_upper_case( } -/*******************************************************************\ - -Function: string_constraint_generatort::add_axioms_for_char_set - - Inputs: function application with three arguments, the first is a string - the second an index and the third a character - - Outputs: a new string expression - - Purpose: add axioms corresponding stating that the result is similar to - that of the StringBuilder.setCharAt java function - Warning: this may be underspecified in the case wher the index exceed - the length of the string - -\*******************************************************************/ - +/// add axioms corresponding stating that the result is similar to that of the +/// StringBuilder.setCharAt java function Warning: this may be underspecified in +/// the case wher the index exceed the length of the string +/// \par parameters: function application with three arguments, the first is a +/// string +/// the second an index and the third a character +/// \return a new string expression string_exprt string_constraint_generatort::add_axioms_for_char_set( const function_application_exprt &f) { @@ -374,19 +317,11 @@ string_exprt string_constraint_generatort::add_axioms_for_char_set( return res; } -/*******************************************************************\ - -Function: string_constraint_generatort::add_axioms_for_replace - - Inputs: function application with three arguments, the first is a string, - the second and the third are characters - - Outputs: a new string expression - - Purpose: add axioms corresponding to the String.replace java function - -\*******************************************************************/ - +/// add axioms corresponding to the String.replace java function +/// \par parameters: function application with three arguments, the first is a +/// string, +/// the second and the third are characters +/// \return a new string expression string_exprt string_constraint_generatort::add_axioms_for_replace( const function_application_exprt &f) { @@ -416,20 +351,11 @@ string_exprt string_constraint_generatort::add_axioms_for_replace( return res; } -/*******************************************************************\ - -Function: string_constraint_generatort::add_axioms_for_delete_char_at - - Inputs: function application with two arguments, the first is a string - and the second is an index - - Outputs: a new string expression - - Purpose: add axioms corresponding to the StringBuilder.deleteCharAt java - function - -\*******************************************************************/ - +/// add axioms corresponding to the StringBuilder.deleteCharAt java function +/// \par parameters: function application with two arguments, the first is a +/// string +/// and the second is an index +/// \return a new string expression string_exprt string_constraint_generatort::add_axioms_for_delete_char_at( const function_application_exprt &f) { @@ -441,20 +367,11 @@ string_exprt string_constraint_generatort::add_axioms_for_delete_char_at( plus_exprt_with_overflow_check(args(f, 2)[1], index_one)); } -/*******************************************************************\ - -Function: string_constraint_generatort::add_axioms_for_delete - - Inputs: a string expression, a start index and an end index - - Outputs: a new string expression - - Purpose: add axioms stating that the returned string corresponds to the input - one where we removed characters between the positions - start (included) and end (not included) - -\*******************************************************************/ - +/// add axioms stating that the returned string corresponds to the input one +/// where we removed characters between the positions start (included) and end +/// (not included) +/// \par parameters: a string expression, a start index and an end index +/// \return a new string expression string_exprt string_constraint_generatort::add_axioms_for_delete( const string_exprt &str, const exprt &start, const exprt &end) { @@ -466,19 +383,10 @@ string_exprt string_constraint_generatort::add_axioms_for_delete( return add_axioms_for_concat(str1, str2); } -/*******************************************************************\ - -Function: string_constraint_generatort::add_axioms_for_delete - - Inputs: function application with three arguments: a string - expression, a start index and an end index - - Outputs: a new string expression - - Purpose: add axioms corresponding to the StringBuilder.delete java function - -\*******************************************************************/ - +/// add axioms corresponding to the StringBuilder.delete java function +/// \par parameters: function application with three arguments: a string +/// expression, a start index and an end index +/// \return a new string expression string_exprt string_constraint_generatort::add_axioms_for_delete( const function_application_exprt &f) { diff --git a/src/solvers/refinement/string_constraint_generator_valueof.cpp b/src/solvers/refinement/string_constraint_generator_valueof.cpp index d967e5bb820..9ad1845c9d0 100644 --- a/src/solvers/refinement/string_constraint_generator_valueof.cpp +++ b/src/solvers/refinement/string_constraint_generator_valueof.cpp @@ -7,21 +7,16 @@ Author: Romain Brenguier, romain.brenguier@diffblue.com \*******************************************************************/ +/// \file +/// Generates string constraints for functions generating strings from other +/// types, in particular int, long, float, double, char, bool + #include #include -/*******************************************************************\ - -Function: string_constraint_generatort::add_axioms_from_int - - Inputs: function application with one integer argument - - Outputs: a new string expression - - Purpose: add axioms corresponding to the String.valueOf(I) java function - -\*******************************************************************/ - +/// add axioms corresponding to the String.valueOf(I) java function +/// \par parameters: function application with one integer argument +/// \return a new string expression string_exprt string_constraint_generatort::add_axioms_from_int( const function_application_exprt &expr) { @@ -29,18 +24,9 @@ string_exprt string_constraint_generatort::add_axioms_from_int( return add_axioms_from_int(args(expr, 1)[0], MAX_INTEGER_LENGTH, ref_type); } -/*******************************************************************\ - -Function: string_constraint_generatort::add_axioms_from_long - - Inputs: function application with one long argument - - Outputs: a new string expression - - Purpose: add axioms corresponding to the String.valueOf(J) java function - -\*******************************************************************/ - +/// add axioms corresponding to the String.valueOf(J) java function +/// \par parameters: function application with one long argument +/// \return a new string expression string_exprt string_constraint_generatort::add_axioms_from_long( const function_application_exprt &expr) { @@ -48,18 +34,9 @@ string_exprt string_constraint_generatort::add_axioms_from_long( return add_axioms_from_int(args(expr, 1)[0], MAX_LONG_LENGTH, ref_type); } -/*******************************************************************\ - -Function: string_constraint_generatort::add_axioms_from_float - - Inputs: function application with one float argument - - Outputs: a new string expression - - Purpose: add axioms corresponding to the String.valueOf(F) java function - -\*******************************************************************/ - +/// add axioms corresponding to the String.valueOf(F) java function +/// \par parameters: function application with one float argument +/// \return a new string expression string_exprt string_constraint_generatort::add_axioms_from_float( const function_application_exprt &f) { @@ -67,18 +44,9 @@ string_exprt string_constraint_generatort::add_axioms_from_float( return add_axioms_from_float(args(f, 1)[0], ref_type, false); } -/*******************************************************************\ - -Function: string_constraint_generatort::add_axioms_from_double - - Inputs: function application with one double argument - - Outputs: a new string expression - - Purpose: add axioms corresponding to the String.valueOf(D) java function - -\*******************************************************************/ - +/// add axioms corresponding to the String.valueOf(D) java function +/// \par parameters: function application with one double argument +/// \return a new string expression string_exprt string_constraint_generatort::add_axioms_from_double( const function_application_exprt &f) { @@ -86,20 +54,12 @@ string_exprt string_constraint_generatort::add_axioms_from_double( return add_axioms_from_float(args(f, 1)[0], ref_type, true); } -/*******************************************************************\ - -Function: string_constraint_generatort::add_axioms_from_float - - Inputs: float expression and Boolean signaling that the argument has - double precision - - Outputs: a new string expression - - Purpose: add axioms corresponding to the String.valueOf(F) java function - Warning: we currently only have partial specification - -\*******************************************************************/ - +/// add axioms corresponding to the String.valueOf(F) java function Warning: we +/// currently only have partial specification +/// \par parameters: float expression and Boolean signaling that the argument +/// has +/// double precision +/// \return a new string expression string_exprt string_constraint_generatort::add_axioms_from_float( const exprt &f, const refined_string_typet &ref_type, bool double_precision) { @@ -191,18 +151,9 @@ string_exprt string_constraint_generatort::add_axioms_from_float( } -/*******************************************************************\ - -Function: string_constraint_generatort::add_axioms_from_bool - - Inputs: function application with on Boolean argument - - Outputs: a new string expression - - Purpose: add axioms corresponding to the String.valueOf(Z) java function - -\*******************************************************************/ - +/// add axioms corresponding to the String.valueOf(Z) java function +/// \par parameters: function application with on Boolean argument +/// \return a new string expression string_exprt string_constraint_generatort::add_axioms_from_bool( const function_application_exprt &f) { @@ -211,19 +162,10 @@ string_exprt string_constraint_generatort::add_axioms_from_bool( } -/*******************************************************************\ - -Function: string_constraint_generatort::add_axioms_from_bool - - Inputs: Boolean expression - - Outputs: a new string expression - - Purpose: add axioms stating that the returned string equals "true" when - the Boolean expression is true and "false" when it is false - -\*******************************************************************/ - +/// add axioms stating that the returned string equals "true" when the Boolean +/// expression is true and "false" when it is false +/// \par parameters: Boolean expression +/// \return a new string expression string_exprt string_constraint_generatort::add_axioms_from_bool( const exprt &b, const refined_string_typet &ref_type) { @@ -265,21 +207,12 @@ string_exprt string_constraint_generatort::add_axioms_from_bool( return res; } -/*******************************************************************\ - -Function: string_constraint_generatort::add_axioms_from_int - - Inputs: a signed integer expression, and a maximal size for the string - representation - - Outputs: a string expression - - Purpose: add axioms to say the string corresponds to the result of - String.valueOf(I) or String.valueOf(J) java functions applied on the - integer expression - -\*******************************************************************/ - +/// add axioms to say the string corresponds to the result of String.valueOf(I) +/// or String.valueOf(J) java functions applied on the integer expression +/// \par parameters: a signed integer expression, and a maximal size for the +/// string +/// representation +/// \return a string expression string_exprt string_constraint_generatort::add_axioms_from_int( const exprt &i, size_t max_size, const refined_string_typet &ref_type) { @@ -383,18 +316,10 @@ string_exprt string_constraint_generatort::add_axioms_from_int( return res; } -/*******************************************************************\ - -Function: string_constraint_generatort::int_of_hex_char - - Inputs: a character expression in the following set: 0123456789abcdef - - Outputs: an integer expression - - Purpose: returns the value represented by the character - -\*******************************************************************/ - +/// returns the value represented by the character +/// \par parameters: a character expression in the following set: +/// 0123456789abcdef +/// \return an integer expression exprt string_constraint_generatort::int_of_hex_char(const exprt &chr) const { exprt zero_char=constant_char('0', chr.type()); @@ -406,19 +331,10 @@ exprt string_constraint_generatort::int_of_hex_char(const exprt &chr) const minus_exprt(chr, zero_char)); } -/*******************************************************************\ - -Function: string_constraint_generatort::add_axioms_from_int_hex - - Inputs: one integer argument - - Outputs: a new string expression - - Purpose: add axioms stating that the returned string corresponds to the - integer argument written in hexadecimal - -\*******************************************************************/ - +/// add axioms stating that the returned string corresponds to the integer +/// argument written in hexadecimal +/// \par parameters: one integer argument +/// \return a new string expression string_exprt string_constraint_generatort::add_axioms_from_int_hex( const exprt &i, const refined_string_typet &ref_type) { @@ -472,18 +388,9 @@ string_exprt string_constraint_generatort::add_axioms_from_int_hex( return res; } -/*******************************************************************\ - -Function: string_constraint_generatort::add_axioms_for_int_hex - - Inputs: function application with integer argument - - Outputs: a new string expression - - Purpose: add axioms corresponding to the Integer.toHexString(I) java function - -\*******************************************************************/ - +/// add axioms corresponding to the Integer.toHexString(I) java function +/// \par parameters: function application with integer argument +/// \return a new string expression string_exprt string_constraint_generatort::add_axioms_from_int_hex( const function_application_exprt &f) { @@ -491,18 +398,9 @@ string_exprt string_constraint_generatort::add_axioms_from_int_hex( return add_axioms_from_int_hex(args(f, 1)[0], ref_type); } -/*******************************************************************\ - -Function: string_constraint_generatort::add_axioms_from_char - - Inputs: function application one char argument - - Outputs: a new string expression - - Purpose: add axioms corresponding to the String.valueOf(C) java function - -\*******************************************************************/ - +/// add axioms corresponding to the String.valueOf(C) java function +/// \par parameters: function application one char argument +/// \return a new string expression string_exprt string_constraint_generatort::add_axioms_from_char( const function_application_exprt &f) { @@ -510,19 +408,10 @@ string_exprt string_constraint_generatort::add_axioms_from_char( return add_axioms_from_char(args(f, 1)[0], ref_type); } -/*******************************************************************\ - -Function: string_constraint_generatort::add_axioms_from_char - - Inputs: one expression of type char - - Outputs: a new string expression - - Purpose: add axioms stating that the returned string has length 1 and - the character it contains correspond to the input expression - -\*******************************************************************/ - +/// add axioms stating that the returned string has length 1 and the character +/// it contains correspond to the input expression +/// \par parameters: one expression of type char +/// \return a new string expression string_exprt string_constraint_generatort::add_axioms_from_char( const exprt &c, const refined_string_typet &ref_type) { @@ -532,19 +421,10 @@ string_exprt string_constraint_generatort::add_axioms_from_char( return res; } -/*******************************************************************\ - -Function: string_constraint_generatort::add_axioms_for_value_of - - Inputs: function application with one or three arguments - - Outputs: a new string expression - - Purpose: add axioms corresponding to the String.valueOf([C) and - String.valueOf([CII) functions - -\*******************************************************************/ - +/// add axioms corresponding to the String.valueOf([C) and String.valueOf([CII) +/// functions +/// \par parameters: function application with one or three arguments +/// \return a new string expression string_exprt string_constraint_generatort::add_axioms_for_value_of( const function_application_exprt &f) { @@ -578,19 +458,10 @@ string_exprt string_constraint_generatort::add_axioms_for_value_of( } } -/*******************************************************************\ - -Function: string_constraint_generatort::add_axioms_for_correct_number_format - - Inputs: function application with one string expression - - Outputs: an boolean expression - - Purpose: add axioms making the return value true if the given string is - a correct number - -\*******************************************************************/ - +/// add axioms making the return value true if the given string is a correct +/// number +/// \par parameters: function application with one string expression +/// \return an boolean expression exprt string_constraint_generatort::add_axioms_for_correct_number_format( const string_exprt &str, std::size_t max_size) { @@ -642,18 +513,9 @@ exprt string_constraint_generatort::add_axioms_for_correct_number_format( return correct; } -/*******************************************************************\ - -Function: string_constraint_generatort::add_axioms_for_parse_int - - Inputs: function application with one string expression - - Outputs: an integer expression - - Purpose: add axioms corresponding to the Integer.parseInt java function - -\*******************************************************************/ - +/// add axioms corresponding to the Integer.parseInt java function +/// \par parameters: function application with one string expression +/// \return an integer expression exprt string_constraint_generatort::add_axioms_for_parse_int( const function_application_exprt &f) { diff --git a/src/solvers/refinement/string_refinement.cpp b/src/solvers/refinement/string_refinement.cpp index 3c28e6f8fa3..257fbf51e48 100644 --- a/src/solvers/refinement/string_refinement.cpp +++ b/src/solvers/refinement/string_refinement.cpp @@ -10,6 +10,13 @@ Author: Alberto Griggio, alberto.griggio@gmail.com \*******************************************************************/ +/// \file +/// String support via creating string constraints and progressively +/// instantiating the universal constraints as needed. The procedure is +/// described in the PASS paper at HVC'13: "PASS: String Solving with +/// Parameterized Array and Interval Automaton" by Guodong Li and Indradeep +/// Ghosh. + #include #include #include @@ -22,19 +29,6 @@ Author: Alberto Griggio, alberto.griggio@gmail.com #include #include -/*******************************************************************\ - -Constructor: string_refinementt - - Inputs: - _ns - a namespace - _prop - a decision procedure - refinement_bound - a bound on the number of refinements - - Purpose: refinement_bound is a bound on the number of refinement allowed. - -\*******************************************************************/ - string_refinementt::string_refinementt( const namespacet &_ns, propt &_prop, @@ -46,62 +40,31 @@ string_refinementt::string_refinementt( non_empty_string(false) { } -/*******************************************************************\ - -Function: string_refinementt::set_max_string_length - - Inputs: - i - maximum length which is allowed for strings. - by default the strings length has no other limit - than the maximal integer according to the type of their - length, for instance 2^31-1 for Java. - - Purpose: Add constraints on the size of strings used in the - program. - -\*******************************************************************/ - +/// Add constraints on the size of strings used in the program. +/// \param i: maximum length which is allowed for strings. +/// by default the strings length has no other limit +/// than the maximal integer according to the type of their +/// length, for instance 2^31-1 for Java. void string_refinementt::set_max_string_length(size_t i) { generator.max_string_length=i; } -/*******************************************************************\ - -Function: string_refinementt::set_max_string_length - - Purpose: Add constraints on the size of nondet character arrays - to ensure they have length at least 1 - -\*******************************************************************/ - +/// Add constraints on the size of nondet character arrays to ensure they have +/// length at least 1 void string_refinementt::enforce_non_empty_string() { non_empty_string=true; } -/*******************************************************************\ - -Function: string_refinementt::enforce_printable_characters - - Purpose: Add constraints on characters used in the program - to ensure they are printable - -\*******************************************************************/ - +/// Add constraints on characters used in the program to ensure they are +/// printable void string_refinementt::enforce_printable_characters() { generator.force_printable_characters=true; } -/*******************************************************************\ - -Function: string_refinementt::display_index_set - - Purpose: display the current index set, for debugging - -\*******************************************************************/ - +/// display the current index set, for debugging void string_refinementt::display_index_set() { std::size_t count=0; @@ -127,15 +90,8 @@ void string_refinementt::display_index_set() << " newly added)" << eom; } -/*******************************************************************\ - -Function: string_refinementt::add_instantiations - - Purpose: compute the index set for all formulas, instantiate the formulas - with the found indexes, and add them as lemmas. - -\*******************************************************************/ - +/// compute the index set for all formulas, instantiate the formulas with the +/// found indexes, and add them as lemmas. void string_refinementt::add_instantiations() { debug() << "string_constraint_generatort::add_instantiations: " @@ -162,19 +118,10 @@ void string_refinementt::add_instantiations() } } -/*******************************************************************\ - -Function: string_refinementt::add_symbol_to_symbol_map() - - Inputs: - lhs - a symbol expression - rhs - an expression to map it to - - Purpose: keeps a map of symbols to expressions, such as none of the - mapped values exist as a key - -\*******************************************************************/ - +/// keeps a map of symbols to expressions, such as none of the mapped values +/// exist as a key +/// \param lhs: a symbol expression +/// \param rhs: an expression to map it to void string_refinementt::add_symbol_to_symbol_map( const exprt &lhs, const exprt &rhs) { @@ -196,16 +143,8 @@ void string_refinementt::add_symbol_to_symbol_map( } } -/*******************************************************************\ - -Function: string_refinementt::set_char_array_equality() - - Inputs: the rhs and lhs of an equality over character arrays - - Purpose: add axioms if the rhs is a character array - -\*******************************************************************/ - +/// add axioms if the rhs is a character array +/// \par parameters: the rhs and lhs of an equality over character arrays void string_refinementt::set_char_array_equality( const exprt &lhs, const exprt &rhs) { @@ -230,19 +169,9 @@ void string_refinementt::set_char_array_equality( // equality. Note that this might not be the case for other languages. } -/*******************************************************************\ - -Function: string_refinementt::substitute_function_applications() - - Inputs: an expression containing function applications - - Outputs: an epression containing no function application - - Purpose: remove functions applications and create the necessary - axioms - -\*******************************************************************/ - +/// remove functions applications and create the necessary axioms +/// \par parameters: an expression containing function applications +/// \return an epression containing no function application exprt string_refinementt::substitute_function_applications(exprt expr) { for(size_t i=0; i 2, y -> -1. - -\*******************************************************************/ - +/// \par parameters: an expression with only addition and substraction +/// \return a map where each leaf of the input is mapped to the number of times +/// it is added. For instance, expression $x + x - y$ would give the map x -> +/// 2, y -> -1. std::map string_refinementt::map_representation_of_sum( const exprt &f) const { @@ -1336,18 +1099,10 @@ std::map string_refinementt::map_representation_of_sum( return elems; } -/*******************************************************************\ - -Function: string_refinementt::sum_over_map - - Inputs: a map from expressions to integers - - Outputs: a expression for the sum of each element in the map a number of - times given by the corresponding integer in the map. - For a map x -> 2, y -> -1 would give an expression $x + x - y$. - -\*******************************************************************/ - +/// \par parameters: a map from expressions to integers +/// \return a expression for the sum of each element in the map a number of +/// times given by the corresponding integer in the map. For a map x -> 2, y +/// -> -1 would give an expression $x + x - y$. exprt string_refinementt::sum_over_map( std::map &m, const typet &type, bool negated) const { @@ -1417,37 +1172,21 @@ exprt string_refinementt::sum_over_map( return index_const; } -/*******************************************************************\ - -Function: string_refinementt::simplify_sum - - Inputs: an expression with only plus and minus expr - - Outputs: an equivalent expression in a cannonical form - -\*******************************************************************/ - +/// \par parameters: an expression with only plus and minus expr +/// \return an equivalent expression in a cannonical form exprt string_refinementt::simplify_sum(const exprt &f) const { std::map map=map_representation_of_sum(f); return sum_over_map(map, f.type()); } -/*******************************************************************\ - -Function: string_refinementt::compute_inverse_function - - Inputs: a symbol qvar, an expression val, an expression f containing + and − - operations in which qvar should appear exactly once. - - Outputs: an expression corresponding of $f^{−1}(val)$ where $f$ is seen as a - function of $qvar$, i.e. the value that is necessary for qvar for f - to be equal to val. For instance, if `f` corresponds to the expression - $q + x$, `compute_inverse_function(q,v,f)` returns an expression for - $v - x$. - -\*******************************************************************/ - +/// \par parameters: a symbol qvar, an expression val, an expression f +/// containing + and − +/// operations in which qvar should appear exactly once. +/// \return an expression corresponding of $f^{−1}(val)$ where $f$ is seen as +/// a function of $qvar$, i.e. the value that is necessary for qvar for f to +/// be equal to val. For instance, if `f` corresponds to the expression $q + +/// x$, `compute_inverse_function(q,v,f)` returns an expression for $v - x$. exprt string_refinementt::compute_inverse_function( const exprt &qvar, const exprt &val, const exprt &f) { @@ -1497,18 +1236,9 @@ class find_qvar_visitort: public const_expr_visitort } }; -/*******************************************************************\ - -Function: find_qvar - - Inputs: an index expression and a symbol qvar - - Outputs: a Boolean - - Purpose: look for the symbol and return true if it is found - -\*******************************************************************/ - +/// look for the symbol and return true if it is found +/// \par parameters: an index expression and a symbol qvar +/// \return a Boolean static bool find_qvar(const exprt index, const symbol_exprt &qvar) { find_qvar_visitort v2(qvar); @@ -1516,17 +1246,9 @@ static bool find_qvar(const exprt index, const symbol_exprt &qvar) return v2.found; } -/*******************************************************************\ - -Function: string_refinementt::initial_index_set - - Inputs: a list of string constraints - - Purpose: add to the index set all the indices that appear in the formulas - and the upper bound minus one - -\*******************************************************************/ - +/// add to the index set all the indices that appear in the formulas and the +/// upper bound minus one +/// \par parameters: a list of string constraints void string_refinementt::initial_index_set( const std::vector &string_axioms) { @@ -1534,32 +1256,17 @@ void string_refinementt::initial_index_set( initial_index_set(axiom); } -/*******************************************************************\ - -Function: string_refinementt::update_index_set - - Inputs: a list of string constraints - - Purpose: add to the index set all the indices that appear in the formulas - -\*******************************************************************/ - +/// add to the index set all the indices that appear in the formulas +/// \par parameters: a list of string constraints void string_refinementt::update_index_set(const std::vector &cur) { for(const auto &axiom : cur) update_index_set(axiom); } -/*******************************************************************\ - -Function: string_refinementt::initial_index_set - - Inputs: a string constraint - - Purpose: add to the index set all the indices that appear in the formula - and the upper bound minus one - -\*******************************************************************/ +/// add to the index set all the indices that appear in the formula and the +/// upper bound minus one +/// \par parameters: a string constraint void string_refinementt::add_to_index_set(const exprt &s, exprt i) { simplify(i, ns); @@ -1620,16 +1327,8 @@ void string_refinementt::initial_index_set(const string_constraintt &axiom) } } -/*******************************************************************\ - -Function: string_refinementt::update_index_set - - Inputs: a string constraint - - Purpose: add to the index set all the indices that appear in the formula - -\*******************************************************************/ - +/// add to the index set all the indices that appear in the formula +/// \par parameters: a string constraint void string_refinementt::update_index_set(const exprt &formula) { std::list to_process; @@ -1677,20 +1376,10 @@ class find_index_visitort: public const_expr_visitort } }; -/*******************************************************************\ - -Function: string_refinementt::update_index_set - - Inputs: a formula expr and a char array str - - Outputs: an index expression - - Purpose: find an index used in the expression for str, for instance - with arguments (str[k] == 'a') and str, the function should - return k - -\*******************************************************************/ - +/// find an index used in the expression for str, for instance with arguments +/// (str[k] == 'a') and str, the function should return k +/// \par parameters: a formula expr and a char array str +/// \return an index expression exprt find_index(const exprt &expr, const exprt &str) { find_index_visitort v1(str); @@ -1702,21 +1391,13 @@ exprt find_index(const exprt &expr, const exprt &str) catch (exprt i) { return i; } } -/*******************************************************************\ - -Function: string_refinementt::instantiate - - Inputs: a universally quantified formula `axiom`, an array of char - variable `str`, and an index expression `val`. - - Outputs: substitute `qvar` the universally quantified variable of `axiom`, by - an index `val`, in `axiom`, so that the index used for `str` equals - `val`. For instance, if `axiom` corresponds to - $\forall q. s[q+x]='a' && t[q]='b'$, `instantiate(axom,s,v)` - would return an expression for $s[v]='a' && t[v-x]='b'$. - -\*******************************************************************/ - +/// \par parameters: a universally quantified formula `axiom`, an array of char +/// variable `str`, and an index expression `val`. +/// \return substitute `qvar` the universally quantified variable of `axiom`, by +/// an index `val`, in `axiom`, so that the index used for `str` equals `val`. +/// For instance, if `axiom` corresponds to $\forall q. s[q+x]='a' && +/// t[q]='b'$, `instantiate(axom,s,v)` would return an expression for +/// $s[v]='a' && t[v-x]='b'$. exprt string_refinementt::instantiate( const string_constraintt &axiom, const exprt &str, const exprt &val) { @@ -1738,18 +1419,10 @@ exprt string_refinementt::instantiate( return implies_exprt(bounds, instance); } -/*******************************************************************\ - -Function: string_refinementt::instantiate_not_contains - - Inputs: a quantified formula representing `not_contains`, and a - list to which to add the created lemmas to - - Purpose: instantiate a quantified formula representing `not_contains` - by substituting the quantifiers and generating axioms - -\*******************************************************************/ - +/// instantiate a quantified formula representing `not_contains` by substituting +/// the quantifiers and generating axioms +/// \par parameters: a quantified formula representing `not_contains`, and a +/// list to which to add the created lemmas to void string_refinementt::instantiate_not_contains( const string_not_contains_constraintt &axiom, std::list &new_lemmas) { @@ -1801,18 +1474,9 @@ void string_refinementt::instantiate_not_contains( } } -/*******************************************************************\ - -Function: string_refinementt::substitute_array_lists() - - Inputs: an expression containing array-list expressions - - Outputs: an epression containing no array-list - - Purpose: replace array-lists by 'with' expressions - -\*******************************************************************/ - +/// replace array-lists by 'with' expressions +/// \par parameters: an expression containing array-list expressions +/// \return an epression containing no array-list exprt string_refinementt::substitute_array_lists(exprt expr) const { for(size_t i=0; i void string_refinementt::pad_vector( std::vector &concrete_array, diff --git a/src/solvers/sat/cnf.cpp b/src/solvers/sat/cnf.cpp index a69947df8f4..98f4a1fb7d2 100644 --- a/src/solvers/sat/cnf.cpp +++ b/src/solvers/sat/cnf.cpp @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// CNF Generation, via Tseitin + #include #include #include @@ -14,19 +17,10 @@ Author: Daniel Kroening, kroening@kroening.com #include "cnf.h" // #define VERBOSE -/*******************************************************************\ - -Function: cnft::gate_and - - Inputs: Two input signals to the AND gate, one output - - Outputs: Side effect: add clauses that encodes relation between - inputs/output via lcnf - - Purpose: Tseitin encoding of conjunction of two literals - -\*******************************************************************/ - +/// Tseitin encoding of conjunction of two literals +/// \par parameters: Two input signals to the AND gate, one output +/// \return Side effect: add clauses that encodes relation between inputs/output +/// via lcnf void cnft::gate_and(literalt a, literalt b, literalt o) { // a*b=c <==> (a + o')( b + o')(a'+b'+o) @@ -48,18 +42,8 @@ void cnft::gate_and(literalt a, literalt b, literalt o) lcnf(lits); } -/*******************************************************************\ - -Function: cnft::gate_or - - Inputs: Two input signals to the OR gate, one output - - Outputs: - - Purpose: Tseitin encoding of disjunction of two literals - -\*******************************************************************/ - +/// Tseitin encoding of disjunction of two literals +/// \par parameters: Two input signals to the OR gate, one output void cnft::gate_or(literalt a, literalt b, literalt o) { // a+b=c <==> (a' + c)( b' + c)(a + b + c') @@ -80,18 +64,8 @@ void cnft::gate_or(literalt a, literalt b, literalt o) lcnf(lits); } -/*******************************************************************\ - -Function: cnft::gate_xor - - Inputs: Two input signals to the XOR gate, one output - - Outputs: - - Purpose: Tseitin encoding of XOR of two literals - -\*******************************************************************/ - +/// Tseitin encoding of XOR of two literals +/// \par parameters: Two input signals to the XOR gate, one output void cnft::gate_xor(literalt a, literalt b, literalt o) { // a xor b = o <==> (a' + b' + o') @@ -121,18 +95,8 @@ void cnft::gate_xor(literalt a, literalt b, literalt o) lcnf(lits); } -/*******************************************************************\ - -Function: cnft::gate_nand - - Inputs: Two input signals to the NAND gate, one output - - Outputs: - - Purpose: Tseitin encoding of NAND of two literals - -\*******************************************************************/ - +/// Tseitin encoding of NAND of two literals +/// \par parameters: Two input signals to the NAND gate, one output void cnft::gate_nand(literalt a, literalt b, literalt o) { // a Nand b = o <==> (a + o)( b + o)(a' + b' + o') @@ -153,18 +117,8 @@ void cnft::gate_nand(literalt a, literalt b, literalt o) lcnf(lits); } -/*******************************************************************\ - -Function: cnft::gate_nor - - Inputs: Two input signals to the NOR gate, one output - - Outputs: - - Purpose: Tseitin encoding of NOR of two literals - -\*******************************************************************/ - +/// Tseitin encoding of NOR of two literals +/// \par parameters: Two input signals to the NOR gate, one output void cnft::gate_nor(literalt a, literalt b, literalt o) { // a Nor b = o <==> (a' + o')( b' + o')(a + b + o) @@ -185,52 +139,23 @@ void cnft::gate_nor(literalt a, literalt b, literalt o) lcnf(lits); } -/*******************************************************************\ - -Function: cnft::gate_equal - - Inputs: Two input signals to the EQUAL gate, one output - - Outputs: - - Purpose: Tseitin encoding of equality between two literals - -\*******************************************************************/ - +/// Tseitin encoding of equality between two literals +/// \par parameters: Two input signals to the EQUAL gate, one output void cnft::gate_equal(literalt a, literalt b, literalt o) { gate_xor(a, b, !o); } -/*******************************************************************\ - -Function: cnft::gate_implies - - Inputs: Two input signals to the IMPLIES gate, one output - - Outputs: - - Purpose: Tseitin encoding of implication between two literals - -\*******************************************************************/ - +/// Tseitin encoding of implication between two literals +/// \par parameters: Two input signals to the IMPLIES gate, one output void cnft::gate_implies(literalt a, literalt b, literalt o) { gate_or(!a, b, o); } -/*******************************************************************\ - -Function: cnft::land - - Inputs: Any number of inputs to the AND gate - - Outputs: Output signal of the AND gate as literal - - Purpose: Tseitin encoding of conjunction between multiple literals - -\*******************************************************************/ - +/// Tseitin encoding of conjunction between multiple literals +/// \par parameters: Any number of inputs to the AND gate +/// \return Output signal of the AND gate as literal literalt cnft::land(const bvt &bv) { if(bv.empty()) @@ -271,18 +196,9 @@ literalt cnft::land(const bvt &bv) return literal; } -/*******************************************************************\ - -Function: cnft::lor - - Inputs: Any number of inputs to the OR gate - - Outputs: Output signal of the OR gate as literal - - Purpose: Tseitin encoding of disjunction between multiple literals - -\*******************************************************************/ - +/// Tseitin encoding of disjunction between multiple literals +/// \par parameters: Any number of inputs to the OR gate +/// \return Output signal of the OR gate as literal literalt cnft::lor(const bvt &bv) { if(bv.empty()) @@ -323,18 +239,9 @@ literalt cnft::lor(const bvt &bv) return literal; } -/*******************************************************************\ - -Function: cnft::lxor - - Inputs: Any number of inputs to the XOR gate - - Outputs: Output signal of the XOR gate as literal - - Purpose: Tseitin encoding of XOR between multiple literals - -\*******************************************************************/ - +/// Tseitin encoding of XOR between multiple literals +/// \par parameters: Any number of inputs to the XOR gate +/// \return Output signal of the XOR gate as literal literalt cnft::lxor(const bvt &bv) { if(bv.empty()) @@ -352,18 +259,8 @@ literalt cnft::lxor(const bvt &bv) return literal; } -/*******************************************************************\ - -Function: cnft::land - - Inputs: Two inputs to the AND gate - - Outputs: Output signal of the AND gate as literal - - Purpose: - -\*******************************************************************/ - +/// \par parameters: Two inputs to the AND gate +/// \return Output signal of the AND gate as literal literalt cnft::land(literalt a, literalt b) { if(a.is_true() || b.is_false()) @@ -378,18 +275,8 @@ literalt cnft::land(literalt a, literalt b) return o; } -/*******************************************************************\ - -Function: cnft::lor - - Inputs: Two inputs to the OR gate - - Outputs: Output signal of the OR gate as literal - - Purpose: - -\*******************************************************************/ - +/// \par parameters: Two inputs to the OR gate +/// \return Output signal of the OR gate as literal literalt cnft::lor(literalt a, literalt b) { if(a.is_false() || b.is_true()) @@ -404,18 +291,8 @@ literalt cnft::lor(literalt a, literalt b) return o; } -/*******************************************************************\ - -Function: cnft::lxor - - Inputs: Two inputs to the XOR gate - - Outputs: Output signal of the XOR gate as literal - - Purpose: - -\*******************************************************************/ - +/// \par parameters: Two inputs to the XOR gate +/// \return Output signal of the XOR gate as literal literalt cnft::lxor(literalt a, literalt b) { if(a.is_false()) @@ -436,86 +313,30 @@ literalt cnft::lxor(literalt a, literalt b) return o; } -/*******************************************************************\ - -Function: cnft::lnand - - Inputs: Two inputs to the NAND gate - - Outputs: Output signal of the NAND gate as literal - - Purpose: - -\*******************************************************************/ - +/// \par parameters: Two inputs to the NAND gate +/// \return Output signal of the NAND gate as literal literalt cnft::lnand(literalt a, literalt b) { return !land(a, b); } -/*******************************************************************\ - -Function: cnft::lnor - - Inputs: Two inputs to the NOR gate - - Outputs: Output signal of the NOR gate as literal - - Purpose: - -\*******************************************************************/ - +/// \par parameters: Two inputs to the NOR gate +/// \return Output signal of the NOR gate as literal literalt cnft::lnor(literalt a, literalt b) { return !lor(a, b); } -/*******************************************************************\ - -Function: cnft::lequal - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - literalt cnft::lequal(literalt a, literalt b) { return !lxor(a, b); } -/*******************************************************************\ - -Function: cnft::limplies - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - literalt cnft::limplies(literalt a, literalt b) { return lor(!a, b); } -/*******************************************************************\ - -Function: cnft::lselect - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - // Tino observed slow-downs up to 50% with OPTIMAL_COMPACT_ITE. #define COMPACT_ITE @@ -560,18 +381,8 @@ literalt cnft::lselect(literalt a, literalt b, literalt c) #endif } -/*******************************************************************\ - -Function: cnft::new_variable - - Inputs: - - Outputs: New variable as literal - - Purpose: Generate a new variable and return it as a literal - -\*******************************************************************/ - +/// Generate a new variable and return it as a literal +/// \return New variable as literal literalt cnft::new_variable() { literalt l; @@ -582,18 +393,9 @@ literalt cnft::new_variable() return l; } -/*******************************************************************\ - -Function: cnft::eliminate_duplicates - - Inputs: set of literals given as vector - - Outputs: set of literals, duplicates removed - - Purpose: eliminate duplicates from given vector of literals - -\*******************************************************************/ - +/// eliminate duplicates from given vector of literals +/// \par parameters: set of literals given as vector +/// \return set of literals, duplicates removed bvt cnft::eliminate_duplicates(const bvt &bv) { std::set s; @@ -608,19 +410,8 @@ bvt cnft::eliminate_duplicates(const bvt &bv) return dest; } -/*******************************************************************\ - -Function: cnft::process_clause - - Inputs: - - Outputs: - - Purpose: filter 'true' from clause, eliminate duplicates, - recognise trivially satisfied clauses - -\*******************************************************************/ - +/// filter 'true' from clause, eliminate duplicates, recognise trivially +/// satisfied clauses bool cnft::process_clause(const bvt &bv, bvt &dest) { dest.clear(); diff --git a/src/solvers/sat/cnf.h b/src/solvers/sat/cnf.h index 644d62999e4..236de673374 100644 --- a/src/solvers/sat/cnf.h +++ b/src/solvers/sat/cnf.h @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// CNF Generation, via Tseitin + #ifndef CPROVER_SOLVERS_SAT_CNF_H #define CPROVER_SOLVERS_SAT_CNF_H diff --git a/src/solvers/sat/cnf_clause_list.cpp b/src/solvers/sat/cnf_clause_list.cpp index 629a7363795..cb68ddad24b 100644 --- a/src/solvers/sat/cnf_clause_list.cpp +++ b/src/solvers/sat/cnf_clause_list.cpp @@ -6,23 +6,14 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// CNF Generation + #include #include #include "cnf_clause_list.h" -/*******************************************************************\ - -Function: cnf_clause_listt::lcnf - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void cnf_clause_listt::lcnf(const bvt &bv) { bvt new_bv; @@ -33,36 +24,12 @@ void cnf_clause_listt::lcnf(const bvt &bv) clauses.push_back(new_bv); } -/*******************************************************************\ - -Function: cnf_clause_list_assignmentt::print_assignment - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void cnf_clause_list_assignmentt::print_assignment(std::ostream &out) const { for(unsigned v=1; v -/*******************************************************************\ - -Function: dimacs_cnft::dimacs_cnft - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - dimacs_cnft::dimacs_cnft():break_lines(false) { } -/*******************************************************************\ - -Function: dimacs_cnf_dumpt::dimacs_cnf_dumpt - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - dimacs_cnf_dumpt::dimacs_cnf_dumpt(std::ostream &_out):out(_out) { } -/*******************************************************************\ - -Function: dimacs_cnft::write_dimacs_cnf - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void dimacs_cnft::write_dimacs_cnf(std::ostream &out) { write_problem_line(out); write_clauses(out); } -/*******************************************************************\ - -Function: dimacs_cnft::write_problem_line - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void dimacs_cnft::write_problem_line(std::ostream &out) { // We start counting at 1, thus there is one variable fewer. @@ -79,18 +31,6 @@ void dimacs_cnft::write_problem_line(std::ostream &out) << clauses.size() << "\n"; } -/*******************************************************************\ - -Function: write_dimacs_clause - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - static void write_dimacs_clause( const bvt &clause, std::ostream &out, @@ -117,18 +57,6 @@ static void write_dimacs_clause( out << "0" << "\n"; } -/*******************************************************************\ - -Function: dimacs_cnft::write_clauses - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void dimacs_cnft::write_clauses(std::ostream &out) { for(clausest::const_iterator it=clauses.begin(); @@ -136,18 +64,6 @@ void dimacs_cnft::write_clauses(std::ostream &out) write_dimacs_clause(*it, out, break_lines); } -/*******************************************************************\ - -Function: dimacs_cnf_dumpt::lcnf - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void dimacs_cnf_dumpt::lcnf(const bvt &bv) { write_dimacs_clause(bv, out, true); diff --git a/src/solvers/sat/pbs_dimacs_cnf.cpp b/src/solvers/sat/pbs_dimacs_cnf.cpp index 5c45f8e0a09..a648a2cb8e1 100644 --- a/src/solvers/sat/pbs_dimacs_cnf.cpp +++ b/src/solvers/sat/pbs_dimacs_cnf.cpp @@ -13,18 +13,6 @@ Author: Alex Groce #include "pbs_dimacs_cnf.h" -/*******************************************************************\ - -Function: pbs_dimacs_cnft::write_dimacs_cnf_pb - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void pbs_dimacs_cnft::write_dimacs_pb(std::ostream &out) { double d_sum=0; @@ -64,18 +52,6 @@ void pbs_dimacs_cnft::write_dimacs_pb(std::ostream &out) // std::cout << "exit: No Lit.=" << no_variables () << "\n"; } -/*******************************************************************\ - -Function: pbs_dimacs_cnft::pbs_solve - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool pbs_dimacs_cnft::pbs_solve() { // std::cout << "solve: No Lit.=" << no_variables () << "\n"; @@ -200,18 +176,6 @@ bool pbs_dimacs_cnft::pbs_solve() return satisfied; } -/*******************************************************************\ - -Function: pbs_dimacs_cnft::prop_solve - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - propt::resultt pbs_dimacs_cnft::prop_solve() { std::ofstream file("temp.cnf"); @@ -252,18 +216,6 @@ propt::resultt pbs_dimacs_cnft::prop_solve() return resultt::P_UNSATISFIABLE; } -/*******************************************************************\ - -Function: pbs_dimacs_cnft::l_get - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - tvt pbs_dimacs_cnft::l_get(literalt a) const { int dimacs_lit=a.dimacs(); diff --git a/src/solvers/sat/read_dimacs_cnf.cpp b/src/solvers/sat/read_dimacs_cnf.cpp index 42e63a5e9e2..f3996fb13de 100644 --- a/src/solvers/sat/read_dimacs_cnf.cpp +++ b/src/solvers/sat/read_dimacs_cnf.cpp @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Reading DIMACS CNF + #include #include // for abs() @@ -15,18 +18,6 @@ Author: Daniel Kroening, kroening@kroening.com // #define VERBOSE -/*******************************************************************\ - -Function: cnft::read_dimacs_cnf - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void read_dimacs_cnf(std::istream &in, cnft &dest) { #define DELIMITERS "\t\n\v\f\r " diff --git a/src/solvers/sat/read_dimacs_cnf.h b/src/solvers/sat/read_dimacs_cnf.h index 2a0c0cb3950..96bb752867a 100644 --- a/src/solvers/sat/read_dimacs_cnf.h +++ b/src/solvers/sat/read_dimacs_cnf.h @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Reading DIMACS CNF + #ifndef CPROVER_SOLVERS_SAT_READ_DIMACS_CNF_H #define CPROVER_SOLVERS_SAT_READ_DIMACS_CNF_H diff --git a/src/solvers/sat/resolution_proof.cpp b/src/solvers/sat/resolution_proof.cpp index 20c10498a96..76cc6c5f69f 100644 --- a/src/solvers/sat/resolution_proof.cpp +++ b/src/solvers/sat/resolution_proof.cpp @@ -11,18 +11,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "resolution_proof.h" -/*******************************************************************\ - -Function: resolution_prooft::build_core - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - template void resolution_prooft::build_core(std::vector &in_core) { diff --git a/src/solvers/sat/satcheck_booleforce.cpp b/src/solvers/sat/satcheck_booleforce.cpp index 16a23f152f9..2bbe9da61aa 100644 --- a/src/solvers/sat/satcheck_booleforce.cpp +++ b/src/solvers/sat/satcheck_booleforce.cpp @@ -16,69 +16,21 @@ extern "C" #include "booleforce.h" } -/*******************************************************************\ - -Function: satcheck_booleforcet::satcheck_booleforcet - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - satcheck_booleforcet::satcheck_booleforcet() { booleforce_set_trace(false); } -/*******************************************************************\ - -Function: satcheck_booleforce_coret::satcheck_booleforce_coret - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - satcheck_booleforce_coret::satcheck_booleforce_coret() { booleforce_set_trace(true); } -/*******************************************************************\ - -Function: satcheck_booleforce_baset::~satcheck_booleforce_baset - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - satcheck_booleforce_baset::~satcheck_booleforce_baset() { booleforce_reset(); } -/*******************************************************************\ - -Function: satcheck_booleforce_baset::l_get - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - tvt satcheck_booleforce_baset::l_get(literalt a) const { assert(status==SAT); @@ -108,35 +60,11 @@ tvt satcheck_booleforce_baset::l_get(literalt a) const return result; } -/*******************************************************************\ - -Function: satcheck_booleforce_Baset::solver_text - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - const std::string satcheck_booleforce_baset::solver_text() { return std::string("Booleforce version ")+booleforce_version(); } -/*******************************************************************\ - -Function: satcheck_booleforce_baset::lcnf - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void satcheck_booleforce_baset::lcnf(const bvt &bv) { bvt tmp; @@ -153,18 +81,6 @@ void satcheck_booleforce_baset::lcnf(const bvt &bv) clause_counter++; } -/*******************************************************************\ - -Function: satcheck_booleforce_baset::prop_solve - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - propt::resultt satcheck_booleforce_baset::prop_solve() { assert(status==SAT || status==INIT); @@ -209,18 +125,6 @@ propt::resultt satcheck_booleforce_baset::prop_solve() return P_ERROR; } -/*******************************************************************\ - -Function: satcheck_booleforce_coret::in_core - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool satcheck_booleforce_coret::is_in_core(literalt l) const { return booleforce_var_in_core(l.var_no()); diff --git a/src/solvers/sat/satcheck_glucose.cpp b/src/solvers/sat/satcheck_glucose.cpp index 152716d8157..9d559111069 100644 --- a/src/solvers/sat/satcheck_glucose.cpp +++ b/src/solvers/sat/satcheck_glucose.cpp @@ -24,18 +24,6 @@ Author: Daniel Kroening, kroening@kroening.com #error "Expected HAVE_GLUCOSE" #endif -/*******************************************************************\ - -Function: convert - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void convert(const bvt &bv, Glucose::vec &dest) { dest.capacity(bv.size()); @@ -45,18 +33,6 @@ void convert(const bvt &bv, Glucose::vec &dest) dest.push(Glucose::mkLit(it->var_no(), it->sign())); } -/*******************************************************************\ - -Function: satcheck_glucose_baset::l_get - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - template tvt satcheck_glucose_baset::l_get(literalt a) const { @@ -85,18 +61,6 @@ tvt satcheck_glucose_baset::l_get(literalt a) const return result; } -/*******************************************************************\ - -Function: satcheck_glucose_baset::set_polarity - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - template void satcheck_glucose_baset::set_polarity(literalt a, bool value) { @@ -105,52 +69,16 @@ void satcheck_glucose_baset::set_polarity(literalt a, bool value) solver->setPolarity(a.var_no(), value); } -/*******************************************************************\ - -Function: satcheck_glucose_no_simplifiert::solver_text - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - const std::string satcheck_glucose_no_simplifiert::solver_text() { return "Glucose Syrup without simplifier"; } -/*******************************************************************\ - -Function: satcheck_glucose_simplifiert::solver_text - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - const std::string satcheck_glucose_simplifiert::solver_text() { return "Glucose Syrup with simplifier"; } -/*******************************************************************\ - -Function: satcheck_glucose_baset::add_variables - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - template void satcheck_glucose_baset::add_variables() { @@ -158,18 +86,6 @@ void satcheck_glucose_baset::add_variables() solver->newVar(); } -/*******************************************************************\ - -Function: satcheck_glucose_baset::lcnf - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - template void satcheck_glucose_baset::lcnf(const bvt &bv) { @@ -195,18 +111,6 @@ void satcheck_glucose_baset::lcnf(const bvt &bv) clause_counter++; } -/*******************************************************************\ - -Function: satcheck_glucose_baset::prop_solve - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - template propt::resultt satcheck_glucose_baset::prop_solve() { @@ -265,18 +169,6 @@ propt::resultt satcheck_glucose_baset::prop_solve() return P_UNSATISFIABLE; } -/*******************************************************************\ - -Function: satcheck_glucose_baset::set_assignment - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - template void satcheck_glucose_baset::set_assignment(literalt a, bool value) { @@ -291,36 +183,12 @@ void satcheck_glucose_baset::set_assignment(literalt a, bool value) solver->model[v]=Glucose::lbool(value); } -/*******************************************************************\ - -Function: satcheck_glucose_baset::satcheck_glucose_baset - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - template satcheck_glucose_baset::satcheck_glucose_baset(T *_solver): solver(_solver) { } -/*******************************************************************\ - -Function: satcheck_glucose_baset::~satcheck_glucose_baset - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - template<> satcheck_glucose_baset::~satcheck_glucose_baset() { @@ -333,18 +201,6 @@ satcheck_glucose_baset::~satcheck_glucose_baset() delete solver; } -/*******************************************************************\ - -Function: satcheck_glucose_baset::is_in_conflict - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - template bool satcheck_glucose_baset::is_in_conflict(literalt a) const { @@ -357,18 +213,6 @@ bool satcheck_glucose_baset::is_in_conflict(literalt a) const return false; } -/*******************************************************************\ - -Function: satcheck_glucose_baset::set_assumptions - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - template void satcheck_glucose_baset::set_assumptions(const bvt &bv) { @@ -378,52 +222,16 @@ void satcheck_glucose_baset::set_assumptions(const bvt &bv) assert(!it->is_constant()); } -/*******************************************************************\ - -Function: satcheck_glucose_no_simplifiert::satcheck_glucose_no_simplifiert - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - satcheck_glucose_no_simplifiert::satcheck_glucose_no_simplifiert(): satcheck_glucose_baset(new Glucose::Solver) { } -/*******************************************************************\ - -Function: satcheck_glucose_simplifiert::satcheck_glucose_simplifiert - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - satcheck_glucose_simplifiert::satcheck_glucose_simplifiert(): satcheck_glucose_baset(new Glucose::SimpSolver) { } -/*******************************************************************\ - -Function: satcheck_glucose_simplifiert::set_frozen - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void satcheck_glucose_simplifiert::set_frozen(literalt a) { if(!a.is_constant()) @@ -433,18 +241,6 @@ void satcheck_glucose_simplifiert::set_frozen(literalt a) } } -/*******************************************************************\ - -Function: satcheck_glucose_simplifiert::is_eliminated - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool satcheck_glucose_simplifiert::is_eliminated(literalt a) const { assert(!a.is_constant()); diff --git a/src/solvers/sat/satcheck_limmat.cpp b/src/solvers/sat/satcheck_limmat.cpp index a8393cf30e8..d1c92d81b58 100644 --- a/src/solvers/sat/satcheck_limmat.cpp +++ b/src/solvers/sat/satcheck_limmat.cpp @@ -16,53 +16,17 @@ extern "C" #include "limmat.h" } -/*******************************************************************\ - -Function: satcheck_limmatt::satcheck_limmatt - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - satcheck_limmatt::satcheck_limmatt() { solver=new_Limmat(NULL); } -/*******************************************************************\ - -Function: satcheck_limmatt::~satcheck_limmatt - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - satcheck_limmatt::~satcheck_limmatt() { if(solver!=NULL) delete_Limmat(solver); } -/*******************************************************************\ - -Function: satcheck_limmatt::l_get - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - tvt satcheck_limmatt::l_get(literalt a) const { if(a.is_true()) @@ -88,35 +52,11 @@ tvt satcheck_limmatt::l_get(literalt a) const return result; } -/*******************************************************************\ - -Function: satcheck_limmatt::solver_text - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - const std::string satcheck_limmatt::solver_text() { return std::string("Limmat version ")+version_Limmat(); } -/*******************************************************************\ - -Function: satcheck_limmatt::copy_cnf - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void satcheck_limmatt::copy_cnf() { for(clausest::iterator it=clauses.begin(); @@ -138,18 +78,6 @@ void satcheck_limmatt::copy_cnf() } } -/*******************************************************************\ - -Function: satcheck_limmatt::prop_solve - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - propt::resultt satcheck_limmatt::prop_solve() { copy_cnf(); diff --git a/src/solvers/sat/satcheck_lingeling.cpp b/src/solvers/sat/satcheck_lingeling.cpp index 18237a903ab..90aa2824c98 100644 --- a/src/solvers/sat/satcheck_lingeling.cpp +++ b/src/solvers/sat/satcheck_lingeling.cpp @@ -21,18 +21,6 @@ extern "C" #error "Expected HAVE_LINGELING" #endif -/*******************************************************************\ - -Function: satcheck_lingelingt::l_get - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - tvt satcheck_lingelingt::l_get(literalt a) const { if(a.is_constant()) @@ -54,35 +42,11 @@ tvt satcheck_lingelingt::l_get(literalt a) const return result; } -/*******************************************************************\ - -Function: satcheck_lingelingt::solver_text - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - const std::string satcheck_lingelingt::solver_text() { return "Lingeling"; } -/*******************************************************************\ - -Function: satcheck_lingelingt::lcnf - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void satcheck_lingelingt::lcnf(const bvt &bv) { bvt new_bv; @@ -98,18 +62,6 @@ void satcheck_lingelingt::lcnf(const bvt &bv) clause_counter++; } -/*******************************************************************\ - -Function: satcheck_lingelingt::prop_solve - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - propt::resultt satcheck_lingelingt::prop_solve() { assert(status!=ERROR); @@ -146,70 +98,22 @@ propt::resultt satcheck_lingelingt::prop_solve() return P_UNSATISFIABLE; } -/*******************************************************************\ - -Function: satcheck_lingelingt::set_assignment - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void satcheck_lingelingt::set_assignment(literalt a, bool value) { assert(false); } -/*******************************************************************\ - -Function: satcheck_lingelingt::satcheck_lingelingt - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - satcheck_lingelingt::satcheck_lingelingt() : solver(lglinit()) { } -/*******************************************************************\ - -Function: satcheck_lingelingt::satcheck_lingelingt - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - satcheck_lingelingt::~satcheck_lingelingt() { lglrelease(solver); solver=0; } -/*******************************************************************\ - -Function: satcheck_lingelingt::set_assumptions - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void satcheck_lingelingt::set_assumptions(const bvt &bv) { assumptions=bv; @@ -218,40 +122,16 @@ void satcheck_lingelingt::set_assumptions(const bvt &bv) assert(!it->is_constant()); } -/*******************************************************************\ - -Function: satcheck_lingelingt::set_frozen - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void satcheck_lingelingt::set_frozen(literalt a) { if(!a.is_constant()) lglfreeze(solver, a.dimacs()); } -/*******************************************************************\ - -Function: satcheck_lingelingt::is_in_conflict - - Inputs: - - Outputs: - - Purpose: Returns true if an assumed literal is in conflict if the - formula is UNSAT. - - NOTE: if the literal is not in the assumption it causes an - assertion failure in lingeling. - -\*******************************************************************/ - +/// Returns true if an assumed literal is in conflict if the formula is UNSAT. +/// +/// NOTE: if the literal is not in the assumption it causes an +/// assertion failure in lingeling. bool satcheck_lingelingt::is_in_conflict(literalt a) const { assert(!a.is_constant()); diff --git a/src/solvers/sat/satcheck_minisat.cpp b/src/solvers/sat/satcheck_minisat.cpp index b615d04e112..637985357c7 100644 --- a/src/solvers/sat/satcheck_minisat.cpp +++ b/src/solvers/sat/satcheck_minisat.cpp @@ -20,18 +20,6 @@ Author: Daniel Kroening, kroening@kroening.com #error "Expected HAVE_MINISAT" #endif -/*******************************************************************\ - -Function: convert - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void convert(const bvt &bv, vec &dest) { dest.growTo(bv.size()); @@ -40,14 +28,6 @@ void convert(const bvt &bv, vec &dest) dest[i]=Lit(bv[i].var_no(), bv[i].sign()); } -/*******************************************************************\ - - Class: minisat_prooft - - Purpose: - -\*******************************************************************/ - class minisat_prooft:public ProofTraverser { public: @@ -76,18 +56,6 @@ class minisat_prooft:public ProofTraverser simple_prooft resolution_proof; }; -/*******************************************************************\ - -Function: minisat_prooft::chain - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void minisat_prooft::chain(const vec &cs, const vec &xs) { assert(cs.size()==xs.size()+1); @@ -112,18 +80,6 @@ void minisat_prooft::chain(const vec &cs, const vec &xs) } } -/*******************************************************************\ - -Function: satcheck_minisat1_baset::l_get - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - tvt satcheck_minisat1_baset::l_get(literalt a) const { if(a.is_true()) @@ -149,53 +105,17 @@ tvt satcheck_minisat1_baset::l_get(literalt a) const return result; } -/*******************************************************************\ - -Function: satcheck_minisat1_baset::solver_text - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - const std::string satcheck_minisat1_baset::solver_text() { return "MiniSAT 1.14p"; } -/*******************************************************************\ - -Function: satcheck_minisat1_baset::add_variables - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void satcheck_minisat1_baset::add_variables() { while((unsigned)solver->nVars()newVar(); } -/*******************************************************************\ - -Function: satcheck_minisat1_baset::lcnf - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void satcheck_minisat1_baset::lcnf(const bvt &bv) { bvt new_bv; @@ -223,18 +143,6 @@ void satcheck_minisat1_baset::lcnf(const bvt &bv) clause_counter++; } -/*******************************************************************\ - -Function: satcheck_minisat1_baset::prop_solve - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - propt::resultt satcheck_minisat1_baset::prop_solve() { assert(status!=ERROR); @@ -280,18 +188,6 @@ propt::resultt satcheck_minisat1_baset::prop_solve() return P_UNSATISFIABLE; } -/*******************************************************************\ - -Function: satcheck_minisat1_baset::set_assignment - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void satcheck_minisat1_baset::set_assignment(literalt a, bool value) { unsigned v=a.var_no(); @@ -301,18 +197,6 @@ void satcheck_minisat1_baset::set_assignment(literalt a, bool value) solver->model[v]=lbool(value); } -/*******************************************************************\ - -Function: satcheck_minisat1_baset::is_in_conflict - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool satcheck_minisat1_baset::is_in_conflict(literalt a) const { int v=a.var_no(); @@ -326,18 +210,6 @@ bool satcheck_minisat1_baset::is_in_conflict(literalt a) const return false; } -/*******************************************************************\ - -Function: satcheck_minisat1_baset::set_assumptions - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void satcheck_minisat1_baset::set_assumptions(const bvt &bv) { assumptions=bv; @@ -348,36 +220,12 @@ void satcheck_minisat1_baset::set_assumptions(const bvt &bv) assert(!it->is_constant()); } -/*******************************************************************\ - -Function: satcheck_minisat1t::satcheck_minisat1t - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - satcheck_minisat1t::satcheck_minisat1t() { empty_clause_added=false; solver=new Solver; } -/*******************************************************************\ - -Function: satcheck_minisat1_prooft::satcheck_minisat1_prooft - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - satcheck_minisat1_prooft::satcheck_minisat1_prooft():satcheck_minisat1t() { minisat_proof=new minisat_prooft; @@ -386,102 +234,30 @@ satcheck_minisat1_prooft::satcheck_minisat1_prooft():satcheck_minisat1t() solver->proof=proof; } -/*******************************************************************\ - -Function: satcheck_minisat1_prooft::~satcheck_minisat1_prooft - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - satcheck_minisat1_prooft::~satcheck_minisat1_prooft() { delete proof; delete minisat_proof; } -/*******************************************************************\ - -Function: satcheck_minisat1_coret::satcheck_minisat1_coret - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - satcheck_minisat1_coret::satcheck_minisat1_coret() { } -/*******************************************************************\ - -Function: satcheck_minisat1_coret::~satcheck_minisat1_coret - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - satcheck_minisat1_coret::~satcheck_minisat1_coret() { } -/*******************************************************************\ - -Function: satcheck_minisat1_baset::~satcheck_minisat1_baset - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - satcheck_minisat1_baset::~satcheck_minisat1_baset() { delete solver; } -/*******************************************************************\ - -Function: satcheck_minisat1_prooft::solver_text - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - const std::string satcheck_minisat1_prooft::solver_text() { return "MiniSAT + Proof"; } -/*******************************************************************\ - -Function: satcheck_minisat1_coret::prop_solve - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - propt::resultt satcheck_minisat1_coret::prop_solve() { propt::resultt r; @@ -497,35 +273,11 @@ propt::resultt satcheck_minisat1_coret::prop_solve() return r; } -/*******************************************************************\ - -Function: satcheck_minisat1_coret::solver_text - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - const std::string satcheck_minisat1_coret::solver_text() { return "MiniSAT + Core"; } -/*******************************************************************\ - -Function: satcheck_minisat1_prooft::get_resolution_proof - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - simple_prooft &satcheck_minisat1_prooft::get_resolution_proof() { return minisat_proof->resolution_proof; diff --git a/src/solvers/sat/satcheck_minisat2.cpp b/src/solvers/sat/satcheck_minisat2.cpp index eaccd29db64..bd522867b10 100644 --- a/src/solvers/sat/satcheck_minisat2.cpp +++ b/src/solvers/sat/satcheck_minisat2.cpp @@ -24,18 +24,6 @@ Author: Daniel Kroening, kroening@kroening.com #error "Expected HAVE_MINISAT2" #endif -/*******************************************************************\ - -Function: convert - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void convert(const bvt &bv, Minisat::vec &dest) { dest.capacity(bv.size()); @@ -45,18 +33,6 @@ void convert(const bvt &bv, Minisat::vec &dest) dest.push(Minisat::mkLit(it->var_no(), it->sign())); } -/*******************************************************************\ - -Function: satcheck_minisat2_baset::l_get - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - template tvt satcheck_minisat2_baset::l_get(literalt a) const { @@ -85,18 +61,6 @@ tvt satcheck_minisat2_baset::l_get(literalt a) const return result; } -/*******************************************************************\ - -Function: satcheck_minisat2_baset::set_polarity - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - template void satcheck_minisat2_baset::set_polarity(literalt a, bool value) { @@ -105,52 +69,16 @@ void satcheck_minisat2_baset::set_polarity(literalt a, bool value) solver->setPolarity(a.var_no(), value); } -/*******************************************************************\ - -Function: satcheck_minisat_no_simplifiert::solver_text - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - const std::string satcheck_minisat_no_simplifiert::solver_text() { return "MiniSAT 2.2.1 without simplifier"; } -/*******************************************************************\ - -Function: satcheck_minisat_simplifiert::solver_text - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - const std::string satcheck_minisat_simplifiert::solver_text() { return "MiniSAT 2.2.1 with simplifier"; } -/*******************************************************************\ - -Function: satcheck_minisat2_baset::add_variables - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - template void satcheck_minisat2_baset::add_variables() { @@ -158,18 +86,6 @@ void satcheck_minisat2_baset::add_variables() solver->newVar(); } -/*******************************************************************\ - -Function: satcheck_minisat2_baset::lcnf - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - template void satcheck_minisat2_baset::lcnf(const bvt &bv) { @@ -195,18 +111,6 @@ void satcheck_minisat2_baset::lcnf(const bvt &bv) clause_counter++; } -/*******************************************************************\ - -Function: satcheck_minisat2_baset::prop_solve - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - template propt::resultt satcheck_minisat2_baset::prop_solve() { @@ -274,18 +178,6 @@ propt::resultt satcheck_minisat2_baset::prop_solve() } } -/*******************************************************************\ - -Function: satcheck_minisat2_baset::set_assignment - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - template void satcheck_minisat2_baset::set_assignment(literalt a, bool value) { @@ -300,36 +192,12 @@ void satcheck_minisat2_baset::set_assignment(literalt a, bool value) solver->model[v]=Minisat::lbool(value); } -/*******************************************************************\ - -Function: satcheck_minisat2_baset::satcheck_minisat2_baset - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - template satcheck_minisat2_baset::satcheck_minisat2_baset(T *_solver): solver(_solver) { } -/*******************************************************************\ - -Function: satcheck_minisat2_baset::~satcheck_minisat2_baset - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - template<> satcheck_minisat2_baset::~satcheck_minisat2_baset() { @@ -342,18 +210,6 @@ satcheck_minisat2_baset::~satcheck_minisat2_baset() delete solver; } -/*******************************************************************\ - -Function: satcheck_minisat2_baset::is_in_conflict - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - template bool satcheck_minisat2_baset::is_in_conflict(literalt a) const { @@ -366,18 +222,6 @@ bool satcheck_minisat2_baset::is_in_conflict(literalt a) const return false; } -/*******************************************************************\ - -Function: satcheck_minisat2_baset::set_assumptions - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - template void satcheck_minisat2_baset::set_assumptions(const bvt &bv) { @@ -391,52 +235,16 @@ void satcheck_minisat2_baset::set_assumptions(const bvt &bv) } } -/*******************************************************************\ - -Function: satcheck_minisat_no_simplifiert::satcheck_minisat_no_simplifiert - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - satcheck_minisat_no_simplifiert::satcheck_minisat_no_simplifiert(): satcheck_minisat2_baset(new Minisat::Solver) { } -/*******************************************************************\ - -Function: satcheck_minisat_simplifiert::satcheck_minisat_simplifiert - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - satcheck_minisat_simplifiert::satcheck_minisat_simplifiert(): satcheck_minisat2_baset(new Minisat::SimpSolver) { } -/*******************************************************************\ - -Function: satcheck_minisat_simplifiert::set_frozen - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void satcheck_minisat_simplifiert::set_frozen(literalt a) { if(!a.is_constant()) @@ -446,18 +254,6 @@ void satcheck_minisat_simplifiert::set_frozen(literalt a) } } -/*******************************************************************\ - -Function: satcheck_minisat_simplifiert::is_eliminated - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool satcheck_minisat_simplifiert::is_eliminated(literalt a) const { assert(!a.is_constant()); diff --git a/src/solvers/sat/satcheck_picosat.cpp b/src/solvers/sat/satcheck_picosat.cpp index 7c3417592a3..a4bd562fa47 100644 --- a/src/solvers/sat/satcheck_picosat.cpp +++ b/src/solvers/sat/satcheck_picosat.cpp @@ -21,18 +21,6 @@ extern "C" #error "Expected HAVE_PICOSAT" #endif -/*******************************************************************\ - -Function: satcheck_picosatt::l_get - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - tvt satcheck_picosatt::l_get(literalt a) const { if(a.is_constant()) @@ -54,35 +42,11 @@ tvt satcheck_picosatt::l_get(literalt a) const return result; } -/*******************************************************************\ - -Function: satcheck_picosatt::solver_text - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - const std::string satcheck_picosatt::solver_text() { return "PicoSAT"; } -/*******************************************************************\ - -Function: satcheck_picosatt::lcnf - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void satcheck_picosatt::lcnf(const bvt &bv) { bvt new_bv; @@ -100,18 +64,6 @@ void satcheck_picosatt::lcnf(const bvt &bv) clause_counter++; } -/*******************************************************************\ - -Function: satcheck_picosatt::prop_solve - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - propt::resultt satcheck_picosatt::prop_solve() { assert(status!=ERROR); @@ -147,69 +99,21 @@ propt::resultt satcheck_picosatt::prop_solve() return P_UNSATISFIABLE; } -/*******************************************************************\ - -Function: satcheck_picosatt::set_assignment - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void satcheck_picosatt::set_assignment(literalt a, bool value) { assert(false); } -/*******************************************************************\ - -Function: satcheck_picosatt::satcheck_picosatt - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - satcheck_picosatt::satcheck_picosatt() { picosat = picosat_init(); } -/*******************************************************************\ - -Function: satcheck_picosatt::~satcheck_picosatt - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - satcheck_picosatt::~satcheck_picosatt() { picosat_reset(picosat); } -/*******************************************************************\ - -Function: satcheck_picosatt::is_in_conflict - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool satcheck_picosatt::is_in_conflict(literalt a) const { assert(!a.is_constant()); @@ -217,18 +121,6 @@ bool satcheck_picosatt::is_in_conflict(literalt a) const return picosat_failed_assumption(picosat, a.dimacs())!=0; } -/*******************************************************************\ - -Function: satcheck_picosatt::set_assumptions - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void satcheck_picosatt::set_assumptions(const bvt &bv) { assumptions=bv; diff --git a/src/solvers/sat/satcheck_precosat.cpp b/src/solvers/sat/satcheck_precosat.cpp index 7589d085678..5041985a3a6 100644 --- a/src/solvers/sat/satcheck_precosat.cpp +++ b/src/solvers/sat/satcheck_precosat.cpp @@ -20,18 +20,6 @@ Author: Michael Tautschnig, michael.tautschnig@cs.ox.ac.uk #define precosat_lit(a) ((a).var_no()*2 + !(a).sign()) -/*******************************************************************\ - -Function: satcheck_precosatt::l_get - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - tvt satcheck_precosatt::l_get(literalt a) const { if(a.is_constant()) @@ -53,35 +41,11 @@ tvt satcheck_precosatt::l_get(literalt a) const return result; } -/*******************************************************************\ - -Function: satcheck_precosatt::solver_text - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - const std::string satcheck_precosatt::solver_text() { return "PrecoSAT"; } -/*******************************************************************\ - -Function: satcheck_precosatt::lcnf - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void satcheck_precosatt::lcnf(const bvt &bv) { bvt new_bv; @@ -97,18 +61,6 @@ void satcheck_precosatt::lcnf(const bvt &bv) clause_counter++; } -/*******************************************************************\ - -Function: satcheck_precosatt::prop_solve - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - propt::resultt satcheck_precosatt::prop_solve() { assert(status!=ERROR); @@ -142,70 +94,22 @@ propt::resultt satcheck_precosatt::prop_solve() return P_UNSATISFIABLE; } -/*******************************************************************\ - -Function: satcheck_precosatt::set_assignment - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void satcheck_precosatt::set_assignment(literalt a, bool value) { assert(false); } -/*******************************************************************\ - -Function: satcheck_precosatt::satcheck_precosatt - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - satcheck_precosatt::satcheck_precosatt() : solver(new PrecoSat::Solver()) { solver->init(); } -/*******************************************************************\ - -Function: satcheck_precosatt::~satcheck_precosatt - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - satcheck_precosatt::~satcheck_precosatt() { delete solver; } -/*******************************************************************\ - -Function: satcheck_precosatt::set_assumptions - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - /* void satcheck_precosatt::set_assumptions(const bvt &bv) { diff --git a/src/solvers/sat/satcheck_smvsat.cpp b/src/solvers/sat/satcheck_smvsat.cpp index 8064900735d..d1f14d50f7c 100644 --- a/src/solvers/sat/satcheck_smvsat.cpp +++ b/src/solvers/sat/satcheck_smvsat.cpp @@ -15,18 +15,6 @@ Author: Daniel Kroening, kroening@kroening.com #include #include -/*******************************************************************\ - -Function: satcheck_smvsatt::satcheck_smvsatt - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - satcheck_smvsatt::satcheck_smvsatt() { satsolver= @@ -36,50 +24,14 @@ satcheck_smvsatt::satcheck_smvsatt() init_const(); } -/*******************************************************************\ - -Function: satcheck_smvsat_coret::satcheck_smvsat_coret - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - satcheck_smvsat_coret::satcheck_smvsat_coret() { } -/*******************************************************************\ - -Function: satcheck_smvsatt::~satcheck_smvsatt - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - satcheck_smvsatt::~satcheck_smvsatt() { } -/*******************************************************************\ - -Function: satcheck_smvsatt::l_get - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - tvt satcheck_smvsatt::l_get(literalt a) const { assert(status==SAT); @@ -105,35 +57,11 @@ tvt satcheck_smvsatt::l_get(literalt a) const return result; } -/*******************************************************************\ - -Function: satcheck_smvsatt::solver_text - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - const std::string satcheck_smvsatt::solver_text() { return std::string("SMVSAT"); } -/*******************************************************************\ - -Function: satcheck_smvsatt::lcnf - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void satcheck_smvsatt::lcnf(const bvt &bv) { bvt tmp; @@ -156,18 +84,6 @@ void satcheck_smvsatt::lcnf(const bvt &bv) delete[] lits; } -/*******************************************************************\ - -Function: satcheck_smvsatt::prop_solve - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - propt::resultt satcheck_smvsatt::prop_solve() { int result=sat_instance_solve(satsolver); @@ -210,18 +126,6 @@ propt::resultt satcheck_smvsatt::prop_solve() return P_ERROR; } -/*******************************************************************\ - -Function: satcheck_smvsat_coret::prop_solve - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - propt::resultt satcheck_smvsat_coret::prop_solve() { propt::resultt result=satcheck_smvsatt::prop_solve(); @@ -234,18 +138,6 @@ propt::resultt satcheck_smvsat_coret::prop_solve() return result; } -/*******************************************************************\ - -Function: satcheck_smvsat_interpolatort::lcnf - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void satcheck_smvsat_interpolatort::lcnf(const bvt &bv) { bvt tmp; @@ -271,18 +163,6 @@ void satcheck_smvsat_interpolatort::lcnf(const bvt &bv) delete[] lits; } -/*******************************************************************\ - -Function: satcheck_smvsat_interpolatort::interpolate - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void satcheck_smvsat_interpolatort::interpolate(exprt &dest) { // crate instance @@ -307,18 +187,6 @@ void satcheck_smvsat_interpolatort::interpolate(exprt &dest) delete interpolator_satsolver; } -/*******************************************************************\ - -Function: satcheck_smvsat_interpolatort::build_aig - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void satcheck_smvsat_interpolatort::build_aig( // NOLINTNEXTLINE(readability/identifiers) struct interpolator &interpolator_satsolver, diff --git a/src/solvers/sat/satcheck_zchaff.cpp b/src/solvers/sat/satcheck_zchaff.cpp index 6697d6b3c6c..53d78065311 100644 --- a/src/solvers/sat/satcheck_zchaff.cpp +++ b/src/solvers/sat/satcheck_zchaff.cpp @@ -13,18 +13,6 @@ Author: Daniel Kroening, kroening@kroening.com #include -/*******************************************************************\ - -Function: satcheck_zchaff_baset::satcheck_zchaff_baset - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - satcheck_zchaff_baset::satcheck_zchaff_baset(CSolver *_solver):solver(_solver) { status=INIT; @@ -32,34 +20,10 @@ satcheck_zchaff_baset::satcheck_zchaff_baset(CSolver *_solver):solver(_solver) solver->set_variable_number(0); } -/*******************************************************************\ - -Function: satcheck_zchaff_baset::~satcheck_zchaff_baset - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - satcheck_zchaff_baset::~satcheck_zchaff_baset() { } -/*******************************************************************\ - -Function: satcheck_zchaff_baset::l_get - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - tvt satcheck_zchaff_baset::l_get(literalt a) const { assert(status==SAT); @@ -86,35 +50,11 @@ tvt satcheck_zchaff_baset::l_get(literalt a) const return result; } -/*******************************************************************\ - -Function: satcheck_zchaff_baset::solver_text - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - const std::string satcheck_zchaff_baset::solver_text() { return solver->version(); } -/*******************************************************************\ - -Function: satcheck_zchaff_baset::copy_cnf - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void satcheck_zchaff_baset::copy_cnf() { assert(status==INIT); @@ -129,18 +69,6 @@ void satcheck_zchaff_baset::copy_cnf() reinterpret_cast(&((*it)[0])), it->size()); } -/*******************************************************************\ - -Function: satcheck_zchaff_baset::prop_solve - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - propt::resultt satcheck_zchaff_baset::prop_solve() { // this is *not* incremental @@ -227,18 +155,6 @@ propt::resultt satcheck_zchaff_baset::prop_solve() return P_ERROR; } -/*******************************************************************\ - -Function: satcheck_zchaff_baset::set_assignment - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void satcheck_zchaff_baset::set_assignment(literalt a, bool value) { unsigned v=a.var_no(); @@ -247,35 +163,11 @@ void satcheck_zchaff_baset::set_assignment(literalt a, bool value) solver->variables()[v].set_value(value); } -/*******************************************************************\ - -Function: satcheck_zchafft::satcheck_zchafft - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - satcheck_zchafft::satcheck_zchafft(): satcheck_zchaff_baset(new CSolver) { } -/*******************************************************************\ - -Function: satcheck_zchafft::~satcheck_zchafft - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - satcheck_zchafft::~satcheck_zchafft() { delete solver; diff --git a/src/solvers/sat/satcheck_zcore.cpp b/src/solvers/sat/satcheck_zcore.cpp index 5079259d6cf..5dda83fce65 100644 --- a/src/solvers/sat/satcheck_zcore.cpp +++ b/src/solvers/sat/satcheck_zcore.cpp @@ -15,85 +15,25 @@ Author: Daniel Kroening, kroening@kroening.com #include -/*******************************************************************\ - -Function: satcheck_zcoret::satcheck_zcoret - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - satcheck_zcoret::satcheck_zcoret() { } -/*******************************************************************\ - -Function: satcheck_zcoret::~satcheck_zcoret - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - satcheck_zcoret::~satcheck_zcoret() { } -/*******************************************************************\ - -Function: satcheck_zcoret::l_get - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - tvt satcheck_zcoret::l_get(literalt a) const { assert(false); return tvt(tvt::tv_enumt::TV_UNKNOWN); } -/*******************************************************************\ - -Function: satcheck_zcoret::solver_text - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - const std::string satcheck_zcoret::solver_text() { return "ZCore"; } -/*******************************************************************\ - -Function: satcheck_zcoret::prop_solve - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - propt::resultt satcheck_zcoret::prop_solve() { // We start counting at 1, thus there is one variable fewer. diff --git a/src/solvers/smt1/smt1_conv.cpp b/src/solvers/smt1/smt1_conv.cpp index e9b71d87956..4dd4bff4220 100644 --- a/src/solvers/smt1/smt1_conv.cpp +++ b/src/solvers/smt1/smt1_conv.cpp @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// SMT Version 1 Backend + #include #include @@ -28,18 +31,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "smt1_conv.h" -/*******************************************************************\ - -Function: smt1_convt::print_assignment - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void smt1_convt::print_assignment(std::ostream &out) const { // Boolean stuff @@ -50,18 +41,6 @@ void smt1_convt::print_assignment(std::ostream &out) const // others } -/*******************************************************************\ - -Function: smt1_convt::l_get - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - tvt smt1_convt::l_get(literalt l) const { if(l.is_true()) @@ -72,18 +51,6 @@ tvt smt1_convt::l_get(literalt l) const return tvt(boolean_assignment[l.var_no()]^l.sign()); } -/*******************************************************************\ - -Function: smt1_convt::dec_solve - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - decision_proceduret::resultt smt1_convt::dec_solve() { write_footer(); @@ -91,18 +58,6 @@ decision_proceduret::resultt smt1_convt::dec_solve() return decision_proceduret::resultt::D_ERROR; } -/*******************************************************************\ - -Function: smt1_convt::write_header - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void smt1_convt::write_header() { out << "(benchmark " << benchmark << "\n"; @@ -111,18 +66,6 @@ void smt1_convt::write_header() out << ":logic " << logic << " ; SMT1" << "\n"; } -/*******************************************************************\ - -Function: smt1_convt::write_footer() - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void smt1_convt::write_footer() { out << "\n"; @@ -130,18 +73,6 @@ void smt1_convt::write_footer() out << ") ; benchmark" << "\n"; } -/*******************************************************************\ - -Function: smt1_convt::get - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - exprt smt1_convt::get(const exprt &expr) const { if(expr.id()==ID_symbol) @@ -183,18 +114,6 @@ exprt smt1_convt::get(const exprt &expr) const return nil_exprt(); } -/*******************************************************************\ - -Function: smt1_convt::ce_value - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - exprt smt1_convt::ce_value( const typet &type, const std::string &index, @@ -309,18 +228,6 @@ exprt smt1_convt::ce_value( return nil_exprt(); } -/*******************************************************************\ - -Function: smt1_convt::array_index_type - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - typet smt1_convt::array_index_type() const { signedbv_typet t; @@ -328,18 +235,6 @@ typet smt1_convt::array_index_type() const return t; } -/*******************************************************************\ - -Function: smt1_convt::array_index - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void smt1_convt::array_index(const exprt &expr) { if(expr.type().id()==ID_integer) @@ -353,18 +248,6 @@ void smt1_convt::array_index(const exprt &expr) convert_expr(tmp, true); } -/*******************************************************************\ - -Function: smt1_convt::convert_address_of_rec - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void smt1_convt::convert_address_of_rec( const exprt &expr, const pointer_typet &result_type) @@ -466,18 +349,6 @@ void smt1_convt::convert_address_of_rec( throw "don't know how to take address of: "+expr.id_string(); } -/*******************************************************************\ - -Function: smt1_convt::convert_byte_extract - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void smt1_convt::convert_byte_extract( const byte_extract_exprt &expr, bool bool_as_bv) @@ -487,18 +358,6 @@ void smt1_convt::convert_byte_extract( convert_expr(flattened_expr, bool_as_bv); } -/*******************************************************************\ - -Function: smt1_convt::convert_byte_update - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void smt1_convt::convert_byte_update( const exprt &expr, bool bool_as_bv) @@ -576,18 +435,6 @@ void smt1_convt::convert_byte_update( } } -/*******************************************************************\ - -Function: smt1_convt::convert - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - literalt smt1_convt::convert(const exprt &expr) { assert(expr.type().id()==ID_bool); @@ -624,18 +471,6 @@ literalt smt1_convt::convert(const exprt &expr) return l; } -/*******************************************************************\ - -Function: smt1_convt::convert_identifier - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string smt1_convt::convert_identifier(const irep_idt &identifier) { std::string s=id2string(identifier), dest; @@ -689,18 +524,6 @@ std::string smt1_convt::convert_identifier(const irep_idt &identifier) return dest; } -/*******************************************************************\ - -Function: smt1_convt::convert_expr - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void smt1_convt::convert_expr(const exprt &expr, bool bool_as_bv) { if(expr.id()==ID_symbol) @@ -1510,18 +1333,6 @@ void smt1_convt::convert_expr(const exprt &expr, bool bool_as_bv) expr.id_string()+"' is unsupported"; } -/*******************************************************************\ - -Function: smt1_convt::convert_typecast - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void smt1_convt::convert_typecast( const typecast_exprt &expr, bool bool_as_bv) @@ -1903,18 +1714,6 @@ void smt1_convt::convert_typecast( throw "TODO typecast4 ? -> "+dest_type.id_string(); } -/*******************************************************************\ - -Function: smt1_convt::convert_struct - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void smt1_convt::convert_struct(const exprt &expr) { const struct_typet &struct_type=to_struct_type(expr.type()); @@ -1969,18 +1768,6 @@ void smt1_convt::convert_struct(const exprt &expr) } } -/*******************************************************************\ - -Function: smt1_convt::convert_union - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void smt1_convt::convert_union(const exprt &expr) { const union_typet &union_type=to_union_type(expr.type()); @@ -2010,18 +1797,6 @@ void smt1_convt::convert_union(const exprt &expr) } } -/*******************************************************************\ - -Function: smt1_convt::convert_constant - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void smt1_convt::convert_constant( const constant_exprt &expr, bool bool_as_bv) @@ -2123,18 +1898,6 @@ void smt1_convt::convert_constant( throw "unknown constant: "+expr.type().id_string(); } -/*******************************************************************\ - -Function: smt1_convt::convert_mod - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void smt1_convt::convert_mod(const mod_exprt &expr) { assert(expr.operands().size()==2); @@ -2156,18 +1919,6 @@ void smt1_convt::convert_mod(const mod_exprt &expr) throw "unsupported type for mod: "+expr.type().id_string(); } -/*******************************************************************\ - -Function: smt1_convt::convert_is_dynamic_object - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void smt1_convt::convert_is_dynamic_object( const exprt &expr, bool bool_as_bv) @@ -2217,18 +1968,6 @@ void smt1_convt::convert_is_dynamic_object( from_bool_end(expr.type(), bool_as_bv); } -/*******************************************************************\ - -Function: smt1_convt::convert_relation - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void smt1_convt::convert_relation(const exprt &expr, bool bool_as_bv) { assert(expr.operands().size()==2); @@ -2294,18 +2033,6 @@ void smt1_convt::convert_relation(const exprt &expr, bool bool_as_bv) from_bool_end(expr.type(), bool_as_bv); } -/*******************************************************************\ - -Function: smt1_convt::convert_plus - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void smt1_convt::convert_plus(const plus_exprt &expr) { assert(expr.operands().size()>=2); @@ -2386,18 +2113,6 @@ void smt1_convt::convert_plus(const plus_exprt &expr) throw "unsupported type for +: "+expr.type().id_string(); } -/*******************************************************************\ - -Function: smt1_convt::convert_floatbv_plus - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void smt1_convt::convert_floatbv_plus(const exprt &expr) { assert(expr.operands().size()==3); @@ -2406,18 +2121,6 @@ void smt1_convt::convert_floatbv_plus(const exprt &expr) throw "todo: floatbv_plus"; } -/*******************************************************************\ - -Function: smt1_convt::convert_minus - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void smt1_convt::convert_minus(const minus_exprt &expr) { assert(expr.operands().size()==2); @@ -2457,18 +2160,6 @@ void smt1_convt::convert_minus(const minus_exprt &expr) throw "unsupported type for -: "+expr.type().id_string(); } -/*******************************************************************\ - -Function: smt1_convt::convert_floatbv_minus - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void smt1_convt::convert_floatbv_minus(const exprt &expr) { assert(expr.operands().size()==3); @@ -2477,18 +2168,6 @@ void smt1_convt::convert_floatbv_minus(const exprt &expr) throw "todo: floatbv_minus"; } -/*******************************************************************\ - -Function: smt1_convt::convert_div - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void smt1_convt::convert_div(const div_exprt &expr) { assert(expr.operands().size()==2); @@ -2528,18 +2207,6 @@ void smt1_convt::convert_div(const div_exprt &expr) throw "unsupported type for /: "+expr.type().id_string(); } -/*******************************************************************\ - -Function: smt1_convt::convert_floatbv_div - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void smt1_convt::convert_floatbv_div(const exprt &expr) { assert(expr.operands().size()==3); @@ -2548,18 +2215,6 @@ void smt1_convt::convert_floatbv_div(const exprt &expr) throw "todo: floatbv_div"; } -/*******************************************************************\ - -Function: smt1_convt::convert_mult - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void smt1_convt::convert_mult(const mult_exprt &expr) { assert(expr.operands().size()>=2); @@ -2623,18 +2278,6 @@ void smt1_convt::convert_mult(const mult_exprt &expr) throw "unsupported type for *: "+expr.type().id_string(); } -/*******************************************************************\ - -Function: smt1_convt::convert_floatbv_mult - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void smt1_convt::convert_floatbv_mult(const exprt &expr) { assert(expr.operands().size()==3); @@ -2643,18 +2286,6 @@ void smt1_convt::convert_floatbv_mult(const exprt &expr) throw "todo: floatbv_mult"; } -/*******************************************************************\ - -Function: smt1_convt::convert_with - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void smt1_convt::convert_with(const exprt &expr) { // get rid of "with" that has more than three operands @@ -2995,18 +2626,6 @@ void smt1_convt::convert_with(const exprt &expr) } } -/*******************************************************************\ - -Function: smt1_convt::convert_update - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void smt1_convt::convert_update(const exprt &expr) { assert(expr.operands().size()==3); @@ -3015,18 +2634,6 @@ void smt1_convt::convert_update(const exprt &expr) throw "smt1_convt::convert_update to be implemented"; } -/*******************************************************************\ - -Function: smt1_convt::convert_index - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void smt1_convt::convert_index(const index_exprt &expr, bool bool_as_bv) { assert(expr.operands().size()==2); @@ -3078,18 +2685,6 @@ void smt1_convt::convert_index(const index_exprt &expr, bool bool_as_bv) } } -/*******************************************************************\ - -Function: smt1_convt::convert_member - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void smt1_convt::convert_member(const member_exprt &expr, bool bool_as_bv) { assert(expr.operands().size()==1); @@ -3140,34 +2735,10 @@ void smt1_convt::convert_member(const member_exprt &expr, bool bool_as_bv) from_bv_end(expr.type(), bool_as_bv); } -/*******************************************************************\ - -Function: smt1_convt::convert_overflow - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void smt1_convt::convert_overflow(const exprt &expr) { } -/*******************************************************************\ - -Function: smt1_convt::set_to - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void smt1_convt::set_to(const exprt &expr, bool value) { if(expr.id()==ID_and && value) @@ -3210,18 +2781,6 @@ void smt1_convt::set_to(const exprt &expr, bool value) out << "\n"; } -/*******************************************************************\ - -Function: smt1_convt::find_symbols - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void smt1_convt::find_symbols(const exprt &expr) { const typet &type=expr.type(); @@ -3349,18 +2908,6 @@ void smt1_convt::find_symbols(const exprt &expr) } } -/*******************************************************************\ - -Function: smt1_convt::convert_type - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void smt1_convt::convert_type(const typet &type) { if(type.id()==ID_array) @@ -3423,18 +2970,6 @@ void smt1_convt::convert_type(const typet &type) throw "unsupported type: "+type.id_string(); } -/*******************************************************************\ - -Function: smt1_convt::convert_literal - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void smt1_convt::convert_literal(const literalt l) { if(l==const_literal(false)) @@ -3453,18 +2988,6 @@ void smt1_convt::convert_literal(const literalt l) } } -/*******************************************************************\ - -Function: smt1_convt::from_bv_begin - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void smt1_convt::from_bv_begin(const typet &type, bool bool_as_bv) { // this turns bv[1] into a predicate if needed @@ -3472,18 +2995,6 @@ void smt1_convt::from_bv_begin(const typet &type, bool bool_as_bv) out << "(= "; } -/*******************************************************************\ - -Function: smt1_convt::from_bv_end - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void smt1_convt::from_bv_end(const typet &type, bool bool_as_bv) { // this turns bv[1] into a predicate if needed @@ -3491,18 +3002,6 @@ void smt1_convt::from_bv_end(const typet &type, bool bool_as_bv) out << " bv1[1])"; } -/*******************************************************************\ - -Function: smt1_convt::from_bool_begin - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void smt1_convt::from_bool_begin(const typet &type, bool bool_as_bv) { // this turns a predicate into bv[1] if needed @@ -3510,18 +3009,6 @@ void smt1_convt::from_bool_begin(const typet &type, bool bool_as_bv) out << "(ite "; } -/*******************************************************************\ - -Function: smt1_convt::from_bool_end - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void smt1_convt::from_bool_end(const typet &type, bool bool_as_bv) { // this turns a predicate into bv[1] if needed @@ -3529,36 +3016,12 @@ void smt1_convt::from_bool_end(const typet &type, bool bool_as_bv) out << " bv1[1] bv0[1])"; } -/*******************************************************************\ - -Function: smt1_convt::find_symbols - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void smt1_convt::find_symbols(const typet &type) { std::set rec_stack; find_symbols_rec(type, rec_stack); } -/*******************************************************************\ - -Function: smt1_convt::find_symbols_rec - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void smt1_convt::find_symbols_rec( const typet &type, std::set &recstack) @@ -3609,18 +3072,6 @@ void smt1_convt::find_symbols_rec( } } -/*******************************************************************\ - -Function: smt1_convt::binary2struct - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - exprt smt1_convt::binary2struct( const struct_typet &type, const std::string &binary) const @@ -3655,18 +3106,6 @@ exprt smt1_convt::binary2struct( return e; } -/*******************************************************************\ - -Function: smt1_convt::binary2union - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - exprt smt1_convt::binary2union( const union_typet &type, const std::string &binary) const @@ -3697,18 +3136,6 @@ exprt smt1_convt::binary2union( return e; } -/*******************************************************************\ - -Function: smt1_convt::flatten_array - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void smt1_convt::flatten_array(const exprt &op) { const array_typet array_type=to_array_type(op.type()); @@ -3756,18 +3183,6 @@ void smt1_convt::flatten_array(const exprt &op) #endif } -/*******************************************************************\ - -Function: smt1_convt::convert_nary - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void smt1_convt::convert_nary( const exprt &expr, const irep_idt op_string, diff --git a/src/solvers/smt1/smt1_conv.h b/src/solvers/smt1/smt1_conv.h index 4a078a0d772..f152423df1c 100644 --- a/src/solvers/smt1/smt1_conv.h +++ b/src/solvers/smt1/smt1_conv.h @@ -7,6 +7,9 @@ Revision: Roberto Bruttomesso, roberto.bruttomesso@unisi.ch \*******************************************************************/ +/// \file +/// SMT Version 1 Backend + #ifndef CPROVER_SOLVERS_SMT1_SMT1_CONV_H #define CPROVER_SOLVERS_SMT1_SMT1_CONV_H diff --git a/src/solvers/smt1/smt1_dec.cpp b/src/solvers/smt1/smt1_dec.cpp index fc01925d883..1b39527a59d 100644 --- a/src/solvers/smt1/smt1_dec.cpp +++ b/src/solvers/smt1/smt1_dec.cpp @@ -26,18 +26,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "smt1_dec.h" -/*******************************************************************\ - -Function: smt1_dect::decision_procedure_text - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string smt1_dect::decision_procedure_text() const { return "SMT1 "+logic+" using "+ @@ -52,18 +40,6 @@ std::string smt1_dect::decision_procedure_text() const "(unknown)"); } -/*******************************************************************\ - -Function: smt1_temp_filet::smt1_temp_filet - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - smt1_temp_filet::smt1_temp_filet() { temp_out_filename=get_temporary_file("smt1_dec_out_", ""); @@ -73,18 +49,6 @@ smt1_temp_filet::smt1_temp_filet() std::ios_base::out | std::ios_base::trunc); } -/*******************************************************************\ - -Function: smt1_temp_filet::~smt1_temp_filet - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - smt1_temp_filet::~smt1_temp_filet() { temp_out.close(); @@ -96,18 +60,6 @@ smt1_temp_filet::~smt1_temp_filet() unlink(temp_result_filename.c_str()); } -/*******************************************************************\ - -Function: smt1_dect::dec_solve - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - decision_proceduret::resultt smt1_dect::dec_solve() { // SMT1 is really not incremental @@ -226,18 +178,7 @@ decision_proceduret::resultt smt1_dect::dec_solve() } } -/*******************************************************************\ - -Function: smt1_dect::read_result_boolector - - Inputs: - - Outputs: - - Purpose: read model produced by Boolector - -\*******************************************************************/ - +/// read model produced by Boolector decision_proceduret::resultt smt1_dect::read_result_boolector(std::istream &in) { std::string line; @@ -321,35 +262,11 @@ decision_proceduret::resultt smt1_dect::read_result_boolector(std::istream &in) return resultt::D_ERROR; } -/*******************************************************************\ - -Function: smt1_dect::read_result_opensmt - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - decision_proceduret::resultt smt1_dect::read_result_opensmt(std::istream &in) { return resultt::D_ERROR; } -/*******************************************************************\ - -Function: smt1_dect::read_result_yices - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - decision_proceduret::resultt smt1_dect::read_result_yices(std::istream &in) { std::string line; @@ -370,18 +287,6 @@ decision_proceduret::resultt smt1_dect::read_result_yices(std::istream &in) return resultt::D_ERROR; } -/*******************************************************************\ - -Function: smt1_dect::mathsat_value - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string smt1_dect::mathsat_value(const std::string &src) { std::size_t pos=src.find('['); @@ -399,18 +304,6 @@ std::string smt1_dect::mathsat_value(const std::string &src) return ""; } -/*******************************************************************\ - -Function: smt1_dect::read_result_mathsat - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - decision_proceduret::resultt smt1_dect::read_result_mathsat(std::istream &in) { std::string line; @@ -481,18 +374,6 @@ decision_proceduret::resultt smt1_dect::read_result_mathsat(std::istream &in) return res; } -/*******************************************************************\ - -Function: smt1_dect::read_result_z3 - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - decision_proceduret::resultt smt1_dect::read_result_z3(std::istream &in) { std::string line; @@ -549,18 +430,6 @@ decision_proceduret::resultt smt1_dect::read_result_z3(std::istream &in) return res; } -/*******************************************************************\ - -Function: smt1_dect::string_to_expr_z3 - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool smt1_dect::string_to_expr_z3( const typet &type, const std::string &value, @@ -677,18 +546,6 @@ bool smt1_dect::string_to_expr_z3( return false; } -/*******************************************************************\ - -Function: smt1_dect::read_result_cvc3 - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - decision_proceduret::resultt smt1_dect::read_result_cvc3(std::istream &in) { std::string line; diff --git a/src/solvers/smt1/smt1_prop.cpp b/src/solvers/smt1/smt1_prop.cpp index e39dfedde80..bdbc0dbfbce 100644 --- a/src/solvers/smt1/smt1_prop.cpp +++ b/src/solvers/smt1/smt1_prop.cpp @@ -13,18 +13,6 @@ Revisions: Roberto Bruttomesso, roberto.bruttomesso@unisi.ch #include "smt1_prop.h" -/*******************************************************************\ - -Function: smt1_propt::smt1_propt - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - smt1_propt::smt1_propt( const std::string &benchmark, const std::string &source, @@ -38,34 +26,10 @@ smt1_propt::smt1_propt( _no_variables=0; } -/*******************************************************************\ - -Function: smt1_propt::~smt1_propt - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - smt1_propt::~smt1_propt() { } -/*******************************************************************\ - -Function: smt1_propt::finalize - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void smt1_propt::finalize() { out << "\n"; @@ -73,18 +37,6 @@ void smt1_propt::finalize() out << ") ; benchmark" << "\n"; } -/*******************************************************************\ - -Function: smt1_propt::land - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - literalt smt1_propt::land(const bvt &bv) { out << "\n"; @@ -102,18 +54,6 @@ literalt smt1_propt::land(const bvt &bv) return l; } -/*******************************************************************\ - -Function: smt1_propt::lor - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - literalt smt1_propt::lor(const bvt &bv) { out << "\n"; @@ -131,18 +71,6 @@ literalt smt1_propt::lor(const bvt &bv) return l; } -/*******************************************************************\ - -Function: smt1_propt::lxor - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - literalt smt1_propt::lxor(const bvt &bv) { if(bv.empty()) @@ -165,18 +93,6 @@ literalt smt1_propt::lxor(const bvt &bv) return l; } -/*******************************************************************\ - -Function: smt1_propt::land - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - literalt smt1_propt::land(literalt a, literalt b) { if(a==const_literal(true)) @@ -203,18 +119,6 @@ literalt smt1_propt::land(literalt a, literalt b) return l; } -/*******************************************************************\ - -Function: smt1_propt::lor - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - literalt smt1_propt::lor(literalt a, literalt b) { if(a==const_literal(false)) @@ -241,18 +145,6 @@ literalt smt1_propt::lor(literalt a, literalt b) return l; } -/*******************************************************************\ - -Function: smt1_propt::lxor - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - literalt smt1_propt::lxor(literalt a, literalt b) { if(a==const_literal(false)) @@ -277,86 +169,26 @@ literalt smt1_propt::lxor(literalt a, literalt b) return l; } -/*******************************************************************\ - -Function: smt1_propt::lnand - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - literalt smt1_propt::lnand(literalt a, literalt b) { return !land(a, b); } -/*******************************************************************\ - -Function: smt1_propt::lnor - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - literalt smt1_propt::lnor(literalt a, literalt b) { return !lor(a, b); } -/*******************************************************************\ - -Function: smt1_propt::lequal - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - literalt smt1_propt::lequal(literalt a, literalt b) { return !lxor(a, b); } -/*******************************************************************\ - -Function: smt1_propt::limplies - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - literalt smt1_propt::limplies(literalt a, literalt b) { return lor(!a, b); } -/*******************************************************************\ - -Function: smt1_propt::lselect - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - literalt smt1_propt::lselect(literalt a, literalt b, literalt c) { if(a==const_literal(true)) @@ -387,18 +219,6 @@ literalt smt1_propt::lselect(literalt a, literalt b, literalt c) return l; } -/*******************************************************************\ - -Function: smt1_propt::new_variable - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - literalt smt1_propt::new_variable() { literalt l; @@ -410,18 +230,6 @@ literalt smt1_propt::new_variable() return l; } -/*******************************************************************\ - -Function: smt1_propt::lcnf - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void smt1_propt::lcnf(const bvt &bv) { out << "\n"; @@ -445,18 +253,6 @@ void smt1_propt::lcnf(const bvt &bv) out << "\n"; } -/*******************************************************************\ - -Function: smt1_propt::smt1_literal - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string smt1_propt::smt1_literal(literalt l) { if(l==const_literal(false)) @@ -472,18 +268,6 @@ std::string smt1_propt::smt1_literal(literalt l) return v; } -/*******************************************************************\ - -Function: smt1_propt::l_get - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - tvt smt1_propt::l_get(literalt literal) const { if(literal.is_true()) @@ -498,18 +282,6 @@ tvt smt1_propt::l_get(literalt literal) const return literal.sign()?!r:r; } -/*******************************************************************\ - -Function: smt1_propt::set_assignment - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void smt1_propt::set_assignment(literalt literal, bool value) { if(literal.is_true() || literal.is_false()) @@ -520,18 +292,6 @@ void smt1_propt::set_assignment(literalt literal, bool value) assignment[v]=tvt(value); } -/*******************************************************************\ - -Function: smt1_propt::prop_solve - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - propt::resultt smt1_propt::prop_solve() { return P_ERROR; diff --git a/src/solvers/smt2/smt2_conv.cpp b/src/solvers/smt2/smt2_conv.cpp index 37a3647ed71..c764c210bec 100644 --- a/src/solvers/smt2/smt2_conv.cpp +++ b/src/solvers/smt2/smt2_conv.cpp @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// SMT Backend + #include #include @@ -44,18 +47,6 @@ Author: Daniel Kroening, kroening@kroening.com // General todos #define TODO(S) throw "TODO: " S -/*******************************************************************\ - -Function: smt2_convt::print_assignment - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void smt2_convt::print_assignment(std::ostream &out) const { // Boolean stuff @@ -66,18 +57,6 @@ void smt2_convt::print_assignment(std::ostream &out) const // others } -/*******************************************************************\ - -Function: smt2_convt::l_get - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - tvt smt2_convt::l_get(literalt l) const { if(l.is_true()) @@ -88,18 +67,6 @@ tvt smt2_convt::l_get(literalt l) const return tvt(boolean_assignment[l.var_no()]^l.sign()); } -/*******************************************************************\ - -Function: smt2_convt::write_header - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void smt2_convt::write_header() { out << "; SMT 2" << "\n"; @@ -127,18 +94,6 @@ void smt2_convt::write_header() out << "(set-logic " << logic << ")" << "\n"; } -/*******************************************************************\ - -Function: smt2_convt::write_footer - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void smt2_convt::write_footer(std::ostream &out) { out << "\n"; @@ -176,18 +131,6 @@ void smt2_convt::write_footer(std::ostream &out) out << "; end of SMT2 file" << "\n"; } -/*******************************************************************\ - -Function: smt2_convt::define_object_size - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void smt2_convt::define_object_size( const irep_idt &id, const exprt &expr) @@ -225,18 +168,6 @@ void smt2_convt::define_object_size( } } -/*******************************************************************\ - -Function: smt2_convt::dec_solve - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - decision_proceduret::resultt smt2_convt::dec_solve() { write_footer(out); @@ -244,18 +175,6 @@ decision_proceduret::resultt smt2_convt::dec_solve() return decision_proceduret::resultt::D_ERROR; } -/*******************************************************************\ - -Function: smt2_convt::get - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - exprt smt2_convt::get(const exprt &expr) const { if(expr.id()==ID_symbol) @@ -279,18 +198,6 @@ exprt smt2_convt::get(const exprt &expr) const return nil_exprt(); } -/*******************************************************************\ - -Function: smt2_convt::parse_literal - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - constant_exprt smt2_convt::parse_literal( const irept &src, const typet &type) @@ -411,18 +318,6 @@ constant_exprt smt2_convt::parse_literal( UNEXPECTEDCASE("smt2_convt::parse_literal can't do type "+type.id_string()); } -/*******************************************************************\ - -Function: smt2_convt::parse_array - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - exprt smt2_convt::parse_array( const irept &src, const array_typet &type) @@ -453,18 +348,6 @@ exprt smt2_convt::parse_array( return nil_exprt(); } -/*******************************************************************\ - -Function: smt2_convt::parse_union - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - exprt smt2_convt::parse_union( const irept &src, const union_typet &type) @@ -480,18 +363,6 @@ exprt smt2_convt::parse_union( return union_exprt(first.get_name(), converted, type); } -/*******************************************************************\ - -Function: smt2_convt::parse_struct - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - exprt smt2_convt::parse_struct( const irept &src, const struct_typet &type) @@ -553,18 +424,6 @@ exprt smt2_convt::parse_struct( return result; } -/*******************************************************************\ - -Function: smt2_convt::parse_rec - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - exprt smt2_convt::parse_rec(const irept &src, const typet &_type) { const typet &type=ns.follow(_type); @@ -616,18 +475,6 @@ exprt smt2_convt::parse_rec(const irept &src, const typet &_type) return nil_exprt(); } -/*******************************************************************\ - -Function: smt2_convt::convert_address_of_rec - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void smt2_convt::convert_address_of_rec( const exprt &expr, const pointer_typet &result_type) @@ -723,18 +570,6 @@ void smt2_convt::convert_address_of_rec( UNEXPECTEDCASE("don't know how to take address of: "+expr.id_string()); } -/*******************************************************************\ - -Function: smt2_convt::convert_byte_extract - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void smt2_convt::convert_byte_extract(const byte_extract_exprt &expr) { // we just run the flattener @@ -744,18 +579,6 @@ void smt2_convt::convert_byte_extract(const byte_extract_exprt &expr) unflatten(wheret::END, expr.type()); } -/*******************************************************************\ - -Function: smt2_convt::convert_byte_update - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void smt2_convt::convert_byte_update(const byte_update_exprt &expr) { assert(expr.operands().size()==3); @@ -860,18 +683,6 @@ void smt2_convt::convert_byte_update(const byte_update_exprt &expr) #endif } -/*******************************************************************\ - -Function: smt2_convt::convert - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - literalt smt2_convt::convert(const exprt &expr) { assert(expr.type().id()==ID_bool); @@ -904,18 +715,6 @@ literalt smt2_convt::convert(const exprt &expr) return l; } -/*******************************************************************\ - -Function: smt2_convt::convert_literal - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void smt2_convt::convert_literal(const literalt l) { if(l==const_literal(false)) @@ -936,18 +735,6 @@ void smt2_convt::convert_literal(const literalt l) } } -/*******************************************************************\ - -Function: smt2_convt::convert_identifier - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string smt2_convt::convert_identifier(const irep_idt &identifier) { // Backslashes are disallowed in quoted symbols just for simplicity. @@ -979,18 +766,6 @@ std::string smt2_convt::convert_identifier(const irep_idt &identifier) return result; } -/*******************************************************************\ - -Function: smt2_convt::type2id - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string smt2_convt::type2id(const typet &type) const { if(type.id()==ID_floatbv) @@ -1025,36 +800,12 @@ std::string smt2_convt::type2id(const typet &type) const } } -/*******************************************************************\ - -Function: smt2_convt::floatbv_suffix - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string smt2_convt::floatbv_suffix(const exprt &expr) const { assert(!expr.operands().empty()); return "_"+type2id(expr.op0().type())+"->"+type2id(expr.type()); } -/*******************************************************************\ - -Function: smt2_convt::convert_floatbv - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void smt2_convt::convert_floatbv(const exprt &expr) { assert(!use_FPA_theory); @@ -1088,18 +839,6 @@ void smt2_convt::convert_floatbv(const exprt &expr) out << ')'; } -/*******************************************************************\ - -Function: smt2_convt::convert_expr - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void smt2_convt::convert_expr(const exprt &expr) { // huge monster case split over expression id @@ -2050,18 +1789,6 @@ void smt2_convt::convert_expr(const exprt &expr) "smt2_convt::convert_expr: `"+expr.id_string()+"' is unsupported"); } -/*******************************************************************\ - -Function: smt2_convt::convert_typecast - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void smt2_convt::convert_typecast(const typecast_exprt &expr) { assert(expr.operands().size()==1); @@ -2546,18 +2273,6 @@ void smt2_convt::convert_typecast(const typecast_exprt &expr) "TODO typecast8 "+src_type.id_string()+" -> "+dest_type.id_string()); } -/*******************************************************************\ - -Function: smt2_convt::convert_floatbv_typecast - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void smt2_convt::convert_floatbv_typecast(const floatbv_typecast_exprt &expr) { const exprt &src=expr.op(); @@ -2704,18 +2419,6 @@ void smt2_convt::convert_floatbv_typecast(const floatbv_typecast_exprt &expr) } } -/*******************************************************************\ - -Function: smt2_convt::convert_struct - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void smt2_convt::convert_struct(const struct_exprt &expr) { const struct_typet &struct_type=to_struct_type(expr.type()); @@ -2778,18 +2481,7 @@ void smt2_convt::convert_struct(const struct_exprt &expr) } } -/*******************************************************************\ - -Function: smt2_convt::flatten_array - - Inputs: - - Outputs: - - Purpose: produce a flat bit-vector for a given array of fixed size - -\*******************************************************************/ - +/// produce a flat bit-vector for a given array of fixed size void smt2_convt::flatten_array(const exprt &expr) { const array_typet &array_type= @@ -2824,18 +2516,6 @@ void smt2_convt::flatten_array(const exprt &expr) out << ")"; // let } -/*******************************************************************\ - -Function: smt2_convt::convert_union - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void smt2_convt::convert_union(const union_exprt &expr) { const union_typet &union_type=to_union_type(expr.type()); @@ -2869,18 +2549,6 @@ void smt2_convt::convert_union(const union_exprt &expr) } } -/*******************************************************************\ - -Function: smt2_convt::convert_constant - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void smt2_convt::convert_constant(const constant_exprt &expr) { const typet &expr_type=expr.type(); @@ -3017,18 +2685,6 @@ void smt2_convt::convert_constant(const constant_exprt &expr) UNEXPECTEDCASE("unknown constant: "+expr_type.id_string()); } -/*******************************************************************\ - -Function: smt2_convt::convert_mod - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void smt2_convt::convert_mod(const mod_exprt &expr) { assert(expr.operands().size()==2); @@ -3050,18 +2706,6 @@ void smt2_convt::convert_mod(const mod_exprt &expr) UNEXPECTEDCASE("unsupported type for mod: "+expr.type().id_string()); } -/*******************************************************************\ - -Function: smt2_convt::convert_is_dynamic_object - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void smt2_convt::convert_is_dynamic_object(const exprt &expr) { std::vector dynamic_objects; @@ -3101,18 +2745,6 @@ void smt2_convt::convert_is_dynamic_object(const exprt &expr) } } -/*******************************************************************\ - -Function: smt2_convt::convert_relation - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void smt2_convt::convert_relation(const exprt &expr) { assert(expr.operands().size()==2); @@ -3198,18 +2830,6 @@ void smt2_convt::convert_relation(const exprt &expr) "unsupported type for "+expr.id_string()+": "+op_type.id_string()); } -/*******************************************************************\ - -Function: smt2_convt::convert_plus - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void smt2_convt::convert_plus(const plus_exprt &expr) { if(expr.operands().size()==0) @@ -3326,19 +2946,10 @@ void smt2_convt::convert_plus(const plus_exprt &expr) } } -/*******************************************************************\ - -Function: smt2_convt::convert_rounding_mode_FPA - - Inputs: The expression representing the rounding mode. - - Outputs: SMT-LIB output to out. - - Purpose: Converting a constant or symbolic rounding mode to SMT-LIB. - Only called when use_FPA_theory is enabled - -\*******************************************************************/ - +/// Converting a constant or symbolic rounding mode to SMT-LIB. Only called when +/// use_FPA_theory is enabled +/// \par parameters: The expression representing the rounding mode. +/// \return SMT-LIB output to out. void smt2_convt::convert_rounding_mode_FPA(const exprt &expr) { assert(use_FPA_theory); @@ -3395,18 +3006,6 @@ void smt2_convt::convert_rounding_mode_FPA(const exprt &expr) } } -/*******************************************************************\ - -Function: smt2_convt::convert_floatbv_plus - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void smt2_convt::convert_floatbv_plus(const ieee_float_op_exprt &expr) { const typet &type=expr.type(); @@ -3443,18 +3042,6 @@ void smt2_convt::convert_floatbv_plus(const ieee_float_op_exprt &expr) convert_floatbv(expr); } -/*******************************************************************\ - -Function: smt2_convt::convert_minus - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void smt2_convt::convert_minus(const minus_exprt &expr) { assert(expr.operands().size()==2); @@ -3548,18 +3135,6 @@ void smt2_convt::convert_minus(const minus_exprt &expr) UNEXPECTEDCASE("unsupported type for -: "+expr.type().id_string()); } -/*******************************************************************\ - -Function: smt2_convt::convert_floatbv_minus - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void smt2_convt::convert_floatbv_minus(const ieee_float_op_exprt &expr) { assert(expr.operands().size()==3); @@ -3579,18 +3154,6 @@ void smt2_convt::convert_floatbv_minus(const ieee_float_op_exprt &expr) convert_floatbv(expr); } -/*******************************************************************\ - -Function: smt2_convt::convert_div - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void smt2_convt::convert_div(const div_exprt &expr) { assert(expr.operands().size()==2); @@ -3637,18 +3200,6 @@ void smt2_convt::convert_div(const div_exprt &expr) UNEXPECTEDCASE("unsupported type for /: "+expr.type().id_string()); } -/*******************************************************************\ - -Function: smt2_convt::convert_floatbv_div - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void smt2_convt::convert_floatbv_div(const ieee_float_op_exprt &expr) { assert(expr.operands().size()==3); @@ -3668,18 +3219,6 @@ void smt2_convt::convert_floatbv_div(const ieee_float_op_exprt &expr) convert_floatbv(expr); } -/*******************************************************************\ - -Function: smt2_convt::convert_mult - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void smt2_convt::convert_mult(const mult_exprt &expr) { assert(expr.operands().size()>=2); @@ -3753,18 +3292,6 @@ void smt2_convt::convert_mult(const mult_exprt &expr) UNEXPECTEDCASE("unsupported type for *: "+expr.type().id_string()); } -/*******************************************************************\ - -Function: smt2_convt::convert_floatbv_mult - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void smt2_convt::convert_floatbv_mult(const ieee_float_op_exprt &expr) { assert(expr.operands().size()==3); @@ -3784,18 +3311,6 @@ void smt2_convt::convert_floatbv_mult(const ieee_float_op_exprt &expr) convert_floatbv(expr); } -/*******************************************************************\ - -Function: smt2_convt::convert_with - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void smt2_convt::convert_with(const with_exprt &expr) { // get rid of "with" that has more than three operands @@ -4043,18 +3558,6 @@ void smt2_convt::convert_with(const with_exprt &expr) expr.type().id_string()); } -/*******************************************************************\ - -Function: smt2_convt::convert_update - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void smt2_convt::convert_update(const exprt &expr) { assert(expr.operands().size()==3); @@ -4062,18 +3565,6 @@ void smt2_convt::convert_update(const exprt &expr) TODO("smt2_convt::convert_update to be implemented"); } -/*******************************************************************\ - -Function: smt2_convt::convert_index - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void smt2_convt::convert_index(const index_exprt &expr) { assert(expr.operands().size()==2); @@ -4176,18 +3667,6 @@ void smt2_convt::convert_index(const index_exprt &expr) "index with unsupported array type: "+array_op_type.id_string()); } -/*******************************************************************\ - -Function: smt2_convt::convert_member - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void smt2_convt::convert_member(const member_exprt &expr) { assert(expr.operands().size()==1); @@ -4253,18 +3732,6 @@ void smt2_convt::convert_member(const member_exprt &expr) "convert_member on an unexpected type "+struct_op_type.id_string()); } -/*******************************************************************\ - -Function: smt2_convt::flatten2bv - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void smt2_convt::flatten2bv(const exprt &expr) { const typet &type=ns.follow(expr.type()); @@ -4361,18 +3828,6 @@ void smt2_convt::flatten2bv(const exprt &expr) convert_expr(expr); } -/*******************************************************************\ - -Function: smt2_convt::unflatten - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void smt2_convt::unflatten( wheret where, const typet &type, @@ -4488,35 +3943,11 @@ void smt2_convt::unflatten( } } -/*******************************************************************\ - -Function: smt2_convt::convert_overflow - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void smt2_convt::convert_overflow(const exprt &expr) { UNREACHABLE; } -/*******************************************************************\ - -Function: smt2_convt::set_to - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void smt2_convt::set_to(const exprt &expr, bool value) { if(expr.id()==ID_and && value) @@ -4605,18 +4036,6 @@ void smt2_convt::set_to(const exprt &expr, bool value) return; } -/*******************************************************************\ - -Function: smt2_convt::find_symbols - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void smt2_convt::find_symbols(const exprt &expr) { // recursive call on type @@ -4810,18 +4229,6 @@ void smt2_convt::find_symbols(const exprt &expr) } } -/*******************************************************************\ - -Function: smt2_convt::use_array_theory - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool smt2_convt::use_array_theory(const exprt &expr) { const typet &type=ns.follow(expr.type()); @@ -4844,18 +4251,6 @@ bool smt2_convt::use_array_theory(const exprt &expr) } } -/*******************************************************************\ - -Function: smt2_convt::convert_type - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void smt2_convt::convert_type(const typet &type) { if(type.id()==ID_array) @@ -5007,36 +4402,12 @@ void smt2_convt::convert_type(const typet &type) } } -/*******************************************************************\ - -Function: smt2_convt::find_symbols - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void smt2_convt::find_symbols(const typet &type) { std::set recstack; find_symbols_rec(type, recstack); } -/*******************************************************************\ - -Function: smt2_convt::find_symbols_rec - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void smt2_convt::find_symbols_rec( const typet &type, std::set &recstack) @@ -5233,18 +4604,6 @@ void smt2_convt::find_symbols_rec( } } -/*******************************************************************\ - -Function: smt2_convt::letify - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - exprt smt2_convt::letify(exprt &expr) { seen_expressionst map; @@ -5255,18 +4614,6 @@ exprt smt2_convt::letify(exprt &expr) return letify_rec(expr, let_order, map, 0); } -/*******************************************************************\ - -Function: smt2_convt::letify_rec - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - exprt smt2_convt::letify_rec( exprt &expr, std::vector &let_order, @@ -5291,18 +4638,6 @@ exprt smt2_convt::letify_rec( return let; } -/*******************************************************************\ - -Function: smt2_convt::collect_bindings - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void smt2_convt::collect_bindings( exprt &expr, seen_expressionst &map, @@ -5334,18 +4669,6 @@ void smt2_convt::collect_bindings( let_order.push_back(expr); } -/*******************************************************************\ - -Function: smt2_convt::substitute_let - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - exprt smt2_convt::substitute_let( exprt &expr, const seen_expressionst &map) diff --git a/src/solvers/smt2/smt2_dec.cpp b/src/solvers/smt2/smt2_dec.cpp index 9a9c5d1fc62..51fb59952a8 100644 --- a/src/solvers/smt2/smt2_dec.cpp +++ b/src/solvers/smt2/smt2_dec.cpp @@ -26,18 +26,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "smt2_dec.h" #include "smt2irep.h" -/*******************************************************************\ - -Function: smt2_dect::decision_procedure_text - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string smt2_dect::decision_procedure_text() const { return "SMT2 "+logic+ @@ -54,18 +42,6 @@ std::string smt2_dect::decision_procedure_text() const "(unknown)"); } -/*******************************************************************\ - -Function: smt2_temp_filet::smt2_temp_filet - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - smt2_temp_filet::smt2_temp_filet() { temp_out_filename=get_temporary_file("smt2_dec_out_", ""); @@ -75,18 +51,6 @@ smt2_temp_filet::smt2_temp_filet() std::ios_base::out | std::ios_base::trunc); } -/*******************************************************************\ - -Function: smt2_temp_filet::~smt2_temp_filet - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - smt2_temp_filet::~smt2_temp_filet() { temp_out.close(); @@ -98,18 +62,6 @@ smt2_temp_filet::~smt2_temp_filet() unlink(temp_result_filename.c_str()); } -/*******************************************************************\ - -Function: smt2_dect::dec_solve - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - decision_proceduret::resultt smt2_dect::dec_solve() { // we write the problem into a file @@ -216,18 +168,6 @@ decision_proceduret::resultt smt2_dect::dec_solve() return read_result(in); } -/*******************************************************************\ - -Function: smt2_dect::read_result - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - decision_proceduret::resultt smt2_dect::read_result(std::istream &in) { std::string line; diff --git a/src/solvers/smt2/smt2_parser.cpp b/src/solvers/smt2/smt2_parser.cpp index 96439833c11..e7bd42b44b4 100644 --- a/src/solvers/smt2/smt2_parser.cpp +++ b/src/solvers/smt2/smt2_parser.cpp @@ -11,18 +11,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "smt2_parser.h" -/*******************************************************************\ - -Function: smt2_parsert::is_simple_symbol_character - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool smt2_parsert::is_simple_symbol_character(char ch) { // any non-empty sequence of letters, digits and the characters @@ -36,18 +24,6 @@ bool smt2_parsert::is_simple_symbol_character(char ch) ch=='?' || ch=='/'; } -/*******************************************************************\ - -Function: smt2_parsert::get_simple_symbol - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void smt2_parsert::get_simple_symbol() { // any non-empty sequence of letters, digits and the characters @@ -73,18 +49,6 @@ void smt2_parsert::get_simple_symbol() // eof -- this is ok here } -/*******************************************************************\ - -Function: smt2_parsert::get_decimal_numeral - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void smt2_parsert::get_decimal_numeral() { // we accept any sequence of digits and dots @@ -108,18 +72,6 @@ void smt2_parsert::get_decimal_numeral() // eof -- this is ok here } -/*******************************************************************\ - -Function: smt2_parsert::get_bin_numeral - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void smt2_parsert::get_bin_numeral() { // we accept any sequence of '0' or '1' @@ -145,18 +97,6 @@ void smt2_parsert::get_bin_numeral() // eof -- this is ok here } -/*******************************************************************\ - -Function: smt2_parsert::get_hex_numeral - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void smt2_parsert::get_hex_numeral() { // we accept any sequence of '0'-'9', 'a'-'f', 'A'-'F' @@ -182,18 +122,6 @@ void smt2_parsert::get_hex_numeral() // eof -- this is ok here } -/*******************************************************************\ - -Function: smt2_parsert::get_quoted_symbol - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void smt2_parsert::get_quoted_symbol() { // any sequence of printable ASCII characters (including space, @@ -214,18 +142,6 @@ void smt2_parsert::get_quoted_symbol() // Hmpf. Eof before end of quoted string. This is an error. } -/*******************************************************************\ - -Function: smt2_parsert::get_string_literal - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void smt2_parsert::get_string_literal() { buffer.clear(); @@ -257,18 +173,6 @@ void smt2_parsert::get_string_literal() error("EOF within string literal"); } -/*******************************************************************\ - -Function: smt2_parsert::operator() - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void smt2_parsert::operator()() { char ch; diff --git a/src/solvers/smt2/smt2_prop.cpp b/src/solvers/smt2/smt2_prop.cpp index d1f7f8bd21f..5ba2cbae409 100644 --- a/src/solvers/smt2/smt2_prop.cpp +++ b/src/solvers/smt2/smt2_prop.cpp @@ -11,18 +11,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "smt2_prop.h" -/*******************************************************************\ - -Function: smt2_propt::smt2_propt - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - smt2_propt::smt2_propt( const std::string &benchmark, const std::string &source, @@ -47,34 +35,10 @@ smt2_propt::smt2_propt( _no_variables=0; } -/*******************************************************************\ - -Function: smt2_propt::~smt2_propt - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - smt2_propt::~smt2_propt() { } -/*******************************************************************\ - -Function: smt2_propt::finalize - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void smt2_propt::finalize() { out << "\n"; @@ -95,18 +59,6 @@ void smt2_propt::finalize() out << "; end of SMT2 file" << "\n"; } -/*******************************************************************\ - -Function: smt2_propt::land - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - literalt smt2_propt::land(const bvt &bv) { out << "\n"; @@ -124,18 +76,6 @@ literalt smt2_propt::land(const bvt &bv) return l; } -/*******************************************************************\ - -Function: smt2_propt::lor - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - literalt smt2_propt::lor(const bvt &bv) { out << "\n"; @@ -153,18 +93,6 @@ literalt smt2_propt::lor(const bvt &bv) return l; } -/*******************************************************************\ - -Function: smt2_propt::lxor - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - literalt smt2_propt::lxor(const bvt &bv) { if(bv.empty()) @@ -187,18 +115,6 @@ literalt smt2_propt::lxor(const bvt &bv) return l; } -/*******************************************************************\ - -Function: smt2_propt::land - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - literalt smt2_propt::land(literalt a, literalt b) { if(a==const_literal(true)) @@ -225,18 +141,6 @@ literalt smt2_propt::land(literalt a, literalt b) return l; } -/*******************************************************************\ - -Function: smt2_propt::lor - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - literalt smt2_propt::lor(literalt a, literalt b) { if(a==const_literal(false)) @@ -263,18 +167,6 @@ literalt smt2_propt::lor(literalt a, literalt b) return l; } -/*******************************************************************\ - -Function: smt2_propt::lxor - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - literalt smt2_propt::lxor(literalt a, literalt b) { if(a==const_literal(false)) @@ -299,86 +191,26 @@ literalt smt2_propt::lxor(literalt a, literalt b) return l; } -/*******************************************************************\ - -Function: smt2_propt::lnand - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - literalt smt2_propt::lnand(literalt a, literalt b) { return !land(a, b); } -/*******************************************************************\ - -Function: smt2_propt::lnor - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - literalt smt2_propt::lnor(literalt a, literalt b) { return !lor(a, b); } -/*******************************************************************\ - -Function: smt2_propt::lequal - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - literalt smt2_propt::lequal(literalt a, literalt b) { return !lxor(a, b); } -/*******************************************************************\ - -Function: smt2_propt::limplies - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - literalt smt2_propt::limplies(literalt a, literalt b) { return lor(!a, b); } -/*******************************************************************\ - -Function: smt2_propt::lselect - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - literalt smt2_propt::lselect(literalt a, literalt b, literalt c) { if(a==const_literal(true)) @@ -409,18 +241,6 @@ literalt smt2_propt::lselect(literalt a, literalt b, literalt c) return l; } -/*******************************************************************\ - -Function: smt2_propt::new_variable - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - literalt smt2_propt::new_variable() { literalt l; @@ -432,18 +252,6 @@ literalt smt2_propt::new_variable() return l; } -/*******************************************************************\ - -Function: smt2_propt::define_new_variable - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - literalt smt2_propt::define_new_variable() { literalt l; @@ -457,18 +265,6 @@ literalt smt2_propt::define_new_variable() return l; } -/*******************************************************************\ - -Function: smt2_propt::lcnf - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void smt2_propt::lcnf(const bvt &bv) { out << "\n"; @@ -492,18 +288,6 @@ void smt2_propt::lcnf(const bvt &bv) out << ")" << "\n"; } -/*******************************************************************\ - -Function: smt2_propt::smt2_literal - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string smt2_propt::smt2_literal(literalt l) { if(l==const_literal(false)) @@ -521,18 +305,6 @@ std::string smt2_propt::smt2_literal(literalt l) return v; } -/*******************************************************************\ - -Function: smt2_propt::l_get - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - tvt smt2_propt::l_get(literalt literal) const { if(literal.is_true()) @@ -547,18 +319,6 @@ tvt smt2_propt::l_get(literalt literal) const return literal.sign()?!r:r; } -/*******************************************************************\ - -Function: smt2_propt::set_assignment - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void smt2_propt::set_assignment(literalt literal, bool value) { if(literal.is_true() || literal.is_false()) @@ -569,18 +329,6 @@ void smt2_propt::set_assignment(literalt literal, bool value) assignment[v]=tvt(value); } -/*******************************************************************\ - -Function: smt2_propt::prop_solve - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - propt::resultt smt2_propt::prop_solve() { return P_ERROR; diff --git a/src/symex/path_search.cpp b/src/symex/path_search.cpp index 8d8e684c2cb..d90ffcbd49e 100644 --- a/src/symex/path_search.cpp +++ b/src/symex/path_search.cpp @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Path-based Symbolic Execution + #include #include @@ -17,18 +20,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "path_search.h" -/*******************************************************************\ - -Function: path_searcht::operator() - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - path_searcht::resultt path_searcht::operator()( const goto_functionst &goto_functions) { @@ -159,18 +150,6 @@ path_searcht::resultt path_searcht::operator()( return number_of_failed_properties==0?resultt::SAFE:resultt::UNSAFE; } -/*******************************************************************\ - -Function: path_searcht::report_statistics - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void path_searcht::report_statistics() { std::size_t number_of_visited_locations=0; @@ -208,18 +187,6 @@ void path_searcht::report_statistics() << sat_time << "s SAT" << messaget::eom; } -/*******************************************************************\ - -Function: path_searcht::pick_state - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void path_searcht::pick_state() { switch(search_heuristic) @@ -240,18 +207,6 @@ void path_searcht::pick_state() } } -/*******************************************************************\ - -Function: path_searcht::do_show_vcc - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void path_searcht::do_show_vcc(statet &state) { // keep statistics @@ -304,18 +259,7 @@ void path_searcht::do_show_vcc(statet &state) out << eom; } -/*******************************************************************\ - -Function: path_searcht::drop_state - - Inputs: - - Outputs: - - Purpose: decide whether to drop a state - -\*******************************************************************/ - +/// decide whether to drop a state bool path_searcht::drop_state(const statet &state) { goto_programt::const_targett pc=state.get_instruction(); @@ -367,18 +311,6 @@ bool path_searcht::drop_state(const statet &state) return false; } -/*******************************************************************\ - -Function: path_searcht::check_assertion - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void path_searcht::check_assertion(statet &state) { // keep statistics @@ -426,18 +358,6 @@ void path_searcht::check_assertion(statet &state) sat_time+=current_time()-sat_start_time; } -/*******************************************************************\ - -Function: path_searcht::is_feasible - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool path_searcht::is_feasible(statet &state) { status() << "Feasibility check" << eom; @@ -458,18 +378,6 @@ bool path_searcht::is_feasible(statet &state) return result; } -/*******************************************************************\ - -Function: path_searcht::initialize_property_map - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void path_searcht::initialize_property_map( const goto_functionst &goto_functions) { diff --git a/src/symex/path_search.h b/src/symex/path_search.h index 49fc621b84e..ca570819cc8 100644 --- a/src/symex/path_search.h +++ b/src/symex/path_search.h @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Path-based Symbolic Execution + #ifndef CPROVER_SYMEX_PATH_SEARCH_H #define CPROVER_SYMEX_PATH_SEARCH_H diff --git a/src/symex/symex_cover.cpp b/src/symex/symex_cover.cpp index cb0b81254c4..50c6a549885 100644 --- a/src/symex/symex_cover.cpp +++ b/src/symex/symex_cover.cpp @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Symex Test Suite Generation + #include #include @@ -16,18 +19,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "symex_parse_options.h" -/*******************************************************************\ - -Function: symex_parse_optionst::get_test - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string symex_parse_optionst::get_test(const goto_tracet &goto_trace) { bool first=true; @@ -52,18 +43,6 @@ std::string symex_parse_optionst::get_test(const goto_tracet &goto_trace) return test; } -/*******************************************************************\ - -Function: symex_parse_optionst::report_cover - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void symex_parse_optionst::report_cover( const path_searcht::property_mapt &property_map) { diff --git a/src/symex/symex_main.cpp b/src/symex/symex_main.cpp index 9407efd6c28..2407aad561c 100644 --- a/src/symex/symex_main.cpp +++ b/src/symex/symex_main.cpp @@ -6,22 +6,13 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Symex Main Module + #include #include "symex_parse_options.h" -/*******************************************************************\ - -Function: main - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - #ifdef _MSC_VER int wmain(int argc, const wchar_t **argv_wide) { diff --git a/src/symex/symex_parse_options.cpp b/src/symex/symex_parse_options.cpp index c7b284383c7..6802eb36ef6 100644 --- a/src/symex/symex_parse_options.cpp +++ b/src/symex/symex_parse_options.cpp @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Symex Command Line Options Processing + #include #include #include @@ -51,18 +54,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "path_search.h" #include "symex_parse_options.h" -/*******************************************************************\ - -Function: symex_parse_optionst::symex_parse_optionst - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - symex_parse_optionst::symex_parse_optionst(int argc, const char **argv): parse_options_baset(SYMEX_OPTIONS, argc, argv), language_uit(cmdline, ui_message_handler), @@ -70,18 +61,6 @@ symex_parse_optionst::symex_parse_optionst(int argc, const char **argv): { } -/*******************************************************************\ - -Function: symex_parse_optionst::eval_verbosity - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void symex_parse_optionst::eval_verbosity() { // this is our default verbosity @@ -99,18 +78,6 @@ void symex_parse_optionst::eval_verbosity() ui_message_handler.set_verbosity(v); } -/*******************************************************************\ - -Function: symex_parse_optionst::get_command_line_options - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void symex_parse_optionst::get_command_line_options(optionst &options) { if(config.set(cmdline)) @@ -145,18 +112,7 @@ void symex_parse_optionst::get_command_line_options(optionst &options) options.set_option("error-label", cmdline.get_values("error-label")); } -/*******************************************************************\ - -Function: symex_parse_optionst::doit - - Inputs: - - Outputs: - - Purpose: invoke main modules - -\*******************************************************************/ - +/// invoke main modules int symex_parse_optionst::doit() { if(cmdline.isset("version")) @@ -296,18 +252,6 @@ int symex_parse_optionst::doit() #endif } -/*******************************************************************\ - -Function: symex_parse_optionst::set_properties - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool symex_parse_optionst::set_properties() { try @@ -337,18 +281,6 @@ bool symex_parse_optionst::set_properties() return false; } -/*******************************************************************\ - -Function: symex_parse_optionst::process_goto_program - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool symex_parse_optionst::process_goto_program(const optionst &options) { try @@ -463,18 +395,6 @@ bool symex_parse_optionst::process_goto_program(const optionst &options) return false; } -/*******************************************************************\ - -Function: symex_parse_optionst::report_properties - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void symex_parse_optionst::report_properties( const path_searcht::property_mapt &property_map) { @@ -542,18 +462,6 @@ void symex_parse_optionst::report_properties( } } -/*******************************************************************\ - -Function: symex_parse_optionst::report_success - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void symex_parse_optionst::report_success() { result() << "VERIFICATION SUCCESSFUL" << eom; @@ -577,18 +485,6 @@ void symex_parse_optionst::report_success() } } -/*******************************************************************\ - -Function: symex_parse_optionst::show_counterexample - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void symex_parse_optionst::show_counterexample( const goto_tracet &error_trace) { @@ -614,18 +510,6 @@ void symex_parse_optionst::show_counterexample( } } -/*******************************************************************\ - -Function: symex_parse_optionst::report_failure - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void symex_parse_optionst::report_failure() { result() << "VERIFICATION FAILED" << eom; @@ -649,18 +533,7 @@ void symex_parse_optionst::report_failure() } } -/*******************************************************************\ - -Function: symex_parse_optionst::help - - Inputs: - - Outputs: - - Purpose: display command line help - -\*******************************************************************/ - +/// display command line help void symex_parse_optionst::help() { std::cout << diff --git a/src/symex/symex_parse_options.h b/src/symex/symex_parse_options.h index 4a149e2147f..b4fc6fe2e1c 100644 --- a/src/symex/symex_parse_options.h +++ b/src/symex/symex_parse_options.h @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Command Line Parsing + #ifndef CPROVER_SYMEX_SYMEX_PARSE_OPTIONS_H #define CPROVER_SYMEX_SYMEX_PARSE_OPTIONS_H diff --git a/src/util/arith_tools.cpp b/src/util/arith_tools.cpp index 37e96ec8ef8..8cc9367612e 100644 --- a/src/util/arith_tools.cpp +++ b/src/util/arith_tools.cpp @@ -15,18 +15,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "arith_tools.h" -/*******************************************************************\ - -Function: to_integer - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool to_integer(const exprt &expr, mp_integer &int_value) { if(!expr.is_constant()) @@ -34,18 +22,6 @@ bool to_integer(const exprt &expr, mp_integer &int_value) return to_integer(to_constant_expr(expr), int_value); } -/*******************************************************************\ - -Function: to_integer - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool to_integer(const constant_exprt &expr, mp_integer &int_value) { const irep_idt &value=expr.get_value(); @@ -113,18 +89,9 @@ bool to_integer(const constant_exprt &expr, mp_integer &int_value) return true; } -/*******************************************************************\ - -Function: to_unsigned_integer - - Inputs: a constant expression and a reference to an unsigned int - - Outputs: an error flag - - Purpose: convert a positive integer expression to an unsigned int - -\*******************************************************************/ - +/// convert a positive integer expression to an unsigned int +/// \par parameters: a constant expression and a reference to an unsigned int +/// \return an error flag bool to_unsigned_integer(const constant_exprt &expr, unsigned &uint_value) { mp_integer i; @@ -139,18 +106,6 @@ bool to_unsigned_integer(const constant_exprt &expr, unsigned &uint_value) } } -/*******************************************************************\ - -Function: from_integer - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - constant_exprt from_integer( const mp_integer &int_value, const typet &type) @@ -251,18 +206,7 @@ constant_exprt from_integer( } } -/*******************************************************************\ - -Function: address_bits - - Inputs: - - Outputs: - - Purpose: ceil(log2(size)) - -\*******************************************************************/ - +/// ceil(log2(size)) mp_integer address_bits(const mp_integer &size) { mp_integer result, x=2; @@ -272,18 +216,9 @@ mp_integer address_bits(const mp_integer &size) return result; } -/*******************************************************************\ - -Function: power - - Inputs: Two mp_integers, base and exponent - - Outputs: One mp_integer with the value base^{exponent} - - Purpose: A multi-precision implementation of the power operator. - -\*******************************************************************/ - +/// A multi-precision implementation of the power operator. +/// \par parameters: Two mp_integers, base and exponent +/// \return One mp_integer with the value base^{exponent} mp_integer power(const mp_integer &base, const mp_integer &exponent) { @@ -335,36 +270,12 @@ mp_integer power(const mp_integer &base, return result; } -/*******************************************************************\ - -Function: mp_min - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void mp_min(mp_integer &a, const mp_integer &b) { if(ba) diff --git a/src/util/array_name.cpp b/src/util/array_name.cpp index d29d60f77fc..cd0c22dac61 100644 --- a/src/util/array_name.cpp +++ b/src/util/array_name.cpp @@ -6,24 +6,15 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Misc Utilities + #include "array_name.h" #include "expr.h" #include "namespace.h" #include "symbol.h" #include "ssa_expr.h" -/*******************************************************************\ - -Function: goto_checkt::array_name - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string array_name( const namespacet &ns, const exprt &expr) diff --git a/src/util/array_name.h b/src/util/array_name.h index 8c797668a65..e3aee4e57a3 100644 --- a/src/util/array_name.h +++ b/src/util/array_name.h @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Misc Utilities + #ifndef CPROVER_UTIL_ARRAY_NAME_H #define CPROVER_UTIL_ARRAY_NAME_H diff --git a/src/util/base_type.cpp b/src/util/base_type.cpp index 340d13116a0..2fc72ca6881 100644 --- a/src/util/base_type.cpp +++ b/src/util/base_type.cpp @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Base Type Computation + #include #include @@ -14,18 +17,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "namespace.h" #include "symbol.h" -/*******************************************************************\ - -Function: base_type_rec - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void base_type_rec( typet &type, const namespacet &ns, std::set &symb) { @@ -84,36 +75,12 @@ void base_type_rec( } } -/*******************************************************************\ - -Function: base_type - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void base_type(typet &type, const namespacet &ns) { std::set symb; base_type_rec(type, ns, symb); } -/*******************************************************************\ - -Function: base_type - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void base_type(exprt &expr, const namespacet &ns) { base_type(expr.type(), ns); @@ -122,18 +89,6 @@ void base_type(exprt &expr, const namespacet &ns) base_type(*it, ns); } -/*******************************************************************\ - -Function: base_type_eqt::base_type_eq_rec - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool base_type_eqt::base_type_eq_rec( const typet &type1, const typet &type2) @@ -282,18 +237,6 @@ bool base_type_eqt::base_type_eq_rec( return tmp1==tmp2; } -/*******************************************************************\ - -Function: base_type_eqt::base_type_eq_rec - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool base_type_eqt::base_type_eq_rec( const exprt &expr1, const exprt &expr2) @@ -323,18 +266,6 @@ bool base_type_eqt::base_type_eq_rec( return true; } -/*******************************************************************\ - -Function: base_type_eq - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool base_type_eq( const typet &type1, const typet &type2, @@ -344,18 +275,6 @@ bool base_type_eq( return base_type_eq.base_type_eq(type1, type2); } -/*******************************************************************\ - -Function: base_type_eq - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool base_type_eq( const exprt &expr1, const exprt &expr2, diff --git a/src/util/base_type.h b/src/util/base_type.h index 41e2fe6df4f..833fd855cca 100644 --- a/src/util/base_type.h +++ b/src/util/base_type.h @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Base Type Computation + #ifndef CPROVER_UTIL_BASE_TYPE_H #define CPROVER_UTIL_BASE_TYPE_H @@ -26,14 +29,6 @@ bool base_type_eq( const exprt &expr2, const namespacet &ns); -/*******************************************************************\ - - Class: base_type_eqt - - Purpose: - -\*******************************************************************/ - class base_type_eqt { public: diff --git a/src/util/bv_arithmetic.cpp b/src/util/bv_arithmetic.cpp index 4e077ad0a1e..6df5fe6c187 100644 --- a/src/util/bv_arithmetic.cpp +++ b/src/util/bv_arithmetic.cpp @@ -15,18 +15,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "std_expr.h" #include "bv_arithmetic.h" -/*******************************************************************\ - -Function: bv_spect::to_type - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - typet bv_spect::to_type() const { if(is_signed) @@ -34,54 +22,18 @@ typet bv_spect::to_type() const return unsignedbv_typet(width); } -/*******************************************************************\ - -Function: bv_spect::max_value - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - mp_integer bv_spect::max_value() const { return is_signed?power(2, width-1)-1: power(2, width)-1; } -/*******************************************************************\ - -Function: bv_spect::min_value - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - mp_integer bv_spect::min_value() const { return is_signed?-power(2, width-1): 0; } -/*******************************************************************\ - -Function: bv_spect::from_type - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void bv_spect::from_type(const typet &type) { if(type.id()==ID_unsignedbv) @@ -94,35 +46,11 @@ void bv_spect::from_type(const typet &type) width=unsafe_string2unsigned(type.get_string(ID_width)); } -/*******************************************************************\ - -Function: bv_arithmetict::print - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void bv_arithmetict::print(std::ostream &out) const { out << to_ansi_c_string(); } -/*******************************************************************\ - -Function: bv_arithmetict::format - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string bv_arithmetict::format(const format_spect &format_spec) const { std::string result; @@ -132,36 +60,12 @@ std::string bv_arithmetict::format(const format_spect &format_spec) const return result; } -/*******************************************************************\ - -Function: bv_arithmetict::from_integer - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void bv_arithmetict::from_integer(const mp_integer &i) { value=i; adjust(); } -/*******************************************************************\ - -Function: bv_arithmetict::adjust - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void bv_arithmetict::adjust() { mp_integer p=power(2, spec.width); @@ -171,18 +75,6 @@ void bv_arithmetict::adjust() value-=p; } -/*******************************************************************\ - -Function: bv_arithmetict::pack - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - mp_integer bv_arithmetict::pack() const { if(value>=0) @@ -190,18 +82,6 @@ mp_integer bv_arithmetict::pack() const return value+power(2, spec.width); } -/*******************************************************************\ - -Function: bv_arithmetict::to_expr - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - exprt bv_arithmetict::to_expr() const { constant_exprt result(spec.to_type()); @@ -209,18 +89,6 @@ exprt bv_arithmetict::to_expr() const return result; } -/*******************************************************************\ - -Function: operator /= - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bv_arithmetict &bv_arithmetict::operator/=(const bv_arithmetict &other) { assert(other.spec==spec); @@ -233,18 +101,6 @@ bv_arithmetict &bv_arithmetict::operator/=(const bv_arithmetict &other) return *this; } -/*******************************************************************\ - -Function: operator *= - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bv_arithmetict &bv_arithmetict::operator*=(const bv_arithmetict &other) { assert(other.spec==spec); @@ -255,18 +111,6 @@ bv_arithmetict &bv_arithmetict::operator*=(const bv_arithmetict &other) return *this; } -/*******************************************************************\ - -Function: operator += - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bv_arithmetict &bv_arithmetict::operator+=(const bv_arithmetict &other) { assert(other.spec==spec); @@ -277,18 +121,6 @@ bv_arithmetict &bv_arithmetict::operator+=(const bv_arithmetict &other) return *this; } -/*******************************************************************\ - -Function: operator -= - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bv_arithmetict &bv_arithmetict::operator -= (const bv_arithmetict &other) { assert(other.spec==spec); @@ -299,18 +131,6 @@ bv_arithmetict &bv_arithmetict::operator -= (const bv_arithmetict &other) return *this; } -/*******************************************************************\ - -Function: operator %= - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bv_arithmetict &bv_arithmetict::operator%=(const bv_arithmetict &other) { assert(other.spec==spec); @@ -321,155 +141,47 @@ bv_arithmetict &bv_arithmetict::operator%=(const bv_arithmetict &other) return *this; } -/*******************************************************************\ - -Function: operator < - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool bv_arithmetict::operator<(const bv_arithmetict &other) { return value - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool bv_arithmetict::operator>(const bv_arithmetict &other) { return value>other.value; } -/*******************************************************************\ - -Function: bv_arithmetict::operator>= - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool bv_arithmetict::operator>=(const bv_arithmetict &other) { return value>=other.value; } -/*******************************************************************\ - -Function: bv_arithmetict::operator== - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool bv_arithmetict::operator==(const bv_arithmetict &other) { return value==other.value; } -/*******************************************************************\ - -Function: bv_arithmetict::operator== - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool bv_arithmetict::operator==(int i) { return value==i; } -/*******************************************************************\ - -Function: bv_arithmetict::operator!= - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool bv_arithmetict::operator!=(const bv_arithmetict &other) { return value!=other.value; } -/*******************************************************************\ - -Function: bv_arithmetict::change_spec - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void bv_arithmetict::change_spec(const bv_spect &dest_spec) { spec=dest_spec; adjust(); } -/*******************************************************************\ - -Function: bv_arithmetict::from_expr - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void bv_arithmetict::from_expr(const exprt &expr) { assert(expr.is_constant()); diff --git a/src/util/byte_operators.cpp b/src/util/byte_operators.cpp index 46e7d3f218e..6e73ff27731 100644 --- a/src/util/byte_operators.cpp +++ b/src/util/byte_operators.cpp @@ -11,18 +11,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "byte_operators.h" #include "config.h" -/*******************************************************************\ - -Function: byte_extract_id - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - irep_idt byte_extract_id() { switch(config.ansi_c.endianness) @@ -38,18 +26,6 @@ irep_idt byte_extract_id() } } -/*******************************************************************\ - -Function: byte_update_id - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - irep_idt byte_update_id() { switch(config.ansi_c.endianness) diff --git a/src/util/cmdline.cpp b/src/util/cmdline.cpp index 56d6a7a1a6c..7ac516ab36f 100644 --- a/src/util/cmdline.cpp +++ b/src/util/cmdline.cpp @@ -12,69 +12,21 @@ Author: Daniel Kroening, kroening@kroening.com #include "cmdline.h" -/*******************************************************************\ - -Function: cmdlinet::cmdlinet - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - cmdlinet::cmdlinet() { } -/*******************************************************************\ - -Function: cmdlinet::~cmdlinet - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - cmdlinet::~cmdlinet() { clear(); } -/*******************************************************************\ - -Function: cmdlinet::clear - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void cmdlinet::clear() { options.clear(); args.clear(); } -/*******************************************************************\ - -Function: cmdlinet::isset - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool cmdlinet::isset(char option) const { int i=getoptnr(option); @@ -83,18 +35,6 @@ bool cmdlinet::isset(char option) const return options[i].isset; } -/*******************************************************************\ - -Function: cmdlinet::isset - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool cmdlinet::isset(const char *option) const { int i=getoptnr(option); @@ -103,18 +43,6 @@ bool cmdlinet::isset(const char *option) const return options[i].isset; } -/*******************************************************************\ - -Function: cmdlinet::get_value - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string cmdlinet::get_value(char option) const { int i=getoptnr(option); @@ -125,18 +53,6 @@ std::string cmdlinet::get_value(char option) const return options[i].values.front(); } -/*******************************************************************\ - -Function: cmdlinet::set - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void cmdlinet::set(const std::string &option) { int i=getoptnr(option); @@ -145,18 +61,6 @@ void cmdlinet::set(const std::string &option) options[i].isset=true; } -/*******************************************************************\ - -Function: cmdlinet::set - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void cmdlinet::set(const std::string &option, const std::string &value) { int i=getoptnr(option); @@ -166,18 +70,6 @@ void cmdlinet::set(const std::string &option, const std::string &value) options[i].values.push_back(value); } -/*******************************************************************\ - -Function: cmdlinet::get_values - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - const std::list &cmdlinet::get_values(char option) const { int i=getoptnr(option); @@ -185,18 +77,6 @@ const std::list &cmdlinet::get_values(char option) const return options[i].values; } -/*******************************************************************\ - -Function: cmdlinet::get_value - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string cmdlinet::get_value(const char *option) const { int i=getoptnr(option); @@ -207,18 +87,6 @@ std::string cmdlinet::get_value(const char *option) const return options[i].values.front(); } -/*******************************************************************\ - -Function: cmdlinet::get_values - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - const std::list &cmdlinet::get_values( const std::string &option) const { @@ -227,18 +95,6 @@ const std::list &cmdlinet::get_values( return options[i].values; } -/*******************************************************************\ - -Function: cmdlinet::getoptnr - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - int cmdlinet::getoptnr(char option) const { for(unsigned i=0; i #include "decision_procedure.h" -/*******************************************************************\ - -Function: decision_proceduret::in_core - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool decision_proceduret::in_core(const exprt &expr) { assert(false); diff --git a/src/util/decision_procedure.h b/src/util/decision_procedure.h index a3c1cf05710..65caffab17e 100644 --- a/src/util/decision_procedure.h +++ b/src/util/decision_procedure.h @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Decision Procedure Interface + #ifndef CPROVER_UTIL_DECISION_PROCEDURE_H #define CPROVER_UTIL_DECISION_PROCEDURE_H diff --git a/src/util/dstring.cpp b/src/util/dstring.cpp index 4fa9769be23..18602127ea1 100644 --- a/src/util/dstring.cpp +++ b/src/util/dstring.cpp @@ -6,4 +6,7 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Container for C-Strings + #include "dstring.h" diff --git a/src/util/dstring.h b/src/util/dstring.h index bda6dece8e6..ae25a395071 100644 --- a/src/util/dstring.h +++ b/src/util/dstring.h @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Container for C-Strings + #ifndef CPROVER_UTIL_DSTRING_H #define CPROVER_UTIL_DSTRING_H diff --git a/src/util/endianness_map.cpp b/src/util/endianness_map.cpp index d030df0c75e..0813541962d 100644 --- a/src/util/endianness_map.cpp +++ b/src/util/endianness_map.cpp @@ -15,18 +15,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "endianness_map.h" #include "namespace.h" -/*******************************************************************\ - -Function: endianness_mapt::output - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void endianness_mapt::output(std::ostream &out) const { for(std::vector::const_iterator it=map.begin(); @@ -39,18 +27,6 @@ void endianness_mapt::output(std::ostream &out) const } } -/*******************************************************************\ - -Function: endianness_mapt::build - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void endianness_mapt::build(const typet &src, bool little_endian) { if(little_endian) @@ -59,18 +35,6 @@ void endianness_mapt::build(const typet &src, bool little_endian) build_big_endian(src); } -/*******************************************************************\ - -Function: endianness_mapt::build_little_endian - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void endianness_mapt::build_little_endian(const typet &src) { mp_integer s=pointer_offset_bits(src, ns); // error is -1 @@ -84,18 +48,6 @@ void endianness_mapt::build_little_endian(const typet &src) map.push_back(i); } -/*******************************************************************\ - -Function: endianness_mapt::build_big_endian - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void endianness_mapt::build_big_endian(const typet &src) { if(src.id()==ID_symbol) diff --git a/src/util/expr.cpp b/src/util/expr.cpp index 3b480e4bfe2..f6b4b0cad4c 100644 --- a/src/util/expr.cpp +++ b/src/util/expr.cpp @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Expression Representation + #include #include @@ -20,18 +23,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "arith_tools.h" #include "std_expr.h" -/*******************************************************************\ - -Function: exprt::move_to_operands - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void exprt::move_to_operands(exprt &expr) { operandst &op=operands(); @@ -39,18 +30,6 @@ void exprt::move_to_operands(exprt &expr) op.back().swap(expr); } -/*******************************************************************\ - -Function: exprt::move_to_operands - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void exprt::move_to_operands(exprt &e1, exprt &e2) { operandst &op=operands(); @@ -63,18 +42,6 @@ void exprt::move_to_operands(exprt &e1, exprt &e2) op.back().swap(e2); } -/*******************************************************************\ - -Function: exprt::move_to_operands - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void exprt::move_to_operands(exprt &e1, exprt &e2, exprt &e3) { operandst &op=operands(); @@ -89,35 +56,11 @@ void exprt::move_to_operands(exprt &e1, exprt &e2, exprt &e3) op.back().swap(e3); } -/*******************************************************************\ - -Function: exprt::copy_to_operands - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void exprt::copy_to_operands(const exprt &expr) { operands().push_back(expr); } -/*******************************************************************\ - -Function: exprt::copy_to_operands - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void exprt::copy_to_operands(const exprt &e1, const exprt &e2) { operandst &op=operands(); @@ -128,18 +71,6 @@ void exprt::copy_to_operands(const exprt &e1, const exprt &e2) op.push_back(e2); } -/*******************************************************************\ - -Function: exprt::copy_to_operands - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void exprt::copy_to_operands( const exprt &e1, const exprt &e2, @@ -154,18 +85,6 @@ void exprt::copy_to_operands( op.push_back(e3); } -/*******************************************************************\ - -Function: exprt::make_typecast - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void exprt::make_typecast(const typet &_type) { exprt new_expr(ID_typecast); @@ -176,18 +95,6 @@ void exprt::make_typecast(const typet &_type) swap(new_expr); } -/*******************************************************************\ - -Function: exprt::make_not - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void exprt::make_not() { if(is_true()) @@ -216,35 +123,11 @@ void exprt::make_not() swap(new_expr); } -/*******************************************************************\ - -Function: exprt::is_constant - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool exprt::is_constant() const { return id()==ID_constant; } -/*******************************************************************\ - -Function: exprt::is_true - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool exprt::is_true() const { return is_constant() && @@ -252,18 +135,6 @@ bool exprt::is_true() const get(ID_value)!=ID_false; } -/*******************************************************************\ - -Function: exprt::is_false - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool exprt::is_false() const { return is_constant() && @@ -271,72 +142,24 @@ bool exprt::is_false() const get(ID_value)==ID_false; } -/*******************************************************************\ - -Function: exprt::make_bool - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void exprt::make_bool(bool value) { *this=exprt(ID_constant, typet(ID_bool)); set(ID_value, value?ID_true:ID_false); } -/*******************************************************************\ - -Function: exprt::make_true - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void exprt::make_true() { *this=exprt(ID_constant, typet(ID_bool)); set(ID_value, ID_true); } -/*******************************************************************\ - -Function: exprt::make_false - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void exprt::make_false() { *this=exprt(ID_constant, typet(ID_bool)); set(ID_value, ID_false); } -/*******************************************************************\ - -Function: exprt::negate - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void exprt::negate() { const irep_idt &type_id=type().id(); @@ -402,35 +225,11 @@ void exprt::negate() } } -/*******************************************************************\ - -Function: exprt::is_boolean - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool exprt::is_boolean() const { return type().id()==ID_bool; } -/*******************************************************************\ - -Function: exprt::is_zero - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool exprt::is_zero() const { if(is_constant()) @@ -475,18 +274,6 @@ bool exprt::is_zero() const return false; } -/*******************************************************************\ - -Function: exprt::is_one - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool exprt::is_one() const { if(is_constant()) @@ -528,18 +315,6 @@ bool exprt::is_one() const return false; } -/*******************************************************************\ - -Function: exprt::sum - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool exprt::sum(const exprt &expr) { if(!is_constant() || !expr.is_constant()) @@ -593,18 +368,6 @@ bool exprt::sum(const exprt &expr) return true; } -/*******************************************************************\ - -Function: exprt::mul - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool exprt::mul(const exprt &expr) { if(!is_constant() || !expr.is_constant()) @@ -658,18 +421,6 @@ bool exprt::mul(const exprt &expr) return true; } -/*******************************************************************\ - -Function: exprt::subtract - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool exprt::subtract(const exprt &expr) { if(!is_constant() || !expr.is_constant()) @@ -709,18 +460,6 @@ bool exprt::subtract(const exprt &expr) return true; } -/*******************************************************************\ - -Function: exprt::find_source_location - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - const source_locationt &exprt::find_source_location() const { const source_locationt &l=source_location(); @@ -738,18 +477,6 @@ const source_locationt &exprt::find_source_location() const return static_cast(get_nil_irep()); } -/*******************************************************************\ - -Function: exprt::visit - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void exprt::visit(expr_visitort &visitor) { std::stack stack; @@ -768,18 +495,6 @@ void exprt::visit(expr_visitort &visitor) } } -/*******************************************************************\ - -Function: exprt::visit - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void exprt::visit(const_expr_visitort &visitor) const { std::stack stack; diff --git a/src/util/expr_util.cpp b/src/util/expr_util.cpp index d5a28e4f5fa..18bd849fcf7 100644 --- a/src/util/expr_util.cpp +++ b/src/util/expr_util.cpp @@ -15,18 +15,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "namespace.h" #include "arith_tools.h" -/*******************************************************************\ - -Function: make_next_state - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void make_next_state(exprt &expr) { Forall_operands(it, expr) @@ -36,18 +24,6 @@ void make_next_state(exprt &expr) expr.id(ID_next_symbol); } -/*******************************************************************\ - -Function: make_binary - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - exprt make_binary(const exprt &expr) { const exprt::operandst &operands=expr.operands(); @@ -79,18 +55,6 @@ exprt make_binary(const exprt &expr) return previous; } -/*******************************************************************\ - -Function: make_with_expr - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - with_exprt make_with_expr(const update_exprt &src) { const exprt::operandst &designator=src.designator(); @@ -122,18 +86,6 @@ with_exprt make_with_expr(const update_exprt &src) return result; } -/*******************************************************************\ - -Function: is_not_zero - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - exprt is_not_zero( const exprt &src, const namespacet &ns) @@ -163,18 +115,6 @@ exprt is_not_zero( return comparison; } -/*******************************************************************\ - -Function: boolean_negate - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - exprt boolean_negate(const exprt &src) { if(src.id()==ID_not && src.operands().size()==1) @@ -187,18 +127,6 @@ exprt boolean_negate(const exprt &src) return not_exprt(src); } -/*******************************************************************\ - -Function: has_subexpr - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool has_subexpr(const exprt &src, const irep_idt &id) { if(src.id()==id) @@ -211,18 +139,6 @@ bool has_subexpr(const exprt &src, const irep_idt &id) return false; } -/*******************************************************************\ - -Function: lift_if - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - if_exprt lift_if(const exprt &src, std::size_t operand_number) { assert(operand_number #if defined(__linux__) || \ @@ -37,18 +40,7 @@ Date: January 2012 #include "file_util.h" -/*******************************************************************\ - -Function: get_current_working_directory - - Inputs: none - - Outputs: current working directory - - Purpose: - -\*******************************************************************/ - +/// \return current working directory std::string get_current_working_directory() { unsigned bsize=50; @@ -71,18 +63,7 @@ std::string get_current_working_directory() return working_directory; } -/*******************************************************************\ - -Function: delete_directory - - Inputs: path - - Outputs: - - Purpose: deletes all files in 'path' and then the directory itself - -\*******************************************************************/ - +/// deletes all files in 'path' and then the directory itself #ifdef _WIN32 void delete_directory_utf16(const std::wstring &path) @@ -142,19 +123,8 @@ void delete_directory(const std::string &path) #endif } -/*******************************************************************\ - -Function: concat_dir_file - - Inputs: directory name and file name - - Outputs: concatenation of directory and file, if the file path is - relative - - Purpose: - -\*******************************************************************/ - +/// \par parameters: directory name and file name +/// \return concatenation of directory and file, if the file path is relative std::string concat_dir_file( const std::string &directory, const std::string &file_name) diff --git a/src/util/find_macros.cpp b/src/util/find_macros.cpp index 8e2e249ada6..01c9a3547b5 100644 --- a/src/util/find_macros.cpp +++ b/src/util/find_macros.cpp @@ -13,18 +13,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "namespace.h" #include "symbol.h" -/*******************************************************************\ - -Function: find_macros - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void find_macros( const exprt &src, const namespacet &ns, diff --git a/src/util/find_symbols.cpp b/src/util/find_symbols.cpp index b62ea77b368..bb60d29eedf 100644 --- a/src/util/find_symbols.cpp +++ b/src/util/find_symbols.cpp @@ -13,18 +13,6 @@ Author: Daniel Kroening, kroening@kroening.com enum class kindt { F_TYPE, F_TYPE_NON_PTR, F_EXPR, F_BOTH }; -/*******************************************************************\ - -Function: find_symbols - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void find_symbols( const exprt &src, find_symbols_sett &dest) @@ -32,18 +20,6 @@ void find_symbols( find_symbols(src, dest, true, true); } -/*******************************************************************\ - -Function: find_symbols - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void find_symbols( const exprt &src, find_symbols_sett &dest, @@ -60,18 +36,6 @@ void find_symbols( } } -/*******************************************************************\ - -Function: has_symbol - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool has_symbol( const exprt &src, const find_symbols_sett &symbols, @@ -91,18 +55,6 @@ bool has_symbol( return false; } -/*******************************************************************\ - -Function: has_symbol - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool has_symbol( const exprt &src, const find_symbols_sett &symbols) @@ -110,18 +62,6 @@ bool has_symbol( return has_symbol(src, symbols, true, true); } -/*******************************************************************\ - -Function: find_symbols - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void find_symbols( const exprt &src, std::set &dest) @@ -135,18 +75,6 @@ void find_symbols( } } -/*******************************************************************\ - -Function: find_symbols - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void find_symbols( const exprt &src, std::set &dest) @@ -160,18 +88,6 @@ void find_symbols( } } -/*******************************************************************\ - -Function: find_symbols - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void find_symbols(kindt kind, const typet &src, find_symbols_sett &dest); void find_symbols(kindt kind, const exprt &src, find_symbols_sett &dest) @@ -197,18 +113,6 @@ void find_symbols(kindt kind, const exprt &src, find_symbols_sett &dest) find_symbols(kind, static_cast(va_arg_type), dest); } -/*******************************************************************\ - -Function: find_symbols - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void find_symbols(kindt kind, const typet &src, find_symbols_sett &dest) { if(kind!=kindt::F_TYPE_NON_PTR || @@ -273,52 +177,16 @@ void find_symbols(kindt kind, const typet &src, find_symbols_sett &dest) } } -/*******************************************************************\ - -Function: find_type_symbols - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void find_type_symbols(const exprt &src, find_symbols_sett &dest) { find_symbols(kindt::F_TYPE, src, dest); } -/*******************************************************************\ - -Function: find_type_symbols - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void find_type_symbols(const typet &src, find_symbols_sett &dest) { find_symbols(kindt::F_TYPE, src, dest); } -/*******************************************************************\ - -Function: find_non_pointer_type_symbols - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void find_non_pointer_type_symbols( const exprt &src, find_symbols_sett &dest) @@ -326,18 +194,6 @@ void find_non_pointer_type_symbols( find_symbols(kindt::F_TYPE_NON_PTR, src, dest); } -/*******************************************************************\ - -Function: find_non_pointer_type_symbols - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void find_non_pointer_type_symbols( const typet &src, find_symbols_sett &dest) @@ -345,35 +201,11 @@ void find_non_pointer_type_symbols( find_symbols(kindt::F_TYPE_NON_PTR, src, dest); } -/*******************************************************************\ - -Function: find_type_and_expr_symbols - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void find_type_and_expr_symbols(const exprt &src, find_symbols_sett &dest) { find_symbols(kindt::F_BOTH, src, dest); } -/*******************************************************************\ - -Function: find_type_and_expr_symbols - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void find_type_and_expr_symbols(const typet &src, find_symbols_sett &dest) { find_symbols(kindt::F_BOTH, src, dest); diff --git a/src/util/fixedbv.cpp b/src/util/fixedbv.cpp index d1703d85ca9..b1635836d93 100644 --- a/src/util/fixedbv.cpp +++ b/src/util/fixedbv.cpp @@ -11,106 +11,34 @@ Author: Daniel Kroening, kroening@kroening.com #include "fixedbv.h" #include "arith_tools.h" -/*******************************************************************\ - -Function: fixedbv_spect::fixedbv_spect - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - fixedbv_spect::fixedbv_spect(const fixedbv_typet &type) { integer_bits=type.get_integer_bits(); width=type.get_width(); } -/*******************************************************************\ - -Function: fixedbvt::fixedbvt - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - fixedbvt::fixedbvt(const constant_exprt &expr) { from_expr(expr); } -/*******************************************************************\ - -Function: fixedbvt::from_expr - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void fixedbvt::from_expr(const constant_exprt &expr) { spec=fixedbv_spect(to_fixedbv_type(expr.type())); v=binary2integer(id2string(expr.get_value()), true); } -/*******************************************************************\ - -Function: fixedbvt::from_integer - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void fixedbvt::from_integer(const mp_integer &i) { v=i*power(2, spec.get_fraction_bits()); } -/*******************************************************************\ - -Function: fixedbvt::to_integer - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - mp_integer fixedbvt::to_integer() const { // this rounds to zero, i.e., we just divide return v/power(2, spec.get_fraction_bits()); } -/*******************************************************************\ - -Function: fixedbvt::to_expr - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - constant_exprt fixedbvt::to_expr() const { fixedbv_typet type; @@ -122,18 +50,6 @@ constant_exprt fixedbvt::to_expr() const return expr; } -/*******************************************************************\ - -Function: fixedbvt::round - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void fixedbvt::round(const fixedbv_spect &dest_spec) { std::size_t old_fraction_bits=spec.width-spec.integer_bits; @@ -167,35 +83,11 @@ void fixedbvt::round(const fixedbv_spect &dest_spec) spec=dest_spec; } -/*******************************************************************\ - -Function: fixedbvt::negate - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void fixedbvt::negate() { v=-v; } -/*******************************************************************\ - -Function: fixedbvt::operator* - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - fixedbvt &fixedbvt::operator*=(const fixedbvt &o) { v*=o.v; @@ -210,18 +102,6 @@ fixedbvt &fixedbvt::operator*=(const fixedbvt &o) return *this; } -/*******************************************************************\ - -Function: fixedbvt::operator/= - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - fixedbvt &fixedbvt::operator/=(const fixedbvt &o) { v*=power(2, o.spec.get_fraction_bits()); @@ -230,35 +110,11 @@ fixedbvt &fixedbvt::operator/=(const fixedbvt &o) return *this; } -/*******************************************************************\ - -Function: fixedbvt::operator== - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool fixedbvt::operator==(int i) const { return v==power(2, spec.get_fraction_bits())*i; } -/*******************************************************************\ - -Function: fixedbvt::format - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string fixedbvt::format( const format_spect &format_spec) const { diff --git a/src/util/format_constant.cpp b/src/util/format_constant.cpp index a63b1d01555..5175ce46c69 100644 --- a/src/util/format_constant.cpp +++ b/src/util/format_constant.cpp @@ -13,18 +13,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "expr.h" #include "std_expr.h" -/*******************************************************************\ - -Function: format_constantt::operator() - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string format_constantt::operator()(const exprt &expr) { if(expr.is_constant()) diff --git a/src/util/format_number_range.cpp b/src/util/format_number_range.cpp index cca3bbf154c..c3cc9d24b9c 100644 --- a/src/util/format_number_range.cpp +++ b/src/util/format_number_range.cpp @@ -6,24 +6,18 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Format vector of numbers into a compressed range + #include #include #include #include "format_number_range.h" -/*******************************************************************\ - -Function: format_number_range::operator() - - Inputs: vector of numbers - - Outputs: string of compressed number range representation - - Purpose: create shorter representation for output - -\*******************************************************************/ - +/// create shorter representation for output +/// \par parameters: vector of numbers +/// \return string of compressed number range representation std::string format_number_ranget::operator()(std::vector &numbers) { std::string number_range; diff --git a/src/util/format_number_range.h b/src/util/format_number_range.h index 7ff016e9c4d..493b82abc99 100644 --- a/src/util/format_number_range.h +++ b/src/util/format_number_range.h @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Format vector of numbers into a compressed range + #ifndef CPROVER_UTIL_FORMAT_NUMBER_RANGE_H #define CPROVER_UTIL_FORMAT_NUMBER_RANGE_H diff --git a/src/util/fresh_symbol.cpp b/src/util/fresh_symbol.cpp index fbe6f09b871..7fb9d7f286a 100644 --- a/src/util/fresh_symbol.cpp +++ b/src/util/fresh_symbol.cpp @@ -6,27 +6,19 @@ Author: Chris Smowton, chris.smowton@diffblue.com \*******************************************************************/ -#include "fresh_symbol.h" - -/*******************************************************************\ - -Function: get_fresh_aux_symbol - - Inputs: `type`: type of new symbol - `name_prefix`, `basename_prefix`: - new symbol will be named name_prefix::basename_prefix$num - unless name_prefix is empty, in which case the :: prefix - is omitted. - `source_location`: new symbol source loc - `symbol_mode`: new symbol mode - `symbol_table`: table to add the new symbol to +/// \file +/// Fresh auxiliary symbol creation - Outputs: - - Purpose: Installs a fresh-named symbol with the requested name pattern - -\*******************************************************************/ +#include "fresh_symbol.h" +/// Installs a fresh-named symbol with the requested name pattern +/// \par parameters: `type`: type of new symbol +/// `name_prefix`, `basename_prefix`: new symbol will be named +/// name_prefix::basename_prefix$num unless name_prefix is empty, in which +/// case the :: prefix is omitted. +/// `source_location`: new symbol source loc +/// `symbol_mode`: new symbol mode +/// `symbol_table`: table to add the new symbol to symbolt &get_fresh_aux_symbol( const typet &type, const std::string &name_prefix, diff --git a/src/util/fresh_symbol.h b/src/util/fresh_symbol.h index c3b2749cbe3..a176a16a551 100644 --- a/src/util/fresh_symbol.h +++ b/src/util/fresh_symbol.h @@ -6,6 +6,9 @@ Author: Chris Smowton, chris.smowton@diffblue.com \*******************************************************************/ +/// \file +/// Fresh auxiliary symbol creation + #ifndef CPROVER_UTIL_FRESH_SYMBOL_H #define CPROVER_UTIL_FRESH_SYMBOL_H diff --git a/src/util/get_base_name.cpp b/src/util/get_base_name.cpp index 3f7bb186937..73984e0e2f5 100644 --- a/src/util/get_base_name.cpp +++ b/src/util/get_base_name.cpp @@ -10,18 +10,9 @@ Author: CM Wintersteiger #include "get_base_name.h" -/*******************************************************************\ - -Function: get_base_name - - Inputs: a string - - Outputs: a new string - - Purpose: cleans a filename from path and extension - -\*******************************************************************/ - +/// cleans a filename from path and extension +/// \par parameters: a string +/// \return a new string std::string get_base_name(const std::string &in, bool strip_suffix) { size_t r=std::string::npos; diff --git a/src/util/get_module.cpp b/src/util/get_module.cpp index e4afd21400f..655c64c6653 100644 --- a/src/util/get_module.cpp +++ b/src/util/get_module.cpp @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Find module symbol using name + #include #include @@ -23,18 +26,6 @@ typedef std::list symbolptr_listt; for(symbolptr_listt::iterator it=(list).begin(); \ it!=(list).end(); ++it) -/*******************************************************************\ - -Function: get_module_by_name - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - const symbolt &get_module_by_name( const symbol_tablet &symbol_table, const std::string &module, @@ -80,18 +71,6 @@ const symbolt &get_module_by_name( return *symbolptr_list.front(); } -/*******************************************************************\ - -Function: get_module - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - const symbolt &get_module( const symbol_tablet &symbol_table, const std::string &module, diff --git a/src/util/get_module.h b/src/util/get_module.h index 1f1063c073c..73eda37dfbb 100644 --- a/src/util/get_module.h +++ b/src/util/get_module.h @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Find module symbol using name + #ifndef CPROVER_UTIL_GET_MODULE_H #define CPROVER_UTIL_GET_MODULE_H diff --git a/src/util/graph.cpp b/src/util/graph.cpp index 07fabf150da..2d80781f41a 100644 --- a/src/util/graph.cpp +++ b/src/util/graph.cpp @@ -6,4 +6,7 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// A Template Class for Graphs + #include "graph.h" diff --git a/src/util/graph.h b/src/util/graph.h index 42988914362..4a49719f7a2 100644 --- a/src/util/graph.h +++ b/src/util/graph.h @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// A Template Class for Graphs + #ifndef CPROVER_UTIL_GRAPH_H #define CPROVER_UTIL_GRAPH_H @@ -255,18 +258,6 @@ class grapht bool non_trivial) const; }; -/*******************************************************************\ - -Function: grapht::add_undirected_edge - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - template void grapht::add_undirected_edge(node_indext a, node_indext b) { @@ -280,18 +271,6 @@ void grapht::add_undirected_edge(node_indext a, node_indext b) nb.add_in(a); } -/*******************************************************************\ - -Function: grapht::remove_undirected_edge - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - template void grapht::remove_undirected_edge(node_indext a, node_indext b) { @@ -303,18 +282,6 @@ void grapht::remove_undirected_edge(node_indext a, node_indext b) nb.in.erase(a); } -/*******************************************************************\ - -Function: grapht::remove_in_edges - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - template void grapht::remove_in_edges(node_indext n) { @@ -330,18 +297,6 @@ void grapht::remove_in_edges(node_indext n) node.in.clear(); } -/*******************************************************************\ - -Function: grapht::remove_out_edges - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - template void grapht::remove_out_edges(node_indext n) { @@ -357,18 +312,6 @@ void grapht::remove_out_edges(node_indext n) node.out.clear(); } -/*******************************************************************\ - -Function: grapht::shortest_path - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - template void grapht::shortest_path( node_indext src, @@ -460,18 +403,6 @@ void grapht::shortest_path( } } -/*******************************************************************\ - -Function: grapht::visit_reachable - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - template void grapht::visit_reachable(node_indext src) { @@ -497,18 +428,6 @@ void grapht::visit_reachable(node_indext src) } } -/*******************************************************************\ - -Function: grapht::connected_subgraphs - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - template std::size_t grapht::connected_subgraphs( std::vector &subgraph_nr) @@ -554,18 +473,6 @@ std::size_t grapht::connected_subgraphs( return nr; } -/*******************************************************************\ - -Function: grapht::tarjan - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - template void grapht::tarjan(tarjant &t, node_indext v) { @@ -610,18 +517,6 @@ void grapht::tarjan(tarjant &t, node_indext v) } } -/*******************************************************************\ - -Function: grapht::SCCs - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - template std::size_t grapht::SCCs(std::vector &subgraph_nr) { @@ -634,18 +529,6 @@ std::size_t grapht::SCCs(std::vector &subgraph_nr) return t.scc_count; } -/*******************************************************************\ - -Function: grapht::make_chordal - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - template void grapht::make_chordal() { @@ -682,18 +565,6 @@ void grapht::make_chordal() } } -/*******************************************************************\ - -Function: grapht::output_dot - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - template void grapht::output_dot(std::ostream &out) const { @@ -701,18 +572,6 @@ void grapht::output_dot(std::ostream &out) const output_dot_node(out, n); } -/*******************************************************************\ - -Function: grapht::output_dot_node - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - template void grapht::output_dot_node(std::ostream &out, node_indext n) const { diff --git a/src/util/guard.cpp b/src/util/guard.cpp index da9cc130723..d77f157176c 100644 --- a/src/util/guard.cpp +++ b/src/util/guard.cpp @@ -6,24 +6,15 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Symbolic Execution + #include #include "std_expr.h" #include "simplify_utils.h" #include "guard.h" -/*******************************************************************\ - -Function: guardt::as_expr - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void guardt::guard_expr(exprt &dest) const { if(is_true()) @@ -48,18 +39,6 @@ void guardt::guard_expr(exprt &dest) const } #if 0 -/*******************************************************************\ - -Function: guardt::as_expr - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - exprt guardt::as_expr(guard_listt::const_iterator it) const { if(it==guard_list.end()) @@ -81,18 +60,6 @@ exprt guardt::as_expr(guard_listt::const_iterator it) const } #endif -/*******************************************************************\ - -Function: guardt::add - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void guardt::add(const exprt &expr) { assert(expr.type().id()==ID_bool); @@ -122,18 +89,6 @@ void guardt::add(const exprt &expr) op.push_back(expr); } -/*******************************************************************\ - -Function: operator -= - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - guardt &operator -= (guardt &g1, const guardt &g2) { if(g1.id()!=ID_and || g2.id()!=ID_and) @@ -163,18 +118,6 @@ guardt &operator -= (guardt &g1, const guardt &g2) return g1; } -/*******************************************************************\ - -Function: operator |= - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - guardt &operator |= (guardt &g1, const guardt &g2) { if(g2.is_false() || g1.is_true()) @@ -260,18 +203,6 @@ guardt &operator |= (guardt &g1, const guardt &g2) } #if 0 -/*******************************************************************\ - -Function: operator << - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::ostream &operator << (std::ostream &out, const guardt &g) { forall_expr_list(it, g.guard_list) @@ -279,18 +210,6 @@ std::ostream &operator << (std::ostream &out, const guardt &g) return out; } -/*******************************************************************\ - -Function: guardt::is_false - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - #define forall_guard(it, guard_list) \ for(guardt::guard_listt::const_iterator it=(guard_list).begin(); \ it!=(guard_list).end(); ++it) @@ -304,18 +223,6 @@ bool guardt::is_false() const return false; } -/*******************************************************************\ - -Function: guardt::make_false - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void guardt::make_false() { guard_list.clear(); diff --git a/src/util/guard.h b/src/util/guard.h index 215ac58ba02..a923680e2ad 100644 --- a/src/util/guard.h +++ b/src/util/guard.h @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Guard Data Structure + #ifndef CPROVER_UTIL_GUARD_H #define CPROVER_UTIL_GUARD_H diff --git a/src/util/identifier.cpp b/src/util/identifier.cpp index 96074d9c43e..fef77e314e0 100644 --- a/src/util/identifier.cpp +++ b/src/util/identifier.cpp @@ -10,18 +10,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "identifier.h" -/*******************************************************************\ - -Function: identifiert::as_string - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string identifiert::as_string() const { std::string result; @@ -37,18 +25,6 @@ std::string identifiert::as_string() const return result; } -/*******************************************************************\ - -Function: identifiert::parse - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void identifiert::parse(const std::string &s) { std::string component; diff --git a/src/util/ieee_float.cpp b/src/util/ieee_float.cpp index 73290f70654..fac8ccdf582 100644 --- a/src/util/ieee_float.cpp +++ b/src/util/ieee_float.cpp @@ -19,35 +19,11 @@ Author: Daniel Kroening, kroening@kroening.com #include "std_expr.h" #include "ieee_float.h" -/*******************************************************************\ - -Function: ieee_float_spect::bias - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - mp_integer ieee_float_spect::bias() const { return power(2, e-1)-1; } -/*******************************************************************\ - -Function: ieee_float_spect::to_type - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - floatbv_typet ieee_float_spect::to_type() const { floatbv_typet result; @@ -58,52 +34,16 @@ floatbv_typet ieee_float_spect::to_type() const return result; } -/*******************************************************************\ - -Function: ieee_float_spect::max_exponent - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - mp_integer ieee_float_spect::max_exponent() const { return power(2, e)-1; } -/*******************************************************************\ - -Function: ieee_float_spect::max_fraction - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - mp_integer ieee_float_spect::max_fraction() const { return power(2, f)-1; } -/*******************************************************************\ - -Function: ieee_float_spect::from_type - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void ieee_float_spect::from_type(const floatbv_typet &type) { std::size_t width=type.get_width(); @@ -116,35 +56,11 @@ void ieee_float_spect::from_type(const floatbv_typet &type) e=e-1; // no hidden bit } -/*******************************************************************\ - -Function: ieee_floatt::print - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void ieee_floatt::print(std::ostream &out) const { out << to_ansi_c_string(); } -/*******************************************************************\ - -Function: ieee_floatt::format - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string ieee_floatt::format(const format_spect &format_spec) const { std::string result; @@ -205,18 +121,6 @@ std::string ieee_floatt::format(const format_spect &format_spec) const return result; } -/*******************************************************************\ - -Function: ieee_floatt::base10_digits - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - mp_integer ieee_floatt::base10_digits(const mp_integer &src) { mp_integer tmp=src; @@ -226,18 +130,6 @@ mp_integer ieee_floatt::base10_digits(const mp_integer &src) return result; } -/*******************************************************************\ - -Function: ieee_floatt::to_string_decimal - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string ieee_floatt::to_string_decimal(std::size_t precision) const { std::string result; @@ -329,20 +221,8 @@ std::string ieee_floatt::to_string_decimal(std::size_t precision) const return result; } -/*******************************************************************\ - -Function: ieee_floatt::to_string_scientific - - Inputs: - - Outputs: - - Purpose: format as [-]d.ddde+-d - Note that printf always produces at least two digits - for the exponent. - -\*******************************************************************/ - +/// format as [-]d.ddde+-d Note that printf always produces at least two digits +/// for the exponent. std::string ieee_floatt::to_string_scientific(std::size_t precision) const { std::string result; @@ -430,18 +310,6 @@ std::string ieee_floatt::to_string_scientific(std::size_t precision) const return result; } -/*******************************************************************\ - -Function: ieee_floatt::unpack - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void ieee_floatt::unpack(const mp_integer &i) { assert(spec.f!=0); @@ -492,35 +360,11 @@ void ieee_floatt::unpack(const mp_integer &i) } } -/*******************************************************************\ - -Function: ieee_floatt::is_normal - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool ieee_floatt::is_normal() const { return fraction>=power(2, spec.f); } -/*******************************************************************\ - -Function: ieee_floatt::pack - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - mp_integer ieee_floatt::pack() const { mp_integer result=0; @@ -559,18 +403,6 @@ mp_integer ieee_floatt::pack() const return result; } -/*******************************************************************\ - -Function: ieee_floatt::extract_base2 - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void ieee_floatt::extract_base2( mp_integer &_fraction, mp_integer &_exponent) const @@ -595,18 +427,6 @@ void ieee_floatt::extract_base2( } } -/*******************************************************************\ - -Function: ieee_floatt::extract_base10 - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void ieee_floatt::extract_base10( mp_integer &_fraction, mp_integer &_exponent) const @@ -643,18 +463,6 @@ void ieee_floatt::extract_base10( } } -/*******************************************************************\ - -Function: ieee_floatt::build - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void ieee_floatt::build( const mp_integer &_fraction, const mp_integer &_exponent) @@ -668,18 +476,7 @@ void ieee_floatt::build( align(); } -/*******************************************************************\ - -Function: ieee_floatt::from_base10 - - Inputs: - - Outputs: - - Purpose: compute f * (10^e) - -\*******************************************************************/ - +/// compute f * (10^e) void ieee_floatt::from_base10( const mp_integer &_fraction, const mp_integer &_exponent) @@ -709,18 +506,6 @@ void ieee_floatt::from_base10( align(); } -/*******************************************************************\ - -Function: ieee_floatt::from_integer - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void ieee_floatt::from_integer(const mp_integer &i) { NaN_flag=infinity_flag=sign_flag=false; @@ -729,18 +514,6 @@ void ieee_floatt::from_integer(const mp_integer &i) align(); } -/*******************************************************************\ - -Function: ieee_floatt::align - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void ieee_floatt::align() { // NaN? @@ -861,18 +634,6 @@ void ieee_floatt::align() exponent=0; } -/*******************************************************************\ - -Function: ieee_floatt::divide_and_round - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void ieee_floatt::divide_and_round( mp_integer &fraction, const mp_integer &factor) @@ -923,18 +684,6 @@ void ieee_floatt::divide_and_round( } } -/*******************************************************************\ - -Function: ieee_floatt::to_expr - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - constant_exprt ieee_floatt::to_expr() const { constant_exprt result(spec.to_type()); @@ -942,18 +691,6 @@ constant_exprt ieee_floatt::to_expr() const return result; } -/*******************************************************************\ - -Function: operator /= - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - ieee_floatt &ieee_floatt::operator/=(const ieee_floatt &other) { assert(other.spec.f==spec.f); @@ -1028,18 +765,6 @@ ieee_floatt &ieee_floatt::operator/=(const ieee_floatt &other) return *this; } -/*******************************************************************\ - -Function: operator *= - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - ieee_floatt &ieee_floatt::operator*=(const ieee_floatt &other) { assert(other.spec.f==spec.f); @@ -1076,18 +801,6 @@ ieee_floatt &ieee_floatt::operator*=(const ieee_floatt &other) return *this; } -/*******************************************************************\ - -Function: operator += - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - ieee_floatt &ieee_floatt::operator+=(const ieee_floatt &other) { ieee_floatt _other=other; @@ -1177,18 +890,6 @@ ieee_floatt &ieee_floatt::operator+=(const ieee_floatt &other) return *this; } -/*******************************************************************\ - -Function: operator -= - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - ieee_floatt &ieee_floatt::operator-=(const ieee_floatt &other) { ieee_floatt _other=other; @@ -1196,18 +897,6 @@ ieee_floatt &ieee_floatt::operator-=(const ieee_floatt &other) return (*this)+=_other; } -/*******************************************************************\ - -Function: ieee_floatt::operator< - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool ieee_floatt::operator<(const ieee_floatt &other) const { if(NaN_flag || other.NaN_flag) @@ -1254,18 +943,6 @@ bool ieee_floatt::operator<(const ieee_floatt &other) const return fraction - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool ieee_floatt::operator>(const ieee_floatt &other) const { return other<*this; } -/*******************************************************************\ - -Function: ieee_floatt::operator>= - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool ieee_floatt::operator>=(const ieee_floatt &other) const { return other<=*this; } -/*******************************************************************\ - -Function: ieee_floatt::operator== - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool ieee_floatt::operator==(const ieee_floatt &other) const { // packed equality! @@ -1357,18 +998,6 @@ bool ieee_floatt::operator==(const ieee_floatt &other) const sign_flag==other.sign_flag; } -/*******************************************************************\ - -Function: ieee_floatt::ieee_equal - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool ieee_floatt::ieee_equal(const ieee_floatt &other) const { if(NaN_flag || other.NaN_flag) @@ -1379,18 +1008,6 @@ bool ieee_floatt::ieee_equal(const ieee_floatt &other) const return *this==other; } -/*******************************************************************\ - -Function: ieee_floatt::operator== - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool ieee_floatt::operator==(int i) const { ieee_floatt other(spec); @@ -1398,35 +1015,11 @@ bool ieee_floatt::operator==(int i) const return *this==other; } -/*******************************************************************\ - -Function: ieee_floatt::operator!= - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool ieee_floatt::operator!=(const ieee_floatt &other) const { return !(*this==other); } -/*******************************************************************\ - -Function: ieee_floatt::ieee_not_equal - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool ieee_floatt::ieee_not_equal(const ieee_floatt &other) const { if(NaN_flag || other.NaN_flag) @@ -1437,18 +1030,6 @@ bool ieee_floatt::ieee_not_equal(const ieee_floatt &other) const return *this!=other; } -/*******************************************************************\ - -Function: ieee_floatt::change_spec - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void ieee_floatt::change_spec(const ieee_float_spect &dest_spec) { mp_integer _exponent=exponent-spec.f; @@ -1468,36 +1049,12 @@ void ieee_floatt::change_spec(const ieee_float_spect &dest_spec) build(_fraction, _exponent); } -/*******************************************************************\ - -Function: ieee_floatt::from_expr - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void ieee_floatt::from_expr(const constant_exprt &expr) { spec=ieee_float_spect(to_floatbv_type(expr.type())); unpack(binary2integer(id2string(expr.get_value()), false)); } -/*******************************************************************\ - -Function: ieee_floatt::to_integer - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - mp_integer ieee_floatt::to_integer() const { if(NaN_flag || infinity_flag || is_zero()) @@ -1519,18 +1076,6 @@ mp_integer ieee_floatt::to_integer() const return result; } -/*******************************************************************\ - -Function: ieee_floatt::from_double - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void ieee_floatt::from_double(const double d) { spec.f=52; @@ -1551,18 +1096,6 @@ void ieee_floatt::from_double(const double d) unpack(u.i); } -/*******************************************************************\ - -Function: ieee_floatt::from_float - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void ieee_floatt::from_float(const float f) { spec.f=23; @@ -1582,18 +1115,6 @@ void ieee_floatt::from_float(const float f) unpack(u.i); } -/*******************************************************************\ - -Function: ieee_floatt::make_NaN - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void ieee_floatt::make_NaN() { NaN_flag=true; @@ -1603,18 +1124,6 @@ void ieee_floatt::make_NaN() infinity_flag=false; } -/*******************************************************************\ - -Function: ieee_floatt::make_fltmax - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void ieee_floatt::make_fltmax() { mp_integer bit_pattern= @@ -1622,35 +1131,11 @@ void ieee_floatt::make_fltmax() unpack(bit_pattern); } -/*******************************************************************\ - -Function: ieee_floatt::make_fltmin - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void ieee_floatt::make_fltmin() { unpack(power(2, spec.f)); } -/*******************************************************************\ - -Function: ieee_floatt::make_plus_infinity - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void ieee_floatt::make_plus_infinity() { NaN_flag=false; @@ -1660,71 +1145,24 @@ void ieee_floatt::make_plus_infinity() infinity_flag=true; } -/*******************************************************************\ - -Function: ieee_floatt::make_minus_infinity - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void ieee_floatt::make_minus_infinity() { make_plus_infinity(); sign_flag=true; } -/*******************************************************************\ - -Function: ieee_floatt::is_double - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool ieee_floatt::is_double() const { return spec.f==52 && spec.e==11; } -/*******************************************************************\ - -Function: ieee_floatt::is_float - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool ieee_floatt::is_float() const { return spec.f==23 && spec.e==8; } -/*******************************************************************\ - -Function: ieee_floatt::to_double - - Inputs: - - Outputs: - - Purpose: Note that calling from_double -> to_double can return different bit - patterns for NaN. - -\*******************************************************************/ - +/// Note that calling from_double -> to_double can return different bit patterns +/// for NaN. double ieee_floatt::to_double() const { union { double f; uint64_t i; } a; @@ -1752,19 +1190,8 @@ double ieee_floatt::to_double() const return a.f; } -/*******************************************************************\ - -Function: ieee_floatt::to_float - - Inputs: - - Outputs: - - Purpose: Note that calling from_float -> to_float can return different bit - patterns for NaN. - -\*******************************************************************/ - +/// Note that calling from_float -> to_float can return different bit patterns +/// for NaN. float ieee_floatt::to_float() const { if(sizeof(unsigned)!=sizeof(float)) @@ -1797,20 +1224,8 @@ float ieee_floatt::to_float() const return a.f; } -/*******************************************************************\ - -Function: ieee_floatt::next_representable - - Inputs: - - Outputs: - - Purpose: Sets *this to the next representable number closer to - plus infinity (greater = true) or minus infinity - (greater = false). - -\*******************************************************************/ - +/// Sets *this to the next representable number closer to plus infinity (greater +/// = true) or minus infinity (greater = false). void ieee_floatt::next_representable(bool greater) { if(is_NaN()) diff --git a/src/util/infix.h b/src/util/infix.h index 2fcc1338d5d..0ff47c646c1 100644 --- a/src/util/infix.h +++ b/src/util/infix.h @@ -6,6 +6,9 @@ Author: Chris Smowton, chris.smowton@diffblue.com \*******************************************************************/ +/// \file +/// String infix shorthand + #ifndef CPROVER_UTIL_INFIX_H #define CPROVER_UTIL_INFIX_H diff --git a/src/util/irep.cpp b/src/util/irep.cpp index 886f8ce9d7b..d2bbbd59085 100644 --- a/src/util/irep.cpp +++ b/src/util/irep.cpp @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Internal Representation + #include #include @@ -28,18 +31,6 @@ irept nil_rep_storage; irept::dt irept::empty_d; #endif -/*******************************************************************\ - -Function: named_subt_lower_bound - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - #ifdef SUB_IS_LIST static inline bool named_subt_order( const std::pair &a, @@ -61,18 +52,6 @@ static inline irept::named_subt::iterator named_subt_lower_bound( } #endif -/*******************************************************************\ - -Function: get_nil_irep - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - const irept &get_nil_irep() { if(nil_rep_storage.id().empty()) // initialized? @@ -80,18 +59,6 @@ const irept &get_nil_irep() return nil_rep_storage; } -/*******************************************************************\ - -Function: irept::detach - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - #ifdef SHARING void irept::detach() { @@ -128,18 +95,6 @@ void irept::detach() } #endif -/*******************************************************************\ - -Function: irept::remove_ref - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - #ifdef SHARING void irept::remove_ref(dt *old_data) { @@ -178,19 +133,8 @@ void irept::remove_ref(dt *old_data) } #endif -/*******************************************************************\ - -Function: irept::nonrecursive_destructor - - Inputs: - - Outputs: - - Purpose: Does the same as remove_ref, but - using an explicit stack instead of recursion. - -\*******************************************************************/ - +/// Does the same as remove_ref, but using an explicit stack instead of +/// recursion. #ifdef SHARING void irept::nonrecursive_destructor(dt *old_data) { @@ -247,18 +191,6 @@ void irept::nonrecursive_destructor(dt *old_data) } #endif -/*******************************************************************\ - -Function: irept::move_to_named_sub - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void irept::move_to_named_sub(const irep_namet &name, irept &irep) { #ifdef SHARING @@ -268,18 +200,6 @@ void irept::move_to_named_sub(const irep_namet &name, irept &irep) irep.clear(); } -/*******************************************************************\ - -Function: irept::move_to_sub - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void irept::move_to_sub(irept &irep) { #ifdef SHARING @@ -289,18 +209,6 @@ void irept::move_to_sub(irept &irep) get_sub().back().swap(irep); } -/*******************************************************************\ - -Function: irept::get - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - const irep_idt &irept::get(const irep_namet &name) const { const named_subt &s= @@ -328,120 +236,36 @@ const irep_idt &irept::get(const irep_namet &name) const return it->second.id(); } -/*******************************************************************\ - -Function: irept::get_bool - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool irept::get_bool(const irep_namet &name) const { return get(name)==ID_1; } -/*******************************************************************\ - -Function: irept::get_int - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - int irept::get_int(const irep_namet &name) const { return unsafe_string2int(get_string(name)); } -/*******************************************************************\ - -Function: irept::get_unsigned_int - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - unsigned int irept::get_unsigned_int(const irep_namet &name) const { return unsafe_string2unsigned(get_string(name)); } -/*******************************************************************\ - -Function: irept::get_size_t - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::size_t irept::get_size_t(const irep_namet &name) const { return unsafe_string2size_t(get_string(name)); } -/*******************************************************************\ - -Function: irept::get_long_long - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - long long irept::get_long_long(const irep_namet &name) const { return unsafe_string2signedlonglong(get_string(name)); } -/*******************************************************************\ - -Function: irept::set - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void irept::set(const irep_namet &name, const long long value) { add(name).id(std::to_string(value)); } -/*******************************************************************\ - -Function: irept::remove - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void irept::remove(const irep_namet &name) { named_subt &s= @@ -457,18 +281,6 @@ void irept::remove(const irep_namet &name) #endif } -/*******************************************************************\ - -Function: irept::find - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - const irept &irept::find(const irep_namet &name) const { const named_subt &s= @@ -490,18 +302,6 @@ const irept &irept::find(const irep_namet &name) const return it->second; } -/*******************************************************************\ - -Function: irept::add - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - irept &irept::add(const irep_namet &name) { named_subt &s= @@ -520,18 +320,6 @@ irept &irept::add(const irep_namet &name) #endif } -/*******************************************************************\ - -Function: irept::add - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - irept &irept::add(const irep_namet &name, const irept &irep) { named_subt &s= @@ -558,18 +346,6 @@ irept &irept::add(const irep_namet &name, const irept &irep) #endif } -/*******************************************************************\ - -Function: irept::operator== - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - #ifdef IREP_HASH_STATS unsigned long long irep_cmp_cnt=0; unsigned long long irep_cmp_ne_cnt=0; @@ -600,18 +376,6 @@ bool irept::operator==(const irept &other) const return true; } -/*******************************************************************\ - -Function: irept::full_eq - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool irept::full_eq(const irept &other) const { #ifdef SHARING @@ -661,18 +425,7 @@ bool irept::full_eq(const irept &other) const return true; } -/*******************************************************************\ - -Function: irept::ordering - - Inputs: - - Outputs: - - Purpose: defines ordering on the internal represenation - -\*******************************************************************/ - +/// defines ordering on the internal represenation bool irept::ordering(const irept &other) const { return compare(other)<0; @@ -738,18 +491,7 @@ bool irept::ordering(const irept &other) const #endif } -/*******************************************************************\ - -Function: irept::compare - - Inputs: - - Outputs: - - Purpose: defines ordering on the internal represenation - -\*******************************************************************/ - +/// defines ordering on the internal represenation int irept::compare(const irept &i) const { int r; @@ -815,36 +557,12 @@ int irept::compare(const irept &i) const return 0; } -/*******************************************************************\ - -Function: irept::operator< - - Inputs: - - Outputs: - - Purpose: defines ordering on the internal represenation - -\*******************************************************************/ - +/// defines ordering on the internal represenation bool irept::operator<(const irept &other) const { return ordering(other); } -/*******************************************************************\ - -Function: irept::hash - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - - #ifdef IREP_HASH_STATS unsigned long long irep_hash_cnt=0; #endif @@ -880,18 +598,6 @@ std::size_t irept::hash() const return result; } -/*******************************************************************\ - -Function: irept::full_hash - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::size_t irept::full_hash() const { const irept::subt &sub=get_sub(); @@ -921,36 +627,12 @@ std::size_t irept::full_hash() const return result; } -/*******************************************************************\ - -Function: indent - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - static void indent_str(std::string &s, unsigned indent) { for(unsigned i=0; i0 && indent>max_indent) diff --git a/src/util/irep_hash.cpp b/src/util/irep_hash.cpp index 96a00a27595..a68776d00cd 100644 --- a/src/util/irep_hash.cpp +++ b/src/util/irep_hash.cpp @@ -6,4 +6,7 @@ Author: Michael Tautschnig, mt@eecs.qmul.ac.uk \*******************************************************************/ +/// \file +/// irep hash functions + #include "irep_hash.h" diff --git a/src/util/irep_hash.h b/src/util/irep_hash.h index b0d24221ff3..ce4ef52da76 100644 --- a/src/util/irep_hash.h +++ b/src/util/irep_hash.h @@ -6,6 +6,9 @@ Author: Michael Tautschnig, mt@eecs.qmul.ac.uk \*******************************************************************/ +/// \file +/// irep hash functions + #ifndef CPROVER_UTIL_IREP_HASH_H #define CPROVER_UTIL_IREP_HASH_H @@ -74,18 +77,6 @@ std::size_t basic_hash_combine( std::size_t h1, std::size_t h2); -/*******************************************************************\ - -Function: basic_hash_combine - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - template<> inline std::size_t basic_hash_combine<32>( std::size_t h1, @@ -94,18 +85,6 @@ inline std::size_t basic_hash_combine<32>( return ROTL32(h1, 7)^h2; } -/*******************************************************************\ - -Function: basic_hash_combine - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - template<> inline std::size_t basic_hash_combine<64>( std::size_t h1, @@ -127,18 +106,6 @@ inline std::size_t basic_hash_combine<64>( #endif } -/*******************************************************************\ - -Function: basic_hash_finalize - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - inline std::size_t basic_hash_finalize( std::size_t h1, std::size_t len) @@ -175,18 +142,6 @@ std::size_t murmurhash2a_hash_finalize( std::size_t h1, std::size_t len); -/*******************************************************************\ - -Function: murmurhash2a_hash_combine - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - static FORCE_INLINE uint32_t mmix32(uint32_t h1, uint32_t h2) { const int r=24; @@ -209,18 +164,7 @@ inline std::size_t murmurhash2a_hash_combine<32>( return mmix32(h1, h2); } -/*******************************************************************\ - -Function: murmurhash2a_hash_finalize - - Inputs: - - Outputs: - - Purpose: force all bits of a hash block to avalanche - -\*******************************************************************/ - +/// force all bits of a hash block to avalanche template<> inline std::size_t murmurhash2a_hash_finalize<32>( std::size_t h1, @@ -237,18 +181,6 @@ inline std::size_t murmurhash2a_hash_finalize<32>( return h1; } -/*******************************************************************\ - -Function: murmurhash2a_hash_combine - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - static FORCE_INLINE uint64_t mmix64(uint64_t h1, uint64_t h2) { const int r=47; @@ -273,18 +205,7 @@ inline std::size_t murmurhash2a_hash_combine<64>( return mmix64(h1, h2); } -/*******************************************************************\ - -Function: murmurhash2a_hash_finalize - - Inputs: - - Outputs: - - Purpose: force all bits of a hash block to avalanche - -\*******************************************************************/ - +/// force all bits of a hash block to avalanche template<> inline std::size_t murmurhash2a_hash_finalize<64>( std::size_t h1, @@ -328,18 +249,6 @@ std::size_t murmurhash3_hash_finalize( std::size_t h1, std::size_t len); -/*******************************************************************\ - -Function: murmurhash3_hash_combine - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - template<> inline std::size_t murmurhash3_hash_combine<32>( std::size_t h1, @@ -359,18 +268,7 @@ inline std::size_t murmurhash3_hash_combine<32>( return h1; } -/*******************************************************************\ - -Function: murmurhash3_hash_finalize - - Inputs: - - Outputs: - - Purpose: force all bits of a hash block to avalanche - -\*******************************************************************/ - +/// force all bits of a hash block to avalanche static FORCE_INLINE uint32_t fmix32(uint32_t h) { h^=h>>16; @@ -392,18 +290,6 @@ inline std::size_t murmurhash3_hash_finalize<32>( return fmix32(h1); } -/*******************************************************************\ - -Function: murmurhash3_hash_combine - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - template<> inline std::size_t murmurhash3_hash_combine<64>( std::size_t h1, @@ -429,18 +315,7 @@ inline std::size_t murmurhash3_hash_combine<64>( return h1; } -/*******************************************************************\ - -Function: murmurhash3_hash_finalize - - Inputs: - - Outputs: - - Purpose: force all bits of a hash block to avalanche - -\*******************************************************************/ - +/// force all bits of a hash block to avalanche static FORCE_INLINE uint64_t fmix64(uint64_t h) { // a brief experiment with supposedly better constants from diff --git a/src/util/irep_hash_container.cpp b/src/util/irep_hash_container.cpp index 5d17b3d3f9f..82f6b812484 100644 --- a/src/util/irep_hash_container.cpp +++ b/src/util/irep_hash_container.cpp @@ -6,22 +6,13 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Hashing IREPs + #include "irep_hash_container.h" #include "irep.h" #include "irep_hash.h" -/*******************************************************************\ - -Function: irep_hash_container_baset::number - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - size_t irep_hash_container_baset::number(const irept &irep) { // the ptr-hash provides a speedup of up to 3x @@ -40,18 +31,6 @@ size_t irep_hash_container_baset::number(const irept &irep) return id; } -/*******************************************************************\ - -Function: irep_hash_container_baset::vector_hasht::operator() - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - size_t irep_hash_container_baset::vector_hasht::operator()( const packedt &p) const { @@ -61,18 +40,6 @@ size_t irep_hash_container_baset::vector_hasht::operator()( return result; } -/*******************************************************************\ - -Function: irep_hash_container_baset::pack - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void irep_hash_container_baset::pack( const irept &irep, packedt &packed) diff --git a/src/util/irep_hash_container.h b/src/util/irep_hash_container.h index 6edaaf0c21c..382130659e0 100644 --- a/src/util/irep_hash_container.h +++ b/src/util/irep_hash_container.h @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// IREP Hash Container + #ifndef CPROVER_UTIL_IREP_HASH_CONTAINER_H #define CPROVER_UTIL_IREP_HASH_CONTAINER_H diff --git a/src/util/irep_ids.cpp b/src/util/irep_ids.cpp index bb67b275f0a..15ff849a058 100644 --- a/src/util/irep_ids.cpp +++ b/src/util/irep_ids.cpp @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Internal Representation + #include #include "irep_ids.h" @@ -39,18 +42,6 @@ const char *irep_ids_table[]= #include "irep_ids.def" // NOLINT(build/include) -/*******************************************************************\ - -Function: initialize_string_container - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void initialize_string_container() { // this is called by the constructor of string_containert diff --git a/src/util/irep_ids.h b/src/util/irep_ids.h index c456840ef5f..2202c95c62b 100644 --- a/src/util/irep_ids.h +++ b/src/util/irep_ids.h @@ -6,6 +6,9 @@ Author: Reuben Thomas, reuben.thomas@me.com \*******************************************************************/ +/// \file +/// util + #ifndef CPROVER_UTIL_IREP_IDS_H #define CPROVER_UTIL_IREP_IDS_H diff --git a/src/util/irep_serialization.cpp b/src/util/irep_serialization.cpp index 3d5734bbb43..466460d92dd 100644 --- a/src/util/irep_serialization.cpp +++ b/src/util/irep_serialization.cpp @@ -8,24 +8,15 @@ Date: May 2007 \*******************************************************************/ +/// \file +/// binary irep conversions with hashing + #include #include #include "irep_serialization.h" #include "string_hash.h" -/*******************************************************************\ - -Function: irep_serializationt::write_irep - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void irep_serializationt::write_irep( std::ostream &out, const irept &irep) @@ -55,18 +46,6 @@ void irep_serializationt::write_irep( out.put(0); // terminator } -/*******************************************************************\ - -Function: irep_serializationt::reference_convert - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void irep_serializationt::reference_convert( std::istream &in, irept &irep) @@ -85,18 +64,6 @@ void irep_serializationt::reference_convert( } } -/*******************************************************************\ - -Function: irep_serializationt::read_irep - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void irep_serializationt::read_irep( std::istream &in, irept &irep) @@ -132,18 +99,6 @@ void irep_serializationt::read_irep( } } -/*******************************************************************\ - -Function: irep_serializationt::reference_convert - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void irep_serializationt::reference_convert( const irept &irep, std::ostream &out) @@ -166,18 +121,9 @@ void irep_serializationt::reference_convert( } } -/*******************************************************************\ - -Function: irep_serializationt::insert_on_write - - Inputs: a size_t and an irep - - Outputs: true on success, false otherwise - - Purpose: inserts an irep into the hashtable - -\*******************************************************************/ - +/// inserts an irep into the hashtable +/// \par parameters: a size_t and an irep +/// \return true on success, false otherwise std::size_t irep_serializationt::insert_on_write(std::size_t h) { std::pair res= @@ -190,19 +136,10 @@ std::size_t irep_serializationt::insert_on_write(std::size_t h) return res.first->second; } -/*******************************************************************\ - -Function: irep_serializationt::insert_on_read - - Inputs: a size_t and an irep - - Outputs: true on success, false otherwise - - Purpose: inserts an irep into the hashtable, but only the id-hashtable - (only to be used upon reading ireps from a file) - -\*******************************************************************/ - +/// inserts an irep into the hashtable, but only the id-hashtable (only to be +/// used upon reading ireps from a file) +/// \par parameters: a size_t and an irep +/// \return true on success, false otherwise std::size_t irep_serializationt::insert_on_read( std::size_t id, const irept &i) @@ -222,19 +159,9 @@ std::size_t irep_serializationt::insert_on_read( return id; } -/*******************************************************************\ - -Function: write_gb_word - - Inputs: an output stream and a number - - Outputs: nothing - - Purpose: outputs 4 characters for a long, - most-significand byte first - -\*******************************************************************/ - +/// outputs 4 characters for a long, most-significand byte first +/// \par parameters: an output stream and a number +/// \return nothing void write_gb_word(std::ostream &out, std::size_t u) { // we write 7 bits each time, until we have zero @@ -254,18 +181,9 @@ void write_gb_word(std::ostream &out, std::size_t u) } } -/*******************************************************************\ - -Function: irep_serializationt::read_gb_word - - Inputs: a stream - - Outputs: a long - - Purpose: reads 4 characters and builds a long int from them - -\*******************************************************************/ - +/// reads 4 characters and builds a long int from them +/// \par parameters: a stream +/// \return a long std::size_t irep_serializationt::read_gb_word(std::istream &in) { std::size_t res=0; @@ -284,18 +202,9 @@ std::size_t irep_serializationt::read_gb_word(std::istream &in) return res; } -/*******************************************************************\ - -Function: write_gb_string - - Inputs: an output stream and a string - - Outputs: nothing - - Purpose: outputs the string and then a zero byte. - -\*******************************************************************/ - +/// outputs the string and then a zero byte. +/// \par parameters: an output stream and a string +/// \return nothing void write_gb_string(std::ostream &out, const std::string &s) { for(std::string::const_iterator it=s.begin(); @@ -310,18 +219,9 @@ void write_gb_string(std::ostream &out, const std::string &s) out.put(0); } -/*******************************************************************\ - -Function: irep_serializationt::read_gb_string - - Inputs: a stream - - Outputs: a string - - Purpose: reads a string from the stream - -\*******************************************************************/ - +/// reads a string from the stream +/// \par parameters: a stream +/// \return a string irep_idt irep_serializationt::read_gb_string(std::istream &in) { char c; @@ -343,18 +243,9 @@ irep_idt irep_serializationt::read_gb_string(std::istream &in) return irep_idt(std::string(read_buffer.data(), length)); } -/*******************************************************************\ - -Function: irep_serializationt::write_string_ref - - Inputs: an output stream and a string - - Outputs: nothing - - Purpose: outputs the string reference - -\*******************************************************************/ - +/// outputs the string reference +/// \par parameters: an output stream and a string +/// \return nothing void irep_serializationt::write_string_ref( std::ostream &out, const irep_idt &s) @@ -373,18 +264,9 @@ void irep_serializationt::write_string_ref( } } -/*******************************************************************\ - -Function: irep_serializationt::read_string_ref - - Inputs: a stream - - Outputs: a string - - Purpose: reads a string reference from the stream - -\*******************************************************************/ - +/// reads a string reference from the stream +/// \par parameters: a stream +/// \return a string irep_idt irep_serializationt::read_string_ref(std::istream &in) { std::size_t id = read_gb_word(in); diff --git a/src/util/irep_serialization.h b/src/util/irep_serialization.h index 715e042300d..6162826475a 100644 --- a/src/util/irep_serialization.h +++ b/src/util/irep_serialization.h @@ -8,6 +8,9 @@ Date: May 2007 \*******************************************************************/ +/// \file +/// binary irep conversions with hashing + #ifndef CPROVER_UTIL_IREP_SERIALIZATION_H #define CPROVER_UTIL_IREP_SERIALIZATION_H diff --git a/src/util/json.cpp b/src/util/json.cpp index 39769a8c5c2..f2d10caf8b2 100644 --- a/src/util/json.cpp +++ b/src/util/json.cpp @@ -12,18 +12,6 @@ Author: Daniel Kroening, kroening@kroening.com const jsont jsont::null_json_object(jsont::kindt::J_NULL); -/*******************************************************************\ - -Function: jsont::escape_string - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void jsont::escape_string(const std::string &src, std::ostream &out) { for(const auto &ch : src) @@ -62,18 +50,6 @@ void jsont::escape_string(const std::string &src, std::ostream &out) } } -/*******************************************************************\ - -Function: jsont::output_rec - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void jsont::output_rec(std::ostream &out, unsigned indent) const { switch(kind) @@ -157,18 +133,6 @@ void jsont::output_rec(std::ostream &out, unsigned indent) const } } -/*******************************************************************\ - -Function: jsont::swap - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void jsont::swap(jsont &other) { std::swap(other.kind, kind); diff --git a/src/util/json_expr.cpp b/src/util/json_expr.cpp index d2d3550e6ff..fde6862270c 100644 --- a/src/util/json_expr.cpp +++ b/src/util/json_expr.cpp @@ -6,6 +6,9 @@ Author: Peter Schrammel \*******************************************************************/ +/// \file +/// Expressions in JSON + #include "namespace.h" #include "expr.h" #include "json.h" @@ -20,18 +23,6 @@ Author: Peter Schrammel #include "json_expr.h" -/*******************************************************************\ - -Function: simplify_json_expr - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - static exprt simplify_json_expr( const exprt &src, const namespacet &ns) @@ -75,18 +66,6 @@ static exprt simplify_json_expr( return src; } -/*******************************************************************\ - -Function: json - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - json_objectt json(const source_locationt &location) { json_objectt result; @@ -110,24 +89,13 @@ json_objectt json(const source_locationt &location) return result; } -/*******************************************************************\ - -Function: json - - Inputs: - type - a type - ns - a namespace - mode - language in which the code was written; - for now ID_C and ID_java are supported - - Outputs: a json object - - Purpose: - Output a CBMC type in json. - The `mode` argument is used to correctly report types. - -\*******************************************************************/ - +/// Output a CBMC type in json. +/// The `mode` argument is used to correctly report types. +/// \param type: a type +/// \param ns: a namespace +/// \param mode: language in which the code was written; for now ID_C and +/// ID_java are supported +/// \return a json object json_objectt json( const typet &type, const namespacet &ns, @@ -230,24 +198,13 @@ json_objectt json( return result; } -/*******************************************************************\ - -Function: json - - Inputs: - expr - an expression - ns - a namespace - mode - language in which the code was written; - for now ID_C and ID_java are supported - - Outputs: a json object - - Purpose: - Output a CBMC expression in json. - The mode is used to correctly report types. - -\*******************************************************************/ - +/// Output a CBMC expression in json. +/// The mode is used to correctly report types. +/// \param expr: an expression +/// \param ns: a namespace +/// \param mode: language in which the code was written; for now ID_C and +/// ID_java are supported +/// \return a json object json_objectt json( const exprt &expr, const namespacet &ns, diff --git a/src/util/json_expr.h b/src/util/json_expr.h index 61f6977a1ff..6b9a124680b 100644 --- a/src/util/json_expr.h +++ b/src/util/json_expr.h @@ -6,6 +6,9 @@ Author: Peter Schrammel \*******************************************************************/ +/// \file +/// Expressions in JSON + #ifndef CPROVER_UTIL_JSON_EXPR_H #define CPROVER_UTIL_JSON_EXPR_H diff --git a/src/util/json_irep.cpp b/src/util/json_irep.cpp index 2740228d1db..7f8c0b58b16 100644 --- a/src/util/json_irep.cpp +++ b/src/util/json_irep.cpp @@ -6,46 +6,27 @@ Author: Thomas Kiley, thomas.kiley@diffblue.com \*******************************************************************/ +/// \file +/// Util + #include "irep.h" #include "json.h" #include "json_irep.h" #include -/*******************************************************************\ - -Function: json_irept::json_irept - - Inputs: - include_comments - when writing JSON, should the comments - sub tree be included. - - Outputs: - - Purpose: To convert to JSON from an irep structure by recurssively - generating JSON for the different sub trees. - -\*******************************************************************/ - +/// To convert to JSON from an irep structure by recurssively generating JSON +/// for the different sub trees. +/// \param include_comments: when writing JSON, should the comments +/// sub tree be included. json_irept::json_irept(bool include_comments): include_comments(include_comments) {} -/*******************************************************************\ - -Function: json_irept::convert_from_irep - - Inputs: - irep - The irep structure to turn into json - json - The json object to be filled up. - - Outputs: - - Purpose: To convert to JSON from an irep structure by recurssively - generating JSON for the different sub trees. - -\*******************************************************************/ - +/// To convert to JSON from an irep structure by recurssively generating JSON +/// for the different sub trees. +/// \param irep: The irep structure to turn into json +/// \param json: The json object to be filled up. void json_irept::convert_from_irep(const irept &irep, jsont &json) const { json_objectt &irep_object=json.make_object(); @@ -60,24 +41,12 @@ void json_irept::convert_from_irep(const irept &irep, jsont &json) const } } -/*******************************************************************\ - -Function: json_irept::convert_sub_tree - - Inputs: - sub_tree_id - the name to give the subtree in the parent object - sub_trees - the list of subtrees to parse - parent - the parent JSON object who should be added to - - Outputs: - - Purpose: To convert to JSON from a list of ireps that are in an - unlabelled subtree. The parent JSON object will get a key - called sub_tree_id and the value shall be an array of JSON - objects generated from each of the sub trees - -\*******************************************************************/ - +/// To convert to JSON from a list of ireps that are in an unlabelled subtree. +/// The parent JSON object will get a key called sub_tree_id and the value shall +/// be an array of JSON objects generated from each of the sub trees +/// \param sub_tree_id: the name to give the subtree in the parent object +/// \param sub_trees: the list of subtrees to parse +/// \param parent: the parent JSON object who should be added to void json_irept::convert_sub_tree( const std::string &sub_tree_id, const irept::subt &sub_trees, @@ -96,25 +65,13 @@ void json_irept::convert_sub_tree( } } -/*******************************************************************\ - -Function: json_irept::convert_named_sub_tree - - Inputs: - sub_tree_id - the name to give the subtree in the parent object - sub_trees - the map of subtrees to parse - parent - the parent JSON object who should be added to - - Outputs: - - Purpose: To convert to JSON from a map of ireps that are in a - named subtree. The parent JSON object will get a key - called sub_tree_id and the value shall be a JSON object - whose keys shall be the name of the sub tree and the value - will be the object generated from the sub tree. - -\*******************************************************************/ - +/// To convert to JSON from a map of ireps that are in a named subtree. The +/// parent JSON object will get a key called sub_tree_id and the value shall be +/// a JSON object whose keys shall be the name of the sub tree and the value +/// will be the object generated from the sub tree. +/// \param sub_tree_id: the name to give the subtree in the parent object +/// \param sub_trees: the map of subtrees to parse +/// \param parent: the parent JSON object who should be added to void json_irept::convert_named_sub_tree( const std::string &sub_tree_id, const irept::named_subt &sub_trees, @@ -133,18 +90,9 @@ void json_irept::convert_named_sub_tree( } } -/*******************************************************************\ - -Function: json_irept::convert_from_json - - Inputs: input - json object to convert - - Outputs: result - irep equivalent of input - - Purpose: Deserialize a JSON irep representation. - -\*******************************************************************/ - +/// Deserialize a JSON irep representation. +/// \param input: json object to convert +/// \return result - irep equivalent of input void json_irept::convert_from_json(const jsont &in, irept &out) const { std::vector have_keys; diff --git a/src/util/json_irep.h b/src/util/json_irep.h index 20a364d31e9..83c8a6902d8 100644 --- a/src/util/json_irep.h +++ b/src/util/json_irep.h @@ -6,6 +6,9 @@ Author: Thomas Kiley, thomas.kiley@diffblue.com \*******************************************************************/ +/// \file +/// Util + #ifndef CPROVER_UTIL_JSON_IREP_H #define CPROVER_UTIL_JSON_IREP_H diff --git a/src/util/language.cpp b/src/util/language.cpp index ddb41979040..35758547b8f 100644 --- a/src/util/language.cpp +++ b/src/util/language.cpp @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Abstract interface to support a programming language + #include "language.h" #include "expr.h" #include @@ -14,70 +17,22 @@ Author: Daniel Kroening, kroening@kroening.com #include #include -/*******************************************************************\ - -Function: languaget::final - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool languaget::final(symbol_tablet &symbol_table) { return false; } -/*******************************************************************\ - -Function: languaget::interfaces - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool languaget::interfaces(symbol_tablet &symbol_table) { return false; } -/*******************************************************************\ - -Function: languaget::dependencies - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void languaget::dependencies( const std::string &module, std::set &modules) { } -/*******************************************************************\ - -Function: languaget::from_expr - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool languaget::from_expr( const exprt &expr, std::string &code, @@ -87,18 +42,6 @@ bool languaget::from_expr( return false; } -/*******************************************************************\ - -Function: languaget::from_type - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool languaget::from_type( const typet &type, std::string &code, @@ -108,18 +51,6 @@ bool languaget::from_type( return false; } -/*******************************************************************\ - -Function: languaget::type_to_name - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool languaget::type_to_name( const typet &type, std::string &name, @@ -131,41 +62,19 @@ bool languaget::type_to_name( return false; } -/*******************************************************************\ - -Function: languaget::set_should_generate_opaque_method_stubs - - Inputs: - should_generate_stubs - Should stub generation be enabled - - Outputs: - - Purpose: Turn on or off stub generation. - -\*******************************************************************/ +/// Turn on or off stub generation. +/// \param should_generate_stubs: Should stub generation be enabled void languaget::set_should_generate_opaque_method_stubs( bool should_generate_stubs) { generate_opaque_stubs=should_generate_stubs; } -/*******************************************************************\ - -Function: languaget::generate_opaque_method_stubs - - Inputs: - symbol_table - the symbol table for the program - - Outputs: - - Purpose: When there are opaque methods (e.g. ones where we don't - have a body), we create a stub function in the goto - program and mark it as opaque so the interpreter fills in - appropriate values for it. This will only happen if - generate_opaque_stubs is enabled. - -\*******************************************************************/ - +/// When there are opaque methods (e.g. ones where we don't have a body), we +/// create a stub function in the goto program and mark it as opaque so the +/// interpreter fills in appropriate values for it. This will only happen if +/// generate_opaque_stubs is enabled. +/// \param symbol_table: the symbol table for the program void languaget::generate_opaque_method_stubs(symbol_tablet &symbol_table) { if(generate_opaque_stubs) @@ -193,24 +102,13 @@ void languaget::generate_opaque_method_stubs(symbol_tablet &symbol_table) } } -/*******************************************************************\ - -Function: languaget::generate_opaque_stub_body - - Inputs: - symbol - the function symbol which is opaque - symbol_table - the symbol table - - Outputs: The identifier of the return variable. ID_nil if the function - doesn't return anything. - - Purpose: To generate the stub function for the opaque function in - question. The identifier is used in the flag to the interpreter - that the function is opaque. This function should be implemented - in the languages. - -\*******************************************************************/ - +/// To generate the stub function for the opaque function in question. The +/// identifier is used in the flag to the interpreter that the function is +/// opaque. This function should be implemented in the languages. +/// \param symbol: the function symbol which is opaque +/// \param symbol_table: the symbol table +/// \return The identifier of the return variable. ID_nil if the function +/// doesn't return anything. irep_idt languaget::generate_opaque_stub_body( symbolt &symbol, symbol_tablet &symbol_table) @@ -218,24 +116,14 @@ irep_idt languaget::generate_opaque_stub_body( return ID_nil; } -/*******************************************************************\ - -Function: languaget::build_stub_parameter_symbol - - Inputs: - function_symbol - the symbol of an opaque function - parameter_index - the index of the parameter within the - the parameter list - parameter_type - the type of the parameter - - Outputs: A named symbol to be added to the symbol table representing - one of the parameters in this opaque function. - - Purpose: To build the parameter symbol and choose its name. This should - be implemented in each language. - -\*******************************************************************/ - +/// To build the parameter symbol and choose its name. This should be +/// implemented in each language. +/// \param function_symbol: the symbol of an opaque function +/// \param parameter_index: the index of the parameter within the the parameter +/// list +/// \param parameter_type: the type of the parameter +/// \return A named symbol to be added to the symbol table representing one of +/// the parameters in this opaque function. parameter_symbolt languaget::build_stub_parameter_symbol( const symbolt &function_symbol, size_t parameter_index, @@ -248,21 +136,11 @@ parameter_symbolt languaget::build_stub_parameter_symbol( return parameter_symbolt(); } -/*******************************************************************\ - -Function: languaget::get_stub_return_symbol_name - - Inputs: - function_id - the function that has a return value - - Outputs: the identifier to use for the symbol that will store the - return value of this function. - - Purpose: To get the name of the symbol to be used for the return value - of the function. Generates a name like to_return_function_name - -\*******************************************************************/ - +/// To get the name of the symbol to be used for the return value of the +/// function. Generates a name like to_return_function_name +/// \param function_id: the function that has a return value +/// \return the identifier to use for the symbol that will store the return +/// value of this function. irep_idt languaget::get_stub_return_symbol_name(const irep_idt &function_id) { std::ostringstream return_symbol_name_builder; @@ -271,22 +149,11 @@ irep_idt languaget::get_stub_return_symbol_name(const irep_idt &function_id) } -/*******************************************************************\ - -Function: languaget::is_symbol_opaque_function - - Inputs: - symbol - the symbol to be checked - - Outputs: True if the symbol is an opaque (e.g. non-bodied) function - - Purpose: To identify if a given symbol is an opaque function and - hence needs to be stubbed. We explicitly exclude CPROVER - functions, if they have no body it is because we haven't - generated it yet. - -\*******************************************************************/ - +/// To identify if a given symbol is an opaque function and hence needs to be +/// stubbed. We explicitly exclude CPROVER functions, if they have no body it is +/// because we haven't generated it yet. +/// \param symbol: the symbol to be checked +/// \return True if the symbol is an opaque (e.g. non-bodied) function bool languaget::is_symbol_opaque_function(const symbolt &symbol) { std::set headers; @@ -301,23 +168,10 @@ bool languaget::is_symbol_opaque_function(const symbolt &symbol) !is_internal; } -/*******************************************************************\ - -Function: languaget::generate_opaque_parameter_symbols - - Inputs: - function_symbol - the symbol of an opaque function - symbol_table - the symbol table to add the new parameter - symbols into - - Outputs: - - Purpose: To create stub parameter symbols for each parameter the - function has and assign their IDs into the parameters - identifier. - -\*******************************************************************/ - +/// To create stub parameter symbols for each parameter the function has and +/// assign their IDs into the parameters identifier. +/// \param function_symbol: the symbol of an opaque function +/// \param symbol_table: the symbol table to add the new parameter symbols into void languaget::generate_opaque_parameter_symbols( symbolt &function_symbol, symbol_tablet &symbol_table) diff --git a/src/util/language.h b/src/util/language.h index 73ead1cd8e4..fac0e13aed7 100644 --- a/src/util/language.h +++ b/src/util/language.h @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Abstract interface to support a programming language + #ifndef CPROVER_UTIL_LANGUAGE_H #define CPROVER_UTIL_LANGUAGE_H diff --git a/src/util/language_file.cpp b/src/util/language_file.cpp index b0fbb47c2f9..df74812ff5a 100644 --- a/src/util/language_file.cpp +++ b/src/util/language_file.cpp @@ -11,18 +11,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "language.h" #include "language_file.h" -/*******************************************************************\ - -Function: language_filet::language_filet - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - language_filet::language_filet(const language_filet &rhs): modules(rhs.modules), language(rhs.language==NULL?NULL:rhs.language->new_language()), @@ -30,36 +18,12 @@ language_filet::language_filet(const language_filet &rhs): { } -/*******************************************************************\ - -Function: language_filet::~language_filet - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - language_filet::~language_filet() { if(language!=NULL) delete language; } -/*******************************************************************\ - -Function: language_filet::get_modules - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void language_filet::get_modules() { language->modules_provided(modules); @@ -72,18 +36,6 @@ void language_filet::convert_lazy_method( language->convert_lazy_method(id, symbol_table); } -/*******************************************************************\ - -Function: language_filest::show_parse - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void language_filest::show_parse(std::ostream &out) { for(file_mapt::iterator it=file_map.begin(); @@ -91,19 +43,8 @@ void language_filest::show_parse(std::ostream &out) it->second.language->show_parse(out); } -/*******************************************************************\ - -Function: language_filest::set_should_generate_opqaue_method_stubs - - Inputs: - should_generate_stubs - Should stub generation be enabled - - Outputs: - - Purpose: Turn on or off stub generation for all the languages - -\*******************************************************************/ - +/// Turn on or off stub generation for all the languages +/// \param should_generate_stubs: Should stub generation be enabled void language_filest::set_should_generate_opaque_method_stubs( bool stubs_enabled) { @@ -114,17 +55,6 @@ void language_filest::set_should_generate_opaque_method_stubs( } } -/*******************************************************************\ -Function: language_filest::parse - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool language_filest::parse() { for(file_mapt::iterator it=file_map.begin(); @@ -158,18 +88,6 @@ bool language_filest::parse() return false; } -/*******************************************************************\ - -Function: language_filest::typecheck - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool language_filest::typecheck(symbol_tablet &symbol_table) { // typecheck interfaces @@ -244,18 +162,6 @@ bool language_filest::typecheck(symbol_tablet &symbol_table) return false; } -/*******************************************************************\ - -Function: language_filest::final - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool language_filest::final( symbol_tablet &symbol_table) { @@ -272,18 +178,6 @@ bool language_filest::final( return false; } -/*******************************************************************\ - -Function: language_filest::interfaces - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool language_filest::interfaces( symbol_tablet &symbol_table) { @@ -297,18 +191,6 @@ bool language_filest::interfaces( return false; } -/*******************************************************************\ - -Function: language_filest::typecheck_module - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool language_filest::typecheck_module( symbol_tablet &symbol_table, const std::string &module) @@ -326,18 +208,6 @@ bool language_filest::typecheck_module( return typecheck_module(symbol_table, it->second); } -/*******************************************************************\ - -Function: language_filest::typecheck_module - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool language_filest::typecheck_module( symbol_tablet &symbol_table, language_modulet &module) diff --git a/src/util/lispexpr.cpp b/src/util/lispexpr.cpp index 7b19fe5db37..76de8584642 100644 --- a/src/util/lispexpr.cpp +++ b/src/util/lispexpr.cpp @@ -10,18 +10,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "lispexpr.h" -/*******************************************************************\ - -Function: lispexprt::expr2string - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string lispexprt::expr2string() const { std::string result; @@ -61,36 +49,12 @@ std::string lispexprt::expr2string() const return result; } -/*******************************************************************\ - -Function: lispexprt::parse - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool lispexprt::parse(const std::string &s) { std::string::size_type ptr=0; return parse(s, ptr); } -/*******************************************************************\ - -Function: lispexprt::parse - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool lispexprt::parse( const std::string &s, std::string::size_type &ptr) @@ -183,18 +147,6 @@ bool lispexprt::parse( return false; } -/*******************************************************************\ - -Function: escape - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string escape(const std::string &s) { std::string result; @@ -210,18 +162,6 @@ std::string escape(const std::string &s) return result; } -/*******************************************************************\ - -Function: test_lispexpr - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - int test_lispexpr() { std::string line; diff --git a/src/util/lispirep.cpp b/src/util/lispirep.cpp index 75e926e8107..6eda56855b8 100644 --- a/src/util/lispirep.cpp +++ b/src/util/lispirep.cpp @@ -10,18 +10,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "irep.h" #include "lispexpr.h" -/*******************************************************************\ - -Function: - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void lisp2irep(const lispexprt &src, irept &dest) { dest.make_nil(); diff --git a/src/util/memory_info.cpp b/src/util/memory_info.cpp index af4f2ef1d52..14cf8245e77 100644 --- a/src/util/memory_info.cpp +++ b/src/util/memory_info.cpp @@ -25,18 +25,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "memory_info.h" -/*******************************************************************\ - -Function: memory_info - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void memory_info(std::ostream &out) { #if defined(__linux__) && defined(__GLIBC__) diff --git a/src/util/merge_irep.cpp b/src/util/merge_irep.cpp index 6b8d4a6924a..f31716e1140 100644 --- a/src/util/merge_irep.cpp +++ b/src/util/merge_irep.cpp @@ -9,18 +9,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "irep_hash.h" #include "merge_irep.h" -/*******************************************************************\ - -Function: to_be_merged_irept::hash - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::size_t to_be_merged_irept::hash() const { std::size_t result=hash_string(id()); @@ -44,18 +32,6 @@ std::size_t to_be_merged_irept::hash() const return result; } -/*******************************************************************\ - -Function: to_be_merged_irept::operator== - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool to_be_merged_irept::operator == (const to_be_merged_irept &other) const { if(id()!=other.id()) @@ -95,18 +71,6 @@ bool to_be_merged_irept::operator == (const to_be_merged_irept &other) const return true; } -/*******************************************************************\ - -Function: merged_irepst::merged - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - const merged_irept &merged_irepst::merged(const irept &irep) { // first see if it's already a merged_irep @@ -149,18 +113,6 @@ const merged_irept &merged_irepst::merged(const irept &irep) static_cast(*result.first)); } -/*******************************************************************\ - -Function: merge_irept::operator() - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void merge_irept::operator()(irept &irep) { // only useful if there is sharing @@ -169,18 +121,6 @@ void merge_irept::operator()(irept &irep) #endif } -/*******************************************************************\ - -Function: merge_irept::merged - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - const irept &merge_irept::merged(const irept &irep) { irep_storet::const_iterator entry=irep_store.find(irep); @@ -221,18 +161,6 @@ const irept &merge_irept::merged(const irept &irep) return *irep_store.insert(new_irep).first; } -/*******************************************************************\ - -Function: merge_full_irept::operator() - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void merge_full_irept::operator()(irept &irep) { // only useful if there is sharing @@ -241,18 +169,6 @@ void merge_full_irept::operator()(irept &irep) #endif } -/*******************************************************************\ - -Function: merge_full_irept::merged - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - const irept &merge_full_irept::merged(const irept &irep) { irep_storet::const_iterator entry=irep_store.find(irep); diff --git a/src/util/message.cpp b/src/util/message.cpp index 21a67433609..6d9a1a22191 100644 --- a/src/util/message.cpp +++ b/src/util/message.cpp @@ -8,18 +8,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "message.h" -/*******************************************************************\ - -Function: message_handlert::print - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void message_handlert::print( unsigned level, const std::string &message, @@ -65,36 +53,12 @@ void message_handlert::print( print(level, dest); } -/*******************************************************************\ - -Function: messaget::print - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void messaget::print(unsigned level, const std::string &message) { if(message_handler!=NULL) message_handler->print(level, message); } -/*******************************************************************\ - -Function: messaget::print - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void messaget::print( unsigned level, const std::string &message, @@ -106,34 +70,10 @@ void messaget::print( location); } -/*******************************************************************\ - -Function: message_clientt::~message_clientt - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - message_clientt::~message_clientt() { } -/*******************************************************************\ - -Function: message_clientt::set_message_handler - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void message_clientt::set_message_handler( message_handlert &_message_handler) { diff --git a/src/util/mp_arith.cpp b/src/util/mp_arith.cpp index 6a9082b6823..de248a60494 100644 --- a/src/util/mp_arith.cpp +++ b/src/util/mp_arith.cpp @@ -21,18 +21,6 @@ Author: Daniel Kroening, kroening@kroening.com typedef BigInt::ullong_t ullong_t; // NOLINT(readability/identifiers) typedef BigInt::llong_t llong_t; // NOLINT(readability/identifiers) -/*******************************************************************\ - -Function: >> - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - mp_integer operator>>(const mp_integer &a, const mp_integer &b) { mp_integer power=::power(2, b); @@ -51,54 +39,20 @@ mp_integer operator>>(const mp_integer &a, const mp_integer &b) } } -/*******************************************************************\ - -Function: << - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - mp_integer operator<<(const mp_integer &a, const mp_integer &b) { return a*power(2, b); } -/*******************************************************************\ - -Function: << - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::ostream &operator<<(std::ostream &out, const mp_integer &n) { out << integer2string(n); return out; } -/*******************************************************************\ - -Function: string2integer - - Inputs: string of '0'-'9' etc. most significant digit first - base of number representation - - Outputs: mp_integer - - Purpose: - -\*******************************************************************/ - +/// \par parameters: string of '0'-'9' etc. most significant digit first +/// base of number representation +/// \return mp_integer const mp_integer string2integer(const std::string &n, unsigned base) { for(unsigned i=0; i=0); @@ -305,18 +203,6 @@ std::size_t integer2size_t(const mp_integer &n) return (std::size_t)ull; } -/*******************************************************************\ - -Function: integer2unsigned - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - unsigned integer2unsigned(const mp_integer &n) { assert(n>=0); @@ -325,105 +211,45 @@ unsigned integer2unsigned(const mp_integer &n) return (unsigned)ull; } -/*******************************************************************\ - -Function: bitwise_or - - Inputs: - - Outputs: - - Purpose: bitwise or - bitwise operations only make sense on native objects, hence the - largest object size should be the largest available c++ integer - size (currently long long) - -\*******************************************************************/ - +/// bitwise or bitwise operations only make sense on native objects, hence the +/// largest object size should be the largest available c++ integer size +/// (currently long long) mp_integer bitwise_or(const mp_integer &a, const mp_integer &b) { ullong_t result=a.to_ulong()|b.to_ulong(); return result; } -/*******************************************************************\ - -Function: bitwise_and - - Inputs: - - Outputs: - - Purpose: bitwise and - bitwise operations only make sense on native objects, hence the - largest object size should be the largest available c++ integer - size (currently long long) - -\*******************************************************************/ - +/// bitwise and bitwise operations only make sense on native objects, hence the +/// largest object size should be the largest available c++ integer size +/// (currently long long) mp_integer bitwise_and(const mp_integer &a, const mp_integer &b) { ullong_t result=a.to_ulong()&b.to_ulong(); return result; } -/*******************************************************************\ - -Function: bitwise_xor - - Inputs: - - Outputs: - - Purpose: bitwise xor - bitwise operations only make sense on native objects, hence the - largest object size should be the largest available c++ integer - size (currently long long) - -\*******************************************************************/ - +/// bitwise xor bitwise operations only make sense on native objects, hence the +/// largest object size should be the largest available c++ integer size +/// (currently long long) mp_integer bitwise_xor(const mp_integer &a, const mp_integer &b) { ullong_t result=a.to_ulong()^b.to_ulong(); return result; } -/*******************************************************************\ - -Function: bitwise_neg - - Inputs: - - Outputs: - - Purpose: bitwise negation - bitwise operations only make sense on native objects, hence the - largest object size should be the largest available c++ integer - size (currently long long) - -\*******************************************************************/ - +/// bitwise negation bitwise operations only make sense on native objects, hence +/// the largest object size should be the largest available c++ integer size +/// (currently long long) mp_integer bitwise_neg(const mp_integer &a) { ullong_t result=~a.to_ulong(); return result; } -/*******************************************************************\ - -Function: arith_left_shift - - Inputs: - - Outputs: - - Purpose: arithmetic left shift - bitwise operations only make sense on native objects, hence the - largest object size should be the largest available c++ integer - size (currently long long) - -\*******************************************************************/ - +/// arithmetic left shift bitwise operations only make sense on native objects, +/// hence the largest object size should be the largest available c++ integer +/// size (currently long long) mp_integer arith_left_shift( const mp_integer &a, const mp_integer &b, @@ -441,21 +267,9 @@ mp_integer arith_left_shift( return result&mask; } -/*******************************************************************\ - -Function: arith_right_shift - - Inputs: - - Outputs: - - Purpose: arithmetic right shift (loads sign on MSB) - bitwise operations only make sense on native objects, hence the - largest object size should be the largest available c++ integer - size (currently long long) - -\*******************************************************************/ - +/// arithmetic right shift (loads sign on MSB) bitwise operations only make +/// sense on native objects, hence the largest object size should be the largest +/// available c++ integer size (currently long long) mp_integer arith_right_shift( const mp_integer &a, const mp_integer &b, @@ -472,21 +286,9 @@ mp_integer arith_right_shift( return result; } -/*******************************************************************\ - -Function: logic_left_shift - - Inputs: - - Outputs: - - Purpose: logic left shift - bitwise operations only make sense on native objects, hence the - largest object size should be the largest available c++ integer - size (currently long long) - -\*******************************************************************/ - +/// logic left shift bitwise operations only make sense on native objects, hence +/// the largest object size should be the largest available c++ integer size +/// (currently long long) mp_integer logic_left_shift( const mp_integer &a, const mp_integer &b, @@ -509,21 +311,9 @@ mp_integer logic_left_shift( return result; } -/*******************************************************************\ - -Function: logic_right_shift - - Inputs: - - Outputs: - - Purpose: logic right shift (loads 0 on MSB) - bitwise operations only make sense on native objects, hence the - largest object size should be the largest available c++ integer - size (currently long long) - -\*******************************************************************/ - +/// logic right shift (loads 0 on MSB) bitwise operations only make sense on +/// native objects, hence the largest object size should be the largest +/// available c++ integer size (currently long long) mp_integer logic_right_shift( const mp_integer &a, const mp_integer &b, @@ -537,21 +327,9 @@ mp_integer logic_right_shift( return result; } -/*******************************************************************\ - -Function: rotate_right - - Inputs: - - Outputs: - - Purpose: rotates right (MSB=LSB) - bitwise operations only make sense on native objects, hence the - largest object size should be the largest available c++ integer - size (currently long long) - -\*******************************************************************/ - +/// rotates right (MSB=LSB) bitwise operations only make sense on native +/// objects, hence the largest object size should be the largest available c++ +/// integer size (currently long long) mp_integer rotate_right( const mp_integer &a, const mp_integer &b, @@ -568,21 +346,9 @@ mp_integer rotate_right( return result; } -/*******************************************************************\ - -Function: rotate_left - - Inputs: - - Outputs: - - Purpose: rotate left (LSB=MSB) - bitwise operations only make sense on native objects, hence the - largest object size should be the largest available c++ integer - size (currently long long) - -\*******************************************************************/ - +/// rotate left (LSB=MSB) bitwise operations only make sense on native objects, +/// hence the largest object size should be the largest available c++ integer +/// size (currently long long) mp_integer rotate_left( const mp_integer &a, const mp_integer &b, diff --git a/src/util/namespace.cpp b/src/util/namespace.cpp index 1abf0fb1c59..4aeff9046e1 100644 --- a/src/util/namespace.cpp +++ b/src/util/namespace.cpp @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Namespace + #include #include @@ -16,18 +19,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "std_types.h" #include "namespace.h" -/*******************************************************************\ - -Function: get_max - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - unsigned get_max( const std::string &prefix, const symbol_tablet::symbolst &symbols) @@ -44,34 +35,10 @@ unsigned get_max( return max_nr; } -/*******************************************************************\ - -Function: namespace_baset::~namespace_baset - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - namespace_baset::~namespace_baset() { } -/*******************************************************************\ - -Function: namespace_baset::follow_symbol - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void namespace_baset::follow_symbol(irept &irep) const { while(irep.id()==ID_symbol) @@ -95,18 +62,6 @@ void namespace_baset::follow_symbol(irept &irep) const } } -/*******************************************************************\ - -Function: namespace_baset::follow - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - const typet &namespace_baset::follow(const typet &src) const { if(src.id()!=ID_symbol) @@ -124,18 +79,6 @@ const typet &namespace_baset::follow(const typet &src) const } } -/*******************************************************************\ - -Function: namespace_baset::follow_tag - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - const typet &namespace_baset::follow_tag(const union_tag_typet &src) const { const symbolt &symbol=lookup(src.get_identifier()); @@ -144,18 +87,6 @@ const typet &namespace_baset::follow_tag(const union_tag_typet &src) const return symbol.type; } -/*******************************************************************\ - -Function: namespace_baset::follow_tag - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - const typet &namespace_baset::follow_tag(const struct_tag_typet &src) const { const symbolt &symbol=lookup(src.get_identifier()); @@ -164,18 +95,6 @@ const typet &namespace_baset::follow_tag(const struct_tag_typet &src) const return symbol.type; } -/*******************************************************************\ - -Function: namespace_baset::follow_tag - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - const typet &namespace_baset::follow_tag(const c_enum_tag_typet &src) const { const symbolt &symbol=lookup(src.get_identifier()); @@ -184,18 +103,6 @@ const typet &namespace_baset::follow_tag(const c_enum_tag_typet &src) const return symbol.type; } -/*******************************************************************\ - -Function: namespace_baset::follow_macros - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void namespace_baset::follow_macros(exprt &expr) const { if(expr.id()==ID_symbol) @@ -215,18 +122,6 @@ void namespace_baset::follow_macros(exprt &expr) const follow_macros(*it); } -/*******************************************************************\ - -Function: namespace_baset::get_max - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - unsigned namespacet::get_max(const std::string &prefix) const { unsigned m=0; @@ -240,18 +135,6 @@ unsigned namespacet::get_max(const std::string &prefix) const return m; } -/*******************************************************************\ - -Function: namespacet::lookup - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool namespacet::lookup( const irep_idt &name, const symbolt *&symbol) const @@ -283,18 +166,6 @@ bool namespacet::lookup( return true; } -/*******************************************************************\ - -Function: multi_namespacet::get_max - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - unsigned multi_namespacet::get_max(const std::string &prefix) const { unsigned m=0; @@ -308,18 +179,6 @@ unsigned multi_namespacet::get_max(const std::string &prefix) const return m; } -/*******************************************************************\ - -Function: multi_namespacet::lookup - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool multi_namespacet::lookup( const irep_idt &name, const symbolt *&symbol) const diff --git a/src/util/nondet_bool.h b/src/util/nondet_bool.h index 6aee700b889..af628d3456e 100644 --- a/src/util/nondet_bool.h +++ b/src/util/nondet_bool.h @@ -6,24 +6,17 @@ Author: Chris Smowton, chris@smowton.net \*******************************************************************/ +/// \file +/// Nondeterministic boolean helper + #ifndef CPROVER_UTIL_NONDET_BOOL_H #define CPROVER_UTIL_NONDET_BOOL_H #include #include -/*******************************************************************\ - -Function: get_nondet_bool - - Inputs: Desired type (C_bool or plain bool) - - Outputs: nondet expr of that type - - Purpose: - -\*******************************************************************/ - +/// \par parameters: Desired type (C_bool or plain bool) +/// \return nondet expr of that type inline exprt get_nondet_bool(const typet &type) { // We force this to 0 and 1 and won't consider diff --git a/src/util/nondet_ifthenelse.cpp b/src/util/nondet_ifthenelse.cpp index ae2f9040977..d02f1ecd114 100644 --- a/src/util/nondet_ifthenelse.cpp +++ b/src/util/nondet_ifthenelse.cpp @@ -6,6 +6,9 @@ Author: Chris Smowton, chris@smowton.net \*******************************************************************/ +/// \file +/// Nondeterministic if-then-else + #include "nondet_ifthenelse.h" #include @@ -39,31 +42,14 @@ static symbolt &new_tmp_symbol( return *symbol_ptr; } -/*******************************************************************\ - -Function: nondet_ifthenelset::begin_if - - Inputs: - - Outputs: - - Purpose: Emits instructions and defines labels for the beginning of - a nondeterministic if-else diamond. Code is emitted to the - `result_code` member of this object's associated - `java_object_factoryt` instance `state`. - The caller should use the following pattern (where *this - is an instance of java_object_factoryt): - ``` - nondet_ifthenelset diamond(*this, "name"); - diamond.begin_if(); - result_code.copy_to_operands(Some if-branch code) - diamond.begin_else(); - result_code.copy_to_operands(Some else-branch code) - diamond.finish(); - ``` - -\*******************************************************************/ - +/// Emits instructions and defines labels for the beginning of a +/// nondeterministic if-else diamond. Code is emitted to the `result_code` +/// member of this object's associated `java_object_factoryt` instance `state`. +/// The caller should use the following pattern (where *this is an instance of +/// java_object_factoryt): ``` nondet_ifthenelset diamond(*this, "name"); +/// diamond.begin_if(); result_code.copy_to_operands(Some if-branch code) +/// diamond.begin_else(); result_code.copy_to_operands(Some else-branch code) +/// diamond.finish(); ``` void nondet_ifthenelset::begin_if() { static size_t nondet_ifthenelse_count=0; @@ -96,38 +82,15 @@ void nondet_ifthenelset::begin_if() result_code.move_to_operands(test); } -/*******************************************************************\ - -Function: nondet_ifthenelset::begin_else - - Inputs: - - Outputs: - - Purpose: Terminates the if-block and begins the else-block of a - nondet if-then-else diamond. See ::begin_if for detail. - -\*******************************************************************/ - +/// Terminates the if-block and begins the else-block of a nondet if-then-else +/// diamond. See ::begin_if for detail. void nondet_ifthenelset::begin_else() { result_code.copy_to_operands(code_gotot(join_label.get_label())); result_code.copy_to_operands(else_label); } -/*******************************************************************\ - -Function: nondet_ifthenelset::finish - - Inputs: - - Outputs: - - Purpose: Concludes a nondet if-then-else diamond. - See ::begin_if for detail. - -\*******************************************************************/ - +/// Concludes a nondet if-then-else diamond. See ::begin_if for detail. void nondet_ifthenelset::finish() { result_code.move_to_operands(join_label); diff --git a/src/util/nondet_ifthenelse.h b/src/util/nondet_ifthenelse.h index c6ee25afcab..664a6bdf1b2 100644 --- a/src/util/nondet_ifthenelse.h +++ b/src/util/nondet_ifthenelse.h @@ -6,6 +6,9 @@ Author: Chris Smowton, chris@smowton.net \*******************************************************************/ +/// \file +/// Nondeterministic if-then-else + #ifndef CPROVER_UTIL_NONDET_IFTHENELSE_H #define CPROVER_UTIL_NONDET_IFTHENELSE_H diff --git a/src/util/options.cpp b/src/util/options.cpp index e1cb8a369db..85b59d64fad 100644 --- a/src/util/options.cpp +++ b/src/util/options.cpp @@ -6,21 +6,12 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Options + #include "string2int.h" #include "options.h" -/*******************************************************************\ - -Function: optionst::set_option - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void optionst::set_option(const std::string &option, const std::string &value) { @@ -29,126 +20,42 @@ void optionst::set_option(const std::string &option, value_list.push_back(value); } -/*******************************************************************\ - -Function: optionst::set_option - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void optionst::set_option(const std::string &option, const bool value) { set_option(option, std::string(value?"1":"0")); } -/*******************************************************************\ - -Function: optionst::set_option - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void optionst::set_option(const std::string &option, const signed int value) { set_option(option, std::to_string(value)); } -/*******************************************************************\ - -Function: optionst::set_option - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void optionst::set_option(const std::string &option, const unsigned int value) { set_option(option, std::to_string(value)); } -/*******************************************************************\ - -Function: optionst::get_bool_option - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool optionst::get_bool_option(const std::string &option) const { const std::string value=get_option(option); return value.empty()?false:(std::stoi(value)!=0); } -/*******************************************************************\ - -Function: optionst::get_signed_int_option - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - signed int optionst::get_signed_int_option(const std::string &option) const { const std::string value=get_option(option); return value.empty()?0:std::stoi(value); } -/*******************************************************************\ - -Function: optionst::get_unsigned_int_option - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - unsigned int optionst::get_unsigned_int_option(const std::string &option) const { const std::string value=get_option(option); return value.empty()?0:safe_string2unsigned(value); } -/*******************************************************************\ - -Function: optionst::get_option - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - const std::string optionst::get_option(const std::string &option) const { option_mapt::const_iterator it= @@ -162,18 +69,6 @@ const std::string optionst::get_option(const std::string &option) const return it->second.front(); } -/*******************************************************************\ - -Function: optionst::get_list_option - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - const optionst::value_listt &optionst::get_list_option( const std::string &option) const { diff --git a/src/util/options.h b/src/util/options.h index 118c365c992..1a558a37331 100644 --- a/src/util/options.h +++ b/src/util/options.h @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Options + #ifndef CPROVER_UTIL_OPTIONS_H #define CPROVER_UTIL_OPTIONS_H diff --git a/src/util/parse_options.cpp b/src/util/parse_options.cpp index f674d9717e6..1e61d7e6664 100644 --- a/src/util/parse_options.cpp +++ b/src/util/parse_options.cpp @@ -19,18 +19,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "parse_options.h" #include "signal_catcher.h" -/*******************************************************************\ - -Function: parse_options_baset::parse_options_baset - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - parse_options_baset::parse_options_baset( const std::string &_optstring, int argc, const char **argv) { @@ -38,52 +26,16 @@ parse_options_baset::parse_options_baset( parse_result=cmdline.parse(argc, argv, optstring.c_str()); } -/*******************************************************************\ - -Function: parse_options_baset::help - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void parse_options_baset::help() { } -/*******************************************************************\ - -Function: parse_options_baset::usage_error - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void parse_options_baset::usage_error() { std::cerr << "Usage error!\n\n"; help(); } -/*******************************************************************\ - -Function: parse_options_baset::main - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - int parse_options_baset::main() { if(parse_result) diff --git a/src/util/parser.cpp b/src/util/parser.cpp index 539ed1f0e63..488389d5e49 100644 --- a/src/util/parser.cpp +++ b/src/util/parser.cpp @@ -15,18 +15,6 @@ int isatty(int f) } #endif -/*******************************************************************\ - -Function: _newstack - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - exprt &_newstack(parsert &parser, unsigned &x) { x=(unsigned)parser.stack.size(); @@ -38,18 +26,6 @@ exprt &_newstack(parsert &parser, unsigned &x) return parser.stack.back(); } -/*******************************************************************\ - -Function: - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void parsert::parse_error( const std::string &message, const std::string &before) diff --git a/src/util/parser.h b/src/util/parser.h index f8792a75c66..b450de7f614 100644 --- a/src/util/parser.h +++ b/src/util/parser.h @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Parser utilities + #ifndef CPROVER_UTIL_PARSER_H #define CPROVER_UTIL_PARSER_H diff --git a/src/util/pipe_stream.cpp b/src/util/pipe_stream.cpp index 104dd3a2075..6a7c1461764 100644 --- a/src/util/pipe_stream.cpp +++ b/src/util/pipe_stream.cpp @@ -6,6 +6,9 @@ Module: A stdin/stdout pipe as STL stream \*******************************************************************/ +/// \file +/// A stdin/stdout pipe as STL stream + #include #include #include @@ -26,18 +29,7 @@ Module: A stdin/stdout pipe as STL stream #define READ_BUFFER_SIZE 1024 -/*******************************************************************\ - -Function: pipe_streamt::pipe_streamt - - Inputs: - - Outputs: - - Purpose: Constructor for external process - -\*******************************************************************/ - +/// Constructor for external process pipe_streamt::pipe_streamt( const std::string &_executable, const std::list &_args): @@ -50,19 +42,9 @@ pipe_streamt::pipe_streamt( #endif } -/*******************************************************************\ - -Function: pipe_streamt::run - - Inputs: - - Outputs: Returns -1 if an error occurs. - - Purpose: Starts an external process. A new process is forked and - run returns immediately. - -\*******************************************************************/ - +/// Starts an external process. A new process is forked and run returns +/// immediately. +/// \return Returns -1 if an error occurs. #ifdef _WIN32 int pipe_streamt::run() @@ -204,18 +186,7 @@ int pipe_streamt::run() #endif -/*******************************************************************\ - -Function: pipe_streamt::wait - - Inputs: - - Outputs: - - Purpose: Wait for the process to terminate - -\*******************************************************************/ - +/// Wait for the process to terminate int pipe_streamt::wait() { #ifdef _WIN32 @@ -242,18 +213,7 @@ int pipe_streamt::wait() #endif } -/*******************************************************************\ - -Function: filedescriptor_streambuft::filedescriptor_streambuft - - Inputs: - - Outputs: - - Purpose: Constructor - -\*******************************************************************/ - +/// Constructor filedescriptor_streambuft::filedescriptor_streambuft(): #ifdef _WIN32 proc_in(INVALID_HANDLE_VALUE), @@ -267,18 +227,7 @@ filedescriptor_streambuft::filedescriptor_streambuft(): setg(in_buffer, in_buffer, in_buffer); } -/*******************************************************************\ - -Function: filedescriptor_streambuft::~filedescriptor_streambuft - - Inputs: - - Outputs: - - Purpose: Destructor - -\*******************************************************************/ - +/// Destructor filedescriptor_streambuft::~filedescriptor_streambuft() { #ifdef _WIN32 @@ -302,18 +251,7 @@ filedescriptor_streambuft::~filedescriptor_streambuft() delete in_buffer; } -/*******************************************************************\ - -Function: filedescriptor_streambuft::overflow - - Inputs: - - Outputs: - - Purpose: write one character to the piped process - -\*******************************************************************/ - +/// write one character to the piped process std::streambuf::int_type filedescriptor_streambuft::overflow( std::streambuf::int_type character) { @@ -334,18 +272,7 @@ std::streambuf::int_type filedescriptor_streambuft::overflow( return character; } -/*******************************************************************\ - -Function: filedescriptor_streambuft::xsputn - - Inputs: - - Outputs: - - Purpose: write a number of character to the piped process - -\*******************************************************************/ - +/// write a number of character to the piped process std::streamsize filedescriptor_streambuft::xsputn( const char* str, std::streamsize count) { @@ -358,18 +285,7 @@ std::streamsize filedescriptor_streambuft::xsputn( #endif } -/*******************************************************************\ - -Function: filedescriptor_streambuft::underflow - - Inputs: - - Outputs: - - Purpose: read a character from the piped process - -\*******************************************************************/ - +/// read a character from the piped process std::streambuf::int_type filedescriptor_streambuft::underflow() { if(gptr()==0) @@ -396,18 +312,7 @@ std::streambuf::int_type filedescriptor_streambuft::underflow() return traits_type::to_int_type(*gptr()); } -/*******************************************************************\ - -Function: filedescriptor_streambuft::xsgetn - - Inputs: - - Outputs: - - Purpose: read a number of characters from the piped process - -\*******************************************************************/ - +/// read a number of characters from the piped process std::streamsize filedescriptor_streambuft::xsgetn( char *target, std::streamsize count) { @@ -430,18 +335,7 @@ std::streamsize filedescriptor_streambuft::xsgetn( return (available + xsgetn(target+available, count-available)); } -/*******************************************************************\ - -Function: filedescriptor_streambuft::showmanyc - - Inputs: - - Outputs: - - Purpose: determine number of available characters in stream - -\*******************************************************************/ - +/// determine number of available characters in stream std::streamsize filedescriptor_streambuft::showmanyc() { if(gptr()==0) @@ -453,12 +347,6 @@ std::streamsize filedescriptor_streambuft::showmanyc() return 0; } -/*******************************************************************\ - - Brief demonstration of the pipe_streamt class - -\*******************************************************************/ - #ifdef UNIT #include diff --git a/src/util/pipe_stream.h b/src/util/pipe_stream.h index b2b5bcea533..e03169ffd1a 100644 --- a/src/util/pipe_stream.h +++ b/src/util/pipe_stream.h @@ -6,6 +6,9 @@ Module: A stdin/stdout pipe as STL stream \*******************************************************************/ +/// \file +/// A stdin/stdout pipe as STL stream + #ifndef CPROVER_UTIL_PIPE_STREAM_H #define CPROVER_UTIL_PIPE_STREAM_H diff --git a/src/util/pointer_offset_size.cpp b/src/util/pointer_offset_size.cpp index 43e7dd0d5a9..ea26479544b 100644 --- a/src/util/pointer_offset_size.cpp +++ b/src/util/pointer_offset_size.cpp @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Pointer Logic + #include #include "expr.h" @@ -56,18 +59,6 @@ member_offset_iterator &member_offset_iterator::operator++() return *this; } -/*******************************************************************\ - -Function: member_offset - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - mp_integer member_offset( const struct_typet &type, const irep_idt &member, @@ -88,18 +79,6 @@ mp_integer member_offset( return offsets->second; } -/*******************************************************************\ - -Function: pointer_offset_size - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - mp_integer pointer_offset_size( const typet &type, const namespacet &ns) @@ -110,18 +89,6 @@ mp_integer pointer_offset_size( return bits/8+(((bits%8)==0)?0:1); } -/*******************************************************************\ - -Function: pointer_offset_bits - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - mp_integer pointer_offset_bits( const typet &type, const namespacet &ns) @@ -251,18 +218,6 @@ mp_integer pointer_offset_bits( return mp_integer(-1); } -/*******************************************************************\ - -Function: member_offset_expr - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - exprt member_offset_expr( const member_exprt &member_expr, const namespacet &ns) @@ -278,18 +233,6 @@ exprt member_offset_expr( return nil_exprt(); } -/*******************************************************************\ - -Function: member_offset_expr - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - exprt member_offset_expr( const struct_typet &type, const irep_idt &member, @@ -331,18 +274,6 @@ exprt member_offset_expr( return result; } -/*******************************************************************\ - -Function: size_of_expr - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - exprt size_of_expr( const typet &type, const namespacet &ns) @@ -526,18 +457,6 @@ exprt size_of_expr( return nil_exprt(); } -/*******************************************************************\ - -Function: compute_pointer_offset - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - mp_integer compute_pointer_offset( const exprt &expr, const namespacet &ns) @@ -597,18 +516,6 @@ mp_integer compute_pointer_offset( return -1; // don't know } -/*******************************************************************\ - -Function: build_sizeof_expr - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - exprt build_sizeof_expr( const constant_exprt &expr, const namespacet &ns) diff --git a/src/util/pointer_offset_size.h b/src/util/pointer_offset_size.h index e6f7ae15314..aeb62e03d74 100644 --- a/src/util/pointer_offset_size.h +++ b/src/util/pointer_offset_size.h @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Pointer Logic + #ifndef CPROVER_UTIL_POINTER_OFFSET_SIZE_H #define CPROVER_UTIL_POINTER_OFFSET_SIZE_H diff --git a/src/util/pointer_predicates.cpp b/src/util/pointer_predicates.cpp index 53427d056e2..fe546d08277 100644 --- a/src/util/pointer_predicates.cpp +++ b/src/util/pointer_predicates.cpp @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Various predicates over pointers in programs + #include "cprover_prefix.h" #include "namespace.h" #include "std_expr.h" @@ -17,18 +20,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "pointer_predicates.h" -/*******************************************************************\ - -Function: pointer_object - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - exprt pointer_object(const exprt &p) { return unary_exprt( @@ -36,71 +27,23 @@ exprt pointer_object(const exprt &p) unsignedbv_typet(config.ansi_c.pointer_width)); } -/*******************************************************************\ - -Function: same_object - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - exprt same_object(const exprt &p1, const exprt &p2) { return equal_exprt(pointer_object(p1), pointer_object(p2)); } -/*******************************************************************\ - -Function: object_size - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - exprt object_size(const exprt &pointer) { typet type=signedbv_typet(config.ansi_c.pointer_width); return unary_exprt(ID_object_size, pointer, type); } -/*******************************************************************\ - -Function: pointer_offset - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - exprt pointer_offset(const exprt &pointer) { typet type=signedbv_typet(config.ansi_c.pointer_width); return unary_exprt(ID_pointer_offset, pointer, type); } -/*******************************************************************\ - -Function: malloc_object - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - exprt malloc_object(const exprt &pointer, const namespacet &ns) { // we check __CPROVER_malloc_object! @@ -109,18 +52,6 @@ exprt malloc_object(const exprt &pointer, const namespacet &ns) return same_object(pointer, malloc_object_symbol.symbol_expr()); } -/*******************************************************************\ - -Function: deallocated - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - exprt deallocated(const exprt &pointer, const namespacet &ns) { // we check __CPROVER_deallocated! @@ -129,18 +60,6 @@ exprt deallocated(const exprt &pointer, const namespacet &ns) return same_object(pointer, deallocated_symbol.symbol_expr()); } -/*******************************************************************\ - -Function: dead_object - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - exprt dead_object(const exprt &pointer, const namespacet &ns) { // we check __CPROVER_dead_object! @@ -149,52 +68,16 @@ exprt dead_object(const exprt &pointer, const namespacet &ns) return same_object(pointer, deallocated_symbol.symbol_expr()); } -/*******************************************************************\ - -Function: dynamic_size - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - exprt dynamic_size(const namespacet &ns) { return ns.lookup(CPROVER_PREFIX "malloc_size").symbol_expr(); } -/*******************************************************************\ - -Function: pointer_object_has_type - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - exprt pointer_object_has_type(const exprt &pointer, const typet &type) { return false_exprt(); } -/*******************************************************************\ - -Function: dynamic_object - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - exprt dynamic_object(const exprt &pointer) { exprt dynamic_expr(ID_dynamic_object, bool_typet()); @@ -202,35 +85,11 @@ exprt dynamic_object(const exprt &pointer) return dynamic_expr; } -/*******************************************************************\ - -Function: good_pointer - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - exprt good_pointer(const exprt &pointer) { return unary_exprt(ID_good_pointer, pointer, bool_typet()); } -/*******************************************************************\ - -Function: good_pointer_def - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - exprt good_pointer_def( const exprt &pointer, const namespacet &ns) @@ -287,36 +146,12 @@ exprt good_pointer_def( good_other); } -/*******************************************************************\ - -Function: null_object - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - exprt null_object(const exprt &pointer) { null_pointer_exprt null_pointer(to_pointer_type(pointer.type())); return same_object(null_pointer, pointer); } -/*******************************************************************\ - -Function: integer_address - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - exprt integer_address(const exprt &pointer) { null_pointer_exprt null_pointer(to_pointer_type(pointer.type())); @@ -324,53 +159,17 @@ exprt integer_address(const exprt &pointer) notequal_exprt(null_pointer, pointer)); } -/*******************************************************************\ - -Function: null_pointer - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - exprt null_pointer(const exprt &pointer) { null_pointer_exprt null_pointer(to_pointer_type(pointer.type())); return same_object(pointer, null_pointer); } -/*******************************************************************\ - -Function: invalid_pointer - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - exprt invalid_pointer(const exprt &pointer) { return unary_exprt(ID_invalid_pointer, pointer, bool_typet()); } -/*******************************************************************\ - -Function: dynamic_object_lower_bound - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - exprt dynamic_object_lower_bound( const exprt &pointer, const namespacet &ns, @@ -379,18 +178,6 @@ exprt dynamic_object_lower_bound( return object_lower_bound(pointer, ns, offset); } -/*******************************************************************\ - -Function: dynamic_object_upper_bound - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - exprt dynamic_object_upper_bound( const exprt &pointer, const typet &dereference_type, @@ -421,18 +208,6 @@ exprt dynamic_object_upper_bound( return binary_relation_exprt(sum, op, malloc_size); } -/*******************************************************************\ - -Function: object_upper_bound - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - exprt object_upper_bound( const exprt &pointer, const typet &dereference_type, @@ -464,18 +239,6 @@ exprt object_upper_bound( return binary_relation_exprt(sum, op, object_size_expr); } -/*******************************************************************\ - -Function: object_lower_bound - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - exprt object_lower_bound( const exprt &pointer, const namespacet &ns, diff --git a/src/util/pointer_predicates.h b/src/util/pointer_predicates.h index 9f3ee3980fd..201d094f50a 100644 --- a/src/util/pointer_predicates.h +++ b/src/util/pointer_predicates.h @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Various predicates over pointers in programs + #ifndef CPROVER_UTIL_POINTER_PREDICATES_H #define CPROVER_UTIL_POINTER_PREDICATES_H diff --git a/src/util/preprocessor.h b/src/util/preprocessor.h index 248a85d0402..64919612319 100644 --- a/src/util/preprocessor.h +++ b/src/util/preprocessor.h @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Preprocessing Base Class + #ifndef CPROVER_UTIL_PREPROCESSOR_H #define CPROVER_UTIL_PREPROCESSOR_H diff --git a/src/util/rational.cpp b/src/util/rational.cpp index 45dfdec86db..f43b5915a28 100644 --- a/src/util/rational.cpp +++ b/src/util/rational.cpp @@ -6,23 +6,14 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Rational Numbers + #include #include #include "rational.h" -/*******************************************************************\ - -Function: rationalt::operator+= - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - rationalt &rationalt::operator+=(const rationalt &n) { rationalt tmp(n); @@ -32,18 +23,6 @@ rationalt &rationalt::operator+=(const rationalt &n) return *this; } -/*******************************************************************\ - -Function: rationalt::operator-= - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - rationalt &rationalt::operator-=(const rationalt &n) { rationalt tmp(n); @@ -53,36 +32,12 @@ rationalt &rationalt::operator-=(const rationalt &n) return *this; } -/*******************************************************************\ - -Function: rationalt::operator-= - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - rationalt &rationalt::operator-() { numerator.negate(); return *this; } -/*******************************************************************\ - -Function: rationalt::operator*= - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - rationalt &rationalt::operator*=(const rationalt &n) { numerator*=n.numerator; @@ -91,18 +46,6 @@ rationalt &rationalt::operator*=(const rationalt &n) return *this; } -/*******************************************************************\ - -Function: rationalt::operator/= - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - rationalt &rationalt::operator/=(const rationalt &n) { assert(!n.numerator.is_zero()); @@ -112,18 +55,6 @@ rationalt &rationalt::operator/=(const rationalt &n) return *this; } -/*******************************************************************\ - -Function: rationalt::normalize - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void rationalt::normalize() { // first do sign @@ -144,18 +75,6 @@ void rationalt::normalize() } } -/*******************************************************************\ - -Function: rationalt::same_denominator - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void rationalt::same_denominator(rationalt &n) { if(denominator==n.denominator) @@ -169,36 +88,12 @@ void rationalt::same_denominator(rationalt &n) n.denominator=t; } -/*******************************************************************\ - -Function: rationalt::invert - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void rationalt::invert() { assert(numerator!=0); std::swap(numerator, denominator); } -/*******************************************************************\ - -Function: inverse - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - rationalt inverse(const rationalt &n) { rationalt tmp(n); @@ -206,18 +101,6 @@ rationalt inverse(const rationalt &n) return tmp; } -/*******************************************************************\ - -Function: operator<< - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::ostream &operator<<(std::ostream &out, const rationalt &a) { std::string d=integer2string(a.get_numerator()); diff --git a/src/util/rational_tools.cpp b/src/util/rational_tools.cpp index 3e57beefc91..140241a9179 100644 --- a/src/util/rational_tools.cpp +++ b/src/util/rational_tools.cpp @@ -6,23 +6,14 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Rational Numbers + #include "rational.h" #include "std_types.h" #include "rational_tools.h" -/*******************************************************************\ - -Function: power10 - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - static mp_integer power10(size_t i) { mp_integer result=1; @@ -33,18 +24,6 @@ static mp_integer power10(size_t i) return result; } -/*******************************************************************\ - -Function: to_rational - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool to_rational(const exprt &expr, rationalt &rational_value) { if(expr.id()!=ID_constant) @@ -99,18 +78,6 @@ bool to_rational(const exprt &expr, rationalt &rational_value) return false; } -/*******************************************************************\ - -Function: from_rational - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - constant_exprt from_rational(const rationalt &a) { std::string d=integer2string(a.get_numerator()); diff --git a/src/util/ref_expr_set.cpp b/src/util/ref_expr_set.cpp index 7e54107fd52..2b9fc3b213d 100644 --- a/src/util/ref_expr_set.cpp +++ b/src/util/ref_expr_set.cpp @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Value Set + #include "ref_expr_set.h" const ref_expr_set_dt ref_expr_set_dt::blank; diff --git a/src/util/ref_expr_set.h b/src/util/ref_expr_set.h index d7846d092d1..349619c233f 100644 --- a/src/util/ref_expr_set.h +++ b/src/util/ref_expr_set.h @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Value Set + #ifndef CPROVER_UTIL_REF_EXPR_SET_H #define CPROVER_UTIL_REF_EXPR_SET_H diff --git a/src/util/reference_counting.h b/src/util/reference_counting.h index e6746f3c3a6..d394bc3be9e 100644 --- a/src/util/reference_counting.h +++ b/src/util/reference_counting.h @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Reference Counting + #ifndef CPROVER_UTIL_REFERENCE_COUNTING_H #define CPROVER_UTIL_REFERENCE_COUNTING_H diff --git a/src/util/refined_string_type.cpp b/src/util/refined_string_type.cpp index 0625149cf83..29f73f88da6 100644 --- a/src/util/refined_string_type.cpp +++ b/src/util/refined_string_type.cpp @@ -10,18 +10,16 @@ Author: Romain Brenguier, romain.brenguier@diffblue.com \*******************************************************************/ +/// \file +/// Type for string expressions used by the string solver. These string +/// expressions contain a field `length`, of type `index_type`, a field +/// `content` of type `content_type`. This module also defines functions to +/// recognise the C and java string types. + #include #include "refined_string_type.h" -/*******************************************************************\ - -Constructor: refined_string_typet::refined_string_typet - - Inputs: type of characters - -\*******************************************************************/ - refined_string_typet::refined_string_typet( const typet &index_type, const typet &char_type) { @@ -32,16 +30,8 @@ refined_string_typet::refined_string_typet( set_tag(CPROVER_PREFIX"refined_string_type"); } -/*******************************************************************\ - -Function: refined_string_typet::is_refined_string_type - - Inputs: a type - - Outputs: Boolean telling whether the input is a refined string type - -\*******************************************************************/ - +/// \par parameters: a type +/// \return Boolean telling whether the input is a refined string type bool refined_string_typet::is_refined_string_type(const typet &type) { return diff --git a/src/util/refined_string_type.h b/src/util/refined_string_type.h index a0cb7500e7f..efa8a0987ec 100644 --- a/src/util/refined_string_type.h +++ b/src/util/refined_string_type.h @@ -10,6 +10,12 @@ Author: Romain Brenguier, romain.brenguier@diffblue.com \*******************************************************************/ +/// \file +/// Type for string expressions used by the string solver. These string +/// expressions contain a field `length`, of type `index_type`, a field +/// `content` of type `content_type`. This module also defines functions to +/// recognise the C and java string types. + #ifndef CPROVER_UTIL_REFINED_STRING_TYPE_H #define CPROVER_UTIL_REFINED_STRING_TYPE_H diff --git a/src/util/rename.cpp b/src/util/rename.cpp index b121edb6acb..c095d420bd8 100644 --- a/src/util/rename.cpp +++ b/src/util/rename.cpp @@ -13,35 +13,17 @@ Author: Daniel Kroening, kroening@kroening.com #include "expr.h" #include "namespace.h" -/*******************************************************************\ - -Function: get_new_name - - Inputs: symbol to be renamed, namespace - - Outputs: new symbol - - Purpose: automated variable renaming - -\*******************************************************************/ - +/// automated variable renaming +/// \par parameters: symbol to be renamed, namespace +/// \return new symbol void get_new_name(symbolt &symbol, const namespacet &ns) { get_new_name(symbol.name, ns); } -/*******************************************************************\ - -Function: get_new_name - - Inputs: symbol to be renamed, namespace - - Outputs: new symbol - - Purpose: automated variable renaming - -\*******************************************************************/ - +/// automated variable renaming +/// \par parameters: symbol to be renamed, namespace +/// \return new symbol void get_new_name(irep_idt &new_name, const namespacet &ns) { const symbolt *symbol; @@ -53,19 +35,9 @@ void get_new_name(irep_idt &new_name, const namespacet &ns) new_name=prefix+std::to_string(ns.get_max(prefix)+1); } -/*******************************************************************\ - -Function: rename - - Inputs: expression, old name, new name - - Outputs: modifies the expression - returns false iff something was renamed - - Purpose: automated variable renaming - -\*******************************************************************/ - +/// automated variable renaming +/// \par parameters: expression, old name, new name +/// \return modifies the expression returns false iff something was renamed bool rename(exprt &expr, const irep_idt &old_name, const irep_idt &new_name) { diff --git a/src/util/rename_symbol.cpp b/src/util/rename_symbol.cpp index c6930a01d87..fff2e220345 100644 --- a/src/util/rename_symbol.cpp +++ b/src/util/rename_symbol.cpp @@ -10,50 +10,14 @@ Author: Daniel Kroening, kroening@kroening.com #include "std_expr.h" #include "rename_symbol.h" -/*******************************************************************\ - -Function: rename_symbolt::rename_symbolt - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - rename_symbolt::rename_symbolt() { } -/*******************************************************************\ - -Function: rename_symbolt::~rename_symbolt - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - rename_symbolt::~rename_symbolt() { } -/*******************************************************************\ - -Function: rename_symbolt::insert - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void rename_symbolt::insert( const symbol_exprt &old_expr, const symbol_exprt &new_expr) @@ -61,18 +25,6 @@ void rename_symbolt::insert( insert_expr(old_expr.get_identifier(), new_expr.get_identifier()); } -/*******************************************************************\ - -Function: rename_symbolt::rename - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool rename_symbolt::rename(exprt &dest) const { bool result=true; @@ -119,18 +71,6 @@ bool rename_symbolt::rename(exprt &dest) const return result; } -/*******************************************************************\ - -Function: rename_symbolt::have_to_rename - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool rename_symbolt::have_to_rename(const exprt &dest) const { if(expr_map.empty() && type_map.empty()) @@ -165,18 +105,6 @@ bool rename_symbolt::have_to_rename(const exprt &dest) const return false; } -/*******************************************************************\ - -Function: rename_symbolt::rename - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool rename_symbolt::rename(typet &dest) const { if(!have_to_rename(dest)) @@ -263,18 +191,6 @@ bool rename_symbolt::rename(typet &dest) const return result; } -/*******************************************************************\ - -Function: rename_symbolt::have_to_rename - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool rename_symbolt::have_to_rename(const typet &dest) const { if(expr_map.empty() && type_map.empty()) diff --git a/src/util/replace_expr.cpp b/src/util/replace_expr.cpp index fc419aa59fa..b4a8e97b086 100644 --- a/src/util/replace_expr.cpp +++ b/src/util/replace_expr.cpp @@ -8,18 +8,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "replace_expr.h" -/*******************************************************************\ - -Function: replace_expr - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool replace_expr(const exprt &what, const exprt &by, exprt &dest) { if(dest==what) @@ -36,18 +24,6 @@ bool replace_expr(const exprt &what, const exprt &by, exprt &dest) return result; } -/*******************************************************************\ - -Function: replace_expr - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool replace_expr(const replace_mapt &what, exprt &dest) { { diff --git a/src/util/replace_symbol.cpp b/src/util/replace_symbol.cpp index 4dce48d8b93..5f69ea7f158 100644 --- a/src/util/replace_symbol.cpp +++ b/src/util/replace_symbol.cpp @@ -10,50 +10,14 @@ Author: Daniel Kroening, kroening@kroening.com #include "std_expr.h" #include "replace_symbol.h" -/*******************************************************************\ - -Function: replace_symbolt::replace_symbolt - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - replace_symbolt::replace_symbolt() { } -/*******************************************************************\ - -Function: replace_symbolt::~replace_symbolt - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - replace_symbolt::~replace_symbolt() { } -/*******************************************************************\ - -Function: replace_symbolt::insert - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void replace_symbolt::insert( const symbol_exprt &old_expr, const exprt &new_expr) @@ -62,18 +26,6 @@ void replace_symbolt::insert( old_expr.get_identifier(), new_expr)); } -/*******************************************************************\ - -Function: replace_symbolt::replace - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool replace_symbolt::replace(exprt &dest) const { bool result=true; @@ -120,18 +72,6 @@ bool replace_symbolt::replace(exprt &dest) const return result; } -/*******************************************************************\ - -Function: replace_symbolt::have_to_replace - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool replace_symbolt::have_to_replace(const exprt &dest) const { // first look at type @@ -163,18 +103,6 @@ bool replace_symbolt::have_to_replace(const exprt &dest) const return false; } -/*******************************************************************\ - -Function: replace_symbolt::replace - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool replace_symbolt::replace(typet &dest) const { if(!have_to_replace(dest)) @@ -236,18 +164,6 @@ bool replace_symbolt::replace(typet &dest) const return result; } -/*******************************************************************\ - -Function: replace_symbolt::have_to_replace - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool replace_symbolt::have_to_replace(const typet &dest) const { if(dest.has_subtype()) diff --git a/src/util/run.cpp b/src/util/run.cpp index 8a8a1c68659..41df754c551 100644 --- a/src/util/run.cpp +++ b/src/util/run.cpp @@ -33,18 +33,6 @@ Date: August 2012 #include "run.h" -/*******************************************************************\ - -Function: run_shell - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - int run_shell(const std::string &command) { std::string shell="/bin/sh"; @@ -54,18 +42,6 @@ int run_shell(const std::string &command) return run(shell, argv, "", ""); } -/*******************************************************************\ - -Function: run - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - int run( const std::string &what, const std::vector &argv, diff --git a/src/util/safe_pointer.h b/src/util/safe_pointer.h index 47e52ac13fe..152eb3242d9 100644 --- a/src/util/safe_pointer.h +++ b/src/util/safe_pointer.h @@ -6,6 +6,9 @@ Author: Chris Smowton, chris@smowton.net \*******************************************************************/ +/// \file +/// Simple checked pointers + #ifndef CPROVER_UTIL_SAFE_POINTER_H #define CPROVER_UTIL_SAFE_POINTER_H diff --git a/src/util/sharing_map.h b/src/util/sharing_map.h index 23f08d0bb06..8cbfcce4002 100644 --- a/src/util/sharing_map.h +++ b/src/util/sharing_map.h @@ -6,6 +6,9 @@ Author: Daniel Poetzl \*******************************************************************/ +/// \file +/// Sharing map + #ifndef CPROVER_UTIL_SHARING_MAP_H #define CPROVER_UTIL_SHARING_MAP_H @@ -211,18 +214,6 @@ class sharing_mapt void gather_all(const node_type &n, delta_viewt &delta_view) const; }; -/*******************************************************************\ - -Function: get_view - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - SHARING_MAPT(void)::get_view(viewt &view) const { assert(view.empty()); @@ -259,18 +250,6 @@ SHARING_MAPT(void)::get_view(viewt &view) const while(!stack.empty()); } -/*******************************************************************\ - -Function: gather_all - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - SHARING_MAPT(void)::gather_all(const node_type &n, delta_viewt &delta_view) const { @@ -307,18 +286,6 @@ SHARING_MAPT(void)::gather_all(const node_type &n, delta_viewt &delta_view) while(!stack.empty()); } -/*******************************************************************\ - -Function: get_delta_view - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - SHARING_MAPT(void)::get_delta_view( const self_type &other, delta_viewt &delta_view, @@ -425,18 +392,6 @@ SHARING_MAPT(void)::get_delta_view( while(!stack.empty()); } -/*******************************************************************\ - -Function: get_container_node - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - SHARING_MAPT2(, node_type *)::get_container_node(const key_type &k) { size_t key=hash()(k); @@ -453,18 +408,6 @@ SHARING_MAPT2(, node_type *)::get_container_node(const key_type &k) return p; } -/*******************************************************************\ - -Function: get_container_node - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - SHARING_MAPT2(const, node_type *)::get_container_node(const key_type &k) const { size_t key=hash()(k); @@ -485,18 +428,6 @@ SHARING_MAPT2(const, node_type *)::get_container_node(const key_type &k) const return p; } -/*******************************************************************\ - -Function: get_leaf_node - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - SHARING_MAPT2(const, node_type *)::get_leaf_node(const key_type &k) const { const node_type *p=get_container_node(k); @@ -508,18 +439,6 @@ SHARING_MAPT2(const, node_type *)::get_leaf_node(const key_type &k) const return p; } -/*******************************************************************\ - -Function: erase - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - SHARING_MAPT2(, size_type)::erase( const key_type &k, const tvt &key_exists) @@ -572,18 +491,6 @@ SHARING_MAPT2(, size_type)::erase( return 1; } -/*******************************************************************\ - -Function: erase_all - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - SHARING_MAPT2(, size_type)::erase_all( const keyst &ks, const tvt &key_exists) @@ -598,18 +505,6 @@ SHARING_MAPT2(, size_type)::erase_all( return cnt; } -/*******************************************************************\ - -Function: insert - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - SHARING_MAPT2(, const_find_type)::insert( const key_type &k, const mapped_type &m, @@ -633,18 +528,6 @@ SHARING_MAPT2(, const_find_type)::insert( return const_find_type(as_const(p)->get_value(), true); } -/*******************************************************************\ - -Function: insert - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - SHARING_MAPT2(, const_find_type)::insert( const value_type &p, const tvt &key_exists) @@ -652,18 +535,6 @@ SHARING_MAPT2(, const_find_type)::insert( return insert(p.first, p.second, key_exists); } -/*******************************************************************\ - -Function: place - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - SHARING_MAPT2(, find_type)::place( const key_type &k, const mapped_type &m) @@ -682,36 +553,12 @@ SHARING_MAPT2(, find_type)::place( return find_type(p->get_value(), true); } -/*******************************************************************\ - -Function: place - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - SHARING_MAPT2(, find_type)::place( const value_type &p) { return place(p.first, p.second); } -/*******************************************************************\ - -Function: find - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - SHARING_MAPT2(, find_type)::find( const key_type &k, const tvt &key_exists) @@ -731,18 +578,6 @@ SHARING_MAPT2(, find_type)::find( } -/*******************************************************************\ - -Function: find - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - SHARING_MAPT2(, const_find_type)::find(const key_type &k) const { const node_type *p=get_leaf_node(k); @@ -753,18 +588,6 @@ SHARING_MAPT2(, const_find_type)::find(const key_type &k) const return const_find_type(p->get_value(), true); } -/*******************************************************************\ - -Function: at - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - SHARING_MAPT2(, mapped_type &)::at( const key_type &k, const tvt &key_exists) @@ -777,18 +600,6 @@ SHARING_MAPT2(, mapped_type &)::at( return r.first; } -/*******************************************************************\ - -Function: at - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - SHARING_MAPT2(const, mapped_type &)::at(const key_type &k) const { const_find_type r=find(k); @@ -798,18 +609,6 @@ SHARING_MAPT2(const, mapped_type &)::at(const key_type &k) const return r.first; } -/*******************************************************************\ - -Function: operator[] - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - SHARING_MAPT2(, mapped_type &)::operator[](const key_type &k) { return place(k, mapped_type()).first; diff --git a/src/util/sharing_node.h b/src/util/sharing_node.h index 1e3d29a413e..9f8cc0a4416 100644 --- a/src/util/sharing_node.h +++ b/src/util/sharing_node.h @@ -6,6 +6,9 @@ Author: Daniel Poetzl \*******************************************************************/ +/// \file +/// Sharing node + #ifndef CPROVER_UTIL_SHARING_NODE_H #define CPROVER_UTIL_SHARING_NODE_H diff --git a/src/util/signal_catcher.cpp b/src/util/signal_catcher.cpp index b0178340543..d06c8356eee 100644 --- a/src/util/signal_catcher.cpp +++ b/src/util/signal_catcher.cpp @@ -28,18 +28,6 @@ Author: Daniel Kroening, kroening@kroening.com std::vector pids_of_children; #endif -/*******************************************************************\ - -Function: install_signal_catcher - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void install_signal_catcher() { #if defined(_WIN32) @@ -57,18 +45,6 @@ void install_signal_catcher() #endif } -/*******************************************************************\ - -Function: remove_signal_catcher - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void remove_signal_catcher() { #if defined(_WIN32) @@ -85,18 +61,6 @@ void remove_signal_catcher() #endif } -/*******************************************************************\ - -Function: signal_catcher - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void signal_catcher(int sig) { #if defined(_WIN32) diff --git a/src/util/simplify_expr.cpp b/src/util/simplify_expr.cpp index 837138258d0..8ac00c44083 100644 --- a/src/util/simplify_expr.cpp +++ b/src/util/simplify_expr.cpp @@ -63,18 +63,6 @@ struct simplify_expr_cachet simplify_expr_cachet simplify_expr_cache; #endif -/*******************************************************************\ - -Function: simplify_exprt::simplify_abs - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool simplify_exprt::simplify_abs(exprt &expr) { if(expr.operands().size()!=1) @@ -115,18 +103,6 @@ bool simplify_exprt::simplify_abs(exprt &expr) return true; } -/*******************************************************************\ - -Function: simplify_exprt::simplify_sign - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool simplify_exprt::simplify_sign(exprt &expr) { if(expr.operands().size()!=1) @@ -157,18 +133,6 @@ bool simplify_exprt::simplify_sign(exprt &expr) return true; } -/*******************************************************************\ - -Function: simplify_exprt::simplify_popcount - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool simplify_exprt::simplify_popcount(exprt &expr) { if(expr.operands().size()!=1) @@ -200,18 +164,6 @@ bool simplify_exprt::simplify_popcount(exprt &expr) return true; } -/*******************************************************************\ - -Function: simplify_exprt::simplify_typecast - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool simplify_exprt::simplify_typecast(exprt &expr) { if(expr.operands().size()!=1) @@ -759,18 +711,6 @@ bool simplify_exprt::simplify_typecast(exprt &expr) return true; } -/*******************************************************************\ - -Function: simplify_exprt::simplify_dereference - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool simplify_exprt::simplify_dereference(exprt &expr) { const exprt &pointer=to_dereference_expr(expr).pointer(); @@ -829,18 +769,6 @@ bool simplify_exprt::simplify_dereference(exprt &expr) return true; } -/*******************************************************************\ - -Function: simplify_exprt::simplify_if_implies - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool simplify_exprt::simplify_if_implies( exprt &expr, const exprt &cond, @@ -932,18 +860,6 @@ bool simplify_exprt::simplify_if_implies( return true; } -/*******************************************************************\ - -Function: simplify_exprt::simplify_if_recursive - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool simplify_exprt::simplify_if_recursive( exprt &expr, const exprt &cond, @@ -976,18 +892,6 @@ bool simplify_exprt::simplify_if_recursive( return result; } -/*******************************************************************\ - -Function: simplify_exprt::simplify_if_conj - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool simplify_exprt::simplify_if_conj( exprt &expr, const exprt &cond) @@ -1009,18 +913,6 @@ bool simplify_exprt::simplify_if_conj( return result; } -/*******************************************************************\ - -Function: simplify_exprt::simplify_if_disj - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool simplify_exprt::simplify_if_disj( exprt &expr, const exprt &cond) @@ -1042,18 +934,6 @@ bool simplify_exprt::simplify_if_disj( return result; } -/*******************************************************************\ - -Function: simplify_exprt::simplify_if_branch - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool simplify_exprt::simplify_if_branch( exprt &trueexpr, exprt &falseexpr, @@ -1086,18 +966,6 @@ bool simplify_exprt::simplify_if_branch( return tresult && fresult; } -/*******************************************************************\ - -Function: simplify_exprt::simplify_if_cond - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool simplify_exprt::simplify_if_cond(exprt &expr) { bool result=true; @@ -1134,18 +1002,6 @@ bool simplify_exprt::simplify_if_cond(exprt &expr) return result; } -/*******************************************************************\ - -Function: simplify_exprt::simplify_if_preorder - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool simplify_exprt::simplify_if_preorder(if_exprt &expr) { exprt &cond=expr.cond(); @@ -1231,18 +1087,6 @@ bool simplify_exprt::simplify_if_preorder(if_exprt &expr) return result; } -/*******************************************************************\ - -Function: simplify_exprt::simplify_if - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool simplify_exprt::simplify_if(if_exprt &expr) { exprt &cond=expr.cond(); @@ -1351,18 +1195,6 @@ bool simplify_exprt::simplify_if(if_exprt &expr) return result; } -/*******************************************************************\ - -Function: simplify_exprt::get_values - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool simplify_exprt::get_values( const exprt &expr, value_listt &value_list) @@ -1389,18 +1221,6 @@ bool simplify_exprt::get_values( return true; } -/*******************************************************************\ - -Function: simplify_exprt::simplify_lambda - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool simplify_exprt::simplify_lambda(exprt &expr) { bool result=true; @@ -1408,18 +1228,6 @@ bool simplify_exprt::simplify_lambda(exprt &expr) return result; } -/*******************************************************************\ - -Function: simplify_exprt::simplify_with - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool simplify_exprt::simplify_with(exprt &expr) { bool result=true; @@ -1493,18 +1301,6 @@ bool simplify_exprt::simplify_with(exprt &expr) return result; } -/*******************************************************************\ - -Function: simplify_exprt::simplify_update - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool simplify_exprt::simplify_update(exprt &expr) { if(expr.operands().size()!=3) @@ -1562,18 +1358,6 @@ bool simplify_exprt::simplify_update(exprt &expr) return false; } -/*******************************************************************\ - -Function: simplify_exprt::simplify_object - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool simplify_exprt::simplify_object(exprt &expr) { if(expr.id()==ID_plus) @@ -1665,18 +1449,6 @@ bool simplify_exprt::simplify_object(exprt &expr) return true; } -/*******************************************************************\ - -Function: simplify_exprt::bits2expr - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - exprt simplify_exprt::bits2expr( const std::string &bits, const typet &_type, @@ -1791,18 +1563,6 @@ exprt simplify_exprt::bits2expr( return nil_exprt(); } -/*******************************************************************\ - -Function: simplify_exprt::expr2bits - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string simplify_exprt::expr2bits( const exprt &expr, bool little_endian) @@ -1863,18 +1623,6 @@ std::string simplify_exprt::expr2bits( return ""; } -/*******************************************************************\ - -Function: simplify_exprt::simplify_byte_extract - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool simplify_exprt::simplify_byte_extract(byte_extract_exprt &expr) { // lift up any ID_if on the object @@ -2125,18 +1873,6 @@ bool simplify_exprt::simplify_byte_extract(byte_extract_exprt &expr) return true; } -/*******************************************************************\ - -Function: simplify_exprt::simplify_byte_update - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool simplify_exprt::simplify_byte_update(byte_update_exprt &expr) { // byte_update(byte_update(root, offset, value), offset, value2) => @@ -2409,18 +2145,6 @@ bool simplify_exprt::simplify_byte_update(byte_update_exprt &expr) return true; } -/*******************************************************************\ - -Function: simplify_exprt::simplify_node_preorder - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool simplify_exprt::simplify_node_preorder(exprt &expr) { bool result=true; @@ -2446,18 +2170,6 @@ bool simplify_exprt::simplify_node_preorder(exprt &expr) return result; } -/*******************************************************************\ - -Function: simplify_exprt::simplify_node - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool simplify_exprt::simplify_node(exprt &expr) { if(!expr.has_operands()) @@ -2591,19 +2303,7 @@ bool simplify_exprt::simplify_node(exprt &expr) return result; } -/*******************************************************************\ - -Function: simplify_exprt::simplify_rec - - Inputs: - - Outputs: returns true if expression unchanged; - returns false if changed - - Purpose: - -\*******************************************************************/ - +/// \return returns true if expression unchanged; returns false if changed bool simplify_exprt::simplify_rec(exprt &expr) { // look up in cache @@ -2663,18 +2363,6 @@ bool simplify_exprt::simplify_rec(exprt &expr) return result; } -/*******************************************************************\ - -Function: simplify_exprt::simplify - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool simplify_exprt::simplify(exprt &expr) { #ifdef DEBUG_ON_DEMAND @@ -2689,35 +2377,11 @@ bool simplify_exprt::simplify(exprt &expr) return res; } -/*******************************************************************\ - -Function: simplify - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool simplify(exprt &expr, const namespacet &ns) { return simplify_exprt(ns).simplify(expr); } -/*******************************************************************\ - -Function: simplify_expr - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - exprt simplify_expr(const exprt &src, const namespacet &ns) { exprt tmp=src; diff --git a/src/util/simplify_expr_array.cpp b/src/util/simplify_expr_array.cpp index f00c039a6ef..8be90d2e74e 100644 --- a/src/util/simplify_expr_array.cpp +++ b/src/util/simplify_expr_array.cpp @@ -16,18 +16,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "arith_tools.h" #include "pointer_offset_size.h" -/*******************************************************************\ - -Function: simplify_exprt::simplify_index - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool simplify_exprt::simplify_index(exprt &expr) { bool result=true; diff --git a/src/util/simplify_expr_boolean.cpp b/src/util/simplify_expr_boolean.cpp index b747047cf98..b1a34c77ec7 100644 --- a/src/util/simplify_expr_boolean.cpp +++ b/src/util/simplify_expr_boolean.cpp @@ -14,18 +14,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "namespace.h" #include "std_expr.h" -/*******************************************************************\ - -Function: simplify_exprt::simplify_boolean - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool simplify_exprt::simplify_boolean(exprt &expr) { if(!expr.has_operands()) @@ -199,18 +187,6 @@ bool simplify_exprt::simplify_boolean(exprt &expr) return true; } -/*******************************************************************\ - -Function: simplify_exprt::simplify_not - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool simplify_exprt::simplify_not(exprt &expr) { if(expr.operands().size()!=1) diff --git a/src/util/simplify_expr_floatbv.cpp b/src/util/simplify_expr_floatbv.cpp index 7115e23024a..e0be11988c8 100644 --- a/src/util/simplify_expr_floatbv.cpp +++ b/src/util/simplify_expr_floatbv.cpp @@ -15,18 +15,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "std_expr.h" #include "arith_tools.h" -/*******************************************************************\ - -Function: simplify_exprt::simplify_isinf - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool simplify_exprt::simplify_isinf(exprt &expr) { if(expr.operands().size()!=1) @@ -45,18 +33,6 @@ bool simplify_exprt::simplify_isinf(exprt &expr) return true; } -/*******************************************************************\ - -Function: simplify_exprt::simplify_isnan - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool simplify_exprt::simplify_isnan(exprt &expr) { if(expr.operands().size()!=1) @@ -72,18 +48,6 @@ bool simplify_exprt::simplify_isnan(exprt &expr) return true; } -/*******************************************************************\ - -Function: simplify_exprt::simplify_isnormal - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool simplify_exprt::simplify_isnormal(exprt &expr) { if(expr.operands().size()!=1) @@ -99,18 +63,6 @@ bool simplify_exprt::simplify_isnormal(exprt &expr) return true; } -/*******************************************************************\ - -Function: simplify_exprt::simplify_abs - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - #if 0 bool simplify_exprt::simplify_abs(exprt &expr) { @@ -153,18 +105,6 @@ bool simplify_exprt::simplify_abs(exprt &expr) } #endif -/*******************************************************************\ - -Function: simplify_exprt::simplify_sign - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - #if 0 bool simplify_exprt::simplify_sign(exprt &expr) { @@ -197,18 +137,6 @@ bool simplify_exprt::simplify_sign(exprt &expr) } #endif -/*******************************************************************\ - -Function: simplify_exprt::simplify_floatbv_typecast - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool simplify_exprt::simplify_floatbv_typecast(exprt &expr) { // These casts usually reduce precision, and thus, usually round. @@ -338,18 +266,6 @@ bool simplify_exprt::simplify_floatbv_typecast(exprt &expr) return true; } -/*******************************************************************\ - -Function: simplify_exprt::simplify_floatbv_op - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool simplify_exprt::simplify_floatbv_op(exprt &expr) { const typet &type=ns.follow(expr.type()); @@ -413,18 +329,6 @@ bool simplify_exprt::simplify_floatbv_op(exprt &expr) return true; } -/*******************************************************************\ - -Function: simplify_exprt::simplify_ieee_float_relation - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool simplify_exprt::simplify_ieee_float_relation(exprt &expr) { assert(expr.id()==ID_ieee_float_equal || diff --git a/src/util/simplify_expr_int.cpp b/src/util/simplify_expr_int.cpp index c9c8a7f12a0..03c67b80014 100644 --- a/src/util/simplify_expr_int.cpp +++ b/src/util/simplify_expr_int.cpp @@ -22,18 +22,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "rational_tools.h" #include "ieee_float.h" -/*******************************************************************\ - -Function: simplify_exprt::simplify_bswap - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool simplify_exprt::simplify_bswap(exprt &expr) { if(expr.type().id()==ID_unsignedbv && @@ -66,18 +54,6 @@ bool simplify_exprt::simplify_bswap(exprt &expr) return true; } -/*******************************************************************\ - -Function: simplify_exprt::simplify_mult - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool simplify_exprt::simplify_mult(exprt &expr) { // check to see if it is a number type @@ -183,18 +159,6 @@ bool simplify_exprt::simplify_mult(exprt &expr) return result; } -/*******************************************************************\ - -Function: simplify_exprt::simplify_div - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool simplify_exprt::simplify_div(exprt &expr) { if(!is_number(expr.type())) @@ -315,18 +279,6 @@ bool simplify_exprt::simplify_div(exprt &expr) return true; } -/*******************************************************************\ - -Function: simplify_exprt::simplify_mod - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool simplify_exprt::simplify_mod(exprt &expr) { if(!is_number(expr.type())) @@ -376,18 +328,6 @@ bool simplify_exprt::simplify_mod(exprt &expr) return true; } -/*******************************************************************\ - -Function: simplify_exprt::simplify_plus - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool simplify_exprt::simplify_plus(exprt &expr) { if(!is_number(expr.type()) && @@ -545,18 +485,6 @@ bool simplify_exprt::simplify_plus(exprt &expr) return result; } -/*******************************************************************\ - -Function: simplify_exprt::simplify_minus - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool simplify_exprt::simplify_minus(exprt &expr) { if(!is_number(expr.type()) && @@ -616,18 +544,6 @@ bool simplify_exprt::simplify_minus(exprt &expr) return true; } -/*******************************************************************\ - -Function: simplify_exprt::simplify_bitwise - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool simplify_exprt::simplify_bitwise(exprt &expr) { if(!is_bitvector_type(expr.type())) @@ -798,18 +714,6 @@ bool simplify_exprt::simplify_bitwise(exprt &expr) return result; } -/*******************************************************************\ - -Function: simplify_exprt::simplify_extractbit - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool simplify_exprt::simplify_extractbit(exprt &expr) { const typet &op0_type=expr.op0().type(); @@ -844,18 +748,6 @@ bool simplify_exprt::simplify_extractbit(exprt &expr) return false; } -/*******************************************************************\ - -Function: simplify_exprt::simplify_concatenation - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool simplify_exprt::simplify_concatenation(exprt &expr) { bool result=true; @@ -943,18 +835,6 @@ bool simplify_exprt::simplify_concatenation(exprt &expr) return result; } -/*******************************************************************\ - -Function: simplify_exprt::simplify_shifts - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool simplify_exprt::simplify_shifts(exprt &expr) { if(!is_number(expr.type())) @@ -1067,18 +947,6 @@ bool simplify_exprt::simplify_shifts(exprt &expr) return true; } -/*******************************************************************\ - -Function: simplify_exprt::simplify_power - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool simplify_exprt::simplify_power(exprt &expr) { if(!is_number(expr.type())) @@ -1101,18 +969,7 @@ bool simplify_exprt::simplify_power(exprt &expr) return false; } -/*******************************************************************\ - -Function: simplify_exprt::simplify_extractbits - - Inputs: - - Outputs: - - Purpose: Simplifies extracting of bits from a constant. - -\*******************************************************************/ - +/// Simplifies extracting of bits from a constant. bool simplify_exprt::simplify_extractbits(exprt &expr) { assert(expr.operands().size()==3); @@ -1161,18 +1018,6 @@ bool simplify_exprt::simplify_extractbits(exprt &expr) return true; } -/*******************************************************************\ - -Function: simplify_exprt::simplify_unary_plus - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool simplify_exprt::simplify_unary_plus(exprt &expr) { if(expr.operands().size()!=1) @@ -1183,18 +1028,6 @@ bool simplify_exprt::simplify_unary_plus(exprt &expr) return false; } -/*******************************************************************\ - -Function: simplify_exprt::simplify_unary_minus - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool simplify_exprt::simplify_unary_minus(exprt &expr) { if(expr.operands().size()!=1) @@ -1272,18 +1105,6 @@ bool simplify_exprt::simplify_unary_minus(exprt &expr) return true; } -/*******************************************************************\ - -Function: simplify_exprt::simplify_bitnot - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool simplify_exprt::simplify_bitnot(exprt &expr) { if(!expr.has_operands()) @@ -1320,18 +1141,7 @@ bool simplify_exprt::simplify_bitnot(exprt &expr) return true; } -/*******************************************************************\ - -Function: simplify_exprt::simplify_inequality - - Inputs: - - Outputs: - - Purpose: simplifies inequalities !=, <=, <, >=, >, and also == - -\*******************************************************************/ - +/// simplifies inequalities !=, <=, <, >=, >, and also == bool simplify_exprt::simplify_inequality(exprt &expr) { exprt::operandst &operands=expr.operands(); @@ -1548,18 +1358,6 @@ bool simplify_exprt::simplify_inequality(exprt &expr) return false; } -/*******************************************************************\ - -Function: simplify_exprt::eliminate_common_addends - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool simplify_exprt::eliminate_common_addends( exprt &op0, exprt &op1) @@ -1608,18 +1406,6 @@ bool simplify_exprt::eliminate_common_addends( return true; } -/*******************************************************************\ - -Function: simplify_exprt::simplify_inequality_not_constant - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool simplify_exprt::simplify_inequality_not_constant(exprt &expr) { exprt::operandst &operands=expr.operands(); @@ -1746,18 +1532,7 @@ bool simplify_exprt::simplify_inequality_not_constant(exprt &expr) return true; } -/*******************************************************************\ - -Function: simplify_exprt::simplify_inequality_constant - - Inputs: an inequality with a constant on the RHS - - Outputs: - - Purpose: - -\*******************************************************************/ - +/// \par parameters: an inequality with a constant on the RHS bool simplify_exprt::simplify_inequality_constant(exprt &expr) { // the constant is always on the RHS diff --git a/src/util/simplify_expr_pointer.cpp b/src/util/simplify_expr_pointer.cpp index 9bc2496f5ff..64800f286f8 100644 --- a/src/util/simplify_expr_pointer.cpp +++ b/src/util/simplify_expr_pointer.cpp @@ -20,18 +20,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "prefix.h" #include "pointer_predicates.h" -/*******************************************************************\ - -Function: is_dereference_integer_object - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - static bool is_dereference_integer_object( const exprt &expr, mp_integer &address) @@ -61,18 +49,6 @@ static bool is_dereference_integer_object( return false; } -/*******************************************************************\ - -Function: simplify_exprt::simplify_address_of_arg - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool simplify_exprt::simplify_address_of_arg(exprt &expr) { if(expr.id()==ID_index) @@ -192,18 +168,6 @@ bool simplify_exprt::simplify_address_of_arg(exprt &expr) return true; } -/*******************************************************************\ - -Function: simplify_exprt::simplify_address_of - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool simplify_exprt::simplify_address_of(exprt &expr) { if(expr.operands().size()!=1) @@ -246,18 +210,6 @@ bool simplify_exprt::simplify_address_of(exprt &expr) return result; } -/*******************************************************************\ - -Function: simplify_exprt::simplify_pointer_offset - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool simplify_exprt::simplify_pointer_offset(exprt &expr) { if(expr.operands().size()!=1) @@ -435,18 +387,6 @@ bool simplify_exprt::simplify_pointer_offset(exprt &expr) return true; } -/*******************************************************************\ - -Function: simplify_exprt::simplify_inequality_address_of - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool simplify_exprt::simplify_inequality_address_of(exprt &expr) { assert(expr.type().id()==ID_bool); @@ -488,18 +428,6 @@ bool simplify_exprt::simplify_inequality_address_of(exprt &expr) return true; } -/*******************************************************************\ - -Function: simplify_exprt::simplify_inequality_pointer_object - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool simplify_exprt::simplify_inequality_pointer_object(exprt &expr) { assert(expr.type().id()==ID_bool); @@ -532,18 +460,6 @@ bool simplify_exprt::simplify_inequality_pointer_object(exprt &expr) return false; } -/*******************************************************************\ - -Function: simplify_exprt::simplify_pointer_object - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool simplify_exprt::simplify_pointer_object(exprt &expr) { if(expr.operands().size()!=1) @@ -572,18 +488,6 @@ bool simplify_exprt::simplify_pointer_object(exprt &expr) return result; } -/*******************************************************************\ - -Function: simplify_exprt::simplify_dynamic_object - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool simplify_exprt::simplify_dynamic_object(exprt &expr) { if(expr.operands().size()!=1) @@ -640,18 +544,6 @@ bool simplify_exprt::simplify_dynamic_object(exprt &expr) return result; } -/*******************************************************************\ - -Function: simplify_exprt::simplify_invalid_pointer - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool simplify_exprt::simplify_invalid_pointer(exprt &expr) { if(expr.operands().size()!=1) @@ -681,18 +573,6 @@ bool simplify_exprt::simplify_invalid_pointer(exprt &expr) return result; } -/*******************************************************************\ - -Function: simplify_exprt::objects_equal - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - tvt simplify_exprt::objects_equal(const exprt &a, const exprt &b) { if(a==b) @@ -717,18 +597,6 @@ tvt simplify_exprt::objects_equal(const exprt &a, const exprt &b) return tvt::unknown(); } -/*******************************************************************\ - -Function: simplify_exprt::objects_equal_address_of - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - tvt simplify_exprt::objects_equal_address_of(const exprt &a, const exprt &b) { if(a==b) @@ -753,18 +621,6 @@ tvt simplify_exprt::objects_equal_address_of(const exprt &a, const exprt &b) return tvt::unknown(); } -/*******************************************************************\ - -Function: simplify_exprt::simplify_object_size - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool simplify_exprt::simplify_object_size(exprt &expr) { if(expr.operands().size()!=1) @@ -811,18 +667,6 @@ bool simplify_exprt::simplify_object_size(exprt &expr) return result; } -/*******************************************************************\ - -Function: simplify_exprt::simplify_good_pointer - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool simplify_exprt::simplify_good_pointer(exprt &expr) { if(expr.operands().size()!=1) diff --git a/src/util/simplify_expr_struct.cpp b/src/util/simplify_expr_struct.cpp index a59c355e72c..52695450157 100644 --- a/src/util/simplify_expr_struct.cpp +++ b/src/util/simplify_expr_struct.cpp @@ -15,18 +15,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "pointer_offset_size.h" #include "arith_tools.h" -/*******************************************************************\ - -Function: simplify_exprt::simplify_member - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool simplify_exprt::simplify_member(exprt &expr) { if(expr.operands().size()!=1) diff --git a/src/util/simplify_utils.cpp b/src/util/simplify_utils.cpp index ff5abf78930..b814e685103 100644 --- a/src/util/simplify_utils.cpp +++ b/src/util/simplify_utils.cpp @@ -10,20 +10,9 @@ Author: Daniel Kroening, kroening@kroening.com #include "simplify_utils.h" -/*******************************************************************\ - -Function: simplify_exprt::sort_operands - - Inputs: operand list - - Outputs: modifies operand list - returns true iff nothing was changed - - Purpose: sort operands of an expression according to ordering - defined by operator< - -\*******************************************************************/ - +/// sort operands of an expression according to ordering defined by operator< +/// \par parameters: operand list +/// \return modifies operand list returns true iff nothing was changed bool sort_operands(exprt::operandst &operands) { bool do_sort=false; @@ -48,19 +37,7 @@ bool sort_operands(exprt::operandst &operands) return false; } -/*******************************************************************\ - -Function: sort_and_join - - Inputs: - - Outputs: - - Purpose: produce canonical ordering for associative and commutative - binary operators - -\*******************************************************************/ - +/// produce canonical ordering for associative and commutative binary operators // The entries // { ID_plus, ID_floatbv }, // { ID_mult, ID_floatbv }, @@ -142,18 +119,6 @@ static const struct saj_tablet &sort_and_join( return saj_table[i]; } -/*******************************************************************\ - -Function: sort_and_join - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool sort_and_join(exprt &expr) { bool result=true; diff --git a/src/util/source_location.cpp b/src/util/source_location.cpp index 7583b40b496..8fb3935cc74 100644 --- a/src/util/source_location.cpp +++ b/src/util/source_location.cpp @@ -11,18 +11,7 @@ Author: Daniel Kroening, kroening@kroening.com #include "source_location.h" #include "file_util.h" -/*******************************************************************\ - -Function: source_locationt::as_string - - Inputs: print_cwd, print the absolute path to the file - - Outputs: - - Purpose: - -\*******************************************************************/ - +/// \par parameters: print_cwd, print the absolute path to the file std::string source_locationt::as_string(bool print_cwd) const { std::string dest; @@ -72,18 +61,6 @@ std::string source_locationt::as_string(bool print_cwd) const return dest; } -/*******************************************************************\ - -Function: operator<< - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::ostream &operator << ( std::ostream &out, const source_locationt &source_location) diff --git a/src/util/sparse_vector.h b/src/util/sparse_vector.h index 193e9a68a01..226564d636e 100644 --- a/src/util/sparse_vector.h +++ b/src/util/sparse_vector.h @@ -6,6 +6,9 @@ Author: Romain Brenguier \*******************************************************************/ +/// \file +/// Sparse Vectors + #ifndef CPROVER_UTIL_SPARSE_VECTOR_H #define CPROVER_UTIL_SPARSE_VECTOR_H diff --git a/src/util/ssa_expr.cpp b/src/util/ssa_expr.cpp index affd2907eb5..3252d90c241 100644 --- a/src/util/ssa_expr.cpp +++ b/src/util/ssa_expr.cpp @@ -13,18 +13,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "ssa_expr.h" -/*******************************************************************\ - -Function: build_identifier_rec - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - static void build_ssa_identifier_rec( const exprt &expr, const irep_idt &l0, @@ -91,18 +79,6 @@ bool ssa_exprt::can_build_identifier(const exprt &expr) return false; } -/*******************************************************************\ - -Function: ssa_exprt::build_identifier - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::pair ssa_exprt::build_identifier( const exprt &expr, const irep_idt &l0, diff --git a/src/util/std_code.cpp b/src/util/std_code.cpp index d7a4f2aa0fd..e5b5fa2eb60 100644 --- a/src/util/std_code.cpp +++ b/src/util/std_code.cpp @@ -9,52 +9,16 @@ Author: Daniel Kroening, kroening@kroening.com #include "std_code.h" #include "std_expr.h" -/*******************************************************************\ - -Function: code_declt::get_identifier - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - const irep_idt &code_declt::get_identifier() const { return to_symbol_expr(symbol()).get_identifier(); } -/*******************************************************************\ - -Function: code_deadt::get_identifier - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - const irep_idt &code_deadt::get_identifier() const { return to_symbol_expr(symbol()).get_identifier(); } -/*******************************************************************\ - -Function: codet::make_block - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - code_blockt &codet::make_block() { if(get_statement()==ID_block) @@ -70,18 +34,6 @@ code_blockt &codet::make_block() return static_cast(*this); } -/*******************************************************************\ - -Function: codet::first_statement - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - codet &codet::first_statement() { const irep_idt &statement=get_statement(); @@ -97,18 +49,6 @@ codet &codet::first_statement() return *this; } -/*******************************************************************\ - -Function: first_statement - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - const codet &codet::first_statement() const { const irep_idt &statement=get_statement(); @@ -124,18 +64,6 @@ const codet &codet::first_statement() const return *this; } -/*******************************************************************\ - -Function: codet::last_statement - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - codet &codet::last_statement() { const irep_idt &statement=get_statement(); @@ -151,18 +79,6 @@ codet &codet::last_statement() return *this; } -/*******************************************************************\ - -Function: codet::last_statement - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - const codet &codet::last_statement() const { const irep_idt &statement=get_statement(); @@ -178,20 +94,8 @@ const codet &codet::last_statement() const return *this; } -/*******************************************************************\ - -Function: code_blockt::append - - Inputs: - extra_block - The input code_blockt - - Outputs: - - Purpose: Add all the codets from extra_block to the current - code_blockt - -\*******************************************************************/ - +/// Add all the codets from extra_block to the current code_blockt +/// \param extra_block: The input code_blockt void code_blockt::append(const code_blockt &extra_block) { operands().reserve(operands().size()+extra_block.operands().size()); diff --git a/src/util/std_expr.cpp b/src/util/std_expr.cpp index 4cb9eeff9cc..d6e1b1d2a47 100644 --- a/src/util/std_expr.cpp +++ b/src/util/std_expr.cpp @@ -17,36 +17,12 @@ Author: Daniel Kroening, kroening@kroening.com #include "std_types.h" #include "std_expr.h" -/*******************************************************************\ - -Function: constant_exprt::value_is_zero_string - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool constant_exprt::value_is_zero_string() const { const std::string val=id2string(get_value()); return val.find_first_not_of('0')==std::string::npos; } -/*******************************************************************\ - -Function: disjunction - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - exprt disjunction(const exprt::operandst &op) { if(op.empty()) @@ -71,18 +47,6 @@ unsigned int dynamic_object_exprt::get_instance() const return std::stoul(id2string(to_constant_expr(op0()).get_value())); } -/*******************************************************************\ - -Function: conjunction - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - exprt conjunction(const exprt::operandst &op) { if(op.empty()) @@ -97,18 +61,7 @@ exprt conjunction(const exprt::operandst &op) } } -/*******************************************************************\ - -Function: build_object_descriptor_rec - - Inputs: - - Outputs: - - Purpose: Build an object_descriptor_exprt from a given expr - -\*******************************************************************/ - +/// Build an object_descriptor_exprt from a given expr static void build_object_descriptor_rec( const namespacet &ns, const exprt &expr, @@ -168,18 +121,7 @@ static void build_object_descriptor_rec( } } -/*******************************************************************\ - -Function: object_descriptor_exprt::build - - Inputs: - - Outputs: - - Purpose: Build an object_descriptor_exprt from a given expr - -\*******************************************************************/ - +/// Build an object_descriptor_exprt from a given expr void object_descriptor_exprt::build( const exprt &expr, const namespacet &ns) @@ -195,35 +137,11 @@ void object_descriptor_exprt::build( assert(root_object().type().id()!=ID_empty); } -/*******************************************************************\ - -Function: constant_exprt::integer_constant - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - constant_exprt constant_exprt::integer_constant(unsigned v) { return constant_exprt(std::to_string(v), integer_typet()); } -/*******************************************************************\ - -Function: shift_exprt::shift_exprt - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - shift_exprt::shift_exprt( const exprt &_src, const irep_idt &_id, @@ -232,18 +150,6 @@ shift_exprt::shift_exprt( { } -/*******************************************************************\ - -Function: extractbit_exprt::extractbit_exprt - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - extractbit_exprt::extractbit_exprt( const exprt &_src, const std::size_t _index): @@ -252,18 +158,6 @@ extractbit_exprt::extractbit_exprt( { } -/*******************************************************************\ - -Function: extractbit_exprt::extractbits_exprt - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - extractbits_exprt::extractbits_exprt( const exprt &_src, const std::size_t _upper, diff --git a/src/util/std_types.cpp b/src/util/std_types.cpp index e6244ab5c9b..3f0ad44a8bd 100644 --- a/src/util/std_types.cpp +++ b/src/util/std_types.cpp @@ -11,18 +11,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "std_types.h" #include "std_expr.h" -/*******************************************************************\ - -Function: fixedbv_typet::get_integer_bits - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::size_t fixedbv_typet::get_integer_bits() const { const irep_idt integer_bits=get(ID_integer_bits); @@ -30,18 +18,6 @@ std::size_t fixedbv_typet::get_integer_bits() const return unsafe_string2unsigned(id2string(integer_bits)); } -/*******************************************************************\ - -Function: floatbv_typet::get_f - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::size_t floatbv_typet::get_f() const { const irep_idt &f=get(ID_f); @@ -49,18 +25,6 @@ std::size_t floatbv_typet::get_f() const return unsafe_string2unsigned(id2string(f)); } -/*******************************************************************\ - -Function: struct_union_typet::component_number - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::size_t struct_union_typet::component_number( const irep_idt &component_name) const { @@ -83,18 +47,6 @@ std::size_t struct_union_typet::component_number( return 0; } -/*******************************************************************\ - -Function: struct_union_typet::get_component - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - const struct_union_typet::componentt &struct_union_typet::get_component( const irep_idt &component_name) const { @@ -112,18 +64,6 @@ const struct_union_typet::componentt &struct_union_typet::get_component( return static_cast(get_nil_irep()); } -/*******************************************************************\ - -Function: struct_union_typet::component_type - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - typet struct_union_typet::component_type( const irep_idt &component_name) const { @@ -132,18 +72,6 @@ typet struct_union_typet::component_type( return c.type(); } -/*******************************************************************\ - -Function: struct_typet::is_prefix_of - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool struct_typet::is_prefix_of(const struct_typet &other) const { const componentst &ot_components=other.components(); @@ -173,275 +101,83 @@ bool struct_typet::is_prefix_of(const struct_typet &other) const return true; // ok, *this is a prefix of ot } -/*******************************************************************\ - -Function: is_reference - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool is_reference(const typet &type) { return type.id()==ID_pointer && type.get_bool(ID_C_reference); } -/*******************************************************************\ - -Function: is_rvalue_reference - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool is_rvalue_reference(const typet &type) { return type.id()==ID_pointer && type.get_bool(ID_C_rvalue_reference); } -/*******************************************************************\ - -Function: range_typet::set_from - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void range_typet::set_from(const mp_integer &from) { set(ID_from, integer2string(from)); } -/*******************************************************************\ - -Function: range_typet::set_to - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void range_typet::set_to(const mp_integer &to) { set(ID_to, integer2string(to)); } -/*******************************************************************\ - -Function: range_typet::get_from - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - mp_integer range_typet::get_from() const { return string2integer(get_string(ID_from)); } -/*******************************************************************\ - -Function: range_typet::get_to - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - mp_integer range_typet::get_to() const { return string2integer(get_string(ID_to)); } -/*******************************************************************\ - -Function: signedbv_typet::smallest - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - mp_integer signedbv_typet::smallest() const { return -power(2, get_width()-1); } -/*******************************************************************\ - -Function: signedbv_typet::largest - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - mp_integer signedbv_typet::largest() const { return power(2, get_width()-1)-1; } -/*******************************************************************\ - -Function: signedbv_typet::zero_expr - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - constant_exprt signedbv_typet::zero_expr() const { return to_constant_expr(from_integer(0, *this)); } -/*******************************************************************\ - -Function: signedbv_typet::smallest_expr - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - constant_exprt signedbv_typet::smallest_expr() const { return to_constant_expr(from_integer(smallest(), *this)); } -/*******************************************************************\ - -Function: signedbv_typet::largest_expr - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - constant_exprt signedbv_typet::largest_expr() const { return to_constant_expr(from_integer(largest(), *this)); } -/*******************************************************************\ - -Function: unsignedbv_typet::smallest - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - mp_integer unsignedbv_typet::smallest() const { return 0; } -/*******************************************************************\ - -Function: unsignedbv_typet::largest - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - mp_integer unsignedbv_typet::largest() const { return power(2, get_width())-1; } -/*******************************************************************\ - -Function: unsignedbv_typet::zero_expr - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - constant_exprt unsignedbv_typet::zero_expr() const { return to_constant_expr(from_integer(0, *this)); } -/*******************************************************************\ - -Function: unsignedbv_typet::smallest_expr - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - constant_exprt unsignedbv_typet::smallest_expr() const { return to_constant_expr(from_integer(smallest(), *this)); } -/*******************************************************************\ - -Function: unsignedbv_typet::largest_expr - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - constant_exprt unsignedbv_typet::largest_expr() const { return to_constant_expr(from_integer(largest(), *this)); diff --git a/src/util/string2int.cpp b/src/util/string2int.cpp index 224e5779858..7a1c10da48b 100644 --- a/src/util/string2int.cpp +++ b/src/util/string2int.cpp @@ -13,18 +13,6 @@ Author: Michael Tautschnig, michael.tautschnig@cs.ox.ac.uk #include "string2int.h" -/*******************************************************************\ - -Function: str2number - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - template inline T str2number(const char *str, int base, bool safe) { @@ -60,103 +48,31 @@ inline T str2number(const char *str, int base, bool safe) return (T)val; } -/*******************************************************************\ - -Function: safe_string2unsigned - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - unsigned safe_string2unsigned(const std::string &str, int base) { return str2number(str.c_str(), base, true); } -/*******************************************************************\ - -Function: safe_string2size_t - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::size_t safe_string2size_t(const std::string &str, int base) { return str2number(str.c_str(), base, true); } -/*******************************************************************\ - -Function: unsafe_string2int - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - int unsafe_string2int(const std::string &str, int base) { return str2number(str.c_str(), base, false); } -/*******************************************************************\ - -Function: unsafe_string2unsigned - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - unsigned unsafe_string2unsigned(const std::string &str, int base) { return str2number(str.c_str(), base, false); } -/*******************************************************************\ - -Function: unsafe_string2size_t - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::size_t unsafe_string2size_t(const std::string &str, int base) { return str2number(str.c_str(), base, false); } -/*******************************************************************\ - -Function: unsafe_string2signedlonglong - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - signed long long int unsafe_string2signedlonglong( const std::string &str, int base) @@ -164,18 +80,6 @@ signed long long int unsafe_string2signedlonglong( return str2number(str.c_str(), base, false); } -/*******************************************************************\ - -Function: unsafe_string2unsignedlonglong - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - unsigned long long int unsafe_string2unsignedlonglong( const std::string &str, int base) diff --git a/src/util/string_container.cpp b/src/util/string_container.cpp index 1b1603631d0..189d721b8ed 100644 --- a/src/util/string_container.cpp +++ b/src/util/string_container.cpp @@ -6,40 +6,19 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Container for C-Strings + #include #include "string_container.h" string_containert string_container; -/*******************************************************************\ - -Function: string_ptrt::string_ptrt - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - string_ptrt::string_ptrt(const char *_s):s(_s), len(strlen(_s)) { } -/*******************************************************************\ - -Function: string_ptrt::operator== - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool string_ptrt::operator==(const string_ptrt &other) const { if(len!=other.len) @@ -48,18 +27,6 @@ bool string_ptrt::operator==(const string_ptrt &other) const return len==0 || memcmp(s, other.s, len)==0; } -/*******************************************************************\ - -Function: string_containert::string_containert - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void initialize_string_container(); string_containert::string_containert() @@ -71,34 +38,10 @@ string_containert::string_containert() initialize_string_container(); } -/*******************************************************************\ - -Function: string_containert::~string_containert - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - string_containert::~string_containert() { } -/*******************************************************************\ - -Function: string_containert::get - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - unsigned string_containert::get(const char *s) { string_ptrt string_ptr(s); @@ -122,18 +65,6 @@ unsigned string_containert::get(const char *s) return r; } -/*******************************************************************\ - -Function: string_containert::get - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - unsigned string_containert::get(const std::string &s) { string_ptrt string_ptr(s); diff --git a/src/util/string_container.h b/src/util/string_container.h index cbd8d0d320b..59a5daff0b8 100644 --- a/src/util/string_container.h +++ b/src/util/string_container.h @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Container for C-Strings + #ifndef CPROVER_UTIL_STRING_CONTAINER_H #define CPROVER_UTIL_STRING_CONTAINER_H diff --git a/src/util/string_expr.h b/src/util/string_expr.h index ff19a8c8259..cdb801988ae 100644 --- a/src/util/string_expr.h +++ b/src/util/string_expr.h @@ -6,6 +6,9 @@ Author: Romain Brenguier, romain.brenguier@diffblue.com \*******************************************************************/ +/// \file +/// String expressions for the string solver + #ifndef CPROVER_UTIL_STRING_EXPR_H #define CPROVER_UTIL_STRING_EXPR_H diff --git a/src/util/string_hash.cpp b/src/util/string_hash.cpp index c59a0a61280..ee212232fa7 100644 --- a/src/util/string_hash.cpp +++ b/src/util/string_hash.cpp @@ -6,19 +6,10 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ -#include "string_hash.h" - -/*******************************************************************\ - -Function: hash_string - - Inputs: +/// \file +/// string hasing - Outputs: - - Purpose: - -\*******************************************************************/ +#include "string_hash.h" size_t hash_string(const std::string &s) { @@ -31,18 +22,6 @@ size_t hash_string(const std::string &s) return h; } -/*******************************************************************\ - -Function: hash_string - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - size_t hash_string(const char *s) { size_t h=0; diff --git a/src/util/string_hash.h b/src/util/string_hash.h index 41f45adeda0..021cb95b341 100644 --- a/src/util/string_hash.h +++ b/src/util/string_hash.h @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// string hashing + #ifndef CPROVER_UTIL_STRING_HASH_H #define CPROVER_UTIL_STRING_HASH_H diff --git a/src/util/string_utils.cpp b/src/util/string_utils.cpp index 9fb81dfa08c..04697b78d91 100644 --- a/src/util/string_utils.cpp +++ b/src/util/string_utils.cpp @@ -12,18 +12,6 @@ Author: Daniel Poetzl #include "string_utils.h" -/*******************************************************************\ - -Function: - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string strip_string(const std::string &s) { auto pred=[](char c){ return std::isspace(c); }; @@ -42,18 +30,6 @@ std::string strip_string(const std::string &s) return s.substr(i, (j-i+1)); } -/*******************************************************************\ - -Function: - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void split_string( const std::string &s, char delim, @@ -104,18 +80,6 @@ void split_string( result.push_back(""); } -/*******************************************************************\ - -Function: - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void split_string( const std::string &s, char delim, diff --git a/src/util/substitute.cpp b/src/util/substitute.cpp index d83ad9361fe..10d49b78d65 100644 --- a/src/util/substitute.cpp +++ b/src/util/substitute.cpp @@ -10,18 +10,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "substitute.h" -/*******************************************************************\ - -Function: substitute - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void substitute( std::string &dest, const std::string &what, diff --git a/src/util/symbol.cpp b/src/util/symbol.cpp index d2883832faf..ed1b2b42d27 100644 --- a/src/util/symbol.cpp +++ b/src/util/symbol.cpp @@ -12,18 +12,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "source_location.h" #include "std_expr.h" -/*******************************************************************\ - -Function: symbolt::show - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void symbolt::show(std::ostream &out) const { out << " " << name << '\n'; @@ -77,18 +65,6 @@ void symbolt::show(std::ostream &out) const out << '\n'; } -/*******************************************************************\ - -Function: operator<< - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::ostream &operator<<(std::ostream &out, const symbolt &symbol) { @@ -96,18 +72,6 @@ std::ostream &operator<<(std::ostream &out, return out; } -/*******************************************************************\ - -Function: symbolt::to_irep - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - irept symbolt::to_irep() const { irept dest; @@ -158,18 +122,6 @@ irept symbolt::to_irep() const return dest; } -/*******************************************************************\ - -Function: symbolt::from_irep - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void symbolt::from_irep(const irept &src) { type=static_cast(src.find(ID_type)); @@ -200,18 +152,6 @@ void symbolt::from_irep(const irept &src) is_volatile=src.get_bool("is_volatile"); } -/*******************************************************************\ - -Function: symbolt::swap - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void symbolt::swap(symbolt &b) { #define SYM_SWAP1(x) x.swap(b.x) @@ -245,18 +185,8 @@ void symbolt::swap(symbolt &b) SYM_SWAP2(is_volatile); } -/*******************************************************************\ - -Function: symbolt::symbol_expr - - Inputs: symbol - - Outputs: symbol_exprt - - Purpose: produces a symbol_exprt for a symbol - -\*******************************************************************/ - +/// produces a symbol_exprt for a symbol +/// \return symbol_exprt symbol_exprt symbolt::symbol_expr() const { return symbol_exprt(name, type); diff --git a/src/util/symbol_table.cpp b/src/util/symbol_table.cpp index 37053b7737b..2a6e71f137f 100644 --- a/src/util/symbol_table.cpp +++ b/src/util/symbol_table.cpp @@ -10,21 +10,11 @@ Author: Daniel Kroening, kroening@kroening.com #include "symbol_table.h" -/*******************************************************************\ - -Function: symbol_tablet::add - - Inputs: - symbol - The symbol to be added to the symbol table - - Outputs: Returns a boolean indicating whether the process failed, - which should only happen if there is a symbol with the same - name already in the symbol table - - Purpose: Add a new symbol to the symbol table - -\*******************************************************************/ - +/// Add a new symbol to the symbol table +/// \param symbol: The symbol to be added to the symbol table +/// \return Returns a boolean indicating whether the process failed, which +/// should only happen if there is a symbol with the same name already in the +/// symbol table bool symbol_tablet::add(const symbolt &symbol) { if(!symbols.insert(std::pair(symbol.name, symbol)).second) @@ -38,35 +28,21 @@ bool symbol_tablet::add(const symbolt &symbol) return false; } -/*******************************************************************\ - -Function: symbol_tablet::move - - Inputs: - symbol - The symbol to be added to the symbol table - new_symbol - Pointer which the function will set to either point - to the symbol in the symbol table with the same name - or to the symbol that has been successfully moved - into the symbol table - - Outputs: Returns a boolean indicating whether the process failed, - which should only happen if there is a symbol with the - same name already in the symbol table. If the process - failed then symbol is unchanged and new_symbol points to - the symbol with the same name. If the process succeeded - symbol is set to be empty and new_symbol points to its new - location in the symbol table - - Purpose: Move a symbol into the symbol table. If there is already - a symbol with the same name then symbol is unchanged, - new_symbol points to the symbol with the same name and - true is returned. Otherwise, the symbol is moved into the - symbol table, symbol is set to be empty, new_symbol points - to its new location in the symbol table and false is - returned - -\*******************************************************************/ - +/// Move a symbol into the symbol table. If there is already a symbol with the +/// same name then symbol is unchanged, new_symbol points to the symbol with the +/// same name and true is returned. Otherwise, the symbol is moved into the +/// symbol table, symbol is set to be empty, new_symbol points to its new +/// location in the symbol table and false is returned +/// \param symbol: The symbol to be added to the symbol table +/// \param new_symbol: Pointer which the function will set to either point to +/// the symbol in the symbol table with the same name or to the symbol that +/// has been successfully moved into the symbol table +/// \return Returns a boolean indicating whether the process failed, which +/// should only happen if there is a symbol with the same name already in the +/// symbol table. If the process failed then symbol is unchanged and +/// new_symbol points to the symbol with the same name. If the process +/// succeeded symbol is set to be empty and new_symbol points to its new +/// location in the symbol table bool symbol_tablet::move(symbolt &symbol, symbolt *&new_symbol) { symbolt tmp; @@ -91,19 +67,9 @@ bool symbol_tablet::move(symbolt &symbol, symbolt *&new_symbol) return false; } -/*******************************************************************\ - -Function: symbol_tablet::remove - - Inputs: - name - The name of the symbol to remove - - Outputs: Returns a boolean indicating whether the process failed - - Purpose: Remove a symbol from the symbol table - -\*******************************************************************/ - +/// Remove a symbol from the symbol table +/// \param name: The name of the symbol to remove +/// \return Returns a boolean indicating whether the process failed bool symbol_tablet::remove(const irep_idt &name) { symbolst::iterator entry=symbols.find(name); @@ -138,19 +104,8 @@ bool symbol_tablet::remove(const irep_idt &name) return false; } -/*******************************************************************\ - -Function: symbol_tablet::show - - Inputs: - out - The ostream to direct output to - - Outputs: - - Purpose: Print the contents of the symbol table - -\*******************************************************************/ - +/// Print the contents of the symbol table +/// \param out: The ostream to direct output to void symbol_tablet::show(std::ostream &out) const { out << "\n" << "Symbols:" << "\n"; @@ -159,20 +114,10 @@ void symbol_tablet::show(std::ostream &out) const out << it->second; } -/*******************************************************************\ - -Function: symbol_tablet::lookup - - Inputs: - identifier - The name of the symbol to look for - - Outputs: The symbol in the symbol table with the correct name - - Purpose: Find a symbol in the symbol table. Throws a string if no - such symbol is found. - -\*******************************************************************/ - +/// Find a symbol in the symbol table. Throws a string if no such symbol is +/// found. +/// \param identifier: The name of the symbol to look for +/// \return The symbol in the symbol table with the correct name const symbolt &symbol_tablet::lookup(const irep_idt &identifier) const { symbolst::const_iterator it=symbols.find(identifier); @@ -183,20 +128,10 @@ const symbolt &symbol_tablet::lookup(const irep_idt &identifier) const return it->second; } -/*******************************************************************\ - -Function: symbol_tablet::lookup - - Inputs: - identifier - The name of the symbol to look for - - Outputs: The symbol in the symbol table with the correct name - - Purpose: Find a symbol in the symbol table. Throws a string if no - such symbol is found. - -\*******************************************************************/ - +/// Find a symbol in the symbol table. Throws a string if no such symbol is +/// found. +/// \param identifier: The name of the symbol to look for +/// \return The symbol in the symbol table with the correct name symbolt &symbol_tablet::lookup(const irep_idt &identifier) { symbolst::iterator it=symbols.find(identifier); @@ -207,20 +142,9 @@ symbolt &symbol_tablet::lookup(const irep_idt &identifier) return it->second; } -/*******************************************************************\ - -Function: operator << - - Inputs: - out - The ostream to direct output to - symbol_table - The symbol table to print out - - Outputs: - - Purpose: Print the contents of the symbol table - -\*******************************************************************/ - +/// Print the contents of the symbol table +/// \param out: The ostream to direct output to +/// \param symbol_table: The symbol table to print out std::ostream &operator << (std::ostream &out, const symbol_tablet &symbol_table) { symbol_table.show(out); diff --git a/src/util/tempdir.cpp b/src/util/tempdir.cpp index e160c664558..f9d4f15956c 100644 --- a/src/util/tempdir.cpp +++ b/src/util/tempdir.cpp @@ -28,18 +28,6 @@ Author: CM Wintersteiger #include "tempdir.h" #include "file_util.h" -/*******************************************************************\ - -Function: get_temporary_directory - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string get_temporary_directory(const std::string &name_template) { std::string result; @@ -86,86 +74,26 @@ std::string get_temporary_directory(const std::string &name_template) return result; } -/*******************************************************************\ - -Function: temp_dirt::temp_dirt - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - temp_dirt::temp_dirt(const std::string &name_template) { path=get_temporary_directory(name_template); } -/*******************************************************************\ - -Function: temp_dirt::operator() - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string temp_dirt::operator()(const std::string &file) { return concat_dir_file(path, file); } -/*******************************************************************\ - -Function: temp_dirt::~temp_dirt - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void temp_dirt::clear() { delete_directory(path); } -/*******************************************************************\ - -Function: temp_dirt::~temp_dirt - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - temp_dirt::~temp_dirt() { clear(); } -/*******************************************************************\ - -Function: temp_working_dirt::temp_working_dirt - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - temp_working_dirt::temp_working_dirt(const std::string &name_template): temp_dirt(name_template) { @@ -174,18 +102,6 @@ temp_working_dirt::temp_working_dirt(const std::string &name_template): assert(false); } -/*******************************************************************\ - -Function: temp_working_dirt::~temp_working_dirt - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - temp_working_dirt::~temp_working_dirt() { if(chdir(old_working_directory.c_str())!=0) diff --git a/src/util/tempfile.cpp b/src/util/tempfile.cpp index 023043e232f..24a76bdc81a 100644 --- a/src/util/tempfile.cpp +++ b/src/util/tempfile.cpp @@ -34,19 +34,8 @@ Author: Daniel Kroening #include "tempfile.h" -/*******************************************************************\ - -Function: my_mkstemps - - Inputs: - - Outputs: - - Purpose: Substitute for mkstemps (OpenBSD standard) for Windows, - where it is unavailable. - -\*******************************************************************/ - +/// Substitute for mkstemps (OpenBSD standard) for Windows, where it is +/// unavailable. #ifdef _WIN32 #define mkstemps my_mkstemps int my_mkstemps(char *template_str, int suffix_len) @@ -92,18 +81,6 @@ int my_mkstemps(char *template_str, int suffix_len) } #endif -/*******************************************************************\ - -Function: get_temporary_file - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string get_temporary_file( const std::string &prefix, const std::string &suffix) @@ -150,18 +127,6 @@ std::string get_temporary_file( return result; } -/*******************************************************************\ - -Function: temporary_filet::~temporary_filet - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - temporary_filet::~temporary_filet() { if(!name.empty()) diff --git a/src/util/time_stopping.cpp b/src/util/time_stopping.cpp index 3dda40c9ee5..f41b3401fd6 100644 --- a/src/util/time_stopping.cpp +++ b/src/util/time_stopping.cpp @@ -8,6 +8,9 @@ Date: February 2004 \*******************************************************************/ +/// \file +/// Time Stopping + #include #if defined(_WIN32) && !defined(__MINGW32__) @@ -41,18 +44,6 @@ void gettimeofday(struct timeval* p, struct timezone *tz) } #endif -/*******************************************************************\ - -Function: current_time - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - absolute_timet current_time() { // NOLINTNEXTLINE(readability/identifiers) @@ -65,35 +56,11 @@ absolute_timet current_time() return absolute_timet(tv.tv_usec/1000+(unsigned long long)tv.tv_sec*1000); } -/*******************************************************************\ - -Function: operator << - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::ostream &operator << (std::ostream &out, const time_periodt &period) { return out << static_cast(period.get_t())/1000; } -/*******************************************************************\ - -Function: time_periodt::as_string - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string time_periodt::as_string() const { std::ostringstream out; diff --git a/src/util/time_stopping.h b/src/util/time_stopping.h index 9187ce2529c..d09a4a91077 100644 --- a/src/util/time_stopping.h +++ b/src/util/time_stopping.h @@ -8,6 +8,9 @@ Date: February 2004 \*******************************************************************/ +/// \file +/// Time Stopping + #ifndef CPROVER_UTIL_TIME_STOPPING_H #define CPROVER_UTIL_TIME_STOPPING_H diff --git a/src/util/timer.cpp b/src/util/timer.cpp index 655dcb21ffb..63b561174cc 100644 --- a/src/util/timer.cpp +++ b/src/util/timer.cpp @@ -8,39 +8,18 @@ Module: Time Stopping \*******************************************************************/ +/// \file +/// Time Stopping + #include #include #include "timer.h" -/*******************************************************************\ - -Function: - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - timert::~timert() { } -/*******************************************************************\ - -Function: - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void timert::start() { assert(!started); @@ -50,18 +29,6 @@ void timert::start() nr_starts++; } -/*******************************************************************\ - -Function: - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void timert::stop() { assert(started); @@ -71,18 +38,6 @@ void timert::stop() _total_time += _latest_time; } -/*******************************************************************\ - -Function: - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void timert::clear() { _total_time.clear(); diff --git a/src/util/timer.h b/src/util/timer.h index dcdba700542..79d60082f65 100644 --- a/src/util/timer.h +++ b/src/util/timer.h @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Time Stopping + #ifndef CPROVER_UTIL_TIMER_H #define CPROVER_UTIL_TIMER_H diff --git a/src/util/type.cpp b/src/util/type.cpp index fa33c7ea58b..aa745def82d 100644 --- a/src/util/type.cpp +++ b/src/util/type.cpp @@ -8,35 +8,11 @@ Author: Daniel Kroening, kroening@kroening.com #include "type.h" -/*******************************************************************\ - -Function: typet::copy_to_subtypes - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void typet::copy_to_subtypes(const typet &type) { subtypes().push_back(type); } -/*******************************************************************\ - -Function: typet::move_to_subtypes - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void typet::move_to_subtypes(typet &type) { subtypest &sub=subtypes(); @@ -44,18 +20,6 @@ void typet::move_to_subtypes(typet &type) sub.back().swap(type); } -/*******************************************************************\ - -Function: is_number - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool is_number(const typet &type) { const irep_idt &id=type.id(); diff --git a/src/util/type_eq.cpp b/src/util/type_eq.cpp index 0a63181b04f..0166c347789 100644 --- a/src/util/type_eq.cpp +++ b/src/util/type_eq.cpp @@ -6,6 +6,9 @@ Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ +/// \file +/// Type Checking + #include #include "type_eq.h" @@ -13,18 +16,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "symbol.h" #include "namespace.h" -/*******************************************************************\ - -Function: type_eq - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool type_eq(const typet &type1, const typet &type2, const namespacet &ns) { if(type1==type2) diff --git a/src/util/typecheck.cpp b/src/util/typecheck.cpp index 67b695e53fa..f359b380b34 100644 --- a/src/util/typecheck.cpp +++ b/src/util/typecheck.cpp @@ -8,18 +8,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "typecheck.h" -/*******************************************************************\ - -Function: - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool typecheckt::typecheck_main() { try diff --git a/src/util/ui_message.cpp b/src/util/ui_message.cpp index 25f6eac92dc..57869c71432 100644 --- a/src/util/ui_message.cpp +++ b/src/util/ui_message.cpp @@ -16,18 +16,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "ui_message.h" #include "cmdline.h" -/*******************************************************************\ - -Function: ui_message_handlert::ui_message_handlert - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - ui_message_handlert::ui_message_handlert( uit __ui, const std::string &program):_ui(__ui) { @@ -60,18 +48,6 @@ ui_message_handlert::ui_message_handlert( } } -/*******************************************************************\ - -Function: ui_message_handlert::ui_message_handlert - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - ui_message_handlert::ui_message_handlert( const class cmdlinet &cmdline, const std::string &program): @@ -83,18 +59,6 @@ ui_message_handlert::ui_message_handlert( { } -/*******************************************************************\ - -Function: ui_message_handlert::~ui_message_handlert - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - ui_message_handlert::~ui_message_handlert() { switch(get_ui()) @@ -112,18 +76,6 @@ ui_message_handlert::~ui_message_handlert() } } -/*******************************************************************\ - -Function: ui_message_handlert::level_string - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - const char *ui_message_handlert::level_string(unsigned level) { if(level==1) @@ -134,18 +86,6 @@ const char *ui_message_handlert::level_string(unsigned level) return "STATUS-MESSAGE"; } -/*******************************************************************\ - -Function: ui_message_handlert::print - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void ui_message_handlert::print( unsigned level, const std::string &message) @@ -173,18 +113,6 @@ void ui_message_handlert::print( } } -/*******************************************************************\ - -Function: ui_message_handlert::print - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void ui_message_handlert::print( unsigned level, const std::string &message, @@ -220,18 +148,6 @@ void ui_message_handlert::print( } } -/*******************************************************************\ - -Function: ui_message_handlert::ui_msg - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void ui_message_handlert::ui_msg( const std::string &type, const std::string &msg1, @@ -253,18 +169,6 @@ void ui_message_handlert::ui_msg( } } -/*******************************************************************\ - -Function: ui_message_handlert::xml_ui_msg - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void ui_message_handlert::xml_ui_msg( const std::string &type, const std::string &msg1, @@ -285,18 +189,6 @@ void ui_message_handlert::xml_ui_msg( std::cout << std::endl; } -/*******************************************************************\ - -Function: ui_message_handlert::json_ui_msg - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void ui_message_handlert::json_ui_msg( const std::string &type, const std::string &msg1, diff --git a/src/util/unicode.cpp b/src/util/unicode.cpp index 4c997f1a6c3..16bba113b9b 100644 --- a/src/util/unicode.cpp +++ b/src/util/unicode.cpp @@ -18,36 +18,14 @@ Author: Daniel Kroening, kroening@kroening.com #include #endif -/*******************************************************************\ - -Function: is_little_endian_arch - - Inputs: - - Outputs: True if the architecture is little_endian - - Purpose: Determine endianness of the architecture - -\*******************************************************************/ - +/// Determine endianness of the architecture +/// \return True if the architecture is little_endian bool is_little_endian_arch() { uint32_t i=1; return reinterpret_cast(i); } -/*******************************************************************\ - -Function: narrow - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - #define BUFSIZE 100 std::string narrow(const wchar_t *s) @@ -75,18 +53,6 @@ std::string narrow(const wchar_t *s) #endif } -/*******************************************************************\ - -Function: widen - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::wstring widen(const char *s) { #ifdef _WIN32 @@ -112,18 +78,6 @@ std::wstring widen(const char *s) #endif } -/*******************************************************************\ - -Function: narrow - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::string narrow(const std::wstring &s) { #ifdef _WIN32 @@ -141,18 +95,6 @@ std::string narrow(const std::wstring &s) #endif } -/*******************************************************************\ - -Function: widen - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - std::wstring widen(const std::string &s) { #ifdef _WIN32 @@ -170,18 +112,8 @@ std::wstring widen(const std::string &s) #endif } -/*******************************************************************\ - -Function: utf8_append_code - - Inputs: character to append, string to append to - - Outputs: - - Purpose: Appends a unicode character to a utf8-encoded string - -\*******************************************************************/ - +/// Appends a unicode character to a utf8-encoded string +/// \par parameters: character to append, string to append to static void utf8_append_code(unsigned int c, std::string &result) { if(c<=0x7f) @@ -206,19 +138,8 @@ static void utf8_append_code(unsigned int c, std::string &result) } } -/*******************************************************************\ - -Function: utf32_to_utf8 - - Inputs: utf32-encoded wide string - - Outputs: utf8-encoded string with the same unicode characters - as the input. - - Purpose: - -\*******************************************************************/ - +/// \param utf32:encoded wide string +/// \return utf8-encoded string with the same unicode characters as the input. std::string utf32_to_utf8(const std::basic_string &s) { std::string result; @@ -231,18 +152,6 @@ std::string utf32_to_utf8(const std::basic_string &s) return result; } -/*******************************************************************\ - -Function: narrow_argv - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - const char **narrow_argv(int argc, const wchar_t **argv_wide) { if(argv_wide==NULL) @@ -258,18 +167,9 @@ const char **narrow_argv(int argc, const wchar_t **argv_wide) return argv_narrow; } -/*******************************************************************\ - -Function: do_swap_bytes - - Inputs: A 16-bit integer - - Outputs: A 16-bit integer with bytes swapped - - Purpose: A helper function for dealing with different UTF16 endians - -\*******************************************************************/ - +/// A helper function for dealing with different UTF16 endians +/// \par parameters: A 16-bit integer +/// \return A 16-bit integer with bytes swapped uint16_t do_swap_bytes(uint16_t x) { uint16_t b1=x & 0xFF; @@ -307,19 +207,10 @@ void utf16_append_code(unsigned int code, bool swap_bytes, std::wstring &result) } -/*******************************************************************\ - -Function: utf8_to_utf16 - - Inputs: String in UTF-8 format, bool value indicating whether the - endianness should be different from the architecture one. - - Outputs: String in UTF-16 format. The encoding follows the - endianness of the architecture iff swap_bytes is true. - - Purpose: - -\*******************************************************************/ +/// \par parameters: String in UTF-8 format, bool value indicating whether the +/// endianness should be different from the architecture one. +/// \return String in UTF-16 format. The encoding follows the endianness of the +/// architecture iff swap_bytes is true. std::wstring utf8_to_utf16(const std::string& in, bool swap_bytes) { std::wstring result; @@ -379,55 +270,24 @@ std::wstring utf8_to_utf16(const std::string& in, bool swap_bytes) return result; } -/*******************************************************************\ - -Function: utf8_to_utf16_big_endian - - Inputs: String in UTF-8 format - - Outputs: String in UTF-16BE format - - Purpose: - -\*******************************************************************/ - +/// \par parameters: String in UTF-8 format +/// \return String in UTF-16BE format std::wstring utf8_to_utf16_big_endian(const std::string& in) { bool swap_bytes=is_little_endian_arch(); return utf8_to_utf16(in, swap_bytes); } -/*******************************************************************\ - -Function: utf8_to_utf16_little_endian - - Inputs: String in UTF-8 format - - Outputs: String in UTF-16LE format - - Purpose: - -\*******************************************************************/ - +/// \par parameters: String in UTF-8 format +/// \return String in UTF-16LE format std::wstring utf8_to_utf16_little_endian(const std::string& in) { bool swap_bytes=!is_little_endian_arch(); return utf8_to_utf16(in, swap_bytes); } -/*******************************************************************\ - -Function: utf16_little_endian_to_ascii - - Inputs: String in UTF-16LE format - - Outputs: String in US-ASCII format, with \uxxxx escapes for other - characters - - Purpose: - -\*******************************************************************/ - +/// \par parameters: String in UTF-16LE format +/// \return String in US-ASCII format, with \uxxxx escapes for other characters std::string utf16_little_endian_to_ascii(const std::wstring& in) { std::ostringstream result; diff --git a/src/util/union_find.cpp b/src/util/union_find.cpp index f37975f32eb..6dc80af058a 100644 --- a/src/util/union_find.cpp +++ b/src/util/union_find.cpp @@ -10,18 +10,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "union_find.h" -/*******************************************************************\ - -Function: unsigned_union_find::make_union - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void unsigned_union_find::make_union(size_type j, size_type k) { check_index(j); @@ -50,18 +38,6 @@ void unsigned_union_find::make_union(size_type j, size_type k) } } -/*******************************************************************\ - -Function: unsigned_union_find::isolate - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void unsigned_union_find::isolate(size_type a) { check_index(a); @@ -95,18 +71,6 @@ void unsigned_union_find::isolate(size_type a) nodes[a].count=1; } -/*******************************************************************\ - -Function: unsigned_union_find::re_root - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void unsigned_union_find::re_root(size_type old_root, size_type new_root) { check_index(old_root); @@ -141,18 +105,6 @@ void unsigned_union_find::re_root(size_type old_root, size_type new_root) } } -/*******************************************************************\ - -Function: unsigned_union_find::get_other - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - unsigned_union_find::size_type unsigned_union_find::get_other(size_type a) { check_index(a); @@ -169,18 +121,6 @@ unsigned_union_find::size_type unsigned_union_find::get_other(size_type a) return 0; } -/*******************************************************************\ - -Function: unsigned_union_find::intersection - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void unsigned_union_find::intersection( const unsigned_union_find &other) { @@ -202,18 +142,6 @@ void unsigned_union_find::intersection( swap(new_sets); } -/*******************************************************************\ - -Function: unsigned_union_find::find - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - unsigned_union_find::size_type unsigned_union_find::find(size_type a) const { if(a>=size()) diff --git a/src/util/xml.cpp b/src/util/xml.cpp index aa784c96604..5e198639e7a 100644 --- a/src/util/xml.cpp +++ b/src/util/xml.cpp @@ -11,18 +11,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "string2int.h" #include "xml.h" -/*******************************************************************\ - -Function: xmlt::clear - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void xmlt::clear() { data.clear(); @@ -31,18 +19,6 @@ void xmlt::clear() elements.clear(); } -/*******************************************************************\ - -Function: xmlt::swap - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void xmlt::swap(xmlt &xml) { xml.data.swap(data); @@ -51,18 +27,6 @@ void xmlt::swap(xmlt &xml) xml.name.swap(name); } -/*******************************************************************\ - -Function: xmlt::output - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void xmlt::output(std::ostream &out, unsigned indent) const { // 'name' needs to be set, or we produce mal-formed @@ -109,18 +73,7 @@ void xmlt::output(std::ostream &out, unsigned indent) const out << '<' << '/' << name << '>' << "\n"; } -/*******************************************************************\ - -Function: xmlt::escape - - Inputs: - - Outputs: - - Purpose: escaping for XML elements - -\*******************************************************************/ - +/// escaping for XML elements void xmlt::escape(const std::string &s, std::ostream &out) { for(const auto ch : s) @@ -156,20 +109,8 @@ void xmlt::escape(const std::string &s, std::ostream &out) } } -/*******************************************************************\ - -Function: xmlt::escape_attribute - - Inputs: - - Outputs: - - Purpose: escaping for XML attributes, assuming that - double quotes " are used consistently, - not single quotes - -\*******************************************************************/ - +/// escaping for XML attributes, assuming that double quotes " are used +/// consistently, not single quotes void xmlt::escape_attribute(const std::string &s, std::ostream &out) { for(const auto ch : s) @@ -202,35 +143,11 @@ void xmlt::escape_attribute(const std::string &s, std::ostream &out) } } -/*******************************************************************\ - -Function: xmlt::do_indent - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void xmlt::do_indent(std::ostream &out, unsigned indent) { out << std::string(indent, ' '); } -/*******************************************************************\ - -Function: xmlt::find - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - xmlt::elementst::const_iterator xmlt::find(const std::string &name) const { for(elementst::const_iterator it=elements.begin(); @@ -242,18 +159,6 @@ xmlt::elementst::const_iterator xmlt::find(const std::string &name) const return elements.end(); } -/*******************************************************************\ - -Function: xmlt::find - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - xmlt::elementst::iterator xmlt::find(const std::string &name) { for(elementst::iterator it=elements.begin(); @@ -265,18 +170,6 @@ xmlt::elementst::iterator xmlt::find(const std::string &name) return elements.end(); } -/*******************************************************************\ - -Function: xmlt::set_attribute - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void xmlt::set_attribute( const std::string &attribute, unsigned value) @@ -284,18 +177,6 @@ void xmlt::set_attribute( set_attribute(attribute, std::to_string(value)); } -/*******************************************************************\ - -Function: xmlt::set_attribute - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void xmlt::set_attribute( const std::string &attribute, unsigned long value) @@ -303,18 +184,6 @@ void xmlt::set_attribute( set_attribute(attribute, std::to_string(value)); } -/*******************************************************************\ - -Function: xmlt::set_attribute - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void xmlt::set_attribute( const std::string &attribute, unsigned long long value) @@ -322,18 +191,6 @@ void xmlt::set_attribute( set_attribute(attribute, std::to_string(value)); } -/*******************************************************************\ - -Function: xmlt::set_attribute - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void xmlt::set_attribute( const std::string &attribute, const std::string &value) @@ -349,18 +206,9 @@ void xmlt::set_attribute( } } -/*******************************************************************\ - -Function: xmlt::unescape - - Inputs: a string - - Outputs: the unescaped string - - Purpose: takes a string and unescapes any xml style escaped symbols - -\*******************************************************************/ - +/// takes a string and unescapes any xml style escaped symbols +/// \par parameters: a string +/// \return the unescaped string std::string xmlt::unescape(const std::string &str) { std::string result(""); diff --git a/src/util/xml_expr.cpp b/src/util/xml_expr.cpp index 236c844f6e5..c027025af82 100644 --- a/src/util/xml_expr.cpp +++ b/src/util/xml_expr.cpp @@ -8,6 +8,9 @@ Author: Daniel Kroening \*******************************************************************/ +/// \file +/// Expressions in XML + #include "namespace.h" #include "expr.h" #include "xml.h" @@ -19,18 +22,6 @@ Author: Daniel Kroening #include "xml_expr.h" -/*******************************************************************\ - -Function: xml - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - xmlt xml(const source_locationt &location) { xmlt result; @@ -52,18 +43,6 @@ xmlt xml(const source_locationt &location) return result; } -/*******************************************************************\ - -Function: xml - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - xmlt xml( const typet &type, const namespacet &ns) @@ -159,18 +138,6 @@ xmlt xml( return result; } -/*******************************************************************\ - -Function: xml - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - xmlt xml( const exprt &expr, const namespacet &ns) diff --git a/src/util/xml_irep.cpp b/src/util/xml_irep.cpp index 92bad4df40c..2dad57871e1 100644 --- a/src/util/xml_irep.cpp +++ b/src/util/xml_irep.cpp @@ -15,18 +15,6 @@ Author: Daniel Kroening #include "irep.h" #include "xml.h" -/*******************************************************************\ - -Function: convert - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void convert( const irept &irep, xmlt &xml) @@ -55,18 +43,6 @@ void convert( } } -/*******************************************************************\ - -Function: convert - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void convert( const xmlt &xml, irept &irep) diff --git a/src/xmllang/graphml.cpp b/src/xmllang/graphml.cpp index e96abaa74ee..54d19654ec1 100644 --- a/src/xmllang/graphml.cpp +++ b/src/xmllang/graphml.cpp @@ -6,6 +6,9 @@ Author: Michael Tautschnig, mt@eecs.qmul.ac.uk \*******************************************************************/ +/// \file +/// Read/write graphs as GraphML + #include #include @@ -20,18 +23,6 @@ Author: Michael Tautschnig, mt@eecs.qmul.ac.uk typedef std::map name_mapt; -/*******************************************************************\ - -Function: add_node - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - static graphmlt::node_indext add_node( const std::string &name, name_mapt &name_to_node, @@ -45,18 +36,6 @@ static graphmlt::node_indext add_node( return entry.first->second; } -/*******************************************************************\ - -Function: build_graph_rec - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - static bool build_graph_rec( const xmlt &xml, name_mapt &name_to_node, @@ -168,18 +147,6 @@ static bool build_graph_rec( return false; } -/*******************************************************************\ - -Function: build_graph - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - static bool build_graph( const xmlt &xml, graphmlt &dest, @@ -214,18 +181,6 @@ static bool build_graph( return err; } -/*******************************************************************\ - -Function: read_graphml - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool read_graphml( std::istream &is, graphmlt &dest, @@ -240,18 +195,6 @@ bool read_graphml( return build_graph(xml, dest, entry); } -/*******************************************************************\ - -Function: read_graphml - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool read_graphml( const std::string &filename, graphmlt &dest, @@ -266,18 +209,6 @@ bool read_graphml( return build_graph(xml, dest, entry); } -/*******************************************************************\ - -Function: write_graphml - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - bool write_graphml(const graphmlt &src, std::ostream &os) { xmlt graphml("graphml"); diff --git a/src/xmllang/graphml.h b/src/xmllang/graphml.h index 1ef5aaedae1..3b399d48c3b 100644 --- a/src/xmllang/graphml.h +++ b/src/xmllang/graphml.h @@ -6,6 +6,9 @@ Author: Michael Tautschnig, mt@eecs.qmul.ac.uk \*******************************************************************/ +/// \file +/// Read/write graphs as GraphML + #ifndef CPROVER_XMLLANG_GRAPHML_H #define CPROVER_XMLLANG_GRAPHML_H diff --git a/src/xmllang/xml_parse_tree.cpp b/src/xmllang/xml_parse_tree.cpp index b18bda862a5..766a34d2816 100644 --- a/src/xmllang/xml_parse_tree.cpp +++ b/src/xmllang/xml_parse_tree.cpp @@ -8,35 +8,11 @@ Author: Daniel Kroening, kroening@kroening.com #include "xml_parse_tree.h" -/*******************************************************************\ - -Function: xml_parse_treet::swap - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void xml_parse_treet::swap(xml_parse_treet &xml_parse_tree) { xml_parse_tree.element.swap(element); } -/*******************************************************************\ - -Function: xml_parse_treet::clear - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - void xml_parse_treet::clear() { xml.clear(); diff --git a/src/xmllang/xml_parser.cpp b/src/xmllang/xml_parser.cpp index f56ee14e202..4a657a557e7 100644 --- a/src/xmllang/xml_parser.cpp +++ b/src/xmllang/xml_parser.cpp @@ -14,18 +14,6 @@ Author: Daniel Kroening, kroening@kroening.com xml_parsert xml_parser; -/*******************************************************************\ - -Function: parse_xml - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - // 'do it all' function bool parse_xml( std::istream &in, @@ -49,18 +37,6 @@ bool parse_xml( return result; } -/*******************************************************************\ - -Function: parse_xml - - Inputs: - - Outputs: - - Purpose: - -\*******************************************************************/ - // 'do it all' function bool parse_xml( const std::string &filename,