Skip to content

Commit

Permalink
Moved axioms derived from Dafny into dedicated directory and added Ms-PL
Browse files Browse the repository at this point in the history
  • Loading branch information
mschwerhoff committed Sep 5, 2014
1 parent 2f22e0f commit a87610e
Show file tree
Hide file tree
Showing 14 changed files with 156 additions and 56 deletions.
23 changes: 14 additions & 9 deletions LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
Silicon and all files of its source code are licensed under the Mozilla Public
License Version 2.0 (see below or http://www.mozilla.org/MPL/2.0/), *except*
files found in the following directories (and their sub-directories), which
are licensed under Public Domain
(see http://creativecommons.org/publicdomain/zero/1.0/):

docs/licenses
project
src/test/resources
utils
License Version 2.0 (see below or http://www.mozilla.org/MPL/2.0/), with the
following *exceptions*:

- Files found in the following directories (and their sub-directories), which
are licensed under Public Domain
(see http://creativecommons.org/publicdomain/zero/1.0/):

docs/licenses
project
src/test/resources
utils

- Files found in src/main/resources/dafny_axioms (and its sub-directories),
which are licensed under Microsoft Public License (Ms-PL)



Expand Down
61 changes: 61 additions & 0 deletions src/main/resources/dafny_axioms/LICENSE.TXT
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
Microsoft Public License (Ms-PL)

This license governs use of the accompanying software. If you use the
software, you accept this license. If you do not accept the license, do
not use the software.

1. Definitions

The terms "reproduce," "reproduction," "derivative works," and
"distribution" have the same meaning here as under U.S. copyright law.

A "contribution" is the original software, or any additions or changes
to the software.

A "contributor" is any person that distributes its contribution under
this license.

"Licensed patents" are a contributor's patent claims that read directly
on its contribution.

2. Grant of Rights

(A) Copyright Grant- Subject to the terms of this license, including the
license conditions and limitations in section 3, each contributor grants
you a non-exclusive, worldwide, royalty-free copyright license to
reproduce its contribution, prepare derivative works of its
contribution, and distribute its contribution or any derivative works
that you create.

(B) Patent Grant- Subject to the terms of this license, including the
license conditions and limitations in section 3, each contributor grants
you a non-exclusive, worldwide, royalty-free license under its licensed
patents to make, have made, use, sell, offer for sale, import, and/or
otherwise dispose of its contribution in the software or derivative
works of the contribution in the software.

3. Conditions and Limitations

(A) No Trademark License- This license does not grant you rights to use
any contributors' name, logo, or trademarks.

(B) If you bring a patent claim against any contributor over patents
that you claim are infringed by the software, your patent license from
such contributor to the software ends automatically.

(C) If you distribute any portion of the software, you must retain all
copyright, patent, trademark, and attribution notices that are present
in the software.

(D) If you distribute any portion of the software in source code form,
you may do so only under this license by including a complete copy of
this license with your distribution. If you distribute any portion of
the software in compiled or object code form, you may only do so under a
license that complies with this license.

(E) The software is licensed "as-is." You bear the risk of using it. The
contributors give no express warranties, guarantees or conditions. You
may have additional consumer rights under your local laws which this
license cannot change. To the extent permitted under your local laws,
the contributors exclude the implied warranties of merchantability,
fitness for a particular purpose and non-infringement.
Original file line number Diff line number Diff line change
@@ -1,23 +1,24 @@
; This Source Code Form is subject to the terms of the Mozilla Public
; License, v. 2.0. If a copy of the MPL was not distributed with this
; file, You can obtain one at http://mozilla.org/MPL/2.0/.
; These axioms are derived from the corresponding axioms of the prelude of
; Microsoft's Dafny tool by translating them from Boogie to SMT-LIB. Visit
; http://dafny.codeplex.com for more information about the Dafny verifier.
;
; This file is subject to the terms of the Microsoft Public License
; (Ms-PL). A copy of the Ms-PL can be found in the same directory in which
; this file is located.


; These axioms correspond to Dafny's multiset axiomatisation from 2013-06-27.
; They depend on the set axiomatisation due to the fromSet-function.

;
; Multiset axioms
;

;type MultiSet T = [T]int;


; 2013-07-24 Malte: Ignored for now. Not sure when it should be used.
;// ints are non-negative, used after havocing, and for conversion from sequences to multisets.
;axiom (forall<T> ms: MultiSet T :: { $IsGoodMultiSet(ms) }
; $IsGoodMultiSet(ms) <==> (forall bx: T :: { ms[bx] } 0 <= ms[bx]));


;axiom (forall<T> s: MultiSet T :: { MultiSet#Card(s) } 0 <= MultiSet#Card(s));
(assert (forall ((xs $Multiset<$S$>)) (!
(< 0 ($Multiset.card xs))
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
; This Source Code Form is subject to the terms of the Mozilla Public
; License, v. 2.0. If a copy of the MPL was not distributed with this
; file, You can obtain one at http://mozilla.org/MPL/2.0/.

; These declarations correspond to Dafny's multiset axiomatisation from 2013-06-27.
; They depend on the set axiomatisation due to the fromSet-function.
; These axioms are derived from the corresponding axioms of the prelude of
; Microsoft's Dafny tool by translating them from Boogie to SMT-LIB. Visit
; http://dafny.codeplex.com for more information about the Dafny verifier.
;
; This file is subject to the terms of the Microsoft Public License
; (Ms-PL). A copy of the Ms-PL can be found in the same directory in which
; this file is located.



Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
; This Source Code Form is subject to the terms of the Mozilla Public
; License, v. 2.0. If a copy of the MPL was not distributed with this
; file, You can obtain one at http://mozilla.org/MPL/2.0/.
; These axioms are derived from the corresponding axioms of the prelude of
; Microsoft's Dafny tool by translating them from Boogie to SMT-LIB. Visit
; http://dafny.codeplex.com for more information about the Dafny verifier.
;
; This file is subject to the terms of the Microsoft Public License
; (Ms-PL). A copy of the Ms-PL can be found in the same directory in which
; this file is located.



; General sequence axioms

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
; This Source Code Form is subject to the terms of the Mozilla Public
; License, v. 2.0. If a copy of the MPL was not distributed with this
; file, You can obtain one at http://mozilla.org/MPL/2.0/.
; These axioms are derived from the corresponding axioms of the prelude of
; Microsoft's Dafny tool by translating them from Boogie to SMT-LIB. Visit
; http://dafny.codeplex.com for more information about the Dafny verifier.
;
; This file is subject to the terms of the Microsoft Public License
; (Ms-PL). A copy of the Ms-PL can be found in the same directory in which
; this file is located.



; General sequence declarations

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
; This Source Code Form is subject to the terms of the Mozilla Public
; License, v. 2.0. If a copy of the MPL was not distributed with this
; file, You can obtain one at http://mozilla.org/MPL/2.0/.
; These axioms are derived from the corresponding axioms of the prelude of
; Microsoft's Dafny tool by translating them from Boogie to SMT-LIB. Visit
; http://dafny.codeplex.com for more information about the Dafny verifier.
;
; This file is subject to the terms of the Microsoft Public License
; (Ms-PL). A copy of the Ms-PL can be found in the same directory in which
; this file is located.



; Axioms specific to integer sequences

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
; These axioms are derived from the corresponding axioms of the prelude of
; Microsoft's Dafny tool by translating them from Boogie to SMT-LIB. Visit
; http://dafny.codeplex.com for more information about the Dafny verifier.
;
; This file is subject to the terms of the Microsoft Public License
; (Ms-PL). A copy of the Ms-PL can be found in the same directory in which
; this file is located.



; Declarations specific to integer sequences

(declare-fun $Seq.rng (Int Int) $Seq<Int>)
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
; This Source Code Form is subject to the terms of the Mozilla Public
; License, v. 2.0. If a copy of the MPL was not distributed with this
; file, You can obtain one at http://mozilla.org/MPL/2.0/.
; These axioms are derived from the corresponding axioms of the prelude of
; Microsoft's Dafny tool by translating them from Boogie to SMT-LIB. Visit
; http://dafny.codeplex.com for more information about the Dafny verifier.
;
; This file is subject to the terms of the Microsoft Public License
; (Ms-PL). A copy of the Ms-PL can be found in the same directory in which
; this file is located.


; These axioms correspond to Dafny's set axiomatisation from 2013-06-27.

; type Set T = [T]bool;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
; This Source Code Form is subject to the terms of the Mozilla Public
; License, v. 2.0. If a copy of the MPL was not distributed with this
; file, You can obtain one at http://mozilla.org/MPL/2.0/.
; These axioms are derived from the corresponding axioms of the prelude of
; Microsoft's Dafny tool by translating them from Boogie to SMT-LIB. Visit
; http://dafny.codeplex.com for more information about the Dafny verifier.
;
; This file is subject to the terms of the Microsoft Public License
; (Ms-PL). A copy of the Ms-PL can be found in the same directory in which
; this file is located.


; These declarations correspond to Dafny's set axiomatisation from 2013-06-27.

(declare-fun $Set.in ($S$ $Set<$S$>) Bool)

Expand Down
7 changes: 0 additions & 7 deletions src/main/resources/sequences_int_declarations_dafny.smt2

This file was deleted.

4 changes: 2 additions & 2 deletions src/main/scala/theories/Multisets.scala
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,14 @@ class DefaultMultisetsEmitter(prover: Prover,
def declareSymbols() {
collectedSorts foreach {s =>
prover.logComment(s"/multisets_declarations_dafny.smt2 [${s.elementsSort}]")
preambleFileEmitter.emitSortParametricAssertions("/multisets_declarations_dafny.smt2", s.elementsSort)
preambleFileEmitter.emitSortParametricAssertions("/dafny_axioms/multisets_declarations_dafny.smt2", s.elementsSort)
}
}

def emitAxioms() {
collectedSorts foreach {s =>
prover.logComment(s"/multisets_axioms_dafny.smt2 [${s.elementsSort}]")
preambleFileEmitter.emitSortParametricAssertions("/multisets_axioms_dafny.smt2", s.elementsSort)
preambleFileEmitter.emitSortParametricAssertions("/dafny_axioms/multisets_axioms_dafny.smt2", s.elementsSort)
}
}
}
12 changes: 6 additions & 6 deletions src/main/scala/theories/Sequences.scala
Original file line number Diff line number Diff line change
Expand Up @@ -69,24 +69,24 @@ class DefaultSequencesEmitter(prover: Prover,
def declareSymbols() {
collectedSorts foreach {s =>
prover.logComment(s"/sequences_declarations_dafny.smt2 [${s.elementsSort}]")
preambleFileEmitter.emitSortParametricAssertions("/sequences_declarations_dafny.smt2", s.elementsSort)
preambleFileEmitter.emitSortParametricAssertions("/dafny_axioms/sequences_declarations_dafny.smt2", s.elementsSort)
}

if (collectedSorts contains terms.sorts.Seq(terms.sorts.Int)) {
prover.logComment("/sequences_int_declarations_dafny.smt2")
preambleFileEmitter.emitSortParametricAssertions("/sequences_int_declarations_dafny.smt2", terms.sorts.Int)
prover.logComment("/dafny_axioms/sequences_int_declarations_dafny.smt2")
preambleFileEmitter.emitSortParametricAssertions("/dafny_axioms/sequences_int_declarations_dafny.smt2", terms.sorts.Int)
}
}

def emitAxioms() {
collectedSorts foreach {s =>
prover.logComment(s"/sequences_axioms_dafny.smt2 [${s.elementsSort}]")
preambleFileEmitter.emitSortParametricAssertions("/sequences_axioms_dafny.smt2", s.elementsSort)
preambleFileEmitter.emitSortParametricAssertions("/dafny_axioms/sequences_axioms_dafny.smt2", s.elementsSort)
}

if (collectedSorts contains terms.sorts.Seq(terms.sorts.Int)) {
prover.logComment("/sequences_int_axioms_dafny.smt2")
preambleFileEmitter.emitSortParametricAssertions("/sequences_int_axioms_dafny.smt2", terms.sorts.Int)
prover.logComment("/dafny_axioms/sequences_int_axioms_dafny.smt2")
preambleFileEmitter.emitSortParametricAssertions("/dafny_axioms/sequences_int_axioms_dafny.smt2", terms.sorts.Int)
}
}
}
4 changes: 2 additions & 2 deletions src/main/scala/theories/Sets.scala
Original file line number Diff line number Diff line change
Expand Up @@ -74,14 +74,14 @@ class DefaultSetsEmitter(prover: Prover,
def declareSymbols() {
collectedSorts foreach {s =>
prover.logComment(s"/sets_declarations_dafny.smt2 [${s.elementsSort}]")
preambleFileEmitter.emitSortParametricAssertions("/sets_declarations_dafny.smt2", s.elementsSort)
preambleFileEmitter.emitSortParametricAssertions("/dafny_axioms/sets_declarations_dafny.smt2", s.elementsSort)
}
}

def emitAxioms() {
collectedSorts foreach {s =>
prover.logComment(s"/sets_axioms_dafny.smt2 [${s.elementsSort}]")
preambleFileEmitter.emitSortParametricAssertions("/sets_axioms_dafny.smt2", s.elementsSort)
preambleFileEmitter.emitSortParametricAssertions("/dafny_axioms/sets_axioms_dafny.smt2", s.elementsSort)
}
}
}

0 comments on commit a87610e

Please sign in to comment.