<< Chapter < Page Chapter >> Page >

You might have objected to the idea of the unary relation yummy , since different people have different tastes.How could you model individuals' tastes? (Hint:Use a binary relation.) )

We can use the binary relation thinksIsYummy : In particular, thinksIsYummy Ian anchovies but thinksIsYummy Phokion anchovies What set are we using, as the domain for this? Really, the domain is the union of people and pizza-toppings.So thinksIsYummy radishes brusselsSprouts is a valid thing to write down; it would be false. Note that if working with such a domain,having unary predicates isVegetable and isPerson would be useful.

Got questions? Get instant answers now!

Modeling actors and the has-starred-with relation didn't include information about specific movies.For instance, it was impossible to write any formula which could capture the notion of three actors all being in the same movie.

Why doesn't hasStarredWith a b hasStarredWith b c hasStarredWith c a capture the notion of a , b , and c all being in the same movie? Prove your answer by giving a counterexample.

The proposed formula asserts that each pair has been in some movie together,but they each could have been different movies without being in the same one simultaneously.As a counterexample, it is true that hasStarredWith Charlie Chaplin Norman Lloyd (as witnessed by Limelight , 1952), hasStarredWith Norman Lloyd Janeane Garofolo (as witnessed by The Adventures of Rocky and Bullwinkle , 2000), and if we generously include archive footage, hasStarredWith Charlie Chaplin Janeane Garofolo (as witnessed by Outlaw Comic: The Censoring of Bill Hicks , 2003); however, they have not all been in a movie together.Might the counterexample you chose become nullified, in the future?

Got questions? Get instant answers now!

How might we make a model which does capture this? What is the domain? What relations do you want?

As always, there are several ways of modeling this problem. We'll outline three.

First, we could augment the hasStarredWith to be a ternary (3-input) relation to include the movie. Like in the yummy extension , the domain would then include both actors and movies, and we'dalso want relations to know which is which.

Second, we could use a bunch of relations. Starting with the familiar binary hasStarredWith , we'd add the ternary hasStarredWith3 , the quaternary hasStarredWith4 , …. Our domain would just be actors.However, we'd either need an infinite number of such relations, which we normally don't allow, or we'd need an arbitrary capon the number of people we're interested in at a time.

Third, we could use sets of actors, instead of individuals.We'd need only one relation, haveStarredtogether , that states a set of actors have starred together in a single movie.

Got questions? Get instant answers now!

Of course, the notion of interpretations are still with us, though usually everybody wants to be thinking of one standard interpretation.Consider a relation with elements such as isChildOf Bart Homer Marge . Would the triple Bart Marge Homer be in the relation as well as Bart Homer Marge ?

As long as all the writers and users of formulas involving isChildOf all agree on what the intended interpretation is, either convention can be used.

A case study: itunes

Consider iTunes'

smart playlists
: you can create a playlist consisting of (say)
All songs I've rated 3-stars or better, and whose genre is not Classical
. This is
smart
because its a program which is re-run every time your music library changes:For example, if you change a song's genre, it may be immediately added or deleted from the playlist.We realize actually have a simple formula (which we can express in propositional logic with relations).The structure (instance) for a single is the interpretation. This formula is true when interpreted on(my library's representation of) Brian Eno's
Here Come the Warm Jets
, but false forBonnie Tyler's '80's epic
Holding Out for a Hero
and for Bach's
Little
Fugue in Gm
. We now have one formula, and want to determine its truth-value inmany different particular interpretations. In fact, we want to return all interpretations which makethe formula (playlist) true.

Look at the GUI box for defining these queries. Compared to propositional logic,what sort of formulas can you define?

This is effectively Disjunctive or Conjunctive Normal Form, limited to clauses of one term each.

Got questions? Get instant answers now!

Are there queries which can't be directly transliterated into the GUI box?

Transliterate
meaning a word-for-word substitution, while
translate
preserves meanings and idioms. So while the German
Übung macht den Meister
transliterates to
Drill makes the master
, it translates to
Practice makes perfect
.

Yes. Two examples are genre Classical genre Holiday , and genre Rock Rating 4 genre Classical .

Got questions? Get instant answers now!

Can you find formulas equivalent to each of the preceding two, which can be expressed?

For the first example, genre Classical genre Holiday , we can clearly use DeMorgan's law and make the query genre Classical genre Holiday .

However, for genre Rock Rating 4 genre Classical there is no equivalent one-term-per-clause DNF or CNF formula! Budding logicians might wonder how you actually prove this claim!

Fortunately, iTunes has a way around this. Playlist membership or non-membership is itself an available predicate, allowing you to nest playlists. Thus, you can build a playlist GoodOrClassical for Rating 4 genre Classical , then another genre Rock GoodOrClassical for the desired result.

Got questions? Get instant answers now!

The upshot is that iTunes came up with a query language which is as expressiveas propositional Technically, this is a

relational calculus
formula, since we are using relations instead of flat propositions.
logic. For some queries, it can be awkward to use, but the GUI designerswho came up with smart playlists might have figured that few users would want such queries.
How might you create a GUI widget which can specify any propositional formula, and yet still look nice and be intuitive enough formy mother to use? Is there a better usability/expressibility trade-off than whatiTunes has done, or are they optimal?

Get Jobilize Job Search Mobile App in your pocket Now!

Get it on Google Play Download on the App Store Now




Source:  OpenStax, Intro to logic. OpenStax CNX. Jan 29, 2008 Download for free at http://cnx.org/content/col10154/1.20
Google Play and the Google Play logo are trademarks of Google Inc.

Notification Switch

Would you like to follow the 'Intro to logic' conversation and receive update notifications?

Ask