Dafny is a programming language with a program verifier. As you type in your program, the verifier constantly looks over your shoulders and flags any errors. Documentation and Github.
Build formal specifications and checks in Dafny for Limited Stack structure.
Constructor must instantiate an empty stack from the maximum stack size information.
- Add an element at the top of the stack and return true, if added, or false, if the stack is already full
- Remove an element from the top of the stack, if it is not empty.
- Read the top value of the stack, without removing it.
- Check whether the stack is full or not, returning true or false.
- Check whether the stack is empty or not, returning true or false. Inform the number of elements stored in the pile
- Inform the maximum pile size • Reverse the order of the pile elements.