تم الحل ✓
categoryقانون عمل وضمان اجتماعي
schoolبكالوريوس
event_available2026-07-15
السؤال
Transcribed Image Text:
Foundations of Computing
UFCFFS-30-1
Mark
/20
Portfolio Task 3 Due 23-12-2020
Based on the FA you already designed, your next task is to extend it to a Pushdown
Automaton (PDA) which can recognise arithmetic expressions with brackets. All
brackets must be paired up correctly. Multiplication operator can't be omitted.
Some accepted examples: 1, -2, -(1), (1+2)*(3-7.3), 1/(-3-1), 8*-(3/8), ((1.2))/(2.1)
Some rejected examples: (3)), (2)(3), 4-), (1.)5, ((3)3)
In Appendix, we show you an example of PDA which accepts strings of unary numbers
with correctly matched brackets. Please fully understand how it works. When you
design your PDA, you should use your FA (from previous worksheet) as a start point.
You need to modify your FA into a PDA, thinking carefully where are the positions
you should allow open/close brackets.
For full marks the diagram must be complete and correct in every respect.
This worksheet is worth of 30% this term's assignment.
The hand in date is Thursday 23rd of Dec 2020.
Appendix - An Example of PDA
A simple example of PDA is a recogniser for the language
{1, 11, 111, (1), (1)(1). (1(11)), ((1)(1)11),
}
Below is a possible PDA.
S1
push($)
push('()
Task 2-model answer
'push('(')
1/nop
S3
1/nop
AS/pop
Please use this as a start point for Portfolio task 3
0-9
pop
0-9
•
start
digit
dec1
sign
0-9
0-9
(dec2
0-9
H
check_circle الجواب — حل مفصل خطوة بخطوة
hourglass_top
🔒
الحل الكامل متاح للمشتركين
اشترك في أرشيف الأسئلة لعرض هذا الحل وآلاف الحلول المفصلة خطوة بخطوة من معلمين معتمدين.