• Keine Ergebnisse gefunden

Exercise 11.1 PDS Modeling

N/A
N/A
Protected

Academic year: 2021

Aktie "Exercise 11.1 PDS Modeling"

Copied!
1
0
0

Wird geladen.... (Jetzt Volltext ansehen)

Volltext

(1)

Applied Automata Theory (WS 2012/2013) Technische Universit¨ at Kaiserslautern

Exercise Sheet 11

Jun.-Prof. Roland Meyer, Reiner H¨ uchting, Georgel C˘ alin Due: Tue, Jan 15 (noon)

Exercise 11.1 PDS Modeling

Consider the following C-like code, in which int r() is a function that randomly returns 0 or 1. Give a pushdown system that models the program. Thereby, describe how you decided to represent the program counter and the value of variable x.

Hint: In a first step, assign each line in the code a unique label.

void m() {

x=1;

if(r()==1) s();

}

void s() {

x=0;

if(r()==1) m();

}

int x=0;

void main() {

m();

}

Exercise 11.2 pre + Method

The set pre + (C) can be calculated by determining pre (C) and then pre(pre (C)). Thus, it may be necessary to have a method to compute pre(C) for a given set C. Present a general description of such a method. Hint: Look at the example given in the lecture.

Exercise 11.3 pre Computation

Use the algorithm given in the lecture to determine pre (C) in the pushdown system below, where C = {(q, w) | w ∈ {γ, δ} and |w| is even}.

p q

γ/ε

γ/ε δ/ε

Exercise 11.4 pre Computation

Compute A pre

starting from A (left) and P (right) given below.

p

q r

s 1 s 2

γ γ

p

q

r γ/δ 1 γ δ 12 γ δ 1 /ε

δ 2 /δ 1

Referenzen

ÄHNLICHE DOKUMENTE

Applied Automata Theory (WS 2013/2014) Technische Universit¨ at Kaiserslautern. Exercise

[r]

Applied Automata Theory (WS 2014/2015) Technische Universit¨ at Kaiserslautern.. Exercise

Applied Automata Theory (WS 2014/2015) Technische Universit¨ at Kaiserslautern. Exercise

Applied Automata Theory (WS 2014/2015) Technische Universit¨ at Kaiserslautern.. Exercise

Applied Automata Theory (WS 2014/2015) Technische Universit¨ at Kaiserslautern.. Exercise

Applied Automata Theory (WS 2014/2015) Technische Universit¨ at Kaiserslautern. Exercise

Applied Automata Theory (WS 2014/2015) Technische Universit¨ at Kaiserslautern.. Exercise