by simplify · 6y ago · 0 comments
I noticed you (assuming you're the author) used what looks like a non-traditional Datalog syntax – which makes sense to me as, IMO, Datalog/Prolog desperately need first-class support for a record-like syntax to finally break into mainstream. Is there any prior work to this syntax, or did you just develop it as you needed it?
And in Prolog you can, of course, just trivially use your own term structure for item-values:
p([ item : "value", ... ])
You could even use JSON-like terms in Prolog (with maybe a little help by the op/3 directive to sort out parsing priorities): A_Prolog_Term = {
x: y,
z: [a, b, {1, d} ]
}
But the more fundamental approach IMHO would be to use nested knowledge-base terms: p(
q(whatever).
r(X) :- q(X).
).
As pioneered in the 1980s for attribute grammars, using ^^ and other special graph tokens as nested "implies" operator, though (see "definite-clause translation grammars").