Escrito por estudiantes que aprobaron Inmediatamente disponible después del pago Leer en línea o como PDF ¿Documento equivocado? Cámbialo gratis 4,6 TrustPilot
logo-home
Examen

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

Puntuación
-
Vendido
-
Páginas
3
Grado
A+
Subido en
23-04-2023
Escrito en
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.) 3. (12 pts.) Circle either “valid” or “invalid” for each of the following hypothesized Rules of Inference. {true} if b then S {Q} valid invalid {P} while b do S {Q} (¬b)  Q B valid {P} while b do S {Q} strongly {true} S {I}, (I Л b)  Q valid invalid {P} repeat S until b {Q} P  (wp(S, Q) Л K) valid invalid {P} S {Q} 4. (9 pts.) Circle either “true” or “false” for each of the following assertions. (Hint: “I is a loop invariant”  I satisfies initialization and preservation; “I is a Q- 2 adequate loop invariant”  I is a loop invariant that (also) satisfies finalization.) a. Z=XJ is a loop invariant for the assertion: true false {Z=0 Л J=0} while JY do Z := Z+X; J := J+1 end_while {Z=XY} b. Z=XJ Л J≤Y is a Q-adequate loop invariant for true false the assertion given in part (a) above. c. {P} repeat S until b {Q}  {P} true false S; while NOT b do S end_while {Q} 3

Mostrar más Leer menos
Institución
CIS 4930/6930: Programs, Functions, Strange Loops,
Grado
CIS 4930/6930: Programs, Functions, Strange Loops,








Ups! No podemos cargar tu documento ahora. Inténtalo de nuevo o contacta con soporte.

Escuela, estudio y materia

Institución
CIS 4930/6930: Programs, Functions, Strange Loops,
Grado
CIS 4930/6930: Programs, Functions, Strange Loops,

Información del documento

Subido en
23 de abril de 2023
Número de páginas
3
Escrito en
2022/2023
Tipo
Examen
Contiene
Preguntas y respuestas

Temas

$10.49
Accede al documento completo:

¿Documento equivocado? Cámbialo gratis Dentro de los 14 días posteriores a la compra y antes de descargarlo, puedes elegir otro documento. Puedes gastar el importe de nuevo.
Escrito por estudiantes que aprobaron
Inmediatamente disponible después del pago
Leer en línea o como PDF

Conoce al vendedor

Seller avatar
Los indicadores de reputación están sujetos a la cantidad de artículos vendidos por una tarifa y las reseñas que ha recibido por esos documentos. Hay tres niveles: Bronce, Plata y Oro. Cuanto mayor reputación, más podrás confiar en la calidad del trabajo del vendedor.
AllAcademic Other
Ver perfil
Seguir Necesitas iniciar sesión para seguir a otros usuarios o asignaturas
Vendido
67
Miembro desde
6 año
Número de seguidores
39
Documentos
548
Última venta
1 mes hace
All the academic resources you need.

All the academic resources you need.

3.7

7 reseñas

5
3
4
1
3
2
2
0
1
1

Por qué los estudiantes eligen Stuvia

Creado por compañeros estudiantes, verificado por reseñas

Calidad en la que puedes confiar: escrito por estudiantes que aprobaron y evaluado por otros que han usado estos resúmenes.

¿No estás satisfecho? Elige otro documento

¡No te preocupes! Puedes elegir directamente otro documento que se ajuste mejor a lo que buscas.

Paga como quieras, empieza a estudiar al instante

Sin suscripción, sin compromisos. Paga como estés acostumbrado con tarjeta de crédito y descarga tu documento PDF inmediatamente.

Student with book image

“Comprado, descargado y aprobado. Así de fácil puede ser.”

Alisha Student

Preguntas frecuentes