KonkurStudy
همه دروس

نظریه زبان‌ها و ماشین‌هاTheory of Computation

اتوماتا، زبان‌های منظم و مستقل از متن، ماشین‌های تورینگ و کلاس NP.

کنکور ارشد علوم کامپیوتر

90 سوالات27 کارت‌ها5 مباحث

مباحث

کارت‌ها · 27

الگوریتمنظریه زبان‌ها و ماشین‌ها
Membership via per-branch counting invariants of a CFG

Read off the single count equality each grammar branch enforces, then test a candidate string by comparing letter counts instead of building derivations.

context-free-grammarmembershipcounting-invariantunion-of-branches
مفهومنظریه زبان‌ها و ماشین‌ها
Context-Free Closure and Single-Stack Matching

A language is context-free if its only stack obligation is one matching, plus regular filters that closure preserves.

context-freeclosure-propertiesPDACFG
مفهومنظریه زبان‌ها و ماشین‌ها
Counting strings accepted by a DFA via complement (trap state)

When almost all states accept, count total strings and subtract those that fall into the trap state.

DFAcountingtrap-statecomplement
قضیهنظریه زبان‌ها و ماشین‌ها
Proving languages non-context-free via the pumping lemma

Pick the right boundary string, then show every split uvxyz with vxy <=p can be pumped out of the language.

pumping-lemmanon-cflcontext-freecross-serial-dependency
الگوریتمنظریه زبان‌ها و ماشین‌ها
Tracing a PDA stack to decide string acceptance

Simulate the PDA step by step, tracking the stack; accept only if input is fully consumed AND you land in a final state (or empty the stack).

pushdown-automatastack-tracestring-acceptanceepsilon-transition
مفهومنظریه زبان‌ها و ماشین‌ها
Deciding regex membership via a structural rule

Translate a regular expression into a forbidden-pattern rule, then test a string by structure instead of full parsing.

regular-expressionstring-membershipkleene-starforbidden-substring
قضیهنظریه زبان‌ها و ماشین‌ها
Right Quotient of a Regular Language by a Symbol

L/ a = w : wa in L is regular: keep the DFA, only re-mark accepting states.

regular-languagesclosure-propertiesright-quotientdfa
مفهومنظریه زبان‌ها و ماشین‌ها
Parity is regular; matching equal counts is not

Finite (bounded) memory like parity stays regular; comparing unbounded counts does not.

regular-languagespumping-lemmadfaparity
مفهومنظریه زبان‌ها و ماشین‌ها
Shuffle (Interleaving) Product of Automata

A product automaton that advances one component per symbol recognizes the shuffle of the two languages.

automatashuffleclosureregular-languages
الگوریتمنظریه زبان‌ها و ماشین‌ها
Reading a Turing Machine: the Binary Increment

Recognize the right-scan + carry-from-the-right pattern that computes x+1 in binary.

turing-machinebinaryincrementsimulation
الگوریتمنظریه زبان‌ها و ماشین‌ها
DFA product construction for intersection, union, and symmetric difference

Run two DFAs in lockstep on the same input — states are pairs ⟨q1,q2⟩ — then pick the accepting pairs to realize any Boolean combination: AND for ∩, OR for ∪, XOR for symmetric difference, AND-NOT for set difference.

finite-automatadfaproduct-constructionclosure-properties
الگوریتمنظریه زبان‌ها و ماشین‌ها
Converting a Finite Automaton to a Regular Expression (State Elimination / GNFA)

Rip out states one by one, rerouting their paths into edge labels, until only start and accept remain; what's left on that edge is the regular expression — Arden's rule does the same job algebraically.

regular-expressionsfinite-automatastate-eliminationgnfa
مفهومنظریه زبان‌ها و ماشین‌ها
Closure properties of regular languages (and what fails for infinite unions)

Regular languages are closed under every standard operation — union, intersection, complement, concatenation, star, reversal, homomorphism — but a countably infinite union of regular languages need not be regular.

regular-languagesclosure-propertiesunion-intersection-complementproduct-automaton
قضیهنظریه زبان‌ها و ماشین‌ها
Proving a Language Non-Regular via the Pumping Lemma

Every regular language has a pumping length p such that any long string splits as xyz with y pumpable; find one long string whose every legal split breaks membership, and the language cannot be regular.

pumping-lemmanon-regularregular-languagesproof-by-contradiction
مفهومنظریه زبان‌ها و ماشین‌ها
Computational power of extended PDAs: two-stack PDA is Turing-equivalent

One stack = exactly the CFLs; TWO independent stacks = a full Turing machine. The number of stacks, not the fancy access rules, is what jumps you past context-free.

theory-of-computationpushdown-automatatwo-stack-pdaturing-equivalence
الگوریتمنظریه زبان‌ها و ماشین‌ها
Tracing an NFA on a String: Following Nondeterministic Branches to Decide Acceptance

An NFA accepts a string iff at least one choice of transitions ends in an accepting state — track the whole set of reachable states symbol by symbol instead of guessing one lucky path.

nfanondeterminismstring-acceptancesubset-construction
مفهومنظریه زبان‌ها و ماشین‌ها
Linear languages and their closure properties

Linear = at most ONE nonterminal per rule body. They sit strictly between regular and context-free, and are closed under union, reversal and homomorphism but NOT under intersection, complement or concatenation.

theory-of-computationlinear-languageslinear-grammarclosure-properties
الگوریتمنظریه زبان‌ها و ماشین‌ها
NFA to DFA: subset construction, epsilon-closure, and minimization

Convert any (epsilon-)NFA to an equivalent DFA whose states are sets of NFA states — then, if the question asks for the minimum number of states, minimize the result rather than reporting the raw subset count.

nfadfasubset-constructionpowerset-construction
مفهومنظریه زبان‌ها و ماشین‌ها
How head-movement restrictions change a Turing machine's power

Adding a Stay option keeps a TM at full recursively-enumerable power, but forbidding the head from re-scanning what it already passed collapses it: a head that can never (or only once) move back toward the start reads each cell at most once and recognizes only regular languages.

turing-machinehead-movementstay-optionrecursively-enumerable
مفهومنظریه زبان‌ها و ماشین‌ها
Turing reducibility: direction, equivalence, and reduction to the complement

A <=T B means a decider for A exists given an oracle for B. Solvability flows OPPOSITE the arrow (B easy => A easy), <=T is a preorder not a partial order (mutual reduction gives Turing-equivalence, not equality), and oracles are closed under complement, so A <=T A^c always.

turing-reducibilityoracle-turing-machinedecidabilityundecidability
مفهومنظریه زبان‌ها و ماشین‌ها
Proving a grammar ambiguous (and language equivalence): the dangling-else example

A CFG is ambiguous iff some string has two distinct leftmost derivations (equivalently, two distinct parse trees) — exhibit ONE such string to prove it. Ambiguity is a property of the grammar, not the language: two grammars can generate the same language while one is ambiguous and the other unambiguous, as the classic dangling-else grammar shows.

ambiguitycontext-free-grammarleftmost-derivationparse-tree
مفهومنظریه زبان‌ها و ماشین‌ها
Empty and finite languages are regular: regular subsets of any language

The empty language and every finite language are regular, so a non-regular language must be infinite and nonempty. Two cheap regular subsets sit inside ANY language L: the empty set, and any finite subset you pick. Use these facts to instantly kill exam claims like 'some language has no regular subset' or 'a non-regular language could be finite'.

empty-languagefinite-languageregular-languageregular-subset
مفهومنظریه زبان‌ها و ماشین‌ها
Inherently ambiguous CFLs and the DCFL / unambiguous-CFL / CFL hierarchy

Ambiguity is a property of a grammar (a string with ≥ 2 parse trees); inherent ambiguity is a property of a language (every grammar for it is ambiguous). These nest into a strict chain RegularsubsetneqDCFLsubsetneqUnambiguous CFLsubsetneqCFL : every deterministic CFL is unambiguous, but some CFLs are inherently ambiguous and lie outside even the unambiguous class.

context-freeinherent-ambiguityambiguous-grammardcfl
مفهومنظریه زبان‌ها و ماشین‌ها
NFAs With No ε-Moves and a Single Accepting State: When the Start Must Accept

Drop ε-transitions and force one accepting state, and if ε∈L the start must equal that accepting state — which forces every accepted string to loop back, making L closed under concatenation.

nfaepsilon-transitionsfinite-automataaccepting-state
مفهومنظریه زبان‌ها و ماشین‌ها
Turing-recognizable (RE) languages: closure properties and domain/range characterization

L is RE iff it is the DOMAIN of a partial computable function, iff it is the RANGE of one (or empty), iff it is enumerable. RE is closed under finite union/intersection, concatenation, star, homomorphism, and EFFECTIVE countable union (dovetailing) — but NOT under complement nor arbitrary countable union.

recursively-enumerableturing-recognizablesemidecidableclosure-properties
قضیهنظریه زبان‌ها و ماشین‌ها
Every context-free language over a unary alphabet is regular (Parikh)

Over a one-letter alphabet the language hierarchy collapses: every context-free L over a single symbol is already regular. This follows from Parikh's theorem (CFL Parikh images are semilinear, and over a unary alphabet the Parikh image IS the language, so the set of lengths is eventually periodic = regular). It does NOT say arbitrary subsets of a^ are regular.

parikh-theoremunary-alphabetcontext-free-languageregular-language
مفهومنظریه زبان‌ها و ماشین‌ها
DFAs for a Forbidden Substring (Trap States)

Recognize "strings that avoid a fixed pattern" with a DFA that tracks the longest matched prefix of the pattern and drops into an absorbing non-accepting trap state the instant the whole pattern appears.

dfatrap-statedead-stateforbidden-substring

سوالات · 30/90

همهٔ 90 سؤال →