%cfa_seq(From, To) %cfa_payload(X, Node, Path) %EXTERNAL CALL %constraints: fn's entry/final scope does not have prev/next scopes resp. :- cfa_seq_guarded(_, NodeTo, in(_)); cfa_seq(_, NodeTo). :- cfa_seq_guarded(NodeFrom, _, out(_)); cfa_seq(NodeFrom, _). cfa_payload(P, NodeTo, (Guard, Path)):- cfa_payload(P, NodeFrom, Path); cfa_seq_guarded(NodeFrom, NodeTo, in(Guard)). weak(cfa_payload(P, NodeTo, (Guard, Path))):- weak(cfa_payload(P, NodeFrom, Path)); cfa_seq_guarded(NodeFrom, NodeTo, in(Guard)). %Path collapse cfa_payload(P, Node, Path):- cfa_payload(P, NodeFrom, Path) : cfa_seq_guarded(NodeFrom, Node, in(_)); cfa_payload(P, Node, (_, Path)); cfa_seq_guarded(_, Node, in(_)). %EXTERNAL RET cfa_payload(P, NodeTo, Path2):- cfa_payload(P, NodeFrom, Path); Path = (Guard, Path2); cfa_seq_guarded(NodeFrom, NodeTo, out(Guard)). cfa_payload(P, NodeTo, ()):- cfa_payload(P, NodeFrom, ()); cfa_seq_guarded(NodeFrom, NodeTo, out(_)). weak(cfa_payload(P, NodeTo, Path2)):- weak(cfa_payload(P, NodeFrom, Path)); Path = (Guard, Path2); cfa_seq_guarded(NodeFrom, NodeTo, out(Guard)). %INTERNAL weak(cfa_payload(P, Node, Path)):- weak(cfa_payload(P, NodeFrom, Path)); cfa_seq(NodeFrom, Node). %INTERNAL AND cfa_payload(P, Node, Path):- cfa_payload(P, NodeFrom, Path); cfa_seq(NodeFrom, Node); Node = and(_). %INTERNAL OR weak(cfa_payload(P, Node, Path)):- cfa_payload(P, NodeFrom, Path); cfa_seq(NodeFrom, Node); Node = or(_). cfa_payload(P, Node, Path):- cfa_payload(P, NodeFrom, Path) : cfa_seq(NodeFrom, Node); Node = or(_); cfa_seq(N, Node); cfa_payload(P, N, Path). %INTERNAL EMPTY %INTERNAL SCOPE :- cfa_seq(A, empty(X)); cfa_seq(B, empty(X)); A<>B. :- cfa_seq(A, scope(X)); cfa_seq(B, scope(X)); A<>B. cfa_payload(P, Node, Path):- cfa_payload(P, NodeFrom, Path); cfa_seq(NodeFrom, Node); Node = empty(_). cfa_payload(P, Node, Path):- cfa_payload(P, NodeFrom, Path); cfa_seq(NodeFrom, Node); Node = scope(_).