Lecture Notes on Part II of Fundamentals of Computation (COMP11212)
4 views 0 purchase
Course
Fundamentals of Computation (COMP11212)
Institution
The University Of Manchester (UOM)
Advance your understanding of computation with these in-depth lecture notes on Part II of Fundamentals of Computation (COMP11212). These notes cover: The While Programming Language, Coding and Counting Programs, Complexity and Asymptotic Analysis, and. Correctness
These lecture notes provide a s...
The while programming language, coding and counting programs, complexity and asymptomatic analysis, and correctness
Subjects
coding
big oh
notation
complexity
computability
correctness
while programming language
Written for
The University of Manchester (UOM)
Unknown
Fundamentals of Computation (COMP11212)
All documents for this subject (6)
Seller
Follow
jpxoi
Content preview
The While Programming Language
he Three Cs of
-
Computer Science What is a computer ?
1. Does
program Pr and Pa that
a both compute a
function ,
f
Complexity A thing that compute...
which one is better ?
.
2 Does Correctness
a
program p correctly compute a
function fu
.
3 What functions can we compute ? i e
.
. are there functions that Computability
cannot be computed by any program ?
Do we need a
computer for Computation ?
No !
The While
Programming Language
Semantics What a
Meaning of a
program what function it
computes
:
program means
Define what it means to interpret execute programs Operational
Syntax : The
form that programs are allowed to take We
focus on these
Define a
program by what it provably does Axiomatic
All languages have will defined
a
syntax
Transform other metalanguage Denotational
Very few have a
formal semantics programs
into some
Syntax given as a
grammar Semantics of the Language
.
5 v := alskip)Seise if then Sy else Se while b do s We need : Weintroduce a relation - on
programs and states :
b : true false an = as an Ea2 it b, "be
·
Represent current values of variables (State
a : In a, +as a, -de a, a2
·
Evaluate arithmetic and logical expressions Si G
A
↓ Sid
·
program state
·
Show how program statements transform state
, [iffetiff] b is true
,
then use iffet b is false , then use iffff [while]
if two then [J] *
else [J) While (y < 1) do (y : y + 2) [y Y
1 else
~
,
z := v : = 2
,
if xx then X := 1 v : = 2 = + 2]
10
,
I
So
,
9b Si Sa 9b Si
WE While (y < 1) do (y : =
y + 2)
S2
-
↓ (v : = 1
, []Y (iftt) ↓ [v : = 2, [JY lifff) ↓ (if (y <1) than (4 :=
y +2
; W) also ship [y
,
+
2]) [while]
Rewrite ! Alternative !
[x : = 1
,
[3)][X +
1] X(x := x +1
,
[x +
1]) [ass]
[comp2]
[ : = 1 ; k : = x +1
, [])X(k := x + 1 ,
[x +
1]) ↓ [x +
2] [ass]
The benefits of buying summaries with Stuvia:
Guaranteed quality through customer reviews
Stuvia customers have reviewed more than 700,000 summaries. This how you know that you are buying the best documents.
Quick and easy check-out
You can quickly pay through credit card or Stuvia-credit for the summaries. There is no membership needed.
Focus on what matters
Your fellow students write the study notes themselves, which is why the documents are always reliable and up-to-date. This ensures you quickly get to the core!
Frequently asked questions
What do I get when I buy this document?
You get a PDF, available immediately after your purchase. The purchased document is accessible anytime, anywhere and indefinitely through your profile.
Satisfaction guarantee: how does it work?
Our satisfaction guarantee ensures that you always find a study document that suits you well. You fill out a form, and our customer service team takes care of the rest.
Who am I buying these notes from?
Stuvia is a marketplace, so you are not buying this document from us, but from seller jpxoi. Stuvia facilitates payment to the seller.
Will I be stuck with a subscription?
No, you only buy these notes for $12.32. You're not tied to anything after your purchase.