diff --git a/Bench/007-filter_by_substring.py b/Bench/007-filter_by_substring.py index 7d4b447..6f1e11f 100644 --- a/Bench/007-filter_by_substring.py +++ b/Bench/007-filter_by_substring.py @@ -12,13 +12,11 @@ def checkSubstring(s : List[int], sub : List[int]) -> bool: # post-conditions-end # impl-start - result = False # type : bool - result = False + result : bool = False if (len(sub)) == (0): result = True elif (len(s)) >= (len(sub)): - d_0_i_ = int(0) # type : int - d_0_i_ = 0 + d_0_i_ : int = 0 while (d_0_i_) <= ((len(s)) - (len(sub))): # invariants-start Invariant(Acc(list_pred(s), 1/2)) @@ -90,8 +88,7 @@ def filter__by__substring(strings : List[List[int]], substring : List[int]) -> L # impl-start res : List[List[int]] = [] - d_2_i_ = int(0) # type : int - d_2_i_ = 0 + d_2_i_ : int = 0 while (d_2_i_) < (len(strings)): # invariants-start Invariant(Acc(list_pred(res))) @@ -104,8 +101,7 @@ def filter__by__substring(strings : List[List[int]], substring : List[int]) -> L Invariant(Forall(int, lambda d_3_i_: (Implies(0 <= d_3_i_ and d_3_i_ < len(res), InArray(strings, res[d_3_i_])), [[InArray(strings, res[d_3_i_])]]))) # invariants-end - d_4_check_ = False # type : bool - d_4_check_ = checkSubstring((strings)[d_2_i_], substring) + d_4_check_ : bool = checkSubstring((strings)[d_2_i_], substring) if d_4_check_: cpy = list((strings)[d_2_i_]) res = (res) + [cpy] diff --git a/Bench/010-is_palindrome.py b/Bench/010-is_palindrome.py index 7762e56..44768af 100644 --- a/Bench/010-is_palindrome.py +++ b/Bench/010-is_palindrome.py @@ -17,10 +17,8 @@ def is__palindrome(start : int, s : List[int]) -> bool: # post-conditions-end # impl-start - d_1_i_ = int(0) # type : int - d_1_i_ = start - d_2_j_ = int(0) # type : int - d_2_j_ = (len(s)) - (1) + d_1_i_ : int = start + d_2_j_ : int = (len(s)) - (1) while (d_1_i_) < (d_2_j_): # invariants-start Invariant(Acc(list_pred(s), 1/2)) @@ -76,12 +74,12 @@ def make__palindrome(s : List[int]) -> List[int]: # post-conditions-end # impl-start - result = list([int(0)] * 0) # type : List[int] + result : List[int] = list([int(0)] * 0) if (len(s)) == (0): result = [] return result - d_6_beginning__of__suffix_ = int(0) # type : int - d_8_flag_ = is__palindrome(d_6_beginning__of__suffix_, s) # type : bool + d_6_beginning__of__suffix_ : int = int(0) + d_8_flag_ : bool = is__palindrome(d_6_beginning__of__suffix_, s) while not(d_8_flag_): # invariants-start Invariant(Acc(list_pred(s))) @@ -91,7 +89,7 @@ def make__palindrome(s : List[int]) -> List[int]: # invariants-end d_6_beginning__of__suffix_ = (d_6_beginning__of__suffix_) + (1) d_8_flag_ = is__palindrome(d_6_beginning__of__suffix_, s) - d_10_reversed_ = reverse(d_6_beginning__of__suffix_, s) # type : List[int] + d_10_reversed_ : List[int] = reverse(d_6_beginning__of__suffix_, s) result = (s) + (d_10_reversed_) return result # impl-end @@ -112,10 +110,8 @@ def reverse(end : int, str : List[int]) -> List[int]: # post-conditions-end # impl-start - rev = list([int(0)] * 0) # type : List[int] - rev = [] - d_12_i_ = int(0) # type : int - d_12_i_ = 0 + rev : List[int] = [] + d_12_i_ : int = 0 while (d_12_i_) < (end): # invariants-start Invariant(Acc(list_pred(str), 1/2)) diff --git a/Bench/036-fizz_buzz.py b/Bench/036-fizz_buzz.py index 9003f24..dadfa37 100644 --- a/Bench/036-fizz_buzz.py +++ b/Bench/036-fizz_buzz.py @@ -11,10 +11,8 @@ def fizz__buzz(n : int) -> int: # post-conditions-end # impl-start - result = int(0) # type : int - result = 0 - d_1_i_ = int(0) # type : int - d_1_i_ = 0 + result : int = 0 + d_1_i_ : int = 0 while (d_1_i_) < (n): # invariants-start Invariant(((0) <= (d_1_i_)) and ((d_1_i_) <= (n))) @@ -23,8 +21,7 @@ def fizz__buzz(n : int) -> int: Invariant(result == fizz_buzz_fun(d_1_i_)) # invariants-end if (((d_1_i_ % 11)) == (0)) or (((d_1_i_ % 13)) == (0)): - d_4_cnt_ = int(0) # type : int - d_4_cnt_ = count7(d_1_i_) + d_4_cnt_ : int = count7(d_1_i_) result = (result) + (d_4_cnt_) d_1_i_ = (d_1_i_) + (1) return result @@ -57,10 +54,8 @@ def count7(x : int) -> int: # post-conditions-end # impl-start - count = int(0) # type : int - count = 0 - d_6_y_ = int(0) # type : int - d_6_y_ = x + count : int = 0 + d_6_y_ : int = x while (d_6_y_) > (0): # invariants-start Invariant(((0) <= (d_6_y_)) and ((d_6_y_) <= (x))) diff --git a/Bench/052-below-threshold.py b/Bench/052-below-threshold.py index d5df927..bfed2a5 100644 --- a/Bench/052-below-threshold.py +++ b/Bench/052-below-threshold.py @@ -12,10 +12,8 @@ def below__threshold(l : List[int], t : int) -> bool: # post-conditions-end # impl-start - b = False # type : bool - b = True - d_1_i_ = int(0) # type : int - d_1_i_ = 0 + b : bool = True + d_1_i_ : int = 0 while (d_1_i_) < (len(l)): # invariants-start Invariant(Acc(list_pred(l))) diff --git a/Bench/072-will_it_fly.py b/Bench/072-will_it_fly.py index 8e05bdd..63854c9 100644 --- a/Bench/072-will_it_fly.py +++ b/Bench/072-will_it_fly.py @@ -12,12 +12,9 @@ def will__it__fly(s : List[int], w : int) -> bool: # post-conditions-end # impl-start - result = False # type : bool - result = True - d_0_i_ = int(0) # type : int - d_0_i_ = 0 - d_1_j_ = int(0) # type : int - d_1_j_ = (len(s)) - (1) + result : bool = True + d_0_i_ : int = 0 + d_1_j_ : int = (len(s)) - (1) while (d_0_i_) < (d_1_j_): # invariants-start Invariant(Acc(list_pred(s))) @@ -32,8 +29,7 @@ def will__it__fly(s : List[int], w : int) -> bool: return result d_0_i_ = (d_0_i_) + (1) d_1_j_ = (d_1_j_) - (1) - d_3_total_ = int(0) # type : int - d_3_total_ = 0 + d_3_total_ : int = 0 d_0_i_ = 0 while (d_0_i_) < (len(s)): # invariants-start diff --git a/Bench/118-get_closest_vowel.py b/Bench/118-get_closest_vowel.py index 771efc0..e449299 100644 --- a/Bench/118-get_closest_vowel.py +++ b/Bench/118-get_closest_vowel.py @@ -31,12 +31,11 @@ def get__closest__vowel(word : List[int]) -> List[int]: # post-conditions-end # impl-start - result = list([int(0)] * 0) # type : List[int] + result : List[int] = list([int(0)] * 0) if (len(word)) < (3): result = [] return result - d_5_i_ = int(0) # type : int - d_5_i_ = (len(word)) - (2) + d_5_i_ : int = (len(word)) - (2) while (d_5_i_) > (0): # invariants-start Invariant(Acc(list_pred(word)))