Professional Documents
Culture Documents
construct. Note that the NFA must cover the generic syntax of the construct, and not
be limited to just a specific sample code. The syntax covers all valid code for the
construct, hence the NFA must accept all valid code, whilst rejecting all invalid code.
Solution:
The while loop construct of the Python programming language is chosen to design the Non-
deterministic Finite Automata (NFA).
while (condition):
statement
… (code block)
σ = {w, h, i, l, e, (, ), :, α, β}
α = Condition
β = Body of statements
∅ =! σ (invalid input)