While debugging my current solution (which by the way, is “complete” but has failed some tests and I’m in the process of figuring out why) I noticed a problem with one of my logical test cases. It’s based on a classic prolog-based test case (one used as an example in SWISH), and goes something like this:
1. Mia loves Vincent
2. Marcellus loves Mia
3. If X loves Y and Y loves Z, X is jealous of Z.
4. Therefore, Marcellus is jealous of Vincent.
I referred to this test case in a previous post about why prolog doesn’t work as a solution to my logic problems, but didn’t see the problem then. In StrictlyLogic, where all truth is relative, it would look more like this:
1. if @1 is Mia && @2 is Vincent, then @1 loves @2
2. if @1 is Marcellus && @2 is Mia, then @1 loves @2
3. if @1 loves of @2 && @2 loves @3, then @1 is jealous of @3
Nothing? Why nothing? Wouldn’t we expect to see: if @1 is Marcellus && @2 is Vincent, then @1 is jealous of @2?
No – and why not took me some time to figure out. We’re missing something: @n is Mia. In other words, Marcellus is only jealous of Vincent if there is a Mia.
So why not just assume there is a Mia? Because that depends on context. In the real world, there is no Mia. In the world of Pulp Fiction, there is Vincent, Marcellus, and Mia. In an alternate Pulp Fiction universe, there could be a Vincent and Marcellus, but no Mia.
This points out an important difference between the absolute truth of Prolog vs the relative truth of StrictlyLogic. In Prolog, loves( Mia, Vincent ) actually assumes there’s a Vincent and a Mia. Which in the case of this particular example is a bit dubious, given that Vincent and Mia are fictional characters. Such assumptions can be problematic where existence is unclear. For example, consider the following example:
never_caught( humans, ghosts).
hard_to_catch(X) :- never_caught( humans, X ).
?- hard_to_catch( ghosts).
So if we assume it’s true that humans have never caught ghosts and that if humans have never caught something, then that thing’s hard to catch, then ghosts must be hard to catch. In a sense I guess that’s true, but it ignores the possibility that ghosts might be easy to catch but don’t exist in the same world as humans, which is probably not what the hard_to_catch was supposed to mean.
Does that mean you can never prove that Marcellus is jealous of Vincent? Well…I’m still thinking about how this would work. But it’s important to keep the difference in mind.
Posted in: Uncategorized