• Ei tuloksia

173205 Theoretical foundations of computer science

N/A
N/A
Info
Lataa
Protected

Academic year: 2022

Jaa "173205 Theoretical foundations of computer science"

Copied!
1
0
0

Kokoteksti

(1)

173205 Theoretical foundations of computer science 2nd middle term exam 21.4. 2005

Write your name, student number, signature, course name and date to all solution papers. Total 42 p.

1. (10 p) Let’s consider the following grammarG:

S→AC|CaX|CaCb|CcC|c|DE|CaA|a|CbY|CbCc

X→ACb

Y →ECc

A→CaX|CaCb

C→CcC|c D→CaD|a E→CbY|CbCc

Ca →a Cb→b Cc →c

Study with CYK-algorithm, whether stringaabbcbelongs to the language described by the grammar!

2. (12 p) The main subclasses of context-free languages are:

Linear languages LL(1)-languages

Deterministic languages Unambiguous languages

Inherently abmiguous languages

(a) Into which subclass of context-free languages do the following languages belong? Se- lect the easiest (innermost) subclass, into which the language belongs. Notice that you can transform the language to a more familiar form, if you want.

G1:S →SD|D,D→0|1|...|9

G2:S →aXbC|AbY c,X →aXb|²,C→cC|c,A→aA|a,Y →bY c|²

G3:S →aSb|B,B→bB|²

(b) How can you solve the parsing problem ”x∈L?” most efficiently in each of the sub- classes?

3. (10 p) Construct a standard-model deterministic Turing machine, which adds number 2 to the input binary number. You can assume that the input is given the least significant bit on left (e.g. number 4 is presented as 001).

4. (10 p)

(a) According to Rice’s theorem all nontrivial semantic properties of Turing machines are unsolvable. What does this exactly mean?

(b) Which of the following properties of Turing machines are syntactic and which seman- tic?

Machine accepts all stringsx∈ {a, b},|x|<100.

For the codecM of machineM holds|cM|<100.

In the machine there are at least 5 states, from which you can enter the accepting final state.

If the size of input isn, then the machine performs exactlynsteps before entering the final state.

(c) Consider the nontrivial semantic properties in the previous task. Are they partially solvable or totally unsolvable? Justify carefully!

Viittaukset

LIITTYVÄT TIEDOSTOT

7 Tieteellisen tiedon tuottamisen järjestelmään liittyvät tutkimuksellisten käytäntöjen lisäksi tiede ja korkeakoulupolitiikka sekä erilaiset toimijat, jotka

Työn merkityksellisyyden rakentamista ohjaa moraalinen kehys; se auttaa ihmistä valitsemaan asioita, joihin hän sitoutuu. Yksilön moraaliseen kehyk- seen voi kytkeytyä

Aineistomme koostuu kolmen suomalaisen leh- den sinkkuutta käsittelevistä jutuista. Nämä leh- det ovat Helsingin Sanomat, Ilta-Sanomat ja Aamulehti. Valitsimme lehdet niiden

Istekki Oy:n lää- kintätekniikka vastaa laitteiden elinkaaren aikaisista huolto- ja kunnossapitopalveluista ja niiden dokumentoinnista sekä asiakkaan palvelupyynnöistä..

In example (3), the speaker is indicating a closeness and a low register to the interlocutor, while referring to the doctor using an honorific third person register. These do not

The problem is that the popu- lar mandate to continue the great power politics will seriously limit Russia’s foreign policy choices after the elections. This implies that the

The US and the European Union feature in multiple roles. Both are identified as responsible for “creating a chronic seat of instability in Eu- rope and in the immediate vicinity

The main decision-making bodies in this pol- icy area – the Foreign Affairs Council, the Political and Security Committee, as well as most of the different CFSP-related working