Skip to content

Instantly share code, notes, and snippets.

@nikomatsakis
Created December 6, 2018 23:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nikomatsakis/0ff064172ff11109eab978419fa937ca to your computer and use it in GitHub Desktop.
Save nikomatsakis/0ff064172ff11109eab978419fa937ca to your computer and use it in GitHub Desktop.
% name(Id, TheName).
% crate(Id, Crate).
% size(Id, TheSize).
% one of:
% code(Id).
% data(Id).
% debug(Id).
% misc(Id).
% edge(Id, Id).
% outputNode(OutputId, Id).
outputNode(Crate, Id) :-
crate(Id, Crate),
notLocal(Crate).
funcTriple(Func, Id, IdHeader, IdBody) :-
misc(Id),
edge(Id, IdHeader),
edge(Id, IdBody),
\+ IdHeader = IdBody.
outputNode(Func, Id) :- funcTriple(Func, Id, _, _).
outputNode(Func, Id) :- funcTriple(Func, _, Id, _).
outputNode(Func, Id) :- funcTriple(Func, _, _, Id).
misc(Id), edge(Id, IdHeader), edge(Id, IdBody), \+ IdHeader = IdBody
<=>
outputNode(Func, Id), outputNode(Func, IdHeader), outputNode(Func, IdBody).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment