Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Why3
why3
Commits
e4af0ac2
Commit
e4af0ac2
authored
Feb 17, 2013
by
MARCHE Claude
Browse files
Removed all apparent soundness bugs with integer division
parent
5cd2f3d6
Changes
11
Expand all
Hide whitespace changes
Inline
Side-by-side
drivers/alt_ergo.drv
View file @
e4af0ac2
...
...
@@ -7,12 +7,14 @@ theory BuiltIn
meta "eliminate_algebraic" "keep_recs"
end
(*
theory int.EuclideanDivision
syntax function div "(%1 / %2)"
syntax function mod "(%1 % %2)"
end
*)
theory map.Map
syntax type map "(%1,%2) farray"
...
...
drivers/alt_ergo_0.94.drv
View file @
e4af0ac2
...
...
@@ -10,6 +10,8 @@ theory BuiltIn
meta "eliminate_algebraic" "keep_recs"
end
(*
theory int.EuclideanDivision
(* workaround for the "-1 % 32 = -1" bug *)
...
...
@@ -19,7 +21,7 @@ theory int.EuclideanDivision
syntax function mod "safe_modulo(%1,%2)"
end
*)
(*
Local Variables:
...
...
drivers/cvc4_bare.drv
View file @
e4af0ac2
...
...
@@ -152,6 +152,7 @@ theory bool.Bool
end
*)
(* CVC4 division does not seem to be the Euclidean one
theory int.EuclideanDivision
syntax function div "(div %1 %2)"
syntax function mod "(mod %1 %2)"
...
...
@@ -160,6 +161,7 @@ theory int.EuclideanDivision
remove prop Mod_1
remove prop Div_1
end
*)
(*
theory real.Truncate
...
...
drivers/gappa.drv
View file @
e4af0ac2
...
...
@@ -70,17 +70,25 @@ theory int.Abs
end
(* wrong: Euclidean division is NOT division round down
e.g : div (-1) (-2) is 1, not 0 *)
(*
theory int.EuclideanDivision
syntax function div "int<dn>(%1 / %2)"
end
*)
(* Gappa <- 0.16.4 has a bug,
it says that div (-1) 2 can have any value *)
(*
theory int.ComputerDivision
syntax function div "int<zr>(%1 / %2)"
end
*)
theory real.Real
...
...
drivers/mathsat.drv
View file @
e4af0ac2
...
...
@@ -132,6 +132,7 @@ theory bool.Bool
syntax function implb "(=> %1 %2)"
end
(* needs to be checked
theory int.EuclideanDivision
syntax function div "(div %1 %2)"
syntax function mod "(mod %1 %2)"
...
...
@@ -140,6 +141,7 @@ theory int.EuclideanDivision
remove prop Mod_1
remove prop Div_1
end
*)
theory real.FromInt
syntax function from_int "(to_real %1)"
...
...
drivers/verit.drv
View file @
e4af0ac2
...
...
@@ -129,6 +129,7 @@ theory bool.Bool
end
(* needs to checked
theory int.EuclideanDivision
syntax function div "(div %1 %2)"
syntax function mod "(mod %1 %2)"
...
...
@@ -137,6 +138,7 @@ theory int.EuclideanDivision
remove prop Mod_1
remove prop Div_1
end
*)
(*
Local Variables:
...
...
drivers/yices_bare.drv
View file @
e4af0ac2
...
...
@@ -133,6 +133,7 @@ theory bool.Bool
end
(* needs to be checked
theory int.EuclideanDivision
syntax function div "(div %1 %2)"
syntax function mod "(mod %1 %2)"
...
...
@@ -141,7 +142,7 @@ theory int.EuclideanDivision
remove prop Mod_1
remove prop Div_1
end
*)
theory map.Map
...
...
drivers/z3_bare.drv
View file @
e4af0ac2
...
...
@@ -132,6 +132,7 @@ theory bool.Bool
syntax function implb "(=> %1 %2)"
end
(* needs to be checked
theory int.EuclideanDivision
syntax function div "(div %1 %2)"
syntax function mod "(mod %1 %2)"
...
...
@@ -140,6 +141,7 @@ theory int.EuclideanDivision
remove prop Mod_1
remove prop Div_1
end
*)
theory real.FromInt
syntax function from_int "(to_real %1)"
...
...
drivers/z3_smtv1.drv
View file @
e4af0ac2
...
...
@@ -132,6 +132,7 @@ end
*)
(* needs to be checked
theory int.EuclideanDivision
syntax function div "(div %1 %2)"
syntax function mod "(mod %1 %2)"
...
...
@@ -140,6 +141,7 @@ theory int.EuclideanDivision
remove prop Mod_1
remove prop Div_1
end
*)
(*
Local Variables:
...
...
examples/tests-provers/div.why
View file @
e4af0ac2
...
...
@@ -4,10 +4,14 @@ theory EuclideanDivTest
use import int.Int
use import int.EuclideanDivision
goal ok1 : div (-1) (-2) = -1
goal ok2 : mod (-1) (-2) = 1
goal smoke1 : div (-1) (-2) = 0
goal smoke2 : mod (-1) (-2) = -1
goal ok1 : div (-1) 2 = -1
goal ok2 : mod (-1) 2 = 1
goal ok3 : div (-1) (-2) = 1
goal ok4 : mod (-1) (-2) = 1
goal smoke1 : div (-1) 2 = 0
goal smoke2 : mod (-1) 2 = -1
goal smoke3 : div (-1) (-2) = 0
goal smoke4 : mod (-1) (-2) = -1
end
...
...
@@ -16,9 +20,13 @@ theory ComputerDivTest
use import int.Int
use import int.ComputerDivision
goal ok1 : div (-1) (-2) = 0
goal ok2 : mod (-1) (-2) = -1
goal smoke1 : div (-1) (-2) = -1
goal smoke2 : mod (-1) (-2) = 1
goal ok1 : div (-1) 2 = 0
goal ok2 : mod (-1) 2 = -1
goal ok3 : div (-1) (-2) = 0
goal ok4 : mod (-1) (-2) = -1
goal smoke1 : div (-1) 2 = -1
goal smoke2 : mod (-1) 2 = 1
goal smoke3 : div (-1) (-2) = -1
goal smoke4 : mod (-1) (-2) = 1
end
\ No newline at end of file
examples/tests-provers/div/why3session.xml
View file @
e4af0ac2
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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