Models of Computation

Lakukan tugas rumah & ujian kamu dengan baik sekarang menggunakan Quizwiz!

How are Kleene Stars of patterns generated?

ε-move to the start of the pattern, ε-move from the end of the pattern to the start of the pattern, ε-move from the end of the pattern to an accepting state, ε-move from the initial state to an accepting state.

How are alternatives of patterns generated?

ε-moves from the initial state to the start of both patterns and then ε-moves from the end of the patterns to an accepting state.

What does a non-deterministic pushdown automata consist of?

∑ - A finite input alphabet. γ - A finite stack alphabet. EOS, EOF - special symbols to indicate the stack is empty and the end of the input string has been reached. Q - A finite set of states. q₀ - A start state. F - A set of accepting states. δ - A transition relation.

What is the set of strings over an alphabet?

∑⁰ = {ε} ∑ⁿ = the set of all strings over ∑ of length n, e.g. ∑¹ = ∑ ∑* = (n = 0 to ∞) ∪∑ⁿ

What do the following mean in a PDA: (a,ε)→A? (ε,ε)→ε? (EOF,EOS)→ε?

(a,ε)→A : read in symbol a, pop nothing from the stack, push A to the stack. (ε,ε)→ε : read in nothing, pop nothing from the stack, push nothing. (EOF,EOS)→ε : End of File, Stack is Empty, push nothing.

What is a leftmost derivation?

A derivation in which only the leftmost non terminal symbol is replaced.

What is a deterministic finite automaton?

A deterministic finite automaton is a deterministic finite state machine (Q,Σ,δ) that has in addition: An element q₀ ∈ Q, the start state. A set F ⊆ Q of accepting states.

What determines that a machine is deterministic?

A machine is deterministic if for every state and every command there is exactly one resulting state to change to.

A subset of a computational data type is decidable if......?

A program can be written which can print out yes or no depending on whether the element belongs to the subset or not.

A non-deterministic machine doesn't have a transition function, what does it have instead?

A transition relation. relation from Qx∑ to Q. Mathematically a subset of Qx∑xQ.

What is the process of removing ε-moves?

Add all triples (p,x,q) a sequence of ε-move transitions followed by x, which goes from p to q. Add all states which have a path to an accepting state consisting of ε-moves to F. Remove unreachable states.

What is Rice's Theorem?

All non-trivial properties of programs are undecidable.

How is a context free grammar defined?

An alphabet ∑ of terminal symbols. An alphabet N of non terminal symbols. A finite set P of productions. A special variable S ∈ N, called the start symbol.

What is a semantic class?

An equivalence between programs based on their semantics. e.g. a two programs which given the same inputs produce the same outputs, are in the same semantic class.

What is a language?

Any subset L ⊆ Σ*

Outline a proof of the Halting problem being undecidable in Java?

Define a program ajc, which prints one of three results, "causes exception", "terminates properly" and "loops for ever" when given a program file and an input file. ajc always produces the correct answer and never raises an uncaught exception or loops forever. Define a second program contra which is the same as ajc but takes one filename and uses this for both, applies the program to itself, and loops instead of terminating properly. A contradiction forms when you apply the checker to contra.

What is the process for removing non-determinacy?

Explore all possible paths in the non-deterministic automaton in parallel. Labelling states as members of the power set of original states. Accepting states are any states which contain an original accepting state in their set.

How can we prove something is undecidable?

For a non-trivial property of a program, use Rice's theorem. Otherwise attempt to reduce the Halting problem, or a known undecidable problem to the given problem. Show how this could be used to decide a known undecidable problem.

What is a transition function?

Function which returns for every state q∈Q and every command x∈∑ the next state δ(q,x). A function from Qx∑ to Q.

What a derivation?

Generating a string according to some grammar. Continual replacing of non terminal symbols to form a string of terminal symbols.

How can an extended alphabet be simulated on a Turing machine?

Grouping cells of the tape together and encoding symbols of the larger alphabet. e.g. with 3 cells you can encode 27 higher level symbols, and whenever the higher machine would move one cell the simulating machine will move three cells read the contents.

Let L ⊆ ∑* and M ⊆ A* be languages such that M is reducible to L, what holds?

If M is undecidable, then L is also undecidable. If L is decidable then M is decidable.

What is Kleene Star of patterns for regular expressions?

If p is a pattern then so is (p*)

What is Alternative of patterns for regular expressions?

If p₁ and p₂ are pattens then (p₁|p₂)

What is Concatenation of patterns for regular expressions?

If p₁ and p₂ are pattens then p₁p₂ is a pattern.

When is a language called semidecidable?

If there is program that will reliably print "yes" if that is the answer. But may go into an infinite loop if the true answer is "no".

How can a multi-tape machine be simulated on a Turing machine?

Interleave the two tapes, with a blank between each data cell as spacers to hold special symbols to denote the start or end of the individual tapes.

What does it mean to say M is reducible to L?

It means that if we could get a decision procedure for L, we could then use that to decide membership of M.

What is the precedence of Concatenation, Alternative and Kleene Star in regular expressions?

Kleene star binds most tightly Concatenation. Alternative binds least tightly.

What is a pumpable part?

Let L be a language. Let w be a word in L. Suppose w can be split into three parts, u, y, v. Where y is non-empty. Y is a pumpable part of w if L contains w=uyⁿv for every natural number n.

What is the pumping lemma?

Let L be a regular language. Then L has a "pumping length" - a natural number, n > 0 such that for any word in L, any n-character stretch within w includes a pumpable part of w.

Is a java termination checker possible?

No, as if we had this, it could be used to define ajc which we know is undecidable. Running two passes of jtc, one with the body of the program in a try block, will determine one of the three outputs of ajc.

What does a Finite State Machine consist of?

Q - A finite non-empty set of states. ∑ - A finite set of commands. δ - A transition function.

What are the semantics of a program nth prime number, given a number n?

Semantically, the program represents an implementation of the mathematical function which maps every positive integer n to the nth prime number.

What are the 2 base cases of patterns for regular expressions?

The empty string is a pattern. Every letter from ∑ is a pattern.

What is the Halting problem?

The halting problem is the problem of determining, from a description of an arbitrary computer program and an input, whether the program will finish running or continue to run forever.

The semantics of a program refers to?

The input-output behaviour of a program.

What can the pumping lemma do? What can't it do?

The pumping lemma cannot be used to prove a language is regular. It can be used to show that a given language is not regular by showing it violates the pumping property.

How can a 2D Turing machine be simulated on a Turing machine?

The rows of the table are stored on the tape with a separation symbol. If you need to go up a row, you move the same steps past the next separator to the left, and right for down. To insert a row, add to the end or shift. To add a column, shift and add one cell to each group.

Syntax of a program refers to?

The rules of the programming language or the source code of a particular program.

What is a non-trivial property of a program?

There is at least one program which computes a function satisfying the property, and one which doesn't.

The Halting problem is?

Undecidable. (Semidecidable)

What is Church's Thesis?

Whatever can be done by any computational device can be done by a Turing machine. Church's Thesis cannot be proven.

What is [a-z] an abbreviation for?

a|b|c|d|e|f|g|h|i|j|k|l|m|n|o|p|q|r|s|t|u|v|w|x|y|z

How are patterns concatenated?

pattern one, an ε-move from the end of pattern one to the start of pattern two, with an accepting state at the end of pattern two.


Set pelajaran terkait

Progression: Maintenance Tech I - II Conventional

View Set

Chapter 58: Drugs Affecting Gastrointestinal Motility

View Set

MDC 3 Rasmussen Module 4 Assessment Respiratory/ Upper Respiratory D/Os

View Set

835 Unit 2 Quiz - body weight calculations

View Set

Macroeconomics Chapter 26, 28, 30

View Set