Papers
Topics
Authors
Recent
Search
2000 character limit reached

State-Dependent PCFGs (PSDGs)

Updated 3 March 2026
  • State-dependent PCFGs are an extension of traditional PCFGs that condition rule probabilities on evolving observable and latent state variables.
  • They enable efficient, exact online inference by leveraging a modular, tree-structured approach combined with dynamic state transitions.
  • This methodology enhances plan recognition in complex environments such as traffic monitoring and air combat by overcoming limitations of fixed probability models.

State-dependent probabilistic context-free grammars (state-dependent PCFGs, or PSDGs) are extensions of PCFGs that capture stochastic plan-generation under uncertainty by conditioning production probabilities on an evolving hidden state. Such state variables may encode both observable environmental context and unobserved, internal agent variables, enabling rigorous, interpretable modeling of planning behavior in applications such as plan recognition, traffic monitoring, and adversarial air combat. PSDGs marry the tree-structured, modular expressivity of PCFGs with explicit, dynamic world-state, supporting efficient, exact online probabilistic inference not feasible with generic dynamic Bayes nets or vanilla PCFGs (Pynadath et al., 2013).

1. Formal Specification of Probabilistic State-Dependent Grammars

A Probabilistic State-Dependent Grammar is defined as a 7-tuple

G=(Σ,N,S,Q,P,π0,T)G = (\Sigma, N, S, Q, P, \pi_0, T)

where:

  • Σ\Sigma: finite set of terminal symbols,
  • NN: finite set of nonterminal symbols,
  • SNS \in N: start symbol,
  • QQ: state-variable domain, which can be factored into external observable and internal latent variables,
  • π0:Q[0,1]\pi_0: Q \to [0,1]: prior distribution over initial state,
  • PP: set of productions r:Xαr: X \to \alpha (XN,α(NΣ)+X \in N,\, \alpha \in (N \cup \Sigma)^+) each with a state-dependent probability function pr:Q[0,1]p_r: Q \to [0,1] such that r:Xαpr(q)=1\sum_{r: X \to \alpha} p_r(q) = 1 X,q\forall X, q,
  • T:Q×Σ×Q[0,1]T: Q \times \Sigma \times Q \to [0,1]: state-transition kernel encoding the Markovian update rule for QQ upon emission of a terminal.

Generative semantics proceed by sampling Q0π0()Q_0 \sim \pi_0(\cdot), then—at each step tt—expanding the current leftmost nonterminal XX in state q=Qt1q = Q_{t-1} via stochastic selection of production rr with probability pr(q)p_r(q). Expansion continues depth-first; terminals emitted increment tt and transition the state by QtT(Qt1,xt,)Q_t \sim T(Q_{t-1}, x_t, \cdot). The joint probability over derivation D=(r1,,rK)D = (r_1, \dots, r_K), emitted string x1:Kx_{1:K}, and state sequence q0:Kq_{0:K} is

π0(q0)t=1K[prt(qt1)T(qt1,xt,qt)].\pi_0(q_0) \cdot \prod_{t=1}^K \big[ p_{r_t}(q_{t-1}) \cdot T(q_{t-1}, x_t, q_t) \big].

2. Comparison to Standard PCFGs

Ordinary PCFGs are defined as tuples with fixed, context-independent rule probabilities:

PCFG:Pr(rX)=pr,\text{PCFG:}\quad \Pr(r \mid X) = p_r,

whereas

PSDG:Pr(rX,q)=pr(q).\text{PSDG:}\quad \Pr(r \mid X, q) = p_r(q).

Thus, in PSDGs, production selection is conditioned on the agent's current planning state qq. This context conditioning is crucial for modeling dynamic behavior, such as varying the likelihood of driving maneuvers based on external (e.g., exit proximity) or internal (e.g., aggressiveness) state. All stochasticity in rule choice becomes explicitly state-dependent, increasing modeling fidelity for sequential decision applications (Pynadath et al., 2013).

3. State Dynamics and Observation Model

The state space QQ in a PSDG is typically factored:

  • QextQ^{ext}: visible variables (e.g., position, velocity, observable traffic features, radar contacts).
  • QintQ^{int}: hidden/latent features (e.g., goals, skill, preference, aggressiveness).

State transitions follow a one-step Markov property:

Pr(Qt=qQt1=q,xt=x)=T(q,x,q).\Pr(Q_t = q' \mid Q_{t-1} = q, x_t = x) = T(q, x, q').

At recognition (inference) time, a subset of QtQ_t may be partially observed, so plan recognition operates over RtQR_t \subseteq Q consistent with available evidence.

4. Efficient Inference and Belief Propagation

Online inference in PSDGs must efficiently update the posterior distribution over stack configuration, current productions, and hidden state. The critical insight is that, conditioned on parse stack level and current state, expansions are independent—enabling scalable belief propagation.

Define hierarchical belief states:

  • BNt(,X,q):B_N^t(\ell, X, q): probability nonterminal XX is active at stack level \ell with prior state qq,
  • BPt(,r,q):B_P^t(\ell, r, q): probability production rr is active at level \ell with prior state qq,
  • BLt(,q):B_L^t(\ell, q): probability that production at level \ell terminated at tt given prior state qq.

After incorporating evidence via the Markov kernel and likelihood of terminal emissions, recurrences for belief update are

Ψt(,X,qq)=Pr(et=qt,Qt=qNt=X,Qt1=q)=r:Xαpr(q)ϕt(,r,qq),\Psi_t(\ell, X, q \to q') = \Pr(e_t=q_t,\, Q_t=q' \mid N_t^\ell = X, Q_{t-1} = q) = \sum_{r: X \to \alpha} p_r(q) \cdot \phi_t(\ell, r, q \to q'),

with ϕt\phi_t computed bottom-up over α\alpha. This enables explanation (filtering) and prediction (one-step ahead) passes with per-step computational cost O(R2Pmd)O(|R|^2 |P| m d), where R|R| is size of filtered state, P|P| total number of productions, mm the longest RHS, and dd max stack depth. This approach maintains exactness while remaining tractable for moderate Q|Q|, with practical inference times reported (e.g., 1s per timestep for traffic domains with R20|R| \sim 20, d=6d=6, m3m \sim 3, P37|P| \sim 37 on legacy hardware) (Pynadath et al., 2013).

5. Empirical Examples in Plan Recognition Domains

Traffic Monitoring

A traffic-domain PSDG example illustrates state-dependence. Nonterminals: Drive, Pass, Exit; Terminals: {Left, Right, Stay}. The state q=(lane,exitDistance,aggressiveness)q = (lane, exitDistance, aggressiveness). Productions include, e.g.,

Production Probability function pr(q)p_r(q)
Drive \to Stay Drive constant $0.2$
Drive \to Left Drive $0.1$ if exitDistance >> 1 km, else $0.01$
Drive \to Pass Drive $0.3$ if aggressiveness=high, else $0.05$
Drive \to Exit soft-threshold(exitDistance)

After observing “Exit” taken and new state q1q_1, only r4r_4: Drive \to Exit is consistent with the trajectory. Inference updates the posterior on production and state accordingly, and predicts next moves via pr(q1)p_r(q_1).

Air Combat

In the air-combat setting, nonterminals include Engage, Attack, Evade, Disengage. State features: range (close, medium, far), threatLevel (low, high). For example, production

EngageAttack Engage,prA(range,threat)={0.8if range=close, threat=high 0.3if range=medium, threat=low 0otherwise\text{Engage} \to \text{Attack Engage},\quad p_{r_A}(range, threat) = \begin{cases} 0.8 & \text{if range=close, threat=high} \ 0.3 & \text{if range=medium, threat=low} \ 0 & \text{otherwise} \end{cases}

Inference proceeds identically, with efficiency increases when all state variables are fully observable.

6. Context-Dependency and Relation to Probabilistic Context-Sensitive Grammars

PSDGs instantiate a form of probabilistic context-sensitive dependency by allowing production probabilities to depend on state, including unobservable latent variables and environmental context. Other models—such as probabilistic context-sensitive grammars (PCSGs) (Nakaishi et al., 2024)—make the dependence explicit in rule formulation by including left/right neighbor context in production application. In PCSGs, rewriting a nonterminal at position AA may depend on neighboring symbols L,RL, R, and rule probabilities interpolate between context-free and context-sensitive forms,

PPCSG(rA,L,R)=(1q)MABCCF+qMLARLBCRCSP_{\text{PCSG}}(r \mid A, L, R) = (1-q) M^\text{CF}_{A \to BC} + q\, M^\text{CS}_{LAR \to LBCR}

depending on parameter qq, with q0q\to0 recovering the PCFG and q>0q>0 breaking context-free independence, as evidenced by nontrivial pairwise and higher-order mutual information.

PSDGs differ in that their context is an explicit, possibly high-dimensional or latent state variable, and state transitions are tightly coupled to plan (production) execution. Both paradigms extend PCFG expressivity to domains where substructure probability must depend nontrivially on plan or environmental context.

7. Significance and Limitations

PSDGs address the key limitation of PCFGs for modeling structured agent or system behavior in partially observed, dynamic environments: namely, the inability of PCFGs to represent context-sensitive plan-generation. By encoding production probabilities as functions of state, PSDGs offer modular, interpretable modeling and allow exact, online inference leveraging state Markovity and stack factorization.

A limitation is the exponential scaling in state and stack depth, though specialized recurrences and state filtering maintain tractability when Q|Q| is moderate and only subsets of state are observable.

A plausible implication is that, as plan-recognition complexity and context-sensitivity increase, PSDGs or related models with explicit latent or contextual dependence will be crucial for practical, scalable inference in real-world sequential decision domains (Pynadath et al., 2013, Nakaishi et al., 2024).

Definition Search Book Streamline Icon: https://streamlinehq.com
References (2)

Topic to Video (Beta)

No one has generated a video about this topic yet.

Whiteboard

No one has generated a whiteboard explanation for this topic yet.

Follow Topic

Get notified by email when new papers are published related to State-Dependent PCFGs (PSDGs).