From 0559cf68016f624cfe38f40cb4a7b213943d81ad Mon Sep 17 00:00:00 2001 From: alex28sh Date: Thu, 22 Aug 2024 17:42:06 +0200 Subject: [PATCH] fix: enumerating all files? --- .github/workflows/test-new.yml | 3 +- WIP: 154-cycpattern_check.py | 99 ---------------------------------- 2 files changed, 2 insertions(+), 100 deletions(-) delete mode 100644 WIP: 154-cycpattern_check.py diff --git a/.github/workflows/test-new.yml b/.github/workflows/test-new.yml index 6e126bb..35cc851 100644 --- a/.github/workflows/test-new.yml +++ b/.github/workflows/test-new.yml @@ -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 \ No newline at end of file diff --git a/WIP: 154-cycpattern_check.py b/WIP: 154-cycpattern_check.py deleted file mode 100644 index 8387dc6..0000000 --- a/WIP: 154-cycpattern_check.py +++ /dev/null @@ -1,99 +0,0 @@ -from typing import List -from nagini_contracts.contracts import * - -@Pure -def IsSubstring(s : List[int], sub : List[int], n : int) -> bool : - Requires(Acc(list_pred(s))) - Requires(Acc(list_pred(sub))) - return ((len(s)) >= (len(sub))) and (Exists(int, lambda d_0_i_: - (((0) <= (d_0_i_)) and ((d_0_i_) < 1 + ((len(s)) - (len(sub))))) and ( - Forall(int, lambda y: (Implies(y >= 0 and y < len(sub), sub[(n + y) % len(sub)] == s[d_0_i_ + y]), [[sub[(n + y) % len(sub)] == s[d_0_i_ + y]]]))))) - -# def IsSubstringFunc(s : List[int], sub : List[int], n : int) -> bool : -# Requires(Acc(list_pred(s))) -# Requires(Acc(list_pred(sub))) -# Ensures(Acc(list_pred(s))) -# Ensures(Acc(list_pred(sub))) -# Ensures(Implies(Result(), len(s) >= len(sub))) -# # Ensures(Result() == (((len(s)) >= (len(sub))) and (Exists(int, lambda d_0_i_: -# # (((0) <= (d_0_i_)) and ((d_0_i_) < 1 + ((len(s)) - (len(sub))))) and ( -# # Forall(int, lambda y: (Implies(y >= 0 and y < len(sub), sub[(n + y) % len(sub)] == s[d_0_i_ + y]), [[sub[(n + y) % len(sub)] == s[d_0_i_ + y]]]))))))) - -# if (len(s) < len(sub)): -# return False - -# i = 0 # type : int -# while i <= len(s) - len(sub): -# Invariant(Acc(list_pred(s), 1/2)) -# Invariant(Acc(list_pred(sub), 1/2)) -# Invariant(((0) <= (i)) and ((i) <= 1 + ((len(s)) - (len(sub))))) -# Invariant(len(s) >= len(sub)) -# # Invariant(Forall(int, lambda d_0_i: -# # (Implies(d_0_i >= 0 and d_0_i < i, -# # Exists(int, lambda y: y >= 0 and y < len(sub) and sub[(n + y) % len(sub)] != s[d_0_i + y])), -# # [[Exists(int, lambda y: y >= 0 and y < len(sub) and sub[(n + y) % len(sub)] != s[d_0_i + y])]]))) - -# Assume(Forall(int, lambda d_0_i: -# (Implies(d_0_i >= 0 and d_0_i < i, -# Exists(int, lambda y: y >= 0 and y < len(sub) and sub[(n + y) % len(sub)] != s[d_0_i + y])), -# [[Exists(int, lambda y: y >= 0 and y < len(sub) and sub[(n + y) % len(sub)] != s[d_0_i + y])]]))) -# j = 0 # type : int -# fl = True # type : bool -# Assert(Forall(int, lambda d_0_i: -# (Implies(d_0_i >= 0 and d_0_i < i, -# Exists(int, lambda y: y >= 0 and y < len(sub) and sub[(n + y) % len(sub)] != s[d_0_i + y])), -# [[Exists(int, lambda y: y >= 0 and y < len(sub) and sub[(n + y) % len(sub)] != s[d_0_i + y])]]))) -# while j < len(sub): -# Invariant(Acc(list_pred(s), 1/2)) -# Invariant(Acc(list_pred(sub), 1/2)) -# Invariant(((0) <= (j)) and ((j) <= (len(sub)))) -# Invariant(((0) <= (i)) and ((i) <= ((len(s)) - (len(sub))))) -# Invariant(len(s) >= len(sub)) -# Invariant(fl) -# Invariant(Forall(int, lambda d_0_i: -# (Implies(d_0_i >= 0 and d_0_i < i, -# Exists(int, lambda y: y >= 0 and y < len(sub) and sub[(n + y) % len(sub)] != s[d_0_i + y])), -# [[Exists(int, lambda y: y >= 0 and y < len(sub) and sub[(n + y) % len(sub)] != s[d_0_i + y])]]))) -# Invariant(Implies(fl, Forall(int, lambda y: (Implies(y >= 0 and y < j, sub[(n + y) % len(sub)] == s[i + y]), [[sub[(n + y) % len(sub)] == s[i + y]]])))) -# if sub[(n + j) % len(sub)] != s[i + j]: -# fl = False -# Assert(fl == (j == len(sub))) -# break -# j = j + 1 - -# Assert(fl == (j == len(sub))) -# if j == len(sub): -# Assert(IsSubstring(s, sub, n)) -# return True -# Assert(Exists(int, lambda y: y >= 0 and y < len(sub) and sub[(n + y) % len(sub)] != s[i + y])) -# Assert(Forall(int, lambda d_0_i: -# (Implies(d_0_i >= 0 and d_0_i <= i, -# Exists(int, lambda y: y >= 0 and y < len(sub) and sub[(n + y) % len(sub)] != s[d_0_i + y])), -# [[Exists(int, lambda y: y >= 0 and y < len(sub) and sub[(n + y) % len(sub)] != s[d_0_i + y])]]))) -# i = i + 1 -# return False - -# def CycpatternCheck(word : List[int], pattern : List[int]) -> bool: -# Requires(Acc(list_pred(word))) -# Requires(Acc(list_pred(pattern))) -# Ensures(Acc(list_pred(word))) -# Ensures(Acc(list_pred(pattern))) -# Ensures(not (Result()) or (Exists(int, lambda d_1_i_: -# (((0) <= (d_1_i_)) and ((d_1_i_) <= (len(pattern)))) and (IsSubstring(word, pattern, d_1_i_))))) -# Ensures(not (not(Result())) or (Forall(int, lambda d_2_i_: -# not (((0) <= (d_2_i_)) and ((d_2_i_) <= (len(pattern)))) or (not(IsSubstring(word, pattern, d_2_i_)))))) -# result = False # type : bool -# d_3_i_ = int(0) # type : int -# d_3_i_ = 0 -# while (d_3_i_) <= (len(pattern)): -# Invariant(Acc(list_pred(word))) -# Invariant(Acc(list_pred(pattern))) -# Invariant(((0) <= (d_3_i_)) and ((d_3_i_) <= ((len(pattern)) + (1)))) -# Invariant(Forall(int, lambda d_4_j_: -# (Implies(((0) <= (d_4_j_)) and ((d_4_j_) < (d_3_i_)), not(IsSubstring(word, pattern, d_4_j_))), [[IsSubstring(word, pattern, d_4_j_)]]))) -# if IsSubstring(word, pattern, d_3_i_): -# result = True -# return result -# d_3_i_ = (d_3_i_) + (1) -# result = False -# return result \ No newline at end of file