Skip to content
Merged
Show file tree
Hide file tree
Changes from 31 commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
b080d6d
Remove opaque and reveal from StdLib
keyboardDrummer Sep 18, 2024
8f0d411
Fix two unstable proofs
keyboardDrummer Sep 18, 2024
80f2578
Fixes
keyboardDrummer Sep 18, 2024
71768d7
Make hide/reveal work for the old resolver
keyboardDrummer Sep 18, 2024
659b547
Fix woops
keyboardDrummer Sep 18, 2024
8dd5307
Fixes
keyboardDrummer Sep 18, 2024
e2c7eb4
Merge remote-tracking branch 'fork/hideRevealOldTypeSystem' into hide…
keyboardDrummer Sep 18, 2024
ac7d807
Cleanup
keyboardDrummer Sep 18, 2024
098046c
Remove excessive linebreaks
keyboardDrummer Sep 18, 2024
a91a80b
Remove uselines blank lines
keyboardDrummer Sep 18, 2024
656d392
Remove more uselines blank lines
keyboardDrummer Sep 18, 2024
b1491a5
Cleanup
keyboardDrummer Sep 18, 2024
3f34c74
Remove hide that's not needed
keyboardDrummer Sep 18, 2024
902932e
A few fixes and updated expect files
keyboardDrummer Sep 19, 2024
987cab5
Merge branch 'hideRevealOldTypeSystem' into hideRevealStdLib
keyboardDrummer Sep 19, 2024
e7b9ebe
Merge commit '535aa5441fee784~1' into hideRevealStdLib
keyboardDrummer Sep 19, 2024
b625a83
Merge commit '535aa5441fee784' into hideRevealStdLib
keyboardDrummer Sep 19, 2024
596954a
Merge branch 'master' into hideRevealStdLib
keyboardDrummer Nov 4, 2024
176ea52
Remove TODO
keyboardDrummer Nov 4, 2024
56d4de5
Merge branch 'hideRevealStdLib' of github.com:keyboardDrummer/dafny i…
keyboardDrummer Nov 4, 2024
1d5f825
Update doo files
keyboardDrummer Nov 4, 2024
17451f5
Merge branch 'master' into hideRevealStdLib
keyboardDrummer Nov 4, 2024
2799972
Fix warning and update doo files
keyboardDrummer Nov 4, 2024
33ffb38
Remove unused requires Valid()
keyboardDrummer Nov 4, 2024
53e9095
Fix tests
keyboardDrummer Nov 5, 2024
9fc52e2
Fix test
keyboardDrummer Nov 5, 2024
e654528
Bring back opaque attribute on functions with complete ensures clauses
keyboardDrummer Nov 5, 2024
cb5c96d
More opaque on ensured functions
keyboardDrummer Nov 5, 2024
43a226d
Fixes
keyboardDrummer Nov 5, 2024
1c2d438
Fixes
keyboardDrummer Nov 6, 2024
e236ba7
last time
keyboardDrummer Nov 6, 2024
25996b8
Merge remote-tracking branch 'origin/master' into hideRevealStdLib
keyboardDrummer Nov 11, 2024
8c0634e
Delete libraries
keyboardDrummer Nov 11, 2024
5228e25
Merge branch 'master' into hideRevealStdLib
keyboardDrummer Nov 11, 2024
0d0a841
Add {:isolate_assertions}
keyboardDrummer Nov 11, 2024
c94c26d
Merge branch 'hideRevealStdLib' of github.com:keyboardDrummer/dafny i…
keyboardDrummer Nov 11, 2024
f8bc9bd
Update doo files
keyboardDrummer Nov 11, 2024
2d6c471
Update doos
keyboardDrummer Nov 29, 2024
c0b551a
Fix substituter reveal bug
keyboardDrummer Nov 29, 2024
621cf35
Update syntax
keyboardDrummer Dec 2, 2024
1c74bc8
Update doos
keyboardDrummer Dec 2, 2024
38850f8
Merge branch 'master' into hideRevealStdLib
keyboardDrummer Dec 2, 2024
7cba321
Fix
keyboardDrummer Dec 2, 2024
5e3ce8e
Merge branch 'hideRevealStdLib' of github.com:keyboardDrummer/dafny i…
keyboardDrummer Dec 2, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified Source/DafnyStandardLibraries/binaries/DafnyStandardLibraries.doo
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -32,19 +32,23 @@ module ArithmeticExamples {
}

method {:test} TestToNatRight() {
hide *;
reveal BASE;
expect ToNatRight([0]) == 0;
expect ToNatRight([1]) == 1;
expect ToNatRight([3]) == 3;
expect ToNatRight([3,0,2]) == 203;
}

method {:test} TestSeqExtend() {
method {:test} {:isolate_assertions} TestSeqExtend() {
expect SeqExtend([], 3) == [0, 0, 0];
expect SeqExtend([1], 3) == [1, 0, 0];
expect SeqExtend([3,0,2], 4) == [3,0,2,0];
}

method {:test} TestSeqExtendMultiple() {
hide *;
reveal BASE;
expect SeqExtendMultiple([], 3) == [0, 0, 0];
print "length: ", |SeqExtendMultiple([1, 2, 3], 3)|;
expect SeqExtendMultiple([1, 2], 3) == [1, 2, 0];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ module ArithmeticTests {
}
}

method {:test} TestPowLog() {
method {:test} {:isolate_assertions} TestPowLog() {
expect Pow(-4, 0) == 1;
expect Pow(-2, 2) == 4;
expect Pow(-2, 3) == -8;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ module CollectionsExamples {
}

method {:test} TestSequenceIndexOf() {
hide *;
reveal s;
AssertAndExpect(IndexOf(s, 5) == 4);
expect IndexOf(s, 1) == 0;
AssertAndExpect(IndexOfOption(s, 5) == Some(4));
Expand Down
8 changes: 0 additions & 8 deletions Source/DafnyStandardLibraries/src/Std/Arithmetic/DivMod.dfy
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,12 @@ module {:disableNonlinearArithmetic} Std.Arithmetic.DivMod {
requires 0 < d
ensures DivRecursive(x, d) == x / d
{
reveal DivPos();
reveal DivRecursive();
LemmaDivInductionAuto(d, x, u => DivRecursive(u, d) == u / d);
}

lemma LemmaDivIsDivRecursiveAuto()
ensures forall x: int, d: int {:trigger x / d} :: d > 0 ==> DivRecursive(x, d) == x / d
{
reveal DivPos();
reveal DivRecursive();
forall x: int, d: int | d > 0
ensures DivRecursive(x, d) == x / d
{
Expand Down Expand Up @@ -132,8 +128,6 @@ module {:disableNonlinearArithmetic} Std.Arithmetic.DivMod {
ensures x / y >= x / z
decreases x
{
reveal DivPos();
reveal DivRecursive();
LemmaDivIsDivRecursiveAuto();
assert forall u: int, d: int {:trigger u / d} {:trigger DivRecursive(u, d)}
:: d > 0 ==> DivRecursive(u, d) == u / d;
Expand Down Expand Up @@ -954,7 +948,6 @@ module {:disableNonlinearArithmetic} Std.Arithmetic.DivMod {
ensures ModRecursive(x, m) == x % m
decreases if x < 0 then -x + m else x
{
reveal ModRecursive();
if x < 0 {
calc {
ModRecursive(x, m);
Expand Down Expand Up @@ -989,7 +982,6 @@ module {:disableNonlinearArithmetic} Std.Arithmetic.DivMod {
lemma LemmaModIsModRecursiveAuto()
ensures forall x: int, d: int {:trigger x % d}:: d > 0 ==> ModRecursive(x, d) == x % d
{
reveal ModRecursive();
forall x: int, d: int | d > 0
ensures ModRecursive(x, d) == x % d
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ module {:disableNonlinearArithmetic} Std.Arithmetic.DivInternals {
import opened MulInternals

/* Performs division recursively with positive denominator. */
function {:opaque} DivPos(x: int, d: int): int
function DivPos(x: int, d: int): int
requires d > 0
decreases if x < 0 then (d - x) else x
{
Expand All @@ -38,10 +38,9 @@ module {:disableNonlinearArithmetic} Std.Arithmetic.DivInternals {
}

/* Performs division recursively. */
function {:opaque} DivRecursive(x: int, d: int): int
function DivRecursive(x: int, d: int): int
requires d != 0
{
reveal DivPos();
if d > 0 then
DivPos(x, d)
else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ module {:disableNonlinearArithmetic} Std.Arithmetic.ModInternals {
import opened DivInternalsNonlinear

/* Performs modulus recursively. */
function {:opaque} ModRecursive(x: int, d: int): int
function ModRecursive(x: int, d: int): int
requires d > 0
decreases if x < 0 then (d - x) else x
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ module {:disableNonlinearArithmetic} Std.Arithmetic.MulInternals {
import opened MulInternalsNonlinear

/* performs multiplication for positive integers using recursive addition */
function {:opaque} MulPos(x: int, y: int) : int
function MulPos(x: int, y: int) : int
requires x >= 0
{
if x == 0 then 0
Expand Down
Loading