Skip to content

move bitvector-related expression classes into separate header file #5759

New issue

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

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

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 18, 2021

Conversation

kroening
Copy link
Member

std_expr.h is by far the largest header file, which impedes on readability.
This commit moves the bitvector-related expression classes into a separate
header file, following the pattern in mathematical_expr.h.

  • Each commit message has a non-empty body, explaining why the change was made.
  • n/a Methods or procedures I have added are documented, following the guidelines provided in CODING_STANDARD.md.
  • n/a The feature or user visible behaviour I have added or modified has been documented in the User Guide in doc/cprover-manual/
  • n/a Regression or unit tests are included, or existing tests cover the modified code (in this case I have detailed which ones those are in the commit message).
  • n/a My commit message includes data points confirming performance improvements (if claimed).
  • My PR is restricted to a single feature or bugfix.
  • n/a White-space or formatting changes outside the feature-related changed lines are in commits of their own.

@codecov
Copy link

codecov bot commented Jan 17, 2021

Codecov Report

Merging #5759 (7b0cc28) into develop (0f57d77) will decrease coverage by 0.00%.
The diff coverage is 94.39%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #5759      +/-   ##
===========================================
- Coverage    69.65%   69.65%   -0.01%     
===========================================
  Files         1243     1245       +2     
  Lines       100843   100842       -1     
===========================================
- Hits         70243    70242       -1     
  Misses       30600    30600              
Flag Coverage Δ
cproversmt2 43.39% <91.26%> (+<0.01%) ⬆️
regression 66.56% <94.28%> (-0.01%) ⬇️
unit 32.20% <55.14%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
.../src/java_bytecode/character_refine_preprocess.cpp 55.01% <ø> (ø)
...c/java_bytecode/java_string_library_preprocess.cpp 96.86% <ø> (ø)
src/analyses/goto_check.cpp 88.35% <ø> (ø)
src/analyses/goto_rw.cpp 55.38% <ø> (ø)
src/ansi-c/c_typecheck_base.h 100.00% <ø> (ø)
src/ansi-c/expr2c_class.h 100.00% <ø> (ø)
src/goto-programs/interpreter_evaluate.cpp 31.98% <ø> (-0.13%) ⬇️
src/solvers/flattening/boolbv.cpp 69.09% <ø> (ø)
src/solvers/flattening/boolbv.h 78.57% <ø> (ø)
src/solvers/flattening/boolbv_bitwise.cpp 90.32% <ø> (ø)
... and 26 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0f57d77...7b0cc28. Read the comment docs.

Copy link
Collaborator

@martin-cs martin-cs left a comment

Choose a reason for hiding this comment

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

If we are going the route of splitting up std_expr.h, then, yes, clearly.

Copy link
Collaborator

@tautschnig tautschnig left a comment

Choose a reason for hiding this comment

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

I believe this is a great first step to make things more manageable for humans. Now I'm wondering whether we can also do some work to help the compiler having to do a little less work, see my comment below.

#ifndef CPROVER_UTIL_BITVECTOR_EXPR_H
#define CPROVER_UTIL_BITVECTOR_EXPR_H

/// \file util/std_expr.h
Copy link
Collaborator

Choose a reason for hiding this comment

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

Copy&paste error.

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed.

/// \file util/std_expr.h
/// API to expression classes for bitvectors

#include "std_expr.h"
Copy link
Collaborator

Choose a reason for hiding this comment

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

I understand that we need this right now, but could we consider adding something like abstract_expr.h that declares the likes of unary_exprt so that we can eventually speed up compile time a bit?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, that's the plan. I am considering to have unary_exprt, binary_exprt etc. in expr.h.

std_expr.h is by far the largest header file, which impedes on readability.
This commit moves the bitvector-related expression classes into a separate
header file, following the pattern in mathematical_expr.h.
@kroening kroening merged commit 6c59fc8 into develop Jan 18, 2021
@kroening kroening deleted the bitvector_expr_h branch January 18, 2021 12:13
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