On Jun 28, 2009, at 8:38 AM, Troman wrote:
> As far as I know Swi-Prolog indexes predicates using the first
> argument.
So it says in the manual.
>
>
> I have a Prolog database with many facts [of the] form:
>
> fact( atom, atom2 ).
>
> Now I'd like to replace both 'atom' and 'atom2' with a list of 2
> atoms.
> Will this negatively affect indexing and performance?
Yes.
> If so, is there a way to prevent this?
Yes: don't do that. I'm serious.
It's worth remembering, in _all_ programming languages,
that something can have more than one interface. You can
have an interface that looks cool and another interface
that is efficient. So for example you could have
cool_fact([X,Y]) :-
fast_fact(X, Y).
add_cool_fact([X,Y]) :-
assert(fast_fact(X, Y)).
...
_______________________________________________
SWI-Prolog mailing list
SWI-Prolog@...
https://mailbox.iai.uni-bonn.de/mailman/listinfo.cgi/swi-prolog