Path: utzoo!attcan!uunet!mcvax!unido!ecrcvax!micha
From: micha@ecrcvax.UUCP (Micha Meier)
Newsgroups: comp.lang.prolog
Subject: Re: An example from "Knowledge Systems & Prolog"
Message-ID: <560@ecrcvax.UUCP>
Date: 7 Jul 88 09:20:15 GMT
References: <149@quintus.UUCP>
Reply-To: micha@ecrcvax.UUCP (Micha Meier)
Organization: ECRC, Munich 81, West Germany
Lines: 17

In article <149@quintus.UUCP> ok@quintus (Richard A. O'Keefe) writes:
>This is actually a very interesting problem.  It crops up in all sorts of
>guises.  I currently have an algorithm which does at most N(N-1) calls to
>subsumes/2 and reduces to at most 2(N-1) when subsumes/2 happens to be
>total.  If anyone knows of a better algorithm I would be _very_ interested
>to hear of it.

	I actually have no better algorithm, but I've implemented
	a predicate compare_instances(Order, Term1, Term2) which is
	similar to compare/3, and this makes it possible to get the
	relation between two terms using only one call (which makes
	only one pass through the terms). This obsoletes any sorting
	of the initial list. I'd be interested as well in an algorithm
	that performs better than the blind one.


--Micha