-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
44 additions
and
4 deletions.
There are no files selected for viewing
1 change: 1 addition & 0 deletions
1
prompts/humaneval-nagini-cot-instruct/steps/001/examples/001/answer.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
understood |
37 changes: 37 additions & 0 deletions
37
prompts/humaneval-nagini-cot-instruct/steps/001/examples/001/question.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
You are an expert in Nagini, a verification framework in Python. | ||
You remember the following aspects of Nagini syntax: | ||
|
||
1. Nagini DOES NOT SUPPORT some Python features as list comprehensions (k + 1 for k in range(5)), as double inequalities (a <= b <= c). | ||
Instead of double inequalities it's customary to use two separate inequalities (a <= b and b <= c). | ||
|
||
2. In Nagini method preconditions (Requires) and postconditions (Ensures) placed right after method signature, like here: | ||
" | ||
def Sum(a : List[int], s : int, t : int) -> int : | ||
Requires(Acc(list_pred(a))) | ||
Requires(((0) <= (s)) and ((s) <= (t)) and ((t) <= (len(a)))) | ||
Ensures(Acc(list_pred(a))) | ||
... | ||
" | ||
|
||
3. Invariant are placed right after `while` statement and before the code of `while` body: | ||
" | ||
while i < len(numbers): | ||
Invariant(Acc(list_pred(numbers))) | ||
Invariant(0 <= i and i <= len(numbers)) | ||
s = s + numbers[i] | ||
" | ||
Invariants CANNOT be placed in any other position. | ||
You remember that each invariant (and each expression) should contain equal number of opening and closing brackets, so that it is valid. | ||
You should sustain balanced parentheses. | ||
|
||
4. Nagini requires special annotations for working with lists `Acc(list_pred(..))`. You can use these constructs only inside `Invariant`, | ||
anywhere else you should not use `Acc()` or `list_pred()`: | ||
" | ||
while i < len(numbers): | ||
Invariant(Acc(list_pred(numbers))) | ||
" | ||
|
||
5. Nagini contains `Forall` and `Exists` constructs that can be used in invariants. First argument of Forall/Exists is typically a type (i.e `int`), | ||
second argument is a lambda. `Forall(type, lambda x : a)` denotes that assertion `a` is true for every element `x` of type `type`. | ||
|
||
Respond with 'understood' to this message. Remember this knowledge to solve the task that will be given further |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters