Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

6. 7. 8. Use quantified predicates to express the following sentences. The sum of two negative integers will always be negative. For each positive

image

6. 7. 8. Use quantified predicates to express the following sentences. The sum of two negative integers will always be negative. For each positive integer, there doesn't exist any negative integer that has the same value as it. For any two integers, there is always another integer equals to their (the first two integers') product. a. b. C. Negate each predicate you created in question 6, then simplify them to remove the negation operators. While simplifying, clarify which logic rule(s) you use in each step. For each sub-question, please answer the following questions. Is state a proper for proposition / predicate e? If no, explain why; if yes, does o satisfy e? a. o = {p = T}, e = (r p) ^ (r p) b. T= = {p = F, q = T}, o = TU {r = F}, e=p^q C. 0 = = {b = 5, i = 0, x = 6}, e = x > b[i] d. o = {x = 5, b = (5,8)}, e = x + 1 = b[0] o = {p = T, b = a}, where a = (2,0, 4), e = p b[b[1]] = 2 JU e. 9. Find all states o (containing only bindings for p, q and r) such that o = p q r. Briefly explain each state you found. 10. Define predicate functions. a. Define predicate function isGreater (b, m, x) which returns True if and only if positive m is not larger than the length of array b, and integer x is greater than each of the first m numbers in b. For example, under state o = : {b = (2, 4, 1, 6)}, isGreater (b, 3, 5) returns True, isGreater (b, 3, 4) returns False. Remind that, you can use size (b) to find the length of array b. b. Define predicate function hasGreater (a, b) which returns True if and only if every integer in array a is greater than some integer in array b. For example, has Greater ((4, 5, 2, 3), (8, 1, 5, 8)) returns True.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Prealgebra

Authors: Elayn Martin Gay

7th edition

321955048, 978-0321955043

More Books

Students also viewed these Algorithms questions