flpq_data.queries.cfpq.generators.c_alias_grammar#

c_alias_grammar(*, assigment_labels: Tuple[str, str] = ('a', 'a_r'), dereference_labels: Tuple[str, str] = ('d', 'd_r'), start_symbol: Variable = Variable(S)) → CFG[source]#

Returns a C Alias grammar that generates a language for the flow-insensitive alias analysis of C programs [1].

Parameters:
assigment_labelsTuple[str, str]

Pair \((a, a_r)\) where label \(a\) represents the assignment operation and \(a_r\) is reverse to it.

dereference_labelsTuple[str, str]

Pair \((d, d_r)\) where label \(d\) represents pointer dereference relation and \(d_r\) is reverse to it.

start_symbolVariable

Start symbol of the grammar.

Returns:
cfgCFG

C Alias context-free grammar.

References

Examples

>>> from flpq_data import *
>>> cfg = c_alias_grammar()
>>> print(cfg_to_text(cfg))
S -> d_r V d
V -> V1 V2 V3
V1 ->
V1 -> V2 a_r V1
V2 ->
V2 -> S
V3 ->
V3 -> a V2 V3