Skip to content

Doc/move irep docs from util to irep #2618

New issue

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

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

Already on GitHub? Sign in to your account

Conversation

owen-mc-diffblue
Copy link
Contributor

No description provided.

Copy link
Contributor

@smowton smowton left a comment

Choose a reason for hiding this comment

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

Might as well update this while we're doing this

src/util/irep.h Outdated
/// The `irept::pretty` function outputs the contents of an `irept` directly
/// and can be used to understand and debug problems with `irept`s.
///
/// On their own `irept`s do not “mean” anything; they are effectively
Copy link
Contributor

Choose a reason for hiding this comment

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

Mix of smart and normal quotes

src/util/irep.h Outdated
/// is used for named children, i.e. subexpressions, parameters, etc.
///
/// * `comments`: Another map from `irep_namet` to `irept` which is used
/// for annotations and other ‘non-semantic’ information
Copy link
Contributor

Choose a reason for hiding this comment

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

Probably worth mentioning the caveat about these not being taken into account by the default operator== here

src/util/irep.h Outdated
/// On their own `irept`s do not “mean” anything; they are effectively
/// generic tree nodes. Their interpretation depends on the contents of
/// result of the `id` function (the `data`) field. `util/irep_ids.txt`
/// contains the complete list of `id` values. During the build process it
Copy link
Contributor

Choose a reason for hiding this comment

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

Nah, ireps that use other strings (e.g. irept("Hello world") are not common but are definitely present in the codebase

src/util/irep.h Outdated
/// with the architecture of the code.
///
/// Many of the key descendant of `exprt` are declared in `std_expr.h`. All
/// expressions have a named subfield / annotation which gives the type of
Copy link
Contributor

Choose a reason for hiding this comment

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

named subexpression with ID "type" would probably be clearer

src/util/irep.h Outdated
/// expressions have a named subfield / annotation which gives the type of
/// the expression (slightly simplified from C/C++ as `unsignedbv_typet`,
/// `signedbv_typet`, `floatbv_typet`, etc.). All type conversions are
/// explicit with an expression with `id() == ID_typecast` and an ‘interface
Copy link
Contributor

Choose a reason for hiding this comment

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

"interface class" is not used anywhere else, just say "i.e. a typecast_exprt" instead

src/util/irep.h Outdated
/// using the `get_identifier` accessor function.
///
/// `codet` inherits from `exprt` and is defined in `std_code.h`. It
/// represents executable code; statements in C rather than expressions. In
Copy link
Contributor

Choose a reason for hiding this comment

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

...a C-like language...

src/util/irep.h Outdated
/// the front-end there are versions of these that hold whole code blocks,
/// but in goto-programs these have been flattened so that each `irept`
/// represents one sequence point (almost one line of code / one
/// semi-colon). The most common descendants of `codet` are `code_assignt`
Copy link
Contributor

Choose a reason for hiding this comment

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

is code_assignt

Copy link
Contributor

@allredj allredj left a comment

Choose a reason for hiding this comment

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

Passed Diffblue compatibility checks (cbmc commit: 105e297).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/80008898

/// of the same string you only have to store the whole string once, which
/// saves space.
///
/// `irep_idt` and `irep_namet` are typedef-ed to `dstringt` in irep.h unless
Copy link
Member

Choose a reason for hiding this comment

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

unless what?

src/util/irep.h Outdated
///
/// On their own `irept`s do not “mean” anything; they are effectively
/// generic tree nodes. Their interpretation depends on the contents of
/// result of the `id` function (the `data`) field. `util/irep_ids.txt`
Copy link
Member

Choose a reason for hiding this comment

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

This is irep_ids.def now.

src/util/irep.h Outdated
/// * `sub`: A vector of `irept` which is used to store ordered but
/// unnamed children.
///
/// The `irept::pretty` function outputs the contents of an `irept` directly
Copy link
Member

Choose a reason for hiding this comment

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

maybe say that it prints the explicit tree structure instead of 'directly'

src/util/irep.h Outdated
/// * `data`: A string[^2], which is returned when the `id()` function is
/// used.
///
/// * `named_sub`: A map from `irep_namet` (a string) to `irept`. This
Copy link
Member

Choose a reason for hiding this comment

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

Use as many \ref as possible

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Annoyingly, doxygen sometimes can't get the \ref to work if the name is in backticks, but sometimes it can

src/util/irep.h Outdated
/// so a common pattern is to cast the `codet` to an assignment and then
/// recurse on the expression on either side.
///
/// [^1]: Or references, if reference counted data sharing is enabled. It is
Copy link
Member

Choose a reason for hiding this comment

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

Maybe inline these footnotes.

@owen-mc-diffblue
Copy link
Contributor Author

I have addressed all the review comments

Copy link
Contributor

@allredj allredj left a comment

Choose a reason for hiding this comment

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

Passed Diffblue compatibility checks (cbmc commit: ae66e65).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/80350969

Copy link
Contributor

@allredj allredj left a comment

Choose a reason for hiding this comment

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

Passed Diffblue compatibility checks (cbmc commit: 6b0dfb6).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/80355880

@owen-mc-diffblue
Copy link
Contributor Author

@peterschrammel @smowton Please re-review.

src/util/irep.h Outdated
///
/// * \ref irept::dt::comments : Another map from `irep_namet` to \ref irept
/// which is used for annotations and other ‘non-semantic’ information. Note
/// that this map is ignore by the default \ref operator==.
Copy link
Contributor

Choose a reason for hiding this comment

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

ignored

src/util/irep.h Outdated
/// result of the \ref id() function, i.e. the `data` field. `util/irep_ids.def`
/// contains a list of `id` values. During the build process it is used
/// to generate `util/irep_ids.h` which gives constants for each id
/// (named `ID_`). You can also make `irep_id`s which do not come from
Copy link
Contributor

Choose a reason for hiding this comment

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

irep_idt?

src/util/irep.h Outdated
/// type of the expression (slightly simplified from C/C++ as \ref
/// unsignedbv_typet, \ref signedbv_typet, \ref floatbv_typet, etc.). All type
/// conversions are explicit with an expression with `id() == ID_typecast`
/// and a \ref typecast_exprt. One key descendant of \ref exprt is \ref
Copy link
Contributor

Choose a reason for hiding this comment

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

The typecast_exprt is the expression with id() == ID_typecast

Owen Jones added 6 commits July 31, 2018 17:36
It was in the documentation for the util folder.
It often doesn't work when backticks are used, so I've removed them.
They don't affect how the text appears that much when I look at the
html.
@owen-mc-diffblue owen-mc-diffblue force-pushed the doc/move-irep-docs-from-util-to-irep branch from 6b0dfb6 to 0855872 Compare July 31, 2018 16:36
Copy link
Contributor

@allredj allredj left a comment

Choose a reason for hiding this comment

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

This PR failed Diffblue compatibility checks (cbmc commit: 0855872).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/80546022
Status will be re-evaluated on next push.
Please contact @peterschrammel, @thk123, or @allredj for support.

Common spurious failures:

  • the cbmc commit has disappeared in the mean time (e.g. in a force-push)
  • the author is not in the list of contributors (e.g. first-time contributors).

@owen-mc-diffblue owen-mc-diffblue merged commit 7c066f9 into diffblue:develop Aug 1, 2018
@owen-mc-diffblue owen-mc-diffblue deleted the doc/move-irep-docs-from-util-to-irep branch August 1, 2018 09:17
NathanJPhillips added a commit to NathanJPhillips/cbmc that referenced this pull request Aug 22, 2018
6a10f1a Merge pull request diffblue#2462 from tautschnig/vs-goto-inline
96fc7b1 Merge pull request diffblue#2654 from peterschrammel/update-jml8
1847066 Update jbmc/lib/java-models-library to java-models-library#8 (remove sun.* imports)
c157ba7 Revert "CMake version.cpp: switch back to add_custom_target"
7a009d6 Merge pull request diffblue#2650 from diffblue/aws-codebuild-clcache
63652fc add clcache to Windows build
6f72b3b Merge pull request diffblue#2657 from smowton/smowton/fix/cmake-version-cpp
35d09d5 CMake version.cpp: switch back to add_custom_target
80331d8 Merge pull request diffblue#2638 from diffblue/CBMC_VERSION_string
7c066f9 Merge pull request diffblue#2618 from owen-jones-diffblue/doc/move-irep-docs-from-util-to-irep
ad5c375 use a string instead of macro for version number
b6258db Merge pull request diffblue#2509 from danpoe/feature/sharing-map-stats
eb71a01 Merge pull request diffblue#2639 from thk123/array-element-type
c5519ec Merge pull request diffblue#2640 from allredj/support-for-load-containing-class-only
0855872 Address review comments diffblue#2
eaa7664 Wrap lines properly
e682eb9 Add \ref in lots of places
3023cca Address review comments
758f069 Move dstringt documentation to above dstringt
a54c82d Move documentation of irept to be above irept
b827ea4 Use type equality check in unit tests
77185fd Merge pull request diffblue#2607 from jeannielynnmoulton/jeannie/ParseThrownExceptions2
1f4ef40 Add class loader debug output
4ae8eb6 Move sharing map friends declarations to unit tests
186897c Sharing stats for the sharing map
4438b43 Fix sharing map internal assertion
332febe Remove wrong sharing map internal assertions
be7e140 Activate internal checks for the sharing map unit tests
713d3fe Merge pull request diffblue#2636 from polgreen/fix_function_map
87f90ee Add replace_all string utility
ea2d393 Make test work on windows
4fa9943 Make array element type be not a comment
655248a Add unit test for when there are no exceptions.
a6e7c4b Refactors interface for exceptions to not use irepts.
1134bba Creates java_method_typet which extends code_typet
aa83622 Unit tests method get_super_class
565c999 Unit tests throws exceptions parsing.
eb88509 Use parsed information for thrown exceptions.
5c7dcac Parses the exception attribute
7fcc42d Adds const to get/set_outer_class
5994dd8 Add method to get super class from java class type.
fbad2d9 Rename variable extends to super_class
6d0776f if function is not in the function map, treat as if it has no body
da86bdb Merge pull request diffblue#2602 from diffblue/__CPROVER_r/w_ok
0202f34 refactor pointer_validity_check using address_check
4a24ad4 use __CPROVER_r/w_ok in string.c library
732ce2a expand __CPROVER_r/w_ok in goto_check
acfea65 __CPROVER_r_ok and __CPROVER_w_ok added to ANSI-C front-end
0618f7d Merge pull request diffblue#2628 from diffblue/clang-extensions
5e43131 Merge pull request diffblue#2608 from diffblue/ms_cl_int64
7c56091 Merge pull request diffblue#2634 from qaphla/local_bitvector_analysis_regression
44ef8d5 Merge pull request diffblue#2630 from diffblue/invalid-pointer-flattening
f74c161 test for __float80 and __float128
8288a72 __float80 is a typedef, not a keyword
5495625 FreeBSD: default flavor is now CLANG
e63402e added _Null_unspecified clang extension
16a49a7 bugfix: __float128
3849bb0 rename APPLE flavor to CLANG
060b59c separate pointer check for integer addresses
9b5847e fix flattening of ID_invalid_pointer
432dcf1 Added a regression test checking that --pointer-check does not generate excess checks if local_bitvector_analysis can gather information on the pointer being checked.
cbfcc5c added support for _int64 keyword
0148347 Avoid signed/unsigned casts and conversion in goto_inline

git-subtree-dir: cbmc
git-subtree-split: 6a10f1a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants