| Index: program.pl
|
| diff --git a/program.pl b/program.pl
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..13019cdd4e2cf363e52a0b9751665fdc97bbfcd6
|
| --- /dev/null
|
| +++ b/program.pl
|
| @@ -0,0 +1,22 @@
|
| +:- [dart].
|
| +
|
| +contains_trans(X, Y) :- contains(X, Y).
|
| +contains_trans(X, Y) :- contains(X, U), contains_trans(U, Y).
|
| +
|
| +callchain(X, Y, [X, Y]) :- calls(X, Y).
|
| +callchain(X, Z, [X | L1]) :- calls(X, Y), callchain(Y, Z, L1).
|
| +
|
| +name(Id, (Class, Function)) :- function(Id, Function), contains(C, Id), class(C, Class).
|
| +
|
| +can_be_called_from_main(X) :- callchain(main, X, _).
|
| +
|
| +enqueued(Source, Target, [Source, Target]) :- enqueues(Source, Target).
|
| +enqueued(Source, Target, [Source | Rest]) :-
|
| + enqueues(Source, Intermediate),
|
| + enqueued(Intermediate, Target, Rest).
|
| +
|
| +why_enqueued(ClassName, FunctionName, Reason) :-
|
| + class(C, ClassName),
|
| + function(F, FunctionName),
|
| + contains(C, F),
|
| + enqueued(main, F, Reason).
|
|
|