100% tevredenheidsgarantie Direct beschikbaar na je betaling Lees online óf als PDF Geen vaste maandelijkse kosten 4.2 TrustPilot
logo-home
College aantekeningen

Lecture Notes on Recursion for Syntax and The Natural Numbers (COMP11120)

Beoordeling
-
Verkocht
-
Pagina's
2
Geüpload op
30-05-2024
Geschreven in
2023/2024

Unlock the power of recursion with these detailed lecture notes for COMP11120. Covering essential topics such as recursive definitions, applications in syntax, and the properties of natural numbers, these notes offer clear explanations and practical examples to solidify your understanding. Ideal for COMP11120 students and self-learners alike, these notes are organized and concise, making complex concepts accessible and easier to grasp. Enhance your learning and excel in your studies with this indispensable resource!

Meer zien Lees minder
Instelling
Vak








Oeps! We kunnen je document nu niet laden. Probeer het nog eens of neem contact op met support.

Geschreven voor

Instelling
Studie
Onbekend
Vak

Documentinformatie

Geüpload op
30 mei 2024
Aantal pagina's
2
Geschreven in
2023/2024
Type
College aantekeningen
Docent(en)
Andrea schalk
Bevat
Recursion for syntax and the natural numbers

Onderwerpen

Voorbeeld van de inhoud

Recursion for Syntax and The Natural Numbers

Syntax and recursion :
Logic

Propositional Formulae are defined recursively ! Example of a recursively defined operation : boolean interpretation

base case If p is a
propositional atom ,
then p is a
formula
Let be valuation that 10 13 to each prop variable
Step .
case
If A is a formula ,
then -A is a
formula v a assigns a value in , .




·
If A B ,
are
formulae ,
then o
AvB Can define Iv : Set of all prop formulae > 10 1),




·
An B base case Irp =
up

·
A > B Step Cases < [v(1A) = LIVA


are
formulae .
v
[v(AvB) = IvA v IrB


1 [v(AnB) =
IvA n lvB


< Iv(A >
B) = IvA > IvB




Syntax and recursion : Formal Languages

Example Pattern : (or regular expression) over alphabet Example : The
property of a
string matching a pattern is recursive




base cases &O is a
pattern base cases & E matches E

E G is a pattern X xEE matches X

X Forxe[ ,
X is a
pattern Step cases - If s, matches p , and se matches Pe then Sisa matches (pipal
,



Step cases + If P , PC are patterns , then so is (PIPa) If s matches p , then
s matches P, /P2

If p , pC are patterns , then so is (P /Pa) , If s matches pa then
s matches P, /P2
,


If pattern then (P )
*
*
p
is a
,
so is *
If ne I and Sy up to Sn pr then
match SiSa ...
In matches pX
What if n = 0 ?

> 3 matches p*




Example : Consider the following definition mapping patterns over [ to subsets of IR




I
base cases 20 = O

-LE =
43] Can prove by induction :

x2x =
(2) Prop Lp =
[SE ** Is matches pl
oncatonation
.




Step cases
+
h(pipa) =
Lp . .
2 c =
455/st2 se2) ,



[(p /Pa)
.
=
Lup u Lp
, &* =
(5 ,
...

Sn nEIN ,
SitL]
*((p*) =
(2p) *



Further examples of recursive constructions ·
Recursion is a
very useful way of defining syntatic expressions of arbitrary leught
·
string generated by a
grammar
·
Can then also use recursion to help us
give meaning to such expressions.

· The While language :
· arithmetic expressions ·
Can then use induction to prove properties of such expressions operations or properties for these.
·
boolean expressions

·
statements
·
Execution of While
a
program
·
Derivations of Hours triples for While programs
€7,66
Krijg toegang tot het volledige document:

100% tevredenheidsgarantie
Direct beschikbaar na je betaling
Lees online óf als PDF
Geen vaste maandelijkse kosten

Maak kennis met de verkoper
Seller avatar
jpxoi

Ook beschikbaar in voordeelbundel

Maak kennis met de verkoper

Seller avatar
jpxoi The University of Manchester
Volgen Je moet ingelogd zijn om studenten of vakken te kunnen volgen
Verkocht
0
Lid sinds
1 jaar
Aantal volgers
0
Documenten
20
Laatst verkocht
-

0,0

0 beoordelingen

5
0
4
0
3
0
2
0
1
0

Recent door jou bekeken

Waarom studenten kiezen voor Stuvia

Gemaakt door medestudenten, geverifieerd door reviews

Kwaliteit die je kunt vertrouwen: geschreven door studenten die slaagden en beoordeeld door anderen die dit document gebruikten.

Niet tevreden? Kies een ander document

Geen zorgen! Je kunt voor hetzelfde geld direct een ander document kiezen dat beter past bij wat je zoekt.

Betaal zoals je wilt, start meteen met leren

Geen abonnement, geen verplichtingen. Betaal zoals je gewend bent via iDeal of creditcard en download je PDF-document meteen.

Student with book image

“Gekocht, gedownload en geslaagd. Zo makkelijk kan het dus zijn.”

Alisha Student

Veelgestelde vragen