Home

About

Advanced Search

Browse by Discipline

Scientific Societies

E-print Alerts

Add E-prints

E-print Network
FAQHELPSITE MAPCONTACT US


  Advanced Search  

 
2 Lehrstuhl fr Informatik 2 Modellierung und Verifikation von Software
 

Summary: 2 Lehrstuhl für Informatik 2
Modellierung und Verifikation von Software
Semantics and Verification of Software WS2011/12
Exercise 6 (Hand in until 13.12.2011)
aaAOR Priv.-Doz. Dr. Thomas Noll Christina Jansen, Sabrina von Styp
Exercise 1 (Assertions): (1+1 Points)
a) Give an assertion (k = gcd(i, j)) =: A Assn with logical variables i, j, k LV ar, expressing that k is the
greatest common divisor of i and j, i.e. k = gcd(i, j).
b) The Smarandache-function µ(i) is defined as the smallest positive integer number satisfying i | (µ(i)!). Give
an assertion A Assn with logical variables i, k LV ar, expressing that k = µ(i).
Exercise 2 (Greatest Common Divisor): (3+4 Points)
a) Show that the greatest common divisor of two positive integers i, j Z, denoted by gcd(i, j), has the
following properties:
a) i > j gcd(i, j) = gcd(i - j, j),
b) gcd(i, j) = gcd(j, i), and
c) gcd(i, i) = i.
b) Using the Hoare rules, prove that the statement c Cmd given by
while ¬(x = y) do if x y then y := y - x else x := x - y,
satisfies the following partial correctness property:
{x = i y = j i 1 j 1} c {x = gcd(x, y) = gcd(i, j)}.

  

Source: Ábrahám, Erika - Fachgruppe Informatik, Rheinisch Westfälische Technische Hochschule Aachen (RWTH)

 

Collections: Computer Technologies and Information Sciences