Saturday, August 15, 2015

Is your author a butterfly?

The author's wife continually accuses your interlocutor of being a butterfly. He is said to pick up a new interest, insanely obsess about it (ordering books, reading articles, immersing himself) for .. oh, a few weeks ... until the next big thing comes up and, magpie-like, he moves on.

I naturally deprecate this characterisation but how to disprove it? Time to ask an artificial intelligence. Here is the transcript of my query to the mighty and powerful SWI-Prolog system.




/* Is Nigel a butterfly? */

likes(nigel,physics).
likes(nigel,prolog).
likes(nigel,genetics).
likes(nigel,politics).
likes(nigel,cosmology).

interests(Person,List) :- findall(Topic,likes(Person,Topic),List).

obsessive(Person)       :- interests(Person,L),length(L,N),N=<2.

butterfly(Person)       :- not(obsessive(Person)).




Welcome to SWI-Prolog (Multi-threaded, 32 bits, Version 7.2.2) Copyright (c) 1990-2015 University of Amsterdam, VU Amsterdam SWI-Prolog comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to redistribute it under certain conditions.

Please visit http://www.swi-prolog.org for details. For help, use ?- help(Topic). or ?- apropos(Word).


1 ?- interests(nigel, L).
L = [physics, prolog, genetics, politics, cosmology].

2 ?- obsessive(nigel).
false.

3 ?- butterfly(nigel).
true.



I am abashed, but what can I do? Clare was right after all: computer says yes ...