Question: Using the csg predicate of our running example, write expressions that assert the following. 1. C. Brown is an A student (i.e., he gets As

Using the csg predicate of our running example, write expressions that assert the following.

1. C. Brown is an A student (i.e., he gets As in all his courses).

2. C. Brown is not an A student.

Using the csg predicate of our running example, write expressions that assert

use example 3

Logical Expressions Example 3 Suppose that we have predicates csg and snap, which we interpret as the relations Course-Student-Grade and Student-Name-Address Phone. Suppose also that we want to find the grade of the student named "C. Brown" in course CS101. We could assert the logical expression csg("CS101", S, G) AND snap(S, "C.Brown, A, P) + answer(G) (1) Here, answer is another predicate, intended to be true of a grade Gif G is the grade of some student named "C. Brown" in CS101. When we "assert" an expression, we mean that its value is TRUE no matter what values we substitute for its variables. Informally, an expression such as (1) can be interpreted as follows. If we substitute a constant for each of the variables, then each of the atomic formulas becomes a ground atomic formula. We can decide whether a ground atomic formula is true or false by referring either to the "real world," or by looking it up in a relation that lists the true ground atomic formulas with a given predicate. When we substitute 0 or 1 for each of the ground atomic formulas, we can evaluate the expression itself, just as we did for propositional logic expressions. In the case of expression (1), we can take the tuples to be true. In particular, 1 csg("CS101",12345, A) and snap(12345, "C. Brown, 12 Apple St.", 4555-1234") are true. Then we can let S=12345 G= "A" A= "12 AppleSt." P= "555 1234" That makes the left side of (1) become 1 AND 1, which has the value 1, of course. In principle, we don't know anything about the predicate answer. However, we asserted the expression, which means that what- ever values we substitute for its variables, its value is TRUE. Since its left side is made TRUE by the above substitution, the right side cannot be FALSE. Thus we deduce that answer("A") is true

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!