cfl closed under reversal


PDF
Videos
List Docs
PDF Properties of Context-Free Languages

As usual when we talk about “a CFL” we really mean “a representation for the CFL e g a CFG or a PDA accepting by final state or empty stack There are algorithms to decide if: String w is in CFL L CFL L is empty CFL L is infinite

  • Are context-free languages closed under reversal?

    Prove that the context-free languages are closed under reversal. We want to show that if L is a context-free language, then L R is a context-free language. So let G be the context-free grammar that generates L.

  • Are CFL closed under concatenation?

    Note: So CFL are closed under Concatenation. Kleene Closure : If L1 is context free, its Kleene closure L1* will also be context free. For example, L1* = { a n b n | n >= 0 }* is also context free. Note : So CFL are closed under Kleen Closure. Intersection and complementation : If L1 and If L2 are two context free languages, their intersection L1 ?

  • Are CFL's closed under intersection or difference?

    Let’s work this out in class. CFL’s are closed under union, concatenation, and Kleene closure. Also, under reversal, homomorphisms and inverse homomorphisms. But not under intersection or difference. Let L and M be CFL’s with grammars G and H, respectively. Assume G and H have no variables in common.

  • Are CFL's closed under reversal?

    CFL’s are closed under union, concatenation, and Kleene closure. Also, under reversal, homomorphisms and inverse homomorphisms. But not under intersection or difference. Let L and M be CFL’s with grammars G and H, respectively. Assume G and H have no variables in common. Names of variables do not affect the language. 1 | S 2.

Summary of Decision Properties

As usual, when we talk about “a CFL” we really mean “a representation for the CFL, e.g., a CFG or a PDA accepting by final state or empty stack. There are algorithms to decide if: String w is in CFL L. CFL L is empty. CFL L is infinite. infolab.stanford.edu

Non-Decision Properties

Many questions that can be decided for regular sets cannot be decided for CFL’s. Example: Are two CFL’s the same? Example: Are two CFL’s disjoint?  How would you do that for regular languages? Need theory of Turing machines and decidability to prove no algorithm exists. infolab.stanford.edu

Testing Emptiness

We already did this. We learned to eliminate variables that generate no terminal string. If the start symbol is one of these, then the CFL is empty; otherwise not. infolab.stanford.edu

Testing Membership

Want to know if string w is in L(G). Assume G is in CNF. Or convert the given grammar to CNF. w = ε is a special case, solved by testing if the start symbol is nullable. Algorithm (CYK ) is a good example of dynamic programming and runs in time O(n3), where n = w. infolab.stanford.edu

Closure Properties of CFL’s

CFL’s are closed under union, concatenation, and Kleene closure. Also, under reversal, homomorphisms and inverse homomorphisms. But not under intersection or difference. infolab.stanford.edu

Closure of CFL’s Under Homomorphism

Let L be a CFL with grammar G. Let h be a homomorphism on the terminal symbols of G. Construct a grammar for h(L) by replacing each terminal symbol a by h(a). infolab.stanford.edu

Closure of CFL’s Under Inverse Homomorphism

Here, grammars don’t help us. But a PDA construction serves nicely. Intuition: Let L = L(P) for some PDA P. Construct PDA P’ to accept h-1(L). P’ simulates P, but keeps, as one component of a two-component state a buffer that holds the result of applying h to one input symbol. infolab.stanford.edu

Construction of P’ – (2)

Input symbols of P’ are the symbols to which h applies. Final states of P’ are the states [q, ε] such that q is a final state of P. infolab.stanford.edu

Transitions of P’

δ’([q, ε], a, X) = {([q, h(a)], X)} for any input symbol a of P’ and any stack symbol X. When the buffer is empty, P’ can reload it. δ’([q, bw], ε, X) contains ([p, w], ) if δ(q, b, X) contains (p, ), where b is either an input symbol of P or ε. Simulate P from the buffer. infolab.stanford.edu

Nonclosure Under Difference

We can prove something more general:  Any class of languages that is closed under difference is closed under intersection. infolab.stanford.edu

Proof: L

 M = L – (L – M). Thus, if CFL’s were closed under difference, they would be closed under intersection, but they are not. infolab.stanford.edu

Intersection with a Regular Language

Intersection of two CFL’s need not be context free. But the intersection of a CFL with a regular language is always a CFL. Proof involves running a DFA in parallel with a PDA, and noting that the combination is a PDA.  PDA’s accept by final state. infolab.stanford.edu

Formal Construction

Let the DFA A have transition function Let the PDA P have transition function δA. δP. States of combined PDA are [q,p], where q is a state of A and p a state of P. δ([q,p], a, X) contains ([δ A(q,a),r], ) if δP(p, a, X) contains (r, ).  Note a could be , in which case δA(q,a) = q. infolab.stanford.edu

Lec-33: Reversal Operation in toc  How regular languages closured under reversal

Lec-33: Reversal Operation in toc How regular languages closured under reversal

Closure and Decision Properties of CFLs

Closure and Decision Properties of CFLs

Closure Properties of Regular Languages + Proofs

Closure Properties of Regular Languages + Proofs

Share on Facebook Share on Whatsapp











Choose PDF
More..











cfo bonus structure cfo salary $100 million company cfo salary guide 2018 cfo salary guide nz cfo salary nyc cfse calculation pdf cft book pdf cft chemistry pdf

PDFprof.com Search Engine
Images may be subject to copyright Report CopyRight Claim

Closure under reversal of regular languages: Proof using Automata

Closure under reversal of regular languages: Proof using Automata


Theory of Computation- Context Free Languages

Theory of Computation- Context Free Languages


Closure under reversal of regular languages: Proof using Automata

Closure under reversal of regular languages: Proof using Automata


PDF) Infinite words without palindrome

PDF) Infinite words without palindrome


PDF) Reverse Transrectal Stapling Technique Using the EEA Stapler

PDF) Reverse Transrectal Stapling Technique Using the EEA Stapler


Abdominal Wall Closure After a Stomal Reversal Procedure

Abdominal Wall Closure After a Stomal Reversal Procedure


Closure properties of context-free languages

Closure properties of context-free languages


PDF) Time-reversal methods in geophysics

PDF) Time-reversal methods in geophysics


Reversing a transaction - MYOB AccountRight - MYOB Help Centre

Reversing a transaction - MYOB AccountRight - MYOB Help Centre


Regular Languages Closed Under Reversal (Theory of Computation  #

Regular Languages Closed Under Reversal (Theory of Computation #


PDF) Evaluation and Modeling of the Fatigue Damage Behavior of

PDF) Evaluation and Modeling of the Fatigue Damage Behavior of


Advanced Candlestick Patterns

Advanced Candlestick Patterns


Study Notes on Closure properties of Languages : GATE \u0026 PSU CS

Study Notes on Closure properties of Languages : GATE \u0026 PSU CS


Reversing Entries - principlesofaccountingcom

Reversing Entries - principlesofaccountingcom


Document Reversal FB08 in SAP: Step by Step Guide

Document Reversal FB08 in SAP: Step by Step Guide


PDF) A Strategic Initiative for Successful Reverse Logistics

PDF) A Strategic Initiative for Successful Reverse Logistics


Reversal of (Im)mobility Privilege and Borders During COVID-19

Reversal of (Im)mobility Privilege and Borders During COVID-19


Motor Control Circuits

Motor Control Circuits


Reverse auction - Wikipedia

Reverse auction - Wikipedia


9 Effective Forex Trading Strategies

9 Effective Forex Trading Strategies


Thermodynamics of the Pyruvate Kinase Reaction and the Reversal of

Thermodynamics of the Pyruvate Kinase Reaction and the Reversal of


Simple minimally-invasive automatic antidote delivery device (A2D2

Simple minimally-invasive automatic antidote delivery device (A2D2


Synchronous Hartmann reversal and incisional hernia repair is

Synchronous Hartmann reversal and incisional hernia repair is


Reversing P/T Nets

Reversing P/T Nets


Reversing a relationship spiral: From vicious to virtuous cycles

Reversing a relationship spiral: From vicious to virtuous cycles


Prayer for Justice: Pray This Prayer To Reverse Unjust Situations

Prayer for Justice: Pray This Prayer To Reverse Unjust Situations


Study Notes on Closure properties of Languages : GATE \u0026 PSU CS

Study Notes on Closure properties of Languages : GATE \u0026 PSU CS


Reversal agents for non-vitamin K antagonist oral anticoagulants

Reversal agents for non-vitamin K antagonist oral anticoagulants


A review of mathematical inventory models for reverse logistics

A review of mathematical inventory models for reverse logistics


Reversing Entries

Reversing Entries

Politique de confidentialité -Privacy policy