Control flow analysis of Prolog (extended remix)

The paper describes how to translate a Prolog program into a control ow graph (CFG). The program is annotated with control information and a system of simple set constraints is formed and solved. Using this information, a CFG can be constructed straightforwardly, which is described. In order to represent control information compactly, the paper proposes a method to structure the solution of the analysis to share information. Compressing the control information reduces the size of the control information at least by half for 18 out of 26 benchmarks, and for some programs by an order of magnitude or more. Finally, the control ow of a set of benchmarks is measured. Forward control turns out to be relatively simple, with typically 5 or less jump targets per predicate. In several smaller benchmark programs, all or close to all success returns could be converted into direct jumps. Failure control is more complex, though there are typically 10 or less jump targets per predicate for the benchmark set.