Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
AVA
FloVer
Commits
8b7ef425
Commit
8b7ef425
authored
Sep 08, 2016
by
Eva Darulova
Browse files
removing default precision in ErrorFunctions as this is bound to lead to unwanted bugs
parent
9fae1946
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/main/scala/daisy/analysis/RangeErrorPhase.scala
View file @
8b7ef425
...
@@ -51,7 +51,7 @@ object RangeErrorPhase extends DaisyPhase with ErrorFunctions {
...
@@ -51,7 +51,7 @@ object RangeErrorPhase extends DaisyPhase with ErrorFunctions {
// setting trait variables
// setting trait variables
trackRoundoffErrs
=
true
trackRoundoffErrs
=
true
uniformPrecision
=
Float64
var
uniformPrecision
:
Precision
=
Float64
// process relevant options
// process relevant options
for
(
opt
<-
ctx
.
options
)
opt
match
{
for
(
opt
<-
ctx
.
options
)
opt
match
{
...
@@ -132,13 +132,13 @@ object RangeErrorPhase extends DaisyPhase with ErrorFunctions {
...
@@ -132,13 +132,13 @@ object RangeErrorPhase extends DaisyPhase with ErrorFunctions {
(
rangeMethod
,
errorMethod
)
match
{
(
rangeMethod
,
errorMethod
)
match
{
case
(
"interval"
,
"affine"
)
=>
case
(
"interval"
,
"affine"
)
=>
errorIntervalAffine
(
fnc
.
body
.
get
,
inputValMap
,
inputErrorMap
)
errorIntervalAffine
(
fnc
.
body
.
get
,
inputValMap
,
inputErrorMap
,
uniformPrecision
)
case
(
"affine"
,
"affine"
)
=>
case
(
"affine"
,
"affine"
)
=>
errorAffineAffine
(
fnc
.
body
.
get
,
inputValMap
,
inputErrorMap
)
errorAffineAffine
(
fnc
.
body
.
get
,
inputValMap
,
inputErrorMap
,
uniformPrecision
)
case
(
"smt"
,
"affine"
)
=>
case
(
"smt"
,
"affine"
)
=>
errorSMTAffine
(
fnc
.
body
.
get
,
inputValMap
,
inputErrorMap
)
errorSMTAffine
(
fnc
.
body
.
get
,
inputValMap
,
inputErrorMap
,
uniformPrecision
)
// default is to use the method that attaches the info to trees.
// default is to use the method that attaches the info to trees.
case
(
"subdiv"
,
_
)
=>
case
(
"subdiv"
,
_
)
=>
...
...
src/main/scala/daisy/utils/ErrorFunctions.scala
View file @
8b7ef425
...
@@ -27,7 +27,7 @@ trait ErrorFunctions {
...
@@ -27,7 +27,7 @@ trait ErrorFunctions {
var
trackRoundoffErrs
:
Boolean
=
true
var
trackRoundoffErrs
:
Boolean
=
true
var
attachToTree
:
Boolean
=
false
var
attachToTree
:
Boolean
=
false
var
dynamicSamplesDefault
:
Int
=
100000
var
dynamicSamplesDefault
:
Int
=
100000
var
u
niformPrecision
:
Precision
=
Float64
//
var
defaultU
niformPrecision: Precision = Float64
var
reporter
:
Reporter
var
reporter
:
Reporter
val
debugSection
:
DebugSection
val
debugSection
:
DebugSection
...
@@ -43,7 +43,8 @@ trait ErrorFunctions {
...
@@ -43,7 +43,8 @@ trait ErrorFunctions {
def
errorIntervalAffine
(
def
errorIntervalAffine
(
expr
:
Expr
,
expr
:
Expr
,
inputValMap
:
Map
[
Identifier
,
Interval
],
inputValMap
:
Map
[
Identifier
,
Interval
],
inputErrorMap
:
Map
[
Identifier
,
Rational
])
:
Rational
=
{
inputErrorMap
:
Map
[
Identifier
,
Rational
],
uniformPrecision
:
Precision
)
:
Rational
=
{
val
(
_
,
error
)
=
evaluate
[
Interval
,
AffineForm
](
val
(
_
,
error
)
=
evaluate
[
Interval
,
AffineForm
](
expr
,
expr
,
inputValMap
,
inputValMap
,
...
@@ -70,7 +71,8 @@ trait ErrorFunctions {
...
@@ -70,7 +71,8 @@ trait ErrorFunctions {
def
errorAffineAffine
(
def
errorAffineAffine
(
expr
:
Expr
,
expr
:
Expr
,
inputValMap
:
Map
[
Identifier
,
Interval
],
inputValMap
:
Map
[
Identifier
,
Interval
],
inputErrorMap
:
Map
[
Identifier
,
Rational
])
:
Rational
=
{
inputErrorMap
:
Map
[
Identifier
,
Rational
],
uniformPrecision
:
Precision
)
:
Rational
=
{
val
(
_
,
error
)
=
evaluate
[
AffineForm
,
AffineForm
](
val
(
_
,
error
)
=
evaluate
[
AffineForm
,
AffineForm
](
expr
,
expr
,
inputValMap
.
map
(
x
=>
(
x
.
_1
->
AffineForm
(
x
.
_2
))),
inputValMap
.
map
(
x
=>
(
x
.
_1
->
AffineForm
(
x
.
_2
))),
...
@@ -97,7 +99,8 @@ trait ErrorFunctions {
...
@@ -97,7 +99,8 @@ trait ErrorFunctions {
def
errorSMTAffine
(
def
errorSMTAffine
(
expr
:
Expr
,
expr
:
Expr
,
inputValMap
:
Map
[
Identifier
,
Interval
],
inputValMap
:
Map
[
Identifier
,
Interval
],
inputErrorMap
:
Map
[
Identifier
,
Rational
])
:
Rational
=
{
inputErrorMap
:
Map
[
Identifier
,
Rational
],
uniformPrecision
:
Precision
)
:
Rational
=
{
val
(
_
,
error
)
=
evaluate
[
SMTRange
,
AffineForm
](
val
(
_
,
error
)
=
evaluate
[
SMTRange
,
AffineForm
](
expr
,
expr
,
inputValMap
.
map
({
case
(
id
,
int
)
=>
(
id
->
SMTRange
(
Variable
(
id
),
int
))
}),
inputValMap
.
map
({
case
(
id
,
int
)
=>
(
id
->
SMTRange
(
Variable
(
id
),
int
))
}),
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment