Skip to content
Snippets Groups Projects
Commit 25e4e292 authored by Regis Blanc's avatar Regis Blanc
Browse files

disallow array equality

parent d7a08f1c
Branches
Tags
No related merge requests found
...@@ -1387,6 +1387,9 @@ trait CodeExtraction extends ASTExtractors { ...@@ -1387,6 +1387,9 @@ trait CodeExtraction extends ASTExtractors {
val rr = extractTree(r) val rr = extractTree(r)
(rl, rr) match { (rl, rr) match {
case (IsTyped(_, ArrayType(_)), IsTyped(_, ArrayType(_))) =>
outOfSubsetError(tr, "Leon does not support array comparison")
case (IsTyped(_, rt), IsTyped(_, lt)) if typesCompatible(lt, rt) => case (IsTyped(_, rt), IsTyped(_, lt)) if typesCompatible(lt, rt) =>
Not(Equals(rl, rr)) Not(Equals(rl, rr))
...@@ -1405,6 +1408,9 @@ trait CodeExtraction extends ASTExtractors { ...@@ -1405,6 +1408,9 @@ trait CodeExtraction extends ASTExtractors {
val rr = extractTree(r) val rr = extractTree(r)
(rl, rr) match { (rl, rr) match {
case (IsTyped(_, ArrayType(_)), IsTyped(_, ArrayType(_))) =>
outOfSubsetError(tr, "Leon does not support array comparison")
case (IsTyped(_, rt), IsTyped(_, lt)) if typesCompatible(lt, rt) => case (IsTyped(_, rt), IsTyped(_, lt)) if typesCompatible(lt, rt) =>
Equals(rl, rr) Equals(rl, rr)
......
package leon.lang._
object ArrayEqual1 {
def f: Boolean = {
Array(1,2,3) == Array(1,2,3)
} ensuring(res => res)
}
package leon.lang._
object ArrayEqual2 {
def f: Boolean = {
Array(1,2,3) != Array(1,2,3)
} ensuring(res => !res)
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment