Previous topic  Top  Next topic  Print this Topic

Limit the Number of Results: limit


If you want to limit the number of answers then you can use the "limit" option. The following example shows the combination of "limit" and "outorder":

@{q1, options[limit(1),outorder(?Y,?X)]} ?- ?X::?Y.

In this example, only one answer will be given. Note that limiting the number of answers does not necessarily mean that the performance will improve.