Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!linus!philabs!seismo!hao!hplabs!sri-unix!UReddy@Utah-20 From: UReddy%Utah-20@sri-unix.UUCP Newsgroups: net.lang.prolog Subject: Marcel's Dilemma Message-ID: <15320@sri-arpa.UUCP> Date: Mon, 16-Jan-84 02:03:22 EST Article-I.D.: sri-arpa.15320 Posted: Mon Jan 16 02:03:22 1984 Date-Received: Sat, 14-Jan-84 04:06:53 EST Lines: 41 From: Uday Reddy Ref: Marcel Schoppers, Prolog Digest, 2, 1, Jan 7, 84 The problem cited by Marcel is an example of what happens if one tries to translate English into a formal language (here Prolog) without regard to the semantic objects involved. His problem is "Suppose you are shown two lamps, 'a' and 'b', and you are told that, at any time, 1. at least one of 'a' or 'b' is on. 2. whenever 'a' is on, 'b' is off. 3. each lamp is either on or off." Marcel tried to express these constraints in Prolog, by defining a predicate 'on'. Such an exercise is meaningless. However you specify 'on', what answers can you expect for the goal ?- on(X). Either 'a', or 'b' or both of them. None of these results captures the constraints above. What is 'on' anyway? It is a predicate on {a,b}. Do the above constraints specify what 'on' is ? No. They specify what 'on' can be. In other words, they specify the properties the predicate 'on' should satisfy. So, what we need is a predicate, say 'valid', which specifies whether a particular 'on' predicate is valid or not. It is, clearly, a higher-order predicate. Forgetting about operational semantics of higher-order logic, it may be specified as valid(on) :- (on(a) ; on(b)), (on(a) -> not(on(b))) Reworking this into Prolog would correspond to what Marcel calls "dumb-search-and-filter" solution. I wonder what he means by "dumb". If what you are trying to do is express a set of axioms and use Prolog to obtain all possible solutions of the axioms, that is what you get. If you are not satisfied with search-and filter, you have to do more than merely express a set of axioms. You have to synthesize an algorithm. Don't expect black magic from Prolog. -- Uday Reddy