Skip to content

Commit

Permalink
Merge pull request #6 from alex28sh/096
Browse files Browse the repository at this point in the history
41, 46, 126, 135, 138, 146
  • Loading branch information
alex28sh authored Aug 22, 2024
2 parents 473a581 + 0559cf6 commit cfbf692
Show file tree
Hide file tree
Showing 19 changed files with 483 additions and 97 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/test-new.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ jobs:
ALL_CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }}
run: |
chmod +x ./public/scripts/test-new.sh
./public/scripts/test-new.sh $ALL_CHANGED_FILES
echo "${ALL_CHANGED_FILES[@]}"
./public/scripts/test-new.sh "${ALL_CHANGED_FILES[@]}"
shell: bash
# nagini 000-has-close-elements.py
9 changes: 9 additions & 0 deletions Bench/041-car_race_collision.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
from typing import cast, List, Dict, Set, Optional, Union
from nagini_contracts.contracts import *

def car__race__collision(n : int) -> int:
Requires((n) >= (0))
Ensures((Result()) == ((n) * (n)))
cnt = int(0) # type : int
cnt = (n) * (n)
return cnt
52 changes: 52 additions & 0 deletions Bench/046-fib4.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
from typing import cast, List, Dict, Set, Optional, Union
from nagini_contracts.contracts import *

@Pure
def fib4__rec(n : int) -> int :
Requires(n >= 0)
if (((n) == (0)) or ((n) == (1))) or ((n) == (2)):
return 0
elif (n) == (3):
return 1
elif True:
return (((fib4__rec((n) - (1))) + (fib4__rec((n) - (2)))) + (fib4__rec((n) - (3)))) + (fib4__rec((n) - (4)))

def fib4(n : int) -> int:
Requires(n >= 0)
Ensures((Result()) == (fib4__rec(n)))
result = int(0) # type : int
if (((n) == (0)) or ((n) == (1))) or ((n) == (2)):
result = 0
return result
if (n) == (3):
result = 1
return result
d_0_a_ = int(0) # type : int
d_1_b_ = int(0) # type : int
d_2_c_ = int(0) # type : int
d_3_d_ = int(0) # type : int
rhs0_ = 0 # type : int
rhs1_ = 0 # type : int
rhs2_ = 0 # type : int
rhs3_ = 1 # type : int
d_0_a_ = rhs0_
d_1_b_ = rhs1_
d_2_c_ = rhs2_
d_3_d_ = rhs3_
d_4_i_ = int(0) # type : int
d_4_i_ = 4
while (d_4_i_) <= (n):
Invariant(((4) <= (d_4_i_)) and ((d_4_i_) <= ((n) + (1))))
Invariant((d_0_a_) == (fib4__rec((d_4_i_) - (4))))
Invariant((d_1_b_) == (fib4__rec((d_4_i_) - (3))))
Invariant((d_2_c_) == (fib4__rec((d_4_i_) - (2))))
Invariant((d_3_d_) == (fib4__rec((d_4_i_) - (1))))
d_5_temp_ = int(0) # type : int
d_5_temp_ = (((d_3_d_) + (d_2_c_)) + (d_1_b_)) + (d_0_a_)
d_0_a_ = d_1_b_
d_1_b_ = d_2_c_
d_2_c_ = d_3_d_
d_3_d_ = d_5_temp_
d_4_i_ = (d_4_i_) + (1)
result = d_3_d_
return result
68 changes: 68 additions & 0 deletions Bench/126-is_sorted.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
from typing import cast, List, Dict, Set, Optional, Union
from nagini_contracts.contracts import *


def is__sorted(a : List[int]) -> bool:
Requires(Acc(list_pred(a)))
Ensures(Acc(list_pred(a)))
Ensures((Result()) == (
Forall(int, lambda d_0_i_:
Forall(int, lambda d_1_j_:
not ((((0) <= (d_0_i_)) and ((d_0_i_) <= (d_1_j_))) and ((d_1_j_) < (len(a)))) or ((((a)[d_0_i_]) <= ((a)[d_1_j_])))))
and (Forall(int, lambda d_2_i_:
not (((0) <= (d_2_i_)) and ((d_2_i_) < (len(a)))) or ((count_set(a, (a)[d_2_i_], 0)) <= (2))))))
f = False # type : bool
if (len(a)) == (0):
f = True
Assert(Forall(int, lambda d_0_i_:
Forall(int, lambda d_1_j_:
not ((((0) <= (d_0_i_)) and ((d_0_i_) <= (d_1_j_))) and ((d_1_j_) < (len(a)))) or ((((a)[d_0_i_]) <= ((a)[d_1_j_]))))))
return f
d_3_is__asc_ = False # type : bool
d_3_is__asc_ = True
d_4_i_ = int(0) # type : int
d_4_i_ = 1
while (d_4_i_) < (len(a)):
Invariant(Acc(list_pred(a)))
Invariant(((1) <= (d_4_i_)) and ((d_4_i_) <= (len(a))))
Invariant((d_3_is__asc_) == (Forall(int, lambda d_5_j_:
Forall(int, lambda d_6_k_:
not ((((0) <= (d_5_j_)) and ((d_5_j_) < (d_6_k_))) and ((d_6_k_) < (d_4_i_))) or (((a)[d_5_j_]) <= ((a)[d_6_k_]))))))
if ((a)[(d_4_i_) - (1)]) > ((a)[d_4_i_]):
d_3_is__asc_ = False
d_4_i_ = (d_4_i_) + (1)
if not(d_3_is__asc_):
f = False
return f
d_4_i_ = 0
d_7_has__no__more__that__2_ = False # type : bool
d_7_has__no__more__that__2_ = True
while (d_4_i_) < (len(a)):
Invariant(Acc(list_pred(a)))
Invariant(((0) <= (d_4_i_)) and ((d_4_i_) <= (len(a))))
Invariant((d_3_is__asc_) ==
(Forall(int, lambda d_5_j_:
Forall(int, lambda d_6_k_:
not ((((0) <= (d_5_j_)) and ((d_5_j_) < (d_6_k_))) and ((d_6_k_) < (len(a)))) or (((a)[d_5_j_]) <= ((a)[d_6_k_]))))))
Invariant((d_7_has__no__more__that__2_) == (Forall(int, lambda d_8_j_:
not (((0) <= (d_8_j_)) and ((d_8_j_) < (d_4_i_))) or ((count_set(a, (a)[d_8_j_], 0)) <= (2))) and
(Forall(int, lambda d_5_j_:
Forall(int, lambda d_6_k_:
not ((((0) <= (d_5_j_)) and ((d_5_j_) < (d_6_k_))) and ((d_6_k_) < (len(a)))) or (((a)[d_5_j_]) <= ((a)[d_6_k_])))))))
d_9_count_ = int(0) # type : int
d_9_count_ = count_set(a, (a)[d_4_i_], 0)
if (d_9_count_) > (2):
d_7_has__no__more__that__2_ = False
d_4_i_ = (d_4_i_) + (1)
f = d_7_has__no__more__that__2_
return f

@Pure
def count_set(a : List[int], x : int, i : int) -> int:
Requires(Acc(list_pred(a), 1/2))
Requires(((0) <= (i)) and ((i) <= (len(a))))
if (i) == 0:
return 0
else:
return (count_set(a, x, (i) - (1))) + (((a)[(i) - (1)]) == (x))

32 changes: 32 additions & 0 deletions Bench/135_can_arrange.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
from typing import cast, List, Dict, Set, Optional, Union
from nagini_contracts.contracts import *

def can__arrange(arr : List[int]) -> int:
Requires(Acc(list_pred(arr)))
Requires((len(arr)) > (0))
Requires(Forall(int, lambda d_0_i_:
Forall(int, lambda d_1_j_:
not ((((0) <= (d_0_i_)) and ((d_0_i_) < (d_1_j_))) and ((d_1_j_) < (len(arr)))) or (((arr)[d_0_i_]) != ((arr)[d_1_j_])))))
Ensures(Acc(list_pred(arr)))
Ensures(not ((Result()) == (-1)) or (Forall(int, lambda d_2_i_:
not (((1) <= (d_2_i_)) and ((d_2_i_) < (len(arr)))) or (((arr)[d_2_i_]) >= ((arr)[(d_2_i_) - (1)])))))
Ensures(not ((Result()) >= (0)) or ((((1) <= (Result())) and ((Result()) < (len(arr)))) and (((arr)[Result()]) < ((arr)[(Result()) - (1)]))))
Ensures(not ((Result()) >= (0)) or (Forall(int, lambda d_3_i_:
not (((Result()) < (d_3_i_)) and ((d_3_i_) < (len(arr)))) or (((arr)[d_3_i_]) >= ((arr)[(d_3_i_) - (1)])))))
pos = int(0) # type : int
d_4_i_ = int(0) # type : int
d_4_i_ = 1
pos = -1
while (d_4_i_) < (len(arr)):
Invariant(Acc(list_pred(arr)))
Invariant(((1) <= (d_4_i_)) and ((d_4_i_) <= (len(arr))))
Invariant(not ((pos) == (-1)) or (Forall(int, lambda d_5_j_:
not (((1) <= (d_5_j_)) and ((d_5_j_) < (d_4_i_))) or (((arr)[d_5_j_]) >= ((arr)[(d_5_j_) - (1)])))))
Invariant(not ((pos) >= (0)) or ((((1) <= (pos)) and ((pos) < (d_4_i_))) and (((arr)[pos]) < ((arr)[(pos) - (1)]))))
Invariant(not ((pos) >= (0)) or (Forall(int, lambda d_6_j_:
not (((pos) < (d_6_j_)) and ((d_6_j_) < (d_4_i_))) or (((arr)[d_6_j_]) >= ((arr)[(d_6_j_) - (1)])))))
if ((arr)[d_4_i_]) < ((arr)[(d_4_i_) - (1)]):
pos = d_4_i_
d_4_i_ = (d_4_i_) + (1)
return pos

8 changes: 8 additions & 0 deletions Bench/138_is_equal_to_sum_even.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
from typing import cast, List, Dict, Set, Optional, Union
from nagini_contracts.contracts import *

def is__equal__to__sum__even(n : int) -> bool:
Ensures((Result()) == ((((n % 2)) == (0)) and ((n) >= (8))))
b = False # type : bool
b = (((n % 2)) == (0)) and ((n) >= (8))
return b
46 changes: 46 additions & 0 deletions Bench/146_specialFilter.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
from typing import cast, List, Dict, Set, Optional, Union
from nagini_contracts.contracts import *

@Pure
def first__digit(n : int) -> int :
Requires(((0) <= (n)))
Ensures(0 <= Result() and (Result()) < (10))
if n < 10:
return n
else:
return first__digit(n // 10)

@Pure
def last__digit(n : int) -> int :
return (n % 10)

def specialFilter(s : List[int]) -> List[int]:
Requires(Acc(list_pred(s)))
Ensures(Acc(list_pred(s)))
Ensures(Acc(list_pred(Result())))
Ensures(Forall(int, lambda d_0_i_:
not (((0) <= (d_0_i_)) and ((d_0_i_) < (len(Result())))) or (((Result())[d_0_i_]) > (10))))
Ensures(Forall(int, lambda d_2_i_:
not (((0) <= (d_2_i_)) and ((d_2_i_) < (len(Result())))) or ((((first__digit((Result())[d_2_i_]) % 2)) == (1)) and (((last__digit((Result())[d_2_i_]) % 2)) == (1)))))
Ensures(Forall(int, lambda d_5_i_:
not (((0) <= (d_5_i_)) and ((d_5_i_) < (len(Result())))) or
(Exists(int, lambda x: x >= 0 and x < len(s) and s[x] == Result()[d_5_i_]))))
r = list([int(0)] * 0) # type : List[int]
d_3_i_ = int(0) # type : int
d_3_i_ = 0
r = list([])
while (d_3_i_) < (len(s)):
Invariant(Acc(list_pred(r)))
Invariant(Acc(list_pred(s)))
Invariant(((0) <= (d_3_i_)) and ((d_3_i_) <= (len(s))))
Invariant(Forall(int, lambda d_5_i_:
not (((0) <= (d_5_i_)) and ((d_5_i_) < (len(r)))) or (((r)[d_5_i_]) > (10))))
Invariant(Forall(int, lambda d_7_i_:
(not (((0) <= (d_7_i_)) and ((d_7_i_) < (len(r)))) or ((((first__digit((r)[d_7_i_]) % 2)) == (1)) and (((last__digit((r)[d_7_i_]) % 2)) == (1))), [[first__digit((r)[d_7_i_])]])))
Invariant(Forall(int, lambda d_5_i_:
not (((0) <= (d_5_i_)) and ((d_5_i_) < (len(r)))) or
(Exists(int, lambda x: x >= 0 and x < len(s) and s[x] == r[d_5_i_]))))
if ((((s)[d_3_i_]) > (10)) and (((last__digit((s)[d_3_i_]) % 2)) == (1))) and (((first__digit((s)[d_3_i_]) % 2)) == (1)):
r = (r) + [(s)[d_3_i_]]
d_3_i_ = (d_3_i_) + (1)
return r
7 changes: 4 additions & 3 deletions WIP/159-eat.py → Bench/159-eat.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@ def eat(number : int, need : int, remaining : int) -> List[int]:
Ensures((len(Result())) == (2))
Ensures(not ((remaining) >= (need)) or ((((Result())[0]) == ((number) + (need))) and (((Result())[1]) == ((remaining) - (need)))))
Ensures(not ((remaining) < (need)) or ((((Result())[0]) == ((number) + (remaining))) and (((Result())[1]) == (0))))
result = list([int(0)] * 0) # type : List[int]
result = list([int(0)] * 2) # type : List[int]
if (remaining) < (need):
result = ([(number) + (remaining), 0])
result[0] = (number) + (remaining)
else:
result = ([(number) + (need), (remaining) - (need)])
result[0] = (number) + (need)
result[1] = (remaining) - (need)
return result
6 changes: 6 additions & 0 deletions WIP/002-truncate.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from nagini_contracts.contracts import *

def truncate_number(number: float) -> float:
Requires(float("0.0") <= number)
Ensures(float("0.0") <= number - Result() and number - Result() < float("1.0"))
return number % float("1.0")
40 changes: 20 additions & 20 deletions WIP/029-filter_by_prefix.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,32 +54,32 @@ def filter__by__prefix(xs : List[List[int]], p : List[int]) -> List[int]:
# (starts__with(x, p, 0), [[starts__with(x, p, 0)]])))
# Invariant(Forall(int, lambda d_2_j_:
# (Implies(((0) <= (d_2_j_)) and ((d_2_j_) < (len(filtered))), starts__with(xs[(filtered)[d_2_j_]], p, 0)), [[starts__with(xs[(filtered)[d_2_j_]], p, 0)]])))
# Invariant(Forall(int, lambda d_2_j_:
# (Implies(((0) <= (d_2_j_)) and ((d_2_j_) < (d_1_i_)) and starts__with(xs[d_2_j_], p, 0),
# Exists(int, lambda x: x >= 0 and x < len(filtered) and filtered[x] == d_2_j_)),
# [[xs[d_2_j_]]])))
Assume(Forall(int, lambda d_2_j_:
Invariant(Forall(int, lambda d_2_j_:
(Implies(((0) <= (d_2_j_)) and ((d_2_j_) < (d_1_i_)) and starts__with(xs[d_2_j_], p, 0),
Exists(int, lambda x: x >= 0 and x < len(filtered) and filtered[x] == d_2_j_)),
[[xs[d_2_j_]]])))
# Assume(Forall(int, lambda d_2_j_:
# (Implies(((0) <= (d_2_j_)) and ((d_2_j_) < (d_1_i_)) and starts__with(xs[d_2_j_], p, 0),
# Exists(int, lambda x: x >= 0 and x < len(filtered) and filtered[x] == d_2_j_)),
# [[xs[d_2_j_]]])))
if starts__with((xs)[d_1_i_], p, 0):
filtered = (filtered) + [d_1_i_]
Assert(starts__with(xs[(filtered)[len(filtered) - 1]], p, 0))
Assert(d_1_i_ == filtered[len(filtered) - 1])
Assert(Exists(int, lambda x: x >= 0 and x < len(filtered) and filtered[x] == d_1_i_))
Assert(Forall(int, lambda d_2_j_:
(Implies(((0) <= (d_2_j_)) and ((d_2_j_) < (d_1_i_)) and starts__with(xs[d_2_j_], p, 0),
Exists(int, lambda x: x >= 0 and x < len(filtered) and filtered[x] == d_2_j_)),
[[xs[d_2_j_]]])))
Assert(Forall(int, lambda d_2_j_:
(Implies(((0) <= (d_2_j_)) and ((d_2_j_) <= (d_1_i_)) and starts__with(xs[d_2_j_], p, 0),
Exists(int, lambda x: x >= 0 and x < len(filtered) and filtered[x] == d_2_j_)),
[[xs[d_2_j_]]])))
# Assert(starts__with(xs[(filtered)[len(filtered) - 1]], p, 0))
# Assert(d_1_i_ == filtered[len(filtered) - 1])
# Assert(Exists(int, lambda x: x >= 0 and x < len(filtered) and filtered[x] == d_1_i_))
# Assert(Forall(int, lambda d_2_j_:
# (Implies(((0) <= (d_2_j_)) and ((d_2_j_) < (d_1_i_)) and starts__with(xs[d_2_j_], p, 0),
# Exists(int, lambda x: x >= 0 and x < len(filtered) and filtered[x] == d_2_j_)),
# [[xs[d_2_j_]]])))
# Assert(Forall(int, lambda d_2_j_:
# (Implies(((0) <= (d_2_j_)) and ((d_2_j_) <= (d_1_i_)) and starts__with(xs[d_2_j_], p, 0),
# Exists(int, lambda x: x >= 0 and x < len(filtered) and filtered[x] == d_2_j_)),
# [[xs[d_2_j_]]])))
d_1_i_ = (d_1_i_) + (1)
Assert(Forall(int, lambda d_2_j_:
(Implies(((0) <= (d_2_j_)) and ((d_2_j_) < (d_1_i_)) and starts__with(xs[d_2_j_], p, 0),
Exists(int, lambda x: x >= 0 and x < len(filtered) and filtered[x] == d_2_j_)),
[[xs[d_2_j_]]])))
# Assert(Forall(int, lambda d_2_j_:
# (Implies(((0) <= (d_2_j_)) and ((d_2_j_) < (d_1_i_)) and starts__with(xs[d_2_j_], p, 0),
# Exists(int, lambda x: x >= 0 and x < len(filtered) and filtered[x] == d_2_j_)),
# [[xs[d_2_j_]]])))
# Assert(Implies(((0) <= (d_1_i_)) and ((d_1_i_) < (d_1_i_)) and starts__with(xs[d_1_i_], p, 0),
# Exists(int, lambda x: x >= 0 and x < len(filtered) and filtered[x] == d_1_i_)))
return filtered
8 changes: 8 additions & 0 deletions WIP/045-triangle_area.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
from typing import cast, List, Dict, Set, Optional, Union
from nagini_contracts.contracts import *

def CalculateTriangleArea(a : float, h : float) -> float:
Requires(((h) >= float("0.0")) and ((a) >= float("0.0")))
Ensures((Result()) == (((h) * (a)) / (float("2.0"))))
area = ((h) * (a)) / float("2.0") # type : float
return area
24 changes: 9 additions & 15 deletions WIP/WIP: 074-total_match.py → WIP/074-total_match.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,9 @@

@Pure
def sum__chars__rec(i : int, j : int, lst : List[List[int]]) -> int :
Requires(Acc(list_pred(lst)))
Requires(Forall(lst, lambda x: Acc(list_pred(x))))
# Requires(Forall(int, lambda x: (Implies(x >= 0 and x < len(lst), Acc(list_pred(lst[x]))), [[lst[x]]])))
Requires(Acc(list_pred(lst), 1/2))
Requires(Forall(lst, lambda x: Acc(list_pred(x), 1/2)))
Requires(((0) <= (i)) and ((i) <= (j)) and ((j) <= (len(lst))))
Requires(Implies(j > 0, Acc(list_pred(lst[j - 1]))))
if i == j:
return 0
else:
Expand All @@ -46,25 +44,21 @@ def sum__chars__rec(i : int, j : int, lst : List[List[int]]) -> int :
def SumChars(lst : List[List[int]]) -> int:
Requires(Acc(list_pred(lst)))
Requires(Forall(lst, lambda x: Acc(list_pred(x))))
# Requires(Forall(int, lambda x: (Implies(x >= 0 and x < len(lst), Acc(list_pred(lst[x]))), [[lst[x]]])))
Ensures(Acc(list_pred(lst)))
Ensures(Forall(lst, lambda x: Acc(list_pred(x))))
# Ensures(Forall(int, lambda x: (Implies(x >= 0 and x < len(lst), Acc(list_pred(lst[x]))), [[lst[x]]])))
Ensures(Implies(len(lst) > 0, Acc(list_pred(lst[len(lst) - 1]))))
Ensures((Result()) == (sum__chars__rec(0, len(lst), lst)))
# Ensures((Result()) == (sum__chars__rec(0, len(lst), lst)))
sum = int(0) # type : int
sum = 0
d_3_i_ = int(0) # type : int
d_3_i_ = 0
while (d_3_i_) < (len(lst)):
Invariant(Acc(list_pred(lst)))
# Invariant(Forall(int, lambda x: (Implies(x >= 0 and x < len(lst), Acc(list_pred(lst[x]))), [[lst[x]]])))
Invariant(Forall(lst, lambda x: Acc(list_pred(x))))
Invariant(Acc(list_pred(lst), 1/2))
Invariant(Forall(lst, lambda x: Acc(list_pred(x), 1/2)))
Invariant(((0) <= (d_3_i_)) and ((d_3_i_) <= (len(lst))))
Invariant(Implies(d_3_i_ > 0, Acc(list_pred(lst[d_3_i_ - 1]))))
Invariant((sum) == (sum__chars__rec(0, d_3_i_, lst)))
Invariant(Forall(int, lambda d_0_i_: (Implies(((0) <= (d_0_i_)) and ((d_0_i_) < (len(lst))), Acc(list_pred(lst[d_0_i_])) and (Implies(d_0_i_ > 0, Acc(list_pred(lst[d_0_i_ - 1])))) and sum__chars__rec(0, d_0_i_ + 1, lst) == sum__chars__rec(0, d_0_i_, lst) + len(lst[d_0_i_])), [[sum__chars__rec(0, d_0_i_ + 1, lst)]])))
Assert(sum__chars__rec(0, d_3_i_ + 1, lst) == sum__chars__rec(0, d_3_i_, lst) + len(lst[d_3_i_]))
Invariant(Forall(int, lambda d_0_i_: (Implies(((0) <= (d_0_i_)) and ((d_0_i_) < (len(lst))), sum__chars__rec(0, d_0_i_ + 1, lst) == (sum__chars__rec(0, d_0_i_, lst) + len(lst[d_0_i_]))),
[[sum__chars__rec(0, d_0_i_ + 1, lst) == (sum__chars__rec(0, d_0_i_, lst) + len(lst[d_0_i_]))]])))
# Invariant((sum) == (sum__chars__rec(0, d_3_i_, lst)))
# Assert(sum__chars__rec(0, d_3_i_ + 1, lst) == sum__chars__rec(0, d_3_i_, lst) + len(lst[d_3_i_]))
sum = (sum) + (len((lst)[d_3_i_]))
d_3_i_ = (d_3_i_) + (1)
# Assert((list) == (list((list)[:len(list):])))
Expand Down
4 changes: 2 additions & 2 deletions WIP/096-count_up_to.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ def CountUpTo(n : int) -> List[int]:
Invariant(Forall(int, lambda d_3_p_:
Implies((((2) <= (d_3_p_)) and ((d_3_p_) < (d_4_i_))) and IsPrime(d_3_p_),
Exists(int, lambda x: x >= 0 and x < len(primes) and primes[x] == d_3_p_))))
# Invariant(Forall(int, lambda d_6_j_:
# (Implies(((0) <= (d_6_j_)) and ((d_6_j_) < (len(primes))), ((2) <= ((primes)[d_6_j_])) and (((primes)[d_6_j_]) < (d_4_i_))))))
Invariant(Forall(int, lambda d_6_j_:
(Implies(((0) <= (d_6_j_)) and ((d_6_j_) < (len(primes))), ((2) <= ((primes)[d_6_j_])) and (((primes)[d_6_j_]) < (d_4_i_))), [[primes[d_6_j_]]])))
# Invariant(Forall(int, lambda d_7_p_:
# (((((2) <= (d_7_p_)) and ((d_7_p_) < (d_4_i_))) and (IsPrime(d_7_p_))) == ((d_7_p_) in (primes)), [[IsPrime(d_7_p_)]])))
# Invariant(Forall(int, lambda d_8_j_:
Expand Down
Loading

0 comments on commit cfbf692

Please sign in to comment.