svf-tools 1.0.937 → 1.0.938
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/svf/include/AE/Core/AbstractValue.h +5 -5
- package/svf/include/AE/Core/IntervalValue.h +44 -48
- package/svf/include/AE/Core/NumericValue.h +656 -0
- package/svf/include/AE/Core/RelationSolver.h +13 -4
- package/svf/lib/AE/Core/RelationSolver.cpp +36 -36
- package/svf/lib/AE/Svfexe/SVFIR2AbsState.cpp +1 -1
- package/svf/include/AE/Core/BoundedZ3Expr.h +0 -404
- package/svf/include/AE/Core/NumericLiteral.h +0 -478
- package/svf/lib/AE/Core/BoundedZ3Expr.cpp +0 -64
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "svf-tools",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.938",
|
|
4
4
|
"description": "* <b>[TypeClone](https://github.com/SVF-tools/SVF/wiki/TypeClone) published in our [ECOOP paper](https://yuleisui.github.io/publications/ecoop20.pdf) is now available in SVF </b> * <b>SVF now uses a single script for its build. Just type [`source ./build.sh`](https://github.com/SVF-tools/SVF/blob/master/build.sh) in your terminal, that's it!</b> * <b>SVF now supports LLVM-10.0.0! </b> * <b>We thank [bsauce](https://github.com/bsauce) for writing a user manual of SVF ([link1](https://www.jianshu.com/p/068a08ec749c) and [link2](https://www.jianshu.com/p/777c30d4240e)) in Chinese </b> * <b>SVF now supports LLVM-9.0.0 (Thank [Byoungyoung Lee](https://github.com/SVF-tools/SVF/issues/142) for his help!). </b> * <b>SVF now supports a set of [field-sensitive pointer analyses](https://yuleisui.github.io/publications/sas2019a.pdf). </b> * <b>[Use SVF as an external lib](https://github.com/SVF-tools/SVF/wiki/Using-SVF-as-a-lib-in-your-own-tool) for your own project (Contributed by [Hongxu Chen](https://github.com/HongxuChen)). </b> * <b>SVF now supports LLVM-7.0.0. </b> * <b>SVF now supports Docker. [Try SVF in Docker](https://github.com/SVF-tools/SVF/wiki/Try-SVF-in-Docker)! </b> * <b>SVF now supports [LLVM-6.0.0](https://github.com/svf-tools/SVF/pull/38) (Contributed by [Jack Anthony](https://github.com/jackanth)). </b> * <b>SVF now supports [LLVM-4.0.0](https://github.com/svf-tools/SVF/pull/23) (Contributed by Jared Carlson. Thank [Jared](https://github.com/jcarlson23) and [Will](https://github.com/dtzWill) for their in-depth [discussions](https://github.com/svf-tools/SVF/pull/18) about updating SVF!) </b> * <b>SVF now supports analysis for C++ programs.</b> <br />",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -213,31 +213,31 @@ public:
|
|
|
213
213
|
return interval.isBottom();
|
|
214
214
|
}
|
|
215
215
|
|
|
216
|
-
const
|
|
216
|
+
const BoundedInt& lb() const
|
|
217
217
|
{
|
|
218
218
|
assert(isInterval());
|
|
219
219
|
return interval.lb();
|
|
220
220
|
}
|
|
221
221
|
|
|
222
|
-
const
|
|
222
|
+
const BoundedInt& ub() const
|
|
223
223
|
{
|
|
224
224
|
assert(isInterval());
|
|
225
225
|
return interval.ub();
|
|
226
226
|
}
|
|
227
227
|
|
|
228
|
-
void setLb(const
|
|
228
|
+
void setLb(const BoundedInt& lb)
|
|
229
229
|
{
|
|
230
230
|
assert(isInterval());
|
|
231
231
|
interval.setLb(lb);
|
|
232
232
|
}
|
|
233
233
|
|
|
234
|
-
void setUb(const
|
|
234
|
+
void setUb(const BoundedInt& ub)
|
|
235
235
|
{
|
|
236
236
|
assert(isInterval());
|
|
237
237
|
interval.setUb(ub);
|
|
238
238
|
}
|
|
239
239
|
|
|
240
|
-
void setValue(const
|
|
240
|
+
void setValue(const BoundedInt &lb, const BoundedInt &ub)
|
|
241
241
|
{
|
|
242
242
|
assert(isInterval());
|
|
243
243
|
interval.setValue(lb, ub);
|
|
@@ -31,8 +31,8 @@
|
|
|
31
31
|
#ifndef Z3_EXAMPLE_IntervalValue_H
|
|
32
32
|
#define Z3_EXAMPLE_IntervalValue_H
|
|
33
33
|
|
|
34
|
-
#include "AE/Core/NumericLiteral.h"
|
|
35
34
|
#include <sstream>
|
|
35
|
+
#include "AE/Core/NumericValue.h"
|
|
36
36
|
|
|
37
37
|
namespace SVF
|
|
38
38
|
{
|
|
@@ -44,10 +44,10 @@ class IntervalValue
|
|
|
44
44
|
{
|
|
45
45
|
private:
|
|
46
46
|
// Lower bound
|
|
47
|
-
|
|
47
|
+
BoundedInt _lb;
|
|
48
48
|
|
|
49
49
|
// Upper bound
|
|
50
|
-
|
|
50
|
+
BoundedInt _ub;
|
|
51
51
|
|
|
52
52
|
// Invariant: isBottom() <=> _lb = 1 && _ub = 0
|
|
53
53
|
public:
|
|
@@ -63,18 +63,18 @@ public:
|
|
|
63
63
|
}
|
|
64
64
|
|
|
65
65
|
/// Get minus infinity -oo
|
|
66
|
-
static
|
|
66
|
+
static BoundedInt minus_infinity()
|
|
67
67
|
{
|
|
68
|
-
return
|
|
68
|
+
return BoundedInt::minus_infinity();
|
|
69
69
|
}
|
|
70
70
|
|
|
71
71
|
/// Get plus infinity +oo
|
|
72
|
-
static
|
|
72
|
+
static BoundedInt plus_infinity()
|
|
73
73
|
{
|
|
74
|
-
return
|
|
74
|
+
return BoundedInt::plus_infinity();
|
|
75
75
|
}
|
|
76
76
|
|
|
77
|
-
static bool is_infinite(const
|
|
77
|
+
static bool is_infinite(const BoundedInt &e)
|
|
78
78
|
{
|
|
79
79
|
return e.is_infinity();
|
|
80
80
|
}
|
|
@@ -103,16 +103,16 @@ public:
|
|
|
103
103
|
|
|
104
104
|
explicit IntervalValue(double n) : _lb(n), _ub(n) {}
|
|
105
105
|
|
|
106
|
-
explicit IntervalValue(
|
|
106
|
+
explicit IntervalValue(BoundedInt n) : IntervalValue(n, n) {}
|
|
107
107
|
|
|
108
108
|
/// Create the IntervalValue [lb, ub]
|
|
109
|
-
explicit IntervalValue(
|
|
109
|
+
explicit IntervalValue(BoundedInt lb, BoundedInt ub) : _lb(std::move(lb)), _ub(std::move(ub)) {}
|
|
110
110
|
|
|
111
|
-
explicit IntervalValue(s64_t lb, s64_t ub) : IntervalValue(
|
|
111
|
+
explicit IntervalValue(s64_t lb, s64_t ub) : IntervalValue(BoundedInt(lb), BoundedInt(ub)) {}
|
|
112
112
|
|
|
113
|
-
explicit IntervalValue(double lb, double ub) : IntervalValue(
|
|
113
|
+
explicit IntervalValue(double lb, double ub) : IntervalValue(BoundedInt(lb), BoundedInt(ub)) {}
|
|
114
114
|
|
|
115
|
-
explicit IntervalValue(float lb, float ub) : IntervalValue(
|
|
115
|
+
explicit IntervalValue(float lb, float ub) : IntervalValue(BoundedInt(lb), BoundedInt(ub)) {}
|
|
116
116
|
|
|
117
117
|
explicit IntervalValue(s32_t lb, s32_t ub) : IntervalValue((s64_t) lb, (s64_t) ub) {}
|
|
118
118
|
|
|
@@ -203,33 +203,33 @@ public:
|
|
|
203
203
|
~IntervalValue() = default;
|
|
204
204
|
|
|
205
205
|
/// Return the lower bound
|
|
206
|
-
const
|
|
206
|
+
const BoundedInt &lb() const
|
|
207
207
|
{
|
|
208
208
|
assert(!this->isBottom());
|
|
209
209
|
return this->_lb;
|
|
210
210
|
}
|
|
211
211
|
|
|
212
212
|
/// Return the upper bound
|
|
213
|
-
const
|
|
213
|
+
const BoundedInt &ub() const
|
|
214
214
|
{
|
|
215
215
|
assert(!this->isBottom());
|
|
216
216
|
return this->_ub;
|
|
217
217
|
}
|
|
218
218
|
|
|
219
219
|
/// Set the lower bound
|
|
220
|
-
void setLb(const
|
|
220
|
+
void setLb(const BoundedInt &lb)
|
|
221
221
|
{
|
|
222
222
|
this->_lb = lb;
|
|
223
223
|
}
|
|
224
224
|
|
|
225
225
|
/// Set the upper bound
|
|
226
|
-
void setUb(const
|
|
226
|
+
void setUb(const BoundedInt &ub)
|
|
227
227
|
{
|
|
228
228
|
this->_ub = ub;
|
|
229
229
|
}
|
|
230
230
|
|
|
231
231
|
/// Set the lower bound
|
|
232
|
-
void setValue(const
|
|
232
|
+
void setValue(const BoundedInt &lb, const BoundedInt &ub)
|
|
233
233
|
{
|
|
234
234
|
this->_lb = lb;
|
|
235
235
|
this->_ub = ub;
|
|
@@ -249,18 +249,14 @@ public:
|
|
|
249
249
|
|
|
250
250
|
bool is_int() const
|
|
251
251
|
{
|
|
252
|
-
|
|
253
|
-
bool ub_int = _ub.is_int();
|
|
254
|
-
assert (lb_int == ub_int && "lb and ub should be both int or both float");
|
|
255
|
-
return _lb.is_int();
|
|
252
|
+
return !is_real();
|
|
256
253
|
}
|
|
257
254
|
|
|
258
255
|
bool is_real() const
|
|
259
256
|
{
|
|
260
257
|
bool lb_real = _lb.is_real();
|
|
261
258
|
bool ub_real = _ub.is_real();
|
|
262
|
-
|
|
263
|
-
return _lb.is_real();
|
|
259
|
+
return lb_real || ub_real;
|
|
264
260
|
}
|
|
265
261
|
|
|
266
262
|
/// Return
|
|
@@ -539,13 +535,13 @@ inline IntervalValue operator*(const IntervalValue &lhs,
|
|
|
539
535
|
}
|
|
540
536
|
else
|
|
541
537
|
{
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
std::vector<
|
|
547
|
-
return IntervalValue(
|
|
548
|
-
|
|
538
|
+
BoundedInt ll = lhs.lb() * rhs.lb();
|
|
539
|
+
BoundedInt lu = lhs.lb() * rhs.ub();
|
|
540
|
+
BoundedInt ul = lhs.ub() * rhs.lb();
|
|
541
|
+
BoundedInt uu = lhs.ub() * rhs.ub();
|
|
542
|
+
std::vector<BoundedDouble> vec{ll, lu, ul, uu};
|
|
543
|
+
return IntervalValue(BoundedInt::min(vec),
|
|
544
|
+
BoundedInt::max(vec));
|
|
549
545
|
}
|
|
550
546
|
}
|
|
551
547
|
|
|
@@ -564,14 +560,14 @@ inline IntervalValue operator/(const IntervalValue &lhs,
|
|
|
564
560
|
else
|
|
565
561
|
{
|
|
566
562
|
// Neither the dividend nor the divisor contains 0
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
std::vector<
|
|
563
|
+
BoundedInt ll = lhs.lb() / rhs.lb();
|
|
564
|
+
BoundedInt lu = lhs.lb() / rhs.ub();
|
|
565
|
+
BoundedInt ul = lhs.ub() / rhs.lb();
|
|
566
|
+
BoundedInt uu = lhs.ub() / rhs.ub();
|
|
567
|
+
std::vector<BoundedDouble> vec{ll, lu, ul, uu};
|
|
572
568
|
|
|
573
|
-
return IntervalValue(
|
|
574
|
-
|
|
569
|
+
return IntervalValue(BoundedInt::min(vec),
|
|
570
|
+
BoundedInt::max(vec));
|
|
575
571
|
}
|
|
576
572
|
}
|
|
577
573
|
|
|
@@ -593,9 +589,9 @@ inline IntervalValue operator%(const IntervalValue &lhs,
|
|
|
593
589
|
}
|
|
594
590
|
else
|
|
595
591
|
{
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
592
|
+
BoundedInt n_ub = max(abs(lhs.lb()), abs(lhs.ub()));
|
|
593
|
+
BoundedInt d_ub = max(abs(rhs.lb()), rhs.ub()) - 1;
|
|
594
|
+
BoundedInt ub = min(n_ub, d_ub);
|
|
599
595
|
|
|
600
596
|
if (lhs.lb().getNumeral() < 0)
|
|
601
597
|
{
|
|
@@ -864,13 +860,13 @@ inline IntervalValue operator>>(const IntervalValue &lhs, const IntervalValue &r
|
|
|
864
860
|
}
|
|
865
861
|
else
|
|
866
862
|
{
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
std::vector<
|
|
872
|
-
return IntervalValue(
|
|
873
|
-
|
|
863
|
+
BoundedInt ll = lhs.lb() >> shift.lb();
|
|
864
|
+
BoundedInt lu = lhs.lb() >> shift.ub();
|
|
865
|
+
BoundedInt ul = lhs.ub() >> shift.lb();
|
|
866
|
+
BoundedInt uu = lhs.ub() >> shift.ub();
|
|
867
|
+
std::vector<BoundedDouble> vec{ll, lu, ul, uu};
|
|
868
|
+
return IntervalValue(BoundedInt::min(vec),
|
|
869
|
+
BoundedInt::max(vec));
|
|
874
870
|
}
|
|
875
871
|
}
|
|
876
872
|
}
|