Skip to content

VSD: Simplifying abstract_objectt::write, collapsing inheritance hierarchy #5755

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 49 commits into from
Jan 28, 2021
Merged
Changes from 1 commit
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
5b4f40f
Fold ID_address_of into ID_array/ID_struct/ID_constant case. They are…
jezhiggins Jan 5, 2021
dbad4e5
Factored out abstract_environmentt::resolve_symbol
jezhiggins Jan 5, 2021
ef31be2
abstract_environmentt::eval unpicked if ladder
jezhiggins Jan 5, 2021
6e35c3b
Simplified abstract_environmentt::write - all cases were equivalent
jezhiggins Jan 6, 2021
bb0b1fe
collapse equivalent cases in abstract_environmentt::assign
jezhiggins Jan 6, 2021
ae9e6aa
call resolve_symbol from abstract_environmentt::assign
jezhiggins Jan 6, 2021
3d53ccd
Removed member functions that just call down to base class
jezhiggins Jan 6, 2021
8918a14
Removed abstract_valuet
jezhiggins Jan 6, 2021
363ed9f
Corrected abstract_environment.h/cpp filenames
jezhiggins Jan 9, 2021
bac4312
Pass shared pointers to assign & write by const-ref
jezhiggins Jan 9, 2021
1c64b91
Introduce abstract_aggregate_objectt
jezhiggins Jan 9, 2021
421d2ff
Implemented two_value_array_abstract_object
jezhiggins Jan 9, 2021
94cbfb6
Eliminate array_abstract_objectt as a base class
jezhiggins Jan 9, 2021
3e47f43
Rename union_abstract_objectt to two_value_union_abstract_objectt
jezhiggins Jan 10, 2021
fddf371
Reordered cases in variable_sensitivity_object_factoryt::get_abstract…
jezhiggins Jan 10, 2021
c09023d
Removed now empty source files
jezhiggins Jan 11, 2021
21af732
Renamed header files to reflect contents
jezhiggins Jan 11, 2021
b37e18b
clean up includes
jezhiggins Jan 11, 2021
ea76a7f
Update make build to match file changes
jezhiggins Jan 11, 2021
9b4acdd
Corrected base class template parameter
jezhiggins Jan 11, 2021
87706b3
Simplified interval_array_abstract_objectt::write_component
jezhiggins Jan 11, 2021
ff4aa07
Introduce abstract_value_objectt as base for constant/interval/value_…
jezhiggins Jan 12, 2021
e7f7239
Starting work on index_range, first step along that path a single arr…
jezhiggins Jan 12, 2021
402809c
input_range for interval_abstract_values
jezhiggins Jan 12, 2021
0585702
index_range needs namespacet passed in
jezhiggins Jan 13, 2021
ab30d0c
Rework interval_array_...::write_component to using index_range
jezhiggins Jan 13, 2021
ce3eb0b
Rework interval_array_...::read_component to use index_range
jezhiggins Jan 13, 2021
19b324e
If the expression is not constant that's an inderminate range not an …
jezhiggins Jan 14, 2021
8e317ba
Remove interval_array_abstract_object::eval_index override
jezhiggins Jan 14, 2021
703c97f
Implemented value_set_index_ranget
jezhiggins Jan 14, 2021
053df78
Refactoring index_ranget and its subclasses
jezhiggins Jan 16, 2021
fdd5712
Combine constant_array_ & interval_array_ implementations
jezhiggins Jan 16, 2021
5a5d4c1
full_array_abstract_object
jezhiggins Jan 16, 2021
aa9925f
Removed value_set_array_abstract_objectt
jezhiggins Jan 17, 2021
a439481
eval_index doesn't need to be a member function
jezhiggins Jan 16, 2021
55b477d
Factor common index loop out of full_array_abstract_object::write_/re…
jezhiggins Jan 16, 2021
058ffd7
get_top_entry instead big abstract_object_factory call
jezhiggins Jan 16, 2021
3168916
Use get_view()/get_sorted_view() instead of get_view(&view)
jezhiggins Jan 16, 2021
886829c
Hoist is_top check from read_element to read_component
jezhiggins Jan 16, 2021
2a3f4cd
Moved merged_sharing_maps into abstract_aggregate_object. Eliminated …
jezhiggins Jan 16, 2021
56370a7
use abstract_objectt::merge(op1, op2) when we're not interested in wh…
jezhiggins Jan 16, 2021
27543d8
Split full_array_::write_element into write_sub_element and write_lea…
jezhiggins Jan 16, 2021
33021a3
Removed redundant if guard
jezhiggins Jan 16, 2021
b04f5c8
Arrange write checks so everything if(not value) replace else insert
jezhiggins Jan 16, 2021
1c18b88
clang-format fixes
jezhiggins Jan 16, 2021
c5248bd
Updated expected doxygen warnings
jezhiggins Jan 17, 2021
f332df8
Fix doxygen warning
jezhiggins Jan 17, 2021
cc75d94
Add header block
jezhiggins Jan 27, 2021
d9f7b72
remove extraneous include
jezhiggins Jan 27, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Rework interval_array_...::write_component to using index_range
  • Loading branch information
jezhiggins committed Jan 27, 2021
commit ab30d0cbcc09b144c1597dba05e7c8f6ccfdca4c
Original file line number Diff line number Diff line change
Expand Up @@ -56,39 +56,32 @@ abstract_object_pointert interval_array_abstract_objectt::write_component(
bool merging_write) const
{
const index_exprt &index_expr = to_index_expr(expr);
auto evaluated_index = environment.eval(index_expr.index(), ns);
auto index_range =
(std::dynamic_pointer_cast<const abstract_value_objectt>(
evaluated_index->unwrap_context()))->index_range(ns);

auto index_interval =
eval_and_get_as_interval(index_expr.index(), environment, ns);
if (!index_range->advance_to_next())
return make_top();

if(
!index_interval.is_top() && !index_interval.is_bottom() &&
index_interval.get_lower().id() != ID_min &&
index_interval.get_upper().id() != ID_max)
sharing_ptrt<abstract_objectt> result = nullptr;
do
{
auto ix = index_interval.get_lower();
auto interval_end = index_interval.get_upper();
sharing_ptrt<abstract_objectt> result = nullptr;
do
{
auto array_after_write_at_index =
constant_array_abstract_objectt::write_component(
environment,
ns,
stack,
index_exprt(index_expr.index(), ix),
value,
merging_write);
bool dontcare;
result = result == nullptr ? array_after_write_at_index :
abstract_objectt::merge(result, array_after_write_at_index, dontcare);
ix = simplify_expr(plus_exprt(ix, from_integer(1, ix.type())), ns);
}
while(!result->is_top() &&
simplify_expr(binary_predicate_exprt(ix, ID_gt, interval_end), ns)
.is_false());
return result;
auto array_after_write_at_index =
constant_array_abstract_objectt::write_component(
environment,
ns,
stack,
index_exprt(index_expr.array(), index_range->current()),
value,
merging_write);
bool dontcare;
result = (result == nullptr)
? array_after_write_at_index
: abstract_objectt::merge(result, array_after_write_at_index, dontcare);
}
return make_top();
while(!result->is_top() && index_range->advance_to_next());
return result;
}

abstract_object_pointert interval_array_abstract_objectt::read_component(
Expand Down