dyna icon indicating copy to clipboard operation
dyna copied to clipboard

implicit :- aggregator (stating facts)

Open jeisner opened this issue 11 years ago • 2 comments

Right now

foo.

appears to translate as

foo |= true.

I think the aggregator should be :- rather than |= since this is part of the Prolog fragment.

Also, I'd like to be able to write

foo(I) for in_range(I).

to mean

foo(I) :- true for in_range(I).

jeisner avatar Jul 10 '13 11:07 jeisner

I'll fix the default aggregator.

The enhancement to implicit :- true with side conditions is lower priority... unless @nwf can add them with little trouble.

I think we should get rid of |= (for now), its currently just a synonym for :-. Thoughts?

timvieira avatar Jul 10 '13 19:07 timvieira

I think we should get rid of |= (for now), its currently just a synonym for :-. Thoughts?

Nope, it's not the same thing. |= like &= is three-valued logic (the result and the aggregands can be true, false, or null) while :- is two-valued logic (the result and the aggregands can only be true or null -- anything else is a type error). So :- is actually a subset of |= with stronger type requirements and guarantees.

The enhancement to implicit :- true with side conditions is lower priority... unless @nwf can add them with little trouble.

Yes, of course that is a parser issue. But I'll leave it open on the ticket.

jeisner avatar Jul 10 '13 21:07 jeisner