summaryrefslogtreecommitdiff
path: root/Binaries/DafnyPrelude.bpl
diff options
context:
space:
mode:
authorGravatar Rustan Leino <unknown>2014-04-02 18:59:29 -0700
committerGravatar Rustan Leino <unknown>2014-04-02 18:59:29 -0700
commita93abfeb96437977f2cbd56c0e99610af6f12386 (patch)
tree341ac2ff04e65ba8f6f047ced1a58f48dbee0449 /Binaries/DafnyPrelude.bpl
parentc7e7d6c277a5a5dcb6102f85d507d986d2675f4c (diff)
Improvements in sequence axioms to make checking more automatic.
Minor changes in a test file.
Diffstat (limited to 'Binaries/DafnyPrelude.bpl')
-rw-r--r--Binaries/DafnyPrelude.bpl9
1 files changed, 7 insertions, 2 deletions
diff --git a/Binaries/DafnyPrelude.bpl b/Binaries/DafnyPrelude.bpl
index 0662d12b..224c5ffd 100644
--- a/Binaries/DafnyPrelude.bpl
+++ b/Binaries/DafnyPrelude.bpl
@@ -410,8 +410,13 @@ axiom (forall<T> s: Seq T, i: int, j: int ::
0 <= i && i < j && j <= Seq#Length(s) ==> Seq#Rank(Seq#Append(Seq#Take(s, i), Seq#Drop(s, j))) < Seq#Rank(s) );
// Additional axioms about common things
-axiom Seq#Take(Seq#Empty(): Seq BoxType, 0) == Seq#Empty(); // [][..0] == []
-axiom Seq#Drop(Seq#Empty(): Seq BoxType, 0) == Seq#Empty(); // [][0..] == []
+axiom (forall<T> s: Seq T, n: int :: { Seq#Drop(s, n) }
+ n == 0 ==> Seq#Drop(s, n) == s);
+axiom (forall<T> s: Seq T, n: int :: { Seq#Take(s, n) }
+ n == 0 ==> Seq#Take(s, n) == Seq#Empty());
+axiom (forall<T> s: Seq T, m, n: int :: { Seq#Drop(Seq#Drop(s, m), n) }
+ 0 <= m && 0 <= n && m+n <= Seq#Length(s) ==>
+ Seq#Drop(Seq#Drop(s, m), n) == Seq#Drop(s, m+n));
// ---------------------------------------------------------------
// -- Axiomatization of Maps -------------------------------------