Skip to content

Commit f361277

Browse files
committed
Add context_abstract_object::to_predicate
Relax to_predicate visibility from private to protected to enable this.
1 parent 1e1baab commit f361277

File tree

6 files changed

+16
-9
lines changed

6 files changed

+16
-9
lines changed

src/analyses/variable-sensitivity/abstract_object.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -363,6 +363,11 @@ class abstract_objectt : public std::enable_shared_from_this<abstract_objectt>
363363
return shared_from_this() == other;
364364
}
365365

366+
/// to_predicate implementation - derived classes will override
367+
/// \param name - the variable name to substitute into the expression
368+
/// \return Returns an exprt representing the object as an invariant.
369+
virtual exprt to_predicate_internal(const exprt &name) const;
370+
366371
private:
367372
/// To enforce copy-on-write these are private and have read-only accessors
368373
typet t;
@@ -378,11 +383,6 @@ class abstract_objectt : public std::enable_shared_from_this<abstract_objectt>
378383
{
379384
}
380385

381-
/// to_predicate implementation - derived classes will override
382-
/// \param name - the variable name to substitute into the expression
383-
/// \return Returns an exprt representing the object as an invariant.
384-
virtual exprt to_predicate_internal(const exprt &name) const;
385-
386386
/**
387387
* Helper function for abstract_objectt::abstract_object_merge to perform any
388388
* additional actions after the base abstract_object_merge has completed it's

src/analyses/variable-sensitivity/constant_abstract_value.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,9 @@ class constant_abstract_valuet : public abstract_value_objectt
8181
abstract_object_pointert
8282
meet_with_value(const abstract_value_pointert &other) const override;
8383

84-
private:
8584
exprt to_predicate_internal(const exprt &name) const override;
8685

86+
private:
8787
exprt value;
8888
};
8989

src/analyses/variable-sensitivity/context_abstract_object.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,11 @@ abstract_object_pointert context_abstract_objectt::unwrap_context() const
160160
return child_abstract_object->unwrap_context();
161161
}
162162

163+
exprt context_abstract_objectt::to_predicate_internal(const exprt &name) const
164+
{
165+
return child_abstract_object->to_predicate(name);
166+
}
167+
163168
void context_abstract_objectt::get_statistics(
164169
abstract_object_statisticst &statistics,
165170
abstract_object_visitedt &visited,

src/analyses/variable-sensitivity/context_abstract_object.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,8 @@ class context_abstract_objectt : public abstract_objectt
117117
bool merging_write) const override;
118118

119119
bool has_been_modified(const abstract_object_pointert &before) const override;
120+
121+
exprt to_predicate_internal(const exprt &name) const override;
120122
};
121123

122124
#endif // CPROVER_ANALYSES_VARIABLE_SENSITIVITY_CONTEXT_ABSTRACT_OBJECT_H

src/analyses/variable-sensitivity/interval_abstract_value.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,9 @@ class interval_abstract_valuet : public abstract_value_objectt
9494
abstract_object_pointert
9595
meet_with_value(const abstract_value_pointert &other) const override;
9696

97-
private:
9897
exprt to_predicate_internal(const exprt &name) const override;
9998

99+
private:
100100
constant_interval_exprt interval;
101101

102102
void set_top_internal() override;

src/analyses/variable-sensitivity/value_set_abstract_object.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,8 @@ class value_set_abstract_objectt : public abstract_value_objectt,
6969
abstract_object_pointert
7070
meet_with_value(const abstract_value_pointert &other) const override;
7171

72+
exprt to_predicate_internal(const exprt &name) const override;
73+
7274
private:
7375
/// Setter for updating the stored values
7476
/// \param other_values: the new (non-empty) set of values
@@ -84,8 +86,6 @@ class value_set_abstract_objectt : public abstract_value_objectt,
8486

8587
void set_top_internal() override;
8688

87-
exprt to_predicate_internal(const exprt &name) const override;
88-
8989
// data
9090
abstract_object_sett values;
9191
};

0 commit comments

Comments
 (0)