A sorites (plural, soriteses) is a kind of logic puzzle. Lewis Carroll (the mathematician and author of Alice in Wonderland) wrote a book called Symbolic Logic and the Game of Logic in which he presented a large number of soriteses. Here is an example:
This can be turned into a set of clauses in predicate calculus by
(Note: ⇒ means implies, ¬means not, and ∨ means or.) So,
| Statement | Implication | Clause |
|---|---|---|
| 1. All my sons are slim. | son ⇒ slim | ¬son ∨ slim |
| 2. No child of mine is healthy who takes no exercise. | ¬exercise ⇒ ¬healthy | exercise ∨ ¬healthy |
| 3. All gluttons, who are children of mine, are fat. | glutton ⇒ ¬slim | ¬glutton ∨ ¬slim |
| 4. No daughter of mine takes any exercise. | ¬son ⇒ ¬exercise | son ∨ ¬exercise |
Here is another sorites:
|
exercise),
strings, ("exercise"), or keywords (:exercise), or
in some other fashion, as long as they can be tested for equality.1, 2,
3, ...). Integers are easy to test for, and do not occur in
logic problems. As always, when resolving clauses, you must remember to
standardize variables apart--the scope of a variable is the clause in which
it occurs, so a 1 in one clause is a different variable from
the 1 in another clause.not. For example, (mother
mary bob) or (sameweight 1 2). Variables may occur
as the "arguments" to predicates (after the first thing in the list), and
nowhere else.(not literal).(:exercise
(not :healthy)). There is no need to represent the "or" explicitly.
To have a consistent representation, a clause consisting of a single literal
is still in a list; a clause containing no literals is the empty list,
().(resolve clause1
clause2)(simple-resolve clause1
clause2)(solve sorites)Unit testing is recommended, but optional.
Zip and turn in your resolution.clj and
resolution-test.clj files by 6am, Monday, October 5.
If you do not do unit testing, or if you put your unit tests in the same
file, just turn in your unzipped resolution.clj. As always,
only files submitted to Canvas
will be accepted. I do not accept assignments submitted by email.