0% found this document useful (0 votes)
4 views

hw2

This document outlines the submission guidelines for Assignment 2, specifying that reports must be submitted as a single PDF file and will undergo a similarity check. It includes two questions: the first requires an example of a lemma in Dafny with detailed calculations, and the second asks for an explanation of loop invariants using an array example, including preconditions and postconditions. Full code for both questions must be included in the document.

Uploaded by

esraecrin9747
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views

hw2

This document outlines the submission guidelines for Assignment 2, specifying that reports must be submitted as a single PDF file and will undergo a similarity check. It includes two questions: the first requires an example of a lemma in Dafny with detailed calculations, and the second asks for an explanation of loop invariants using an array example, including preconditions and postconditions. Full code for both questions must be included in the document.

Uploaded by

esraecrin9747
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Assignment 2

●​ Assignments should be submitted in electronic format. Please upload your report as a


single PDF file, using the naming format (number_name.pdf). Do not upload any
source code or additional materials.
●​ Please be aware that all homework will undergo a similarity check. Avoid sharing your
work with others, and do not use examples from class.

QUESTIONS:

1- Write an example of a lemma in Dafny, test it to ensure it works, and use calculation (calc)
blocks to detail the steps. Provide a brief explanation of each step in your answer. At the end of
the answer, include your full code within the document.

2- Introduce the concept of loop invariants. Illustrate this using an example that operates on
arrays. Describe your preconditions and postconditions. At the end of the answer, include your
full code within the document.

You might also like