JSON is an interesting enough use case that I want to add intrinsic support for it. Plan is that instead of
edge A B :-
field _ "edges" is Edges,
field Edges _ is AdjList,
field AdjList 0 is A,
field AdjList 1 is Neighbors,
field Neighbors _ is B.
I should be able to write:
edge A B :-
$$->"edges"->_ == AdjList
A == AdjList->0,
B == AdjList->_->B.
A -> B is C
is a built-in default for when you import JSON data (In my AOC examples I always specified that the predicate was field
.)
$
should be a tightly-binding prefix operation, $N
is the N
th loaded JSON object.
$$
should always be equal to $0
, for the common case where you're only loading one JSON object.