Skip to content

Commit 3cab9ba

Browse files
authored
Merge pull request #561 from fabianboesiger/master
Rename range function in Viper code generated by Nagini frontend
2 parents 3a31f39 + 821640a commit 3cab9ba

30 files changed

Lines changed: 136 additions & 136 deletions

File tree

src/test/resources/frontends/nagini/testsarpverificationtest_rd_quantified.py.vpr

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ domain PyType {
8484

8585
unique function slice(): PyType
8686

87-
unique function range(): PyType
87+
unique function py_range(): PyType
8888

8989
unique function Iterator_basic(): PyType
9090

@@ -274,8 +274,8 @@ domain PyType {
274274
extends_(slice(), object()) && get_basic(slice()) == slice()
275275
}
276276

277-
axiom subtype_range {
278-
extends_(range(), object()) && get_basic(range()) == range()
277+
axiom subtype_py_range {
278+
extends_(py_range(), object()) && get_basic(py_range()) == py_range()
279279
}
280280

281281
axiom subtype_Iterator {

src/test/resources/frontends/nagini/testsfunctionalverificationexamplescav_example.py.vpr

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ domain PyType {
8484

8585
unique function slice(): PyType
8686

87-
unique function range(): PyType
87+
unique function py_range(): PyType
8888

8989
unique function Iterator_basic(): PyType
9090

@@ -278,8 +278,8 @@ domain PyType {
278278
extends_(slice(), object()) && get_basic(slice()) == slice()
279279
}
280280

281-
axiom subtype_range {
282-
extends_(range(), object()) && get_basic(range()) == range()
281+
axiom subtype_py_range {
282+
extends_(py_range(), object()) && get_basic(py_range()) == py_range()
283283
}
284284

285285
axiom subtype_Iterator {

src/test/resources/frontends/nagini/testsfunctionalverificationexamplesiap_bst.py.vpr

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ domain PyType {
8484

8585
unique function slice(): PyType
8686

87-
unique function range(): PyType
87+
unique function py_range(): PyType
8888

8989
unique function Iterator_basic(): PyType
9090

@@ -278,8 +278,8 @@ domain PyType {
278278
extends_(slice(), object()) && get_basic(slice()) == slice()
279279
}
280280

281-
axiom subtype_range {
282-
extends_(range(), object()) && get_basic(range()) == range()
281+
axiom subtype_py_range {
282+
extends_(py_range(), object()) && get_basic(py_range()) == py_range()
283283
}
284284

285285
axiom subtype_Iterator {

src/test/resources/frontends/nagini/testsfunctionalverificationexamplesparkinson_recell.py.vpr

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ domain PyType {
8484

8585
unique function slice(): PyType
8686

87-
unique function range(): PyType
87+
unique function py_range(): PyType
8888

8989
unique function Iterator_basic(): PyType
9090

@@ -278,8 +278,8 @@ domain PyType {
278278
extends_(slice(), object()) && get_basic(slice()) == slice()
279279
}
280280

281-
axiom subtype_range {
282-
extends_(range(), object()) && get_basic(range()) == range()
281+
axiom subtype_py_range {
282+
extends_(py_range(), object()) && get_basic(py_range()) == py_range()
283283
}
284284

285285
axiom subtype_Iterator {

src/test/resources/frontends/nagini/testsfunctionalverificationexamplesrosetta_qsort.py.vpr

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ domain PyType {
8484

8585
unique function slice(): PyType
8686

87-
unique function range(): PyType
87+
unique function py_range(): PyType
8888

8989
unique function Iterator_basic(): PyType
9090

@@ -274,8 +274,8 @@ domain PyType {
274274
extends_(slice(), object()) && get_basic(slice()) == slice()
275275
}
276276

277-
axiom subtype_range {
278-
extends_(range(), object()) && get_basic(range()) == range()
277+
axiom subtype_py_range {
278+
extends_(py_range(), object()) && get_basic(py_range()) == py_range()
279279
}
280280

281281
axiom subtype_Iterator {

src/test/resources/frontends/nagini/testsfunctionalverificationexamplestest_student_enroll_preds.py.vpr

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ domain PyType {
8484

8585
unique function slice(): PyType
8686

87-
unique function range(): PyType
87+
unique function py_range(): PyType
8888

8989
unique function Iterator_basic(): PyType
9090

@@ -278,8 +278,8 @@ domain PyType {
278278
extends_(slice(), object()) && get_basic(slice()) == slice()
279279
}
280280

281-
axiom subtype_range {
282-
extends_(range(), object()) && get_basic(range()) == range()
281+
axiom subtype_py_range {
282+
extends_(py_range(), object()) && get_basic(py_range()) == py_range()
283283
}
284284

285285
axiom subtype_Iterator {

src/test/resources/frontends/nagini/testsfunctionalverificationissues00017.py.vpr

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ domain PyType {
8484

8585
unique function slice(): PyType
8686

87-
unique function range(): PyType
87+
unique function py_range(): PyType
8888

8989
unique function Iterator_basic(): PyType
9090

@@ -274,8 +274,8 @@ domain PyType {
274274
extends_(slice(), object()) && get_basic(slice()) == slice()
275275
}
276276

277-
axiom subtype_range {
278-
extends_(range(), object()) && get_basic(range()) == range()
277+
axiom subtype_py_range {
278+
extends_(py_range(), object()) && get_basic(py_range()) == py_range()
279279
}
280280

281281
axiom subtype_Iterator {
@@ -489,33 +489,33 @@ function Measure$check(map: Seq[Measure$], key: Ref, value: Int): Bool
489489
(forall m: Measure$ :: { (m in map) } (m in map) ==> Measure$guard(m) && Measure$key(m) == key ==> Measure$value(m) > value)
490490
}
491491

492-
function range___create__(start: Int, stop: Int, ctr: Int): Ref
492+
function py_range___create__(start: Int, stop: Int, ctr: Int): Ref
493493
requires stop >= start
494-
ensures range___val__(result) == [start..stop)
495-
ensures range___start__(result) == start
496-
ensures range___stop__(result) == stop
497-
ensures typeof(result) == range()
494+
ensures py_range___val__(result) == [start..stop)
495+
ensures py_range___start__(result) == start
496+
ensures py_range___stop__(result) == stop
497+
ensures typeof(result) == py_range()
498498

499499

500-
function range___val__(self: Ref): Seq[Int]
500+
function py_range___val__(self: Ref): Seq[Int]
501501

502502

503-
function range___start__(self: Ref): Int
503+
function py_range___start__(self: Ref): Int
504504

505505

506-
function range___stop__(self: Ref): Int
506+
function py_range___stop__(self: Ref): Int
507507

508508

509-
function range___len__(self: Ref): Int
510-
requires issubtype(typeof(self), range())
511-
ensures result == |range___val__(self)|
509+
function py_range___len__(self: Ref): Int
510+
requires issubtype(typeof(self), py_range())
511+
ensures result == |py_range___val__(self)|
512512

513513

514-
function range___sil_seq__(self: Ref): Seq[Ref]
515-
requires issubtype(typeof(self), range())
516-
ensures |result| == range___len__(self)
517-
ensures (forall i: Int :: { result[i] } i >= 0 && i < |range___val__(self)| ==> result[i] == __prim__int___box__(range___val__(self)[i]))
518-
ensures (forall i: Ref :: { (i in result) } (i in result) == (typeof(i) == int() && (int___unbox__(i) in range___val__(self))))
514+
function py_range___sil_seq__(self: Ref): Seq[Ref]
515+
requires issubtype(typeof(self), py_range())
516+
ensures |result| == py_range___len__(self)
517+
ensures (forall i: Int :: { result[i] } i >= 0 && i < |py_range___val__(self)| ==> result[i] == __prim__int___box__(py_range___val__(self)[i]))
518+
ensures (forall i: Ref :: { (i in result) } (i in result) == (typeof(i) == int() && (int___unbox__(i) in py_range___val__(self))))
519519

520520

521521
function str___len__(self: Ref): Int
@@ -594,13 +594,13 @@ method test_nested_forall(_cthread_157: Ref, _caller_measures_157: Seq[Measure$]
594594
var _method_measures_157: Seq[Measure$]
595595
_method_measures_157 := Seq[Measure$]()
596596
_err := null
597-
a_1 := range___create__(1, 3, 0)
597+
a_1 := py_range___create__(1, 3, 0)
598598
inhale _isDefined(3235681)
599-
b_0 := range___create__(1, 6, 1)
599+
b_0 := py_range___create__(1, 6, 1)
600600
inhale _isDefined(3170146)
601-
c := range___create__(4, 7, 2)
601+
c := py_range___create__(4, 7, 2)
602602
inhale _isDefined(99)
603-
assert (forall lambda17_21$x: Ref :: { (lambda17_21$x in range___sil_seq__(_checkDefined(a_1, 3235681))) } issubtype(typeof(lambda17_21$x), int()) ==> (lambda17_21$x in range___sil_seq__(_checkDefined(a_1, 3235681))) ==> (forall lambda17_42$y: Ref :: { (lambda17_42$y in range___sil_seq__(_checkDefined(b_0, 3170146))) } issubtype(typeof(lambda17_42$y), int()) ==> (lambda17_42$y in range___sil_seq__(_checkDefined(b_0, 3170146))) ==> int___eq__(lambda17_21$x, lambda17_42$y) ==> (forall lambda17_79$x: Ref :: { (lambda17_79$x in range___sil_seq__(_checkDefined(c, 99))) } issubtype(typeof(lambda17_79$x), int()) ==> (lambda17_79$x in range___sil_seq__(_checkDefined(c, 99))) ==> int___gt__(int___unbox__(lambda17_79$x), int___unbox__(lambda17_42$y)))))
603+
assert (forall lambda17_21$x: Ref :: { (lambda17_21$x in py_range___sil_seq__(_checkDefined(a_1, 3235681))) } issubtype(typeof(lambda17_21$x), int()) ==> (lambda17_21$x in py_range___sil_seq__(_checkDefined(a_1, 3235681))) ==> (forall lambda17_42$y: Ref :: { (lambda17_42$y in py_range___sil_seq__(_checkDefined(b_0, 3170146))) } issubtype(typeof(lambda17_42$y), int()) ==> (lambda17_42$y in py_range___sil_seq__(_checkDefined(b_0, 3170146))) ==> int___eq__(lambda17_21$x, lambda17_42$y) ==> (forall lambda17_79$x: Ref :: { (lambda17_79$x in py_range___sil_seq__(_checkDefined(c, 99))) } issubtype(typeof(lambda17_79$x), int()) ==> (lambda17_79$x in py_range___sil_seq__(_checkDefined(c, 99))) ==> int___gt__(int___unbox__(lambda17_79$x), int___unbox__(lambda17_42$y)))))
604604
goto __end
605605
label __end
606606
}
@@ -620,13 +620,13 @@ method test_nested_forall_2(_cthread_158: Ref, _caller_measures_158: Seq[Measure
620620
var _method_measures_158: Seq[Measure$]
621621
_method_measures_158 := Seq[Measure$]()
622622
_err := null
623-
a_2 := range___create__(1, 5, 3)
623+
a_2 := py_range___create__(1, 5, 3)
624624
inhale _isDefined(3301217)
625-
b_1 := range___create__(1, 6, 4)
625+
b_1 := py_range___create__(1, 6, 4)
626626
inhale _isDefined(3235682)
627-
c_0 := range___create__(4, 7, 5)
627+
c_0 := py_range___create__(4, 7, 5)
628628
inhale _isDefined(3170147)
629-
assert (forall lambda25_21$x: Ref :: { (lambda25_21$x in range___sil_seq__(_checkDefined(a_2, 3301217))) } issubtype(typeof(lambda25_21$x), int()) ==> (lambda25_21$x in range___sil_seq__(_checkDefined(a_2, 3301217))) ==> (forall lambda25_42$y: Ref :: { (lambda25_42$y in range___sil_seq__(_checkDefined(b_1, 3235682))) } issubtype(typeof(lambda25_42$y), int()) ==> (lambda25_42$y in range___sil_seq__(_checkDefined(b_1, 3235682))) ==> int___eq__(lambda25_21$x, lambda25_42$y) ==> (forall lambda25_79$x: Ref :: { (lambda25_79$x in range___sil_seq__(_checkDefined(c_0, 3170147))) } issubtype(typeof(lambda25_79$x), int()) ==> (lambda25_79$x in range___sil_seq__(_checkDefined(c_0, 3170147))) ==> int___gt__(int___unbox__(lambda25_79$x), int___unbox__(lambda25_42$y)))))
629+
assert (forall lambda25_21$x: Ref :: { (lambda25_21$x in py_range___sil_seq__(_checkDefined(a_2, 3301217))) } issubtype(typeof(lambda25_21$x), int()) ==> (lambda25_21$x in py_range___sil_seq__(_checkDefined(a_2, 3301217))) ==> (forall lambda25_42$y: Ref :: { (lambda25_42$y in py_range___sil_seq__(_checkDefined(b_1, 3235682))) } issubtype(typeof(lambda25_42$y), int()) ==> (lambda25_42$y in py_range___sil_seq__(_checkDefined(b_1, 3235682))) ==> int___eq__(lambda25_21$x, lambda25_42$y) ==> (forall lambda25_79$x: Ref :: { (lambda25_79$x in py_range___sil_seq__(_checkDefined(c_0, 3170147))) } issubtype(typeof(lambda25_79$x), int()) ==> (lambda25_79$x in py_range___sil_seq__(_checkDefined(c_0, 3170147))) ==> int___gt__(int___unbox__(lambda25_79$x), int___unbox__(lambda25_42$y)))))
630630
goto __end
631631
label __end
632632
}

src/test/resources/frontends/nagini/testsfunctionalverificationissues00031.py.vpr

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ domain PyType {
8484

8585
unique function slice(): PyType
8686

87-
unique function range(): PyType
87+
unique function py_range(): PyType
8888

8989
unique function Iterator_basic(): PyType
9090

@@ -292,8 +292,8 @@ domain PyType {
292292
extends_(slice(), object()) && get_basic(slice()) == slice()
293293
}
294294

295-
axiom subtype_range {
296-
extends_(range(), object()) && get_basic(range()) == range()
295+
axiom subtype_py_range {
296+
extends_(py_range(), object()) && get_basic(py_range()) == py_range()
297297
}
298298

299299
axiom subtype_Iterator {

src/test/resources/frontends/nagini/testsfunctionalverificationissues00057.py.vpr

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ domain PyType {
8484

8585
unique function slice(): PyType
8686

87-
unique function range(): PyType
87+
unique function py_range(): PyType
8888

8989
unique function Iterator_basic(): PyType
9090

@@ -278,8 +278,8 @@ domain PyType {
278278
extends_(slice(), object()) && get_basic(slice()) == slice()
279279
}
280280

281-
axiom subtype_range {
282-
extends_(range(), object()) && get_basic(range()) == range()
281+
axiom subtype_py_range {
282+
extends_(py_range(), object()) && get_basic(py_range()) == py_range()
283283
}
284284

285285
axiom subtype_Iterator {

src/test/resources/frontends/nagini/testsfunctionalverificationtest_behavioural_subtyping_classmethod.py.vpr

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ domain PyType {
8484

8585
unique function slice(): PyType
8686

87-
unique function range(): PyType
87+
unique function py_range(): PyType
8888

8989
unique function Iterator_basic(): PyType
9090

@@ -286,8 +286,8 @@ domain PyType {
286286
extends_(slice(), object()) && get_basic(slice()) == slice()
287287
}
288288

289-
axiom subtype_range {
290-
extends_(range(), object()) && get_basic(range()) == range()
289+
axiom subtype_py_range {
290+
extends_(py_range(), object()) && get_basic(py_range()) == py_range()
291291
}
292292

293293
axiom subtype_Iterator {

0 commit comments

Comments
 (0)