<< Chapter < Page | Chapter >> Page > |
You might have objected to the idea of the unary relation , since different people have different tastes.How could you model individuals' tastes? (Hint:Use a binary relation.) )
We can use the binary relation : In particular, but What set are we using, as the domain for this? Really, the domain is the union of people and pizza-toppings.So is a valid thing to write down; it would be false. Note that if working with such a domain,having unary predicates and would be useful.
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 capture the notion of , , and 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 (as witnessed by Limelight , 1952), (as witnessed by The Adventures of Rocky and Bullwinkle , 2000), and if we generously include archive footage, (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?
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 to be a ternary (3-input) relation to include the movie. Like in the 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 , we'd add the ternary , the quaternary , …. 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, , that states a set of actors have starred together in a single movie.
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 . Would the triple be in the relation as well as ?
As long as all the writers and users of formulas involving all agree on what the intended interpretation is, either convention can be used.
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
smartbecause 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 Heroand for Bach's
. 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.LittleFugue in Gm
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.
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 , and .
Can you find formulas equivalent to each of the preceding two, which can be expressed?
For the first example, , we can clearly use DeMorgan's law and make the query .
However, for 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 for , then another for the desired result.
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.
Notification Switch
Would you like to follow the 'Intro to logic' conversation and receive update notifications?