118k views
1 vote
From each of the following english sttements (1) translate into predicate logic, (2) write the nagation of that statement in predicate logic with the negation symbols pushed as far in as possible so that any neggation symbols are directly in front of a predicate, and then (3) write a natural traslation of (2) to english .

For the logic, let your domain of discourse be programs and values. You should use only the predicates Accepts(x,y) and Returns(x,y) which say that a program z accepts a value y as input or that returns y as output; the predicates Program(x) and Value(2), which say whether is a program or a value (respectively); and the predicates r=y and r y, which say whether I and y are the same object

(a) [6 points) "Hello" is the only value that the program HelloWorld returns.
(b) [6 points) There is a value that is accepted by some program but returned by all programs.
(c) [6 points) Programs that return "Hello" don't accept some value.

User Punchline
by
7.0k points

1 Answer

5 votes

Answer:

Please go through the explanation section.

Step-by-step explanation:

(a) Returns(HelloWorld, Hello)

Negation: ~Returns(HelloWorld, Hello)

English translation of negation: The program HelloWorld does not return the value Hello.

(b) ∃x ∃y ∀z, Accepts(y, x) ^ Returns(z, x)

Negation: ∀x ∀y ∃z, ~Accepts(y, x) v ~Returns(z, x)

English translation of negation: For all values x and all programs y, there exists a program z such that Program y does not accept value x or Program z does not return value x.

(c) ∀x ∃y, Returns(x, Hello) ^ ~Accepts(x, y)

Negation: ∃x ∀y, ~Returns(x, Hello) v Accepts(x, y)

English translation of negation: There exists a program x such that for which all values y, program x does not returns value Hello or program x accepts value y.

User David Kidwell
by
7.1k points

Related questions

asked Nov 11, 2023 226k views
Phym asked Nov 11, 2023
by Phym
8.0k points
1 answer
0 votes
226k views
asked Oct 17, 2021 122k views
Cryptex Technologies asked Oct 17, 2021
by Cryptex Technologies
7.8k points
1 answer
4 votes
122k views
asked Jul 10, 2022 137k views
Aleksikallio asked Jul 10, 2022
by Aleksikallio
8.7k points
1 answer
0 votes
137k views