Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
why3
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
119
Issues
119
List
Boards
Labels
Service Desk
Milestones
Merge Requests
16
Merge Requests
16
Operations
Operations
Incidents
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Why3
why3
Commits
326d87ce
Commit
326d87ce
authored
Mar 07, 2014
by
Jean-Christophe Filliâtre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed division totality in OCaml extracted code
parent
23718fa4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
10 deletions
+8
-10
lib/ocaml/why3__BigInt_num.ml
lib/ocaml/why3__BigInt_num.ml
+4
-5
lib/ocaml/why3__BigInt_zarith.ml
lib/ocaml/why3__BigInt_zarith.ml
+4
-5
No files found.
lib/ocaml/why3__BigInt_num.ml
View file @
326d87ce
...
...
@@ -39,15 +39,15 @@ let ge = ge_big_int
let
lt_nat
x
y
=
le
zero
y
&&
lt
x
y
let
lex
(
x1
,
x2
)
(
y1
,
y2
)
=
lt
x1
y1
||
eq
x1
y1
&&
lt
x2
y2
let
euclidean_div_mod
=
quomod_big_int
let
euclidean_div_mod
x
y
=
if
eq
y
zero
then
zero
,
zero
else
quomod_big_int
x
y
let
euclidean_div
x
y
=
fst
(
euclidean_div_mod
x
y
)
let
euclidean_mod
x
y
=
snd
(
euclidean_div_mod
x
y
)
let
computer_div_mod
x
y
=
let
q
,
r
=
quomod_big_int
x
y
in
(* we have x = q*y + r with 0 <= r < |y| *)
let
q
,
r
=
euclidean_div_mod
x
y
in
(* w
hen y <> 0, w
e have x = q*y + r with 0 <= r < |y| *)
if
sign
x
<
0
then
if
sign
y
<
0
then
(
pred
q
,
add
r
y
)
...
...
@@ -55,7 +55,6 @@ let computer_div_mod x y =
else
(
q
,
r
)
let
computer_div
x
y
=
fst
(
computer_div_mod
x
y
)
let
computer_mod
x
y
=
snd
(
computer_div_mod
x
y
)
let
min
=
min_big_int
...
...
lib/ocaml/why3__BigInt_zarith.ml
View file @
326d87ce
...
...
@@ -29,15 +29,15 @@ let ge = ge_big_int
let
lt_nat
x
y
=
le
zero
y
&&
lt
x
y
let
lex
(
x1
,
x2
)
(
y1
,
y2
)
=
lt
x1
y1
||
eq
x1
y1
&&
lt
x2
y2
let
euclidean_div_mod
=
quomod_big_int
let
euclidean_div_mod
x
y
=
if
eq
y
zero
then
zero
,
zero
else
quomod_big_int
x
y
let
euclidean_div
x
y
=
fst
(
euclidean_div_mod
x
y
)
let
euclidean_mod
x
y
=
snd
(
euclidean_div_mod
x
y
)
let
computer_div_mod
x
y
=
let
q
,
r
=
quomod_big_int
x
y
in
(* we have x = q*y + r with 0 <= r < |y| *)
let
q
,
r
=
euclidean_div_mod
x
y
in
(* w
hen y <> 0, w
e have x = q*y + r with 0 <= r < |y| *)
if
sign
x
<
0
then
if
sign
y
<
0
then
(
pred
q
,
add
r
y
)
...
...
@@ -45,7 +45,6 @@ let computer_div_mod x y =
else
(
q
,
r
)
let
computer_div
x
y
=
fst
(
computer_div_mod
x
y
)
let
computer_mod
x
y
=
snd
(
computer_div_mod
x
y
)
let
min
=
min_big_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