There are several variations of languages with “context”:
- with lookahead / right context
- with lookbehind / left context
- with both
CF with one-sided context
Languages of strings in contexts: L⊆Σ∗×Σ∗:
L1∪L2L1∩L2={(x,y)∣(x,y)∈L1∨(x,y)∈L2}={(x,y)∣(x,y)∈L1∧(x,y)∈L2}
Left context:
L1⋅⊲L2⊲L1⊴L1⊲L1⊴L1={(x,yz)∣(x,y)∈L1∧(xy,z)∈L2}={(x,y)∣(ε,x)∈L1∧y∈Σ∗}={(x,y)∣(ε,xy)∈L1}=?(ε∩⊴L1)Σ∗=?Σ∗(ε∩⊲L1)
Right context:
L1⋅⊳L2⊳L1⊵L1⊳L1⊵L1={(zy,x)∣(z,yx)∈L1∧(y,x)∈L2}={(y,x)∣(x,ε)∈L1∧y∈Σ∗}={(y,x)∣(yx,ε)∈L1}=?Σ∗(ε∩⊵L1)=?(ε∩⊳L1)Σ∗
Reversal:
LR(L1⋅⊲L2)R={(xR,yR)∣(y,x)∈L}=L2R⋅⊳L1R
Read more here:
CFwLA
L1⋅L2&L1!L1&L1={(xy,z)∣(x,yz)∈L1∧(y,z)∈L2}={(ε,xy)∣(x,y)∈L1}=({ε}×Σ∗)∖&L1≈⊳(L1Σ∗)
Read more here:
Conjuctive
(&L1)L2≈(L1Σ∗)∩L2if ∣w1∣≤∣w2∣,w1∈L1,w2∈L2
Limited Boolean
(!L1)L2≈(L1Σ∗)′∩L2if ∣w1∣≤∣w2∣,w1∈L1,w2∈L2