
Jie Ouyang wrote:
I started a thread on the news group comp.lang.prolog about anonymous variables in prolog language. Thank you very much for your reply. Here I have some newbie questions about PPL since I just started to use it to do some logic program analysis. Say a predicate, P(A,B,C), appears in the body of another predicate, e.g. P1(...):- ...,P(D,E,F). It is easy to see that the variables of P are renamed and they correspond to different space dimensions. If we have the constaints of P defined on A,B,C, is there an easy way to map the constaints to the space dimensions D,E,F? The way I handle this now is to first use ppl_Polyhedron_map_space_dimensions to do the mapping: A-D,B-E,C-F. Then get the constraints which are defined on A,B,C,D,E,F. Since I don't want the effect of A,B,C after the mapping, I have to remove all constaints defined on A,B,C only and get the constraints system defined on D,E,F eventually. This procedure seems tedious and easily to miss something. So I'd like to find a better way to do it.
Dear Jie,
when you say "I have to remove all constaints defined on A,B,C" you mean that you are projecting away the space dimensions corresponding to A, B and C, right? If so, what you do does not seem wrong. I do not understand what you mean by "this procedure seems tedious and easily to miss something": if you coude your analyzer correctly, it will not miss anything.
More generally, the point is not the handling of polyhedra but rather the abstact semantics construction you are employing. You should first define this in a clear and unambiguous way: then we can discuss about how to use the PPL polyhedra as efficiently as possible. To be more specific, notice that your example above is quite special. What if you have
p1(A, B, C) :- ..., p(C, E, A), ...
or p1(A, B, C) :- ..., p(E, f(A, B), g(B, C)), ...
?
Are you employing a top-down or a bottom-up analysis framework?
I hope this question does not disturb you and look forward to your reply. I am sorry if I missed some thing in the manual about this issue.
You are welcome. Please address your messages to ppl-devel@cs.unipr.it All the best,
Roberto
participants (1)
-
Roberto Bagnara