Untested, but what about using range/3 ?
http://software-lab.de/doc/refR.html#range/3

## Advertising

On Sat, Nov 12, 2016 at 9:59 AM, CILz <cilz...@cilzone.fr> wrote:
> Hello,
>
> Let's say that I have those two facts in a pilog database:
>
> (be age (Paul 18))
> (be age (Vincent 17))
>
> I'm looking for the guy under 18 with this rule:
>
> (be underage (@X)
> (age @X @Y)
> (< @Y 18))
>
> If I ask (? (underage @X)) the result here is -> NIL where I expect to get
> @X=Vincent.
>
> If I modify the above rule with:
>
> (be underage (@X)
> (age @X @Y)
> (equal @Y 18))
>
> The same query (? (underage @X)) now gives @X=Paul which is the expected
> result.
>
> I'm sure I'm missing something in the first case but I don't know what. Any
> idea?
>
> Thanks,
>
> Eric
>
> --
> UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
--
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe