Lecture 3
FIT2014 Theory of Computation
Terms
Sentences
Quantifiers
Knowledge
Representation
All men are mortal
Socrates is a man.
Therefore Socrates is mortal.
Objects: socrates,
set of people.
Properties: man, mortal
There is an app which is loved

FIT2014 Theory of Computation
Computable
Languages
Recursive Languages
ALAN
ALAN
Other Machines
For a Turing Machine T
Accept(T)
The set of strings leading to a ACCEPT state.
Called the language accepted by T.
Reject(T)
The set of strings that c

Slides by Graham Farr, Monash University, Sept 2012
FIT2014 Theory of Computation
Decidability: its not enough
Time complexity
Polynomial time
The class P
Properties of P
Examples of languages in P
Solvable, in principle, by a computer
Doesnt matter

Slides by Graham Farr, Monash University, Oct 2012
FIT2014 Theory of Computation
Some languages are easier to decide than others.
How to compare languages?
Could we use time complexity?
seldom known exactly; usually we just know an upper
bound (e.g., b

Nondeterministic Polynomial time,
and the class NP
Slides by Graham Farr, Monash University, Oct 2012
FIT2014 Theory of Computation
Overview
Deciding and Verifying
Certificate
The class NP
Proving membership of NP
Examples of languages in NP
P !

Slides by Graham Farr, Monash University, Oct 2012
FIT2014 Theory of Computation
NP-completeness
The Cook-Levin Theorem
Reductions to SATISFIABILITY
Proving NP-completeness
Implications of NP-completeness
In NP, not known to be in P:
SATISFIABILITY, 3

Monash University
Faculty of Information Technology
Lecture 3
Lecture 6
Finite Automata
Slides by David Albrecht (2011), modified by Graham Farr (2013).
FIT2014 Theory of Computation
Overview
Definition
How
they are used to define languages
Representat

Monash University
Faculty of Information Technology
Lecture 18
Lecture 2
Propositional Logic
Slides by David Albrecht (2011), modified by Graham Farr (2013).
FIT2014 Theory of Computation
Overview
! Propositions
! Connectives
! Tautologies
! Arguments
! R

Monash University
Faculty of Information Technology
Lecture 3
Lecture 4
Proofs
Slides by Graham Farr (2013-2014).
FIT2014 Theory of Computation
Overview
Finding
proofs
Proof by construction
Proof by cases
Proof by contradiction
Proof by induction
ba

Monash University
Faculty of Information Technology
Lecture 20
Lecture 3
(A) Predicate logic
(B) Prolog
Slides by David Albrecht (2011), modified by Graham Farr (2013-2014).
FIT2014 Theory of Computation
Overview
Predicate logic
Sentences
Quantifiers
K

Monash University
Faculty of Information Technology
Lecture 2
Lecture 5
Regular Expressions
Slides by David Albrecht (2011), modified by Graham Farr (2013).
FIT2014 Theory of Computation
Overview
Some
Problems
Applications of Regular Expressions
Simple

Monash University
Faculty of Information Technology
Lecture 1
Slides by David Albrecht (2011), modified by Graham Farr (2013).
All materials produced for teaching this course of study, including all lectures and any supplementary materials are
protected b

Monash University
Faculty of Information Technology
Overview
Questions
Kleenes Theorem
Convert
Lecture 7
Kleenes Theorem.
Slides by David Albrecht (2011) and Graham Farr (2013).
Regular
Expressions to NFA
Convert NFA to FA
Convert FA to
Regular Expre

Monash University
Faculty of Information Technology
Lecture 3
Overview
Finding
proofs
by construction
Proof by cases
Proof by contradiction
Proof by induction
Proof
Lecture 4
Proofs
base case
inductive step
conclusion
Slides by Graham Farr (2013-2

Monash University
Faculty of Information Technology
Overview
Definition
Lecture 3
How
they are used to define languages
Representations
Complement Languages
Comparison with Regular Expressions
Lecture 6
Finite Automata
Slides by David Albrecht (2011)

Undecidable Problems
FIT2014 Theory of Computation
Overview
Countable Sets
Uncountable Sets
Halting Problem (or Entscheidungsproblem)
Other undecidable problems
Computable sets
Formal Logic Theory
Gdel s Incompleteness Theorem
Turing Results

FIT2014 Theory of Computation
Tables
for Turing Machines
Encoding
Decoding
Definition of a Universal Turing Machine
(UTM)
Algorithm for a Universal Turing Machine
Input Alphabet
ab
Tape Alphabet
ab#
Start
State
Numbered 1.
Accept
State
Numbered

FIT2014 Theory of Computation
Decidable
problems
Deciders
Decidable
Languages
A Decidable Logic Theory
Given a Finite Automaton, can we determine
whether it defines the empty language?
Given two Regular Expressions, can we tell
whether they define th

Lecture 1
A./Prof. David Dowe and A./Prof. Graham Farr
Important
information
Language
Examples
Terminology
Other
things we will cover in the course.
Assoc. Prof. David Dowe
Room 230, Building 63
Email:David.Dowe_at_monash.edu
and
Assoc. Prof. Graham

Lecture 18
FIT2014 Theory of Computation
Outline
of issues in this lecture
Propositions
Connectives
Tautologies
Arguments
Representing Knowledge
A proposition is
A
statement
which is
Either
true or false.
2
+2=4
Is a proposition which is true.

Lecture 3
FIT2014 Theory of Computation
Definition
How
they are used to define languages
Representations
Complement Languages
Comparison with Regular Expressions
Sometimes
known as a Deterministic Finite
Automaton (or Finite State Automaton,
or Fini

Lecture 20
FIT2014 Theory of Computation
Prolog
Database
List
Arithmetic
Implementing
Non-deterministic Finite
Automata (NFAs)
Towers of Hanoi
Programming Language: Sicstus (for
Prolog)
PROgramming
in LOGic
Used for solving problems between
objec

Lecture 2
FIT2014 Theory of Computation
Some
Problems
Applications of Regular Expressions
Simple Languages
Regular Expressions
Regular Languages
Find
all the files which contain old subject
course codes.
Find all the e-mail addresses in a set of ma

FIT2014 Theory of Computation
Questions
Kleenes Theorem
Consequences
Convert
Regular Expressions to NFA
Convert NFA to FA
Can
every language which is represented
by a regular expression be described
by a finite automaton?
Can every language which i

FIT2014 Theory of Computation
Circuits
Pumping
Lemma
Non-regular Languages
Intersection of Regular Languages
b
a
a
b
b
b
a
b
b
a
a
a
abbab .
a
b
A
circuit is a path which starts and ends
at the same state.
The length of a circuit is the number of
e

FIT2014 Theory of Computation
Chomsky
Normal Form
CYK Parsing algorithm
Every CFG can be represented as a PDA
Pumping Lemma
A CFG is said to be in Chomsky Normal
Form if all the productions are in the form
Nonterminal Nonterminal
Nonterminal
or
Nonter

FIT2014 Theory of Computation
Lexical Analyzer
Tokens
and lexemes
Implementing Lexical Analyzer
Other Algorithms
- 2 . 4 5 + 3 . 98
*
0 . 4 5 6 \n
Lexemes:
-2.45
+
3.98
*
Tokens:
Numbers, spaces, operators, newlines
0.456 \n
c
i
i
cfw_
l
l
c
n
S
n
as

FIT2014 Theory of Computation
Definition
Examples
Top
Down Parsers
Recursive Descent Parsers
Predictive Parsers
Bottom
Up Parsers
LR Parsers
Suppose
you have a Context Free
Grammar, and a string of letters.
Parsing is the task of determining
whet

Context Free Grammars
FIT2014 Theory of Computation
Overview
Recursive
Definitions
Context Free Grammars
Parse Trees
Derivations
Arithmetic Expressions
1. All integers are Arithmetic Expressions
2. If A and B are Arithmetic Expressions, so
are:
(i

FIT2014 Theory of Computation
Regular
Grammars
Pushdown Automata (PDAs)
Constructing a PDA to accept a Regular
Grammar
1. Name all the states in the NFA by a
symbol.
Call the Start State S.
2. For each edge
X
a
write:
X aY
Y
3. For each edge
X
write: