diff --git a/Bench/000-has-close-elements.py b/Bench/000-has-close-elements.py index 7970ab7..1da5b1a 100644 --- a/Bench/000-has-close-elements.py +++ b/Bench/000-has-close-elements.py @@ -34,7 +34,6 @@ def has_close_elements(numbers: List[int], threshold: int) -> bool: Ensures(Implies(Result() != True, Forall(range(len(numbers)), lambda x : fn(x, numbers, threshold) ))) - flag = False i = 0 diff --git a/WIP/096-count_up_to.py b/WIP/096-count_up_to.py index 25fe389..f79705d 100644 --- a/WIP/096-count_up_to.py +++ b/WIP/096-count_up_to.py @@ -9,6 +9,8 @@ def IsPrime(n : int) -> bool : def CountUpTo(n : int) -> List[int]: Requires((n) >= (0)) Ensures(Acc(list_pred(Result()))) + + Ensures(Forall(int, lambda d_2_i_: not (((0) <= (d_2_i_)) and ((d_2_i_) < (len(Result())))) or (((Result())[d_2_i_]) < (n)))) # Ensures(Forall(int, lambda d_1_i_: diff --git a/public/scripts/test-new.sh b/public/scripts/test-new.sh index a06e59e..7efffed 100644 --- a/public/scripts/test-new.sh +++ b/public/scripts/test-new.sh @@ -1,25 +1,33 @@ #!/bin/bash set -eou pipefail +DIRECTORY="./Bench" # You can change this to your specific directory + # Timeout duration in seconds TIMEOUT_DURATION=600 file_count=0 echo "New files found:" for f in $1; do - if [[ $f == *.dfy ]]; then - echo $f - file_count=$((file_count+1)) + # Check if the file is in the known directory + if [[ $f == $directory/* ]]; then + if [[ $f == *.py and $f == $directory/*]]; then + echo $f + file_count=$((file_count+1)) + fi fi done echo "Staring the check" for f in $1 do - if [[ $f == *.dfy ]]; then - file_no=$((file_no+1)) - echo "Running dafny on $(basename "$f") ($file_no/$file_count)" - timeout "$TIMEOUT_DURATION" nagini "$file" + # Check if the file is in the known directory + if [[ $f == $directory/* ]]; then + if [[ $f == *.py ]]; then + file_no=$((file_no+1)) + echo "Running dafny on $(basename "$f") ($file_no/$file_count)" + timeout "$TIMEOUT_DURATION" nagini "$file" + fi fi done