From: Barry B. <bar...@st...> - 2008-09-07 13:29:23
|
> 1) Interesting, but understandable. (It is possible, of course, but > would require checking, if the Builtin can handle the particular situation.) Yes, so the blanket requirement is only one unbound term. If we went down the road of trying to be as flexible as possible we would end up with a large number of special cases, e.g. DIVIDE(?X, ?X, 1) => any numeric value for ?X, except zero MULTIPLY(?X, ?X, 0) => ?X=0 (single value) MULTIPLY(?X, ?X, 1) => ?X=1 or ?X=-1 (two values) MULTIPLY(?X, 1, ?X) => ?X=any values (infinite values) > 2) I understand your concern towards query-independence (I think). Also, > I understand where the implementation is restricted in respect to query > evaluation (predicates are gone, only precomputed facts remain), which > really is a consequence of the former. I think, where I do not follow is > that the following two queries deliver different results. > > ?- EQUAL(5,?x). > > eq(?x,?y) :- EQUAL(?x,?y). > ?- eq(5,?x). > > Note that I do understand /why/ that is, I only don't think those > programs /ought/ to behave differently. But then again, I am no expert > in logic programming, and my guts may be simply wrong. :) Actually, your guts are quite correct! IRIS uses only bottom-up evaluation (at the moment - SLDNF is on the way), so we have a big computational cost to evaluate the model. Strictly speaking, we should recalculate this model based on the query as the ground terms here are part of the universe. We *should* recompute the model for every query? So far, only you have noticed this! > Thanks again for that piece of insight. Time for some more code diving. :] No problem. It seems we are both don't have anything better to do on a sunday! barry |