Geschreven door studenten die geslaagd zijn Direct beschikbaar na je betaling Online lezen of als PDF Verkeerd document? Gratis ruilen 4,6 TrustPilot
logo-home
Tentamen (uitwerkingen)

Assign_2_SOLN University of Florida CEN 6070

Beoordeling
-
Verkocht
-
Pagina's
3
Cijfer
A+
Geüpload op
08-04-2023
Geschreven in
2022/2023

CIS 4930/6930: Programs, Functions, Strange Loops, and Consciousness Programs and Functions Assignment 2 1. (4 pts.) Which one of the following statements best captures the precise meaning of the strong correctness predicate, "{P} S {Q} strongly"? (Circle ONE only.) a. P must hold before S executes and Q must hold if S terminates. b. {P} S {Q} is true unless Q could be false if S terminates. c. If P holds before executing S, S must terminate in state Q. d. If P holds before executing S, {P} S {Q} is true unless S could terminate with Q being false. e. {P} S {Q} is true unless Q is always false when S terminates, given that P held before executing S. 2. (9 pts.) Consider the hypothesized invariant: for the assertion: Which of the following correctly identifies which of the while_do statement ROI antecedents would hold when attempting to prove this assertion using the given hypothesized invariant? (Circle ONE only.) a. initialization only (6 pts.) e. initialization and finalization only (9 pts.) b. preservation only (0 pts.) f. initialization and preservation only (3 pts.) c. finalization only (6 pts.) g. initialization, preservation, and finalization (6 pts.) d. preservation and finalization only (3 pts.) h. none of the antecedents would hold (3 pts.) Partial credit points are indicated red for each alternative to the correct answer, e. As stated in class, the given hypothesized invariant means: “Sum is equal to the sum of the first J elements of array X – i.e., X[1

Meer zien Lees minder
Instelling
Vak

Voorbeeld van de inhoud

CIS 4930/6930: Programs, Functions, Strange Loops, and
Consciousness
Programs and Functions Assignment 2

1. (4 pts.) Which one of the following statements best captures the precise meaning
of the strong correctness predicate, "{P} S {Q} strongly"? (Circle ONE only.)

a. P must hold before S executes and Q must hold if S terminates.

b. {P} S {Q} is true unless Q could be false if S terminates.

c. If P holds before executing S, S must terminate in state Q.

d. If P holds before executing S, {P} S {Q} is true unless S could terminate with
Q being false.

e. {P} S {Q} is true unless Q is always false when S terminates, given that P
held before executing S.


2. (9 pts.) Consider the hypothesized invariant:
for the assertion:




Which of the following correctly identifies which of the while_do statement ROI
antecedents would hold when attempting to prove this assertion using the given
hypothesized invariant? (Circle ONE only.)

a. initialization only (6 pts.) e. initialization and finalization only (9 pts.)

b. preservation only (0 pts.) f. initialization and preservation only (3 pts.)

c. finalization only (6 pts.) g. initialization, preservation, and finalization (6 pts.)

d. preservation and finalization only (3 pts.) h. none of the antecedents would hold (3 pts.)

Partial credit points are indicated red for each alternative to the correct answer, e. As stated in
class, the given hypothesized invariant means: “Sum is equal to the sum of the first J elements
of array X – i.e., X[1]+X[2]+…+X[J]”. Therefore, the sum of the first 0 elements (=no elements)
is 0.


This study source was downloaded by 100000850872992 from CourseHero.com on 04-08-2023 16:31:14 GMT -05:00


https://www.coursehero.com/file/122497716/Assign-2-SOLNdocx/

Geschreven voor

Vak

Documentinformatie

Geüpload op
8 april 2023
Aantal pagina's
3
Geschreven in
2022/2023
Type
Tentamen (uitwerkingen)
Bevat
Vragen en antwoorden

Onderwerpen

$10.49
Krijg toegang tot het volledige document:

Verkeerd document? Gratis ruilen Binnen 14 dagen na aankoop en voor het downloaden kun je een ander document kiezen. Je kunt het bedrag gewoon opnieuw besteden.
Geschreven door studenten die geslaagd zijn
Direct beschikbaar na je betaling
Online lezen of als PDF

Maak kennis met de verkoper

Seller avatar
De reputatie van een verkoper is gebaseerd op het aantal documenten dat iemand tegen betaling verkocht heeft en de beoordelingen die voor die items ontvangen zijn. Er zijn drie niveau’s te onderscheiden: brons, zilver en goud. Hoe beter de reputatie, hoe meer de kwaliteit van zijn of haar werk te vertrouwen is.
ExamsConnoisseur Self
Volgen Je moet ingelogd zijn om studenten of vakken te kunnen volgen
Verkocht
587
Lid sinds
3 jaar
Aantal volgers
344
Documenten
1492
Laatst verkocht
3 weken geleden

4.2

68 beoordelingen

5
40
4
11
3
13
2
1
1
3

Recent door jou bekeken

Waarom studenten kiezen voor Stuvia

Gemaakt door medestudenten, geverifieerd door reviews

Kwaliteit die je kunt vertrouwen: geschreven door studenten die slaagden en beoordeeld door anderen die dit document gebruikten.

Niet tevreden? Kies een ander document

Geen zorgen! Je kunt voor hetzelfde geld direct een ander document kiezen dat beter past bij wat je zoekt.

Betaal zoals je wilt, start meteen met leren

Geen abonnement, geen verplichtingen. Betaal zoals je gewend bent via iDeal of creditcard en download je PDF-document meteen.

Student with book image

“Gekocht, gedownload en geslaagd. Zo makkelijk kan het dus zijn.”

Alisha Student

Bezig met je bronvermelding?

Maak nauwkeurige citaten in APA, MLA en Harvard met onze gratis bronnengenerator.

Bezig met je bronvermelding?

Veelgestelde vragen