Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Exam (elaborations)

Assign_3 University of Florida CIS 4930

Rating
-
Sold
-
Pages
2
Grade
A+
Uploaded on
09-04-2023
Written in
2022/2023

CIS 4930/6930: Programs, Functions, Strange Loops, and Consciousness Programs and Functions Assignment 3 1. (5 pts.) If f = [while p do g], which one of the following, according to the Iteration Recursion Lemma (IRL), is functionally equivalent to [while p do g]? Circle ONE only. a. [if p then f;g end_if] b. [if p then gof end_if] c. [if p then g else f end_if_else] d. [if p then f else g end_if_else] e. [if p then g end_if] f. [if p then f end_if; g] g. [if p then g;f end_if] h. [if p then f end_if] i. (none of the above) 2. (14 pts.) Match each assertion of functional correctness below to the appropriate Correctness Condition(s) among the following. (Note: Correctness Condition(s) may be appropriate for none, one, or more than one assertion.) A. (f = gohok) E. term(f,S), pog  (f = g), ¬(pog)  (f = fog) B. p  (f = g), ¬p  (f = h) F. term(f,S), p  (f = fog) ¬p  (f = I) C. (f = kohog) G. term(f,S), gop  (f = g), ¬(gop)  (f = gof) D. p  (f = g), ¬p  (f = I) H. term(f,S), p  (f = gof) ¬p  (f = I) __E__ a. f = [S] where S = repeat g until p _D___ b. f = [if p then g] _C___ c. f = [g;h;k] __E__ d. f = [S] where S = g; if ¬p then repeat g until p end_if _B___ e. f = [if p then g else h] __E__ f. f = [S] where S = g; while ¬p do g __F__ g. f = [S] where S = if p then g; while p do g end_if 3. (12 pts.) Determine (but do not formally verify) the function of the following program: x := y-2 while x5 do x := x-1 end_while Give your answer in the simplified form: (p  x,y := ?,?) where p is a Boolean predicate which specifies the domain of the program function. (Hint: Use heuristics to identify the function of the while loop and then use the Axiom of Replacement and function composition to determine the program function.) loop will only terminate if y=7, will always finalize with x = 5, y = y program function: (y≥7  x,y := 5,y) 4. Suppose that you wish to prove t

Show more Read less
Institution
Course

Content preview

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

1. (5 pts.) If f = [while p do g], which one of the following, according to the Iteration
Recursion Lemma (IRL), is functionally equivalent to [while p do g]? Circle ONE only.

a. [if p then f;g end_if] b. [if p then g o f end_if] c. [if p then g else f end_if_else]
d. [if p then f else g end_if_else] e. [if p then g end_if] f. [if p then f end_if; g]
g. [if p then g;f end_if] h. [if p then f end_if] i. (none of the above)


2. (14 pts.) Match each assertion of functional correctness below to the appropriate
Correctness Condition(s) among the following. (Note: Correctness Condition(s) may be
appropriate for none, one, or more than one assertion.)
A. (f = gohok) E. term(f,S), pog  (f = g), ¬(pog)  (f = fog)
B. p  (f = g), ¬p  (f = h) F. term(f,S), p  (f = fog) ¬p  (f = I)
C. (f = kohog) G. term(f,S), gop  (f = g), ¬(gop)  (f = gof)
D. p  (f = g), ¬p  (f = I) H. term(f,S), p  (f = gof) ¬p  (f = I)

__E__ a. f = [S] where S = repeat g until p
_D___ b. f = [if p then g]
_C___ c. f = [g;h;k]
__E__ d. f = [S] where S = g; if ¬p then repeat g until p end_if
_B___ e. f = [if p then g else h]
__E__ f. f = [S] where S = g; while ¬p do g
__F__ g. f = [S] where S = if p then g; while p do g end_if


3. (12 pts.) Determine (but do not formally verify) the function of the following program:
x := y-2
while x<>5 do
x := x-1
end_while

Give your answer in the simplified form: (p  x,y := ?,?) where p is a Boolean
predicate which specifies the domain of the program function. (Hint: Use heuristics to
identify the function of the while loop and then use the Axiom of Replacement and
function composition to determine the program function.)
loop will only terminate if y>=7, will always finalize with x = 5, y = y
program function: (y≥7  x,y := 5,y)
4. Suppose that you wish to prove that the program, M, below computes the given

This study source was downloaded by 100000850872992 from CourseHero.com on 04-09-2023 01:26:21 GMT -05:00


https://www.coursehero.com/file/128211843/Assign-3docx/

Written for

Course

Document information

Uploaded on
April 9, 2023
Number of pages
2
Written in
2022/2023
Type
Exam (elaborations)
Contains
Questions & answers

Subjects

$8.49
Get access to the full document:

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Get to know the seller

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
beckyfawcet Rasmussen College
Follow You need to be logged in order to follow users or courses
Sold
125
Member since
4 year
Number of followers
19
Documents
599
Last sold
13 hours ago
GradesBooster

Verified eBooks available for a Quick and Easy Download at Affordable rates I OFFER: -Study Guides -eBooks -ATI Test Prep, Assignments -WGU Papers, \"Task\" Assignments (Complete RN BSN Curriculum), Rubric &amp; Task Info for Each Course -HCI College Nursing Associates Program -NCLEX Prep *ALL WORK HAS PASSED WITHOUT NEEDING REVISIONS AND BY THE RUBRIC.

4.2

27 reviews

5
18
4
3
3
2
2
1
1
3

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions