Skip to content

Commit

Permalink
checks
Browse files Browse the repository at this point in the history
  • Loading branch information
alex28sh committed Aug 21, 2024
1 parent 08e9b20 commit 651f4f2
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 8 deletions.
1 change: 0 additions & 1 deletion Bench/000-has-close-elements.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions WIP/096-count_up_to.py
Original file line number Diff line number Diff line change
Expand Up @@ -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_:
Expand Down
22 changes: 15 additions & 7 deletions public/scripts/test-new.sh
Original file line number Diff line number Diff line change
@@ -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

Expand Down

0 comments on commit 651f4f2

Please sign in to comment.