Skip to content

Commit d2a41ad

Browse files
author
Mark R. Tuttle
committed
Rename module Math->MathLib, name conflicts with Java/C# Math class
1 parent 8b0c399 commit d2a41ad

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

src/Collections/Sequences/Seq.dfy

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
*******************************************************************************/
1515

1616
include "../../Wrappers.dfy"
17-
include "../../Math.dfy"
17+
include "../../MathLib.dfy"
1818
include "MergeSort.dfy"
1919
include "../../Relations.dfy"
2020

@@ -23,7 +23,7 @@ module {:options "-functionSyntax:4"} Seq {
2323
import opened Wrappers
2424
import opened MergeSort
2525
import opened Relations
26-
import Math
26+
import MathLib
2727

2828
/**********************************************************
2929
*
@@ -427,7 +427,7 @@ module {:options "-functionSyntax:4"} Seq {
427427
ensures Max(xs) in xs
428428
{
429429
assert xs == [xs[0]] + xs[1..];
430-
if |xs| == 1 then xs[0] else Math.Max(xs[0], Max(xs[1..]))
430+
if |xs| == 1 then xs[0] else MathLib.Max(xs[0], Max(xs[1..]))
431431
}
432432

433433
/* The maximum of the concatenation of two non-empty sequences is greater than or
@@ -453,7 +453,7 @@ module {:options "-functionSyntax:4"} Seq {
453453
ensures Min(xs) in xs
454454
{
455455
assert xs == [xs[0]] + xs[1..];
456-
if |xs| == 1 then xs[0] else Math.Min(xs[0], Min(xs[1..]))
456+
if |xs| == 1 then xs[0] else MathLib.Min(xs[0], Min(xs[1..]))
457457
}
458458

459459
/* The minimum of the concatenation of two non-empty sequences is

src/JSON/Serializer.dfy

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
include "../Collections/Sequences/Seq.dfy"
1111
include "../BoundedInts.dfy"
12-
include "../Math.dfy"
12+
include "../MathLib.dfy"
1313

1414
include "Utils/Views.dfy"
1515
include "Utils/Vectors.dfy"
@@ -20,7 +20,7 @@ include "Spec.dfy"
2020

2121
module {:options "-functionSyntax:4"} JSON.Serializer {
2222
import Seq
23-
import Math
23+
import MathLib
2424
import opened Wrappers
2525
import opened BoundedInts
2626
import opened Utils.Str
@@ -83,15 +83,15 @@ module {:options "-functionSyntax:4"} JSON.Serializer {
8383

8484
function Number(dec: Values.Decimal): Result<jnumber> {
8585
var minus: jminus := Sign(dec.n);
86-
var num: jnum :- Int(Math.Abs(dec.n));
86+
var num: jnum :- Int(MathLib.Abs(dec.n));
8787
var frac: Maybe<jfrac> := Empty();
8888
var exp: Maybe<jexp> :-
8989
if dec.e10 == 0 then
9090
Success(Empty())
9191
else
9292
var e: je := View.OfBytes(['e' as byte]);
9393
var sign: jsign := Sign(dec.e10);
94-
var num: jnum :- Int(Math.Abs(dec.e10));
94+
var num: jnum :- Int(MathLib.Abs(dec.e10));
9595
Success(NonEmpty(JExp(e, sign, num)));
9696
Success(JNumber(minus, num, Empty, exp))
9797
}

src/Math.dfy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* SPDX-License-Identifier: MIT
66
*******************************************************************************/
77

8-
module {:options "-functionSyntax:4"} Math {
8+
module {:options "-functionSyntax:4"} MathLib {
99
function Min(a: int, b: int): int
1010
{
1111
if a < b

0 commit comments

Comments
 (0)