From: Eyal D. <eya...@gm...> - 2016-02-16 19:45:04
|
Why do you need this diff/1 at all? Why not? :- table same/2. same(1, 2). same(1, 3). same(4, 5). same(4, 6). same(X, Y) :- same(Y, X). same(X, Z) :- same(X, Y), same(Y, Z). you can exclude same(X, X) in a new predicate like: same1(X, Y) :- same(X, Y), X \= Y. Eyal On Tue, Feb 16, 2016 at 2:05 PM, Edward Schwartz <esc...@ce...> wrote: > Hi Eyal, > > Thank you -- this seems to explain the behavior I'm seeing. Do you have > any suggested alternative? A version of dif/2 that doesn't use > co-routining maybe? Does such a thing exist? > > Thanks, > > Ed > > On 02/16/2016 01:29 PM, Eyal Dechter wrote: > > Hi Ed, > > > > I think that this is because dif/2 is part of the co-routining extension > > and the tabling extension (YAPTab) doesn't support the co-routining > > extension. According to the manual (section 18) this should through an > > error; that it doesn't is likely a bug. > > > > I think the reason it is not supported is because tabling in YAP depends > > on being able to ask when one term is a variant of another. But in the > > presence of constraints like dif/2, two terms that are syntactic > > variants are no longer necessarily unifiable. > > > > Best, > > Eyal > |