Closed norm2782 closed 7 years ago
I thought I had responded to this but turns out I hadn't :/
gfiltermap
works by recursively calling match
on the graph, and this is the behaviour it has always had.
As such, this may be a documentation issue (it's come up before).
The
gfiltermap
function shows unexpected (for me, at least) behaviour. Its description: "Build a graph out of the contexts for which the predicate is true.", where context is represented by typeContext
, which is documented as follows: "Links to theNode
, theNode
itself, a label, links from theNode
."Given these descriptions, I would expect that for every node I get its predecessors and successors in the context. This does not appear the case in the example below:
Executing
main
gives the following output, where the first four lines are the output fromtraceShowId
and the last four lines the output ofprettyPrint
:While the code faithfully reconstructs the original graph (as is also tested in the test suite), the trace output shows some strange behaviour. For example, I would expect node 4 to have node 1 and node 2 in its context, but its context is empty.
So, either
gfiltermap
has a bug, in which case it would be great if that could be fixed. Orgfiltermap
's documentation should possibly be updated to reflectgfiltermap
's current behaviour.I am using revision 71b66d6.