Skip to content

Commit

Permalink
Merge pull request #117 from JstnMcBrd/dafny
Browse files Browse the repository at this point in the history
Add Dafny implementation
  • Loading branch information
mawerty authored Jan 11, 2024
2 parents cfb5808 + dc537ab commit 683aa57
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ C++
C#
CSS
CUDA
Dafny
Dart
Elixir
Elm
Expand Down
11 changes: 11 additions & 0 deletions implementations/main.dfy
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
predicate is_prime(number: int)
{
false
}

// Because Dafny is a formal verification language, assertions to prove correctness
// are necessary for the program to have any meaning.
method {:test} test()
{
assert forall n :: n in [4, 6, 8, 9, 10] ==> !is_prime(n);
}
2 changes: 2 additions & 0 deletions optimized_implementations/main.dfy
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
predicate is_prime(n:int){false}
method{:test}test(){assert forall n::n in [4,6,8,9,10] ==> !is_prime(n);}

0 comments on commit 683aa57

Please sign in to comment.