DD2452
    Homework 2
    Skip to content
    Dashboard
    • Login
    • Dashboard
    • Calendar
    • Inbox
    • Help
    Close
    • Min översikt
    • DD2452
    • Assignments
    • Homework 2
    • Home
    • Assignments
    • Pages
    • Files
    • Syllabus
    • Modules
    • Collaborations
    • Media Gallery
    • Video Recording

    Homework 2

    • Due 12 Sep 2018 by 15:15
    • Points 2
    • Submitting on paper

    Consider the following program with annotated while loop:

    y = 0;
    {x ≥ 0 ∧ x + y = x0}
    while (x > 0) {
       x = x - 1;
       y = y + 1
    }

    and the contract:

    (x ≥ 0 ∧ x = x0, y = x0)

    Show that the program meets the contract by computing a verification condition. The verification condition should be computed with two techniques (see Lecture 2 slides):

    1. Dilian’s Verification Condition Generator (VC-function)
    2. Weakest Precondition Calculation for the Intermediate Language (wp-function)

    Show clearly all steps in the computation, applying one rule at a time (and indicate which).

    Compare the two resulting formulas.

    1536758100 09/12/2018 03:15pm
    Additional comments:
    Rating max score to > Pts

    Rubric

     
     
     
     
     
     
     
         
    Can't change a rubric once you've started using it.  
    Find a rubric
    Find rubric
    Title
    You've already rated students with this rubric. Any major changes could affect their assessment results.
    Title
    Criteria Ratings Pts
    Edit criterion description Delete criterion row
    This criterion is linked to a learning outcome Description of criterion
    threshold: 5 pts
    Edit rating Delete rating
    5 to >0 Pts
    Full marks
    blank
    Edit rating Delete rating
    0 to >0 Pts
    No marks
    blank_2
    This area will be used by the assessor to leave comments related to this criterion.
    pts
      / 5 pts
    --
    Additional comments
    Total points: 5 out of 5