Question
For all formal languages you design, use BNF without the construct { } for 0, 1, or more repetitions. 1. Define a formal language for
For all formal languages you design, use BNF without the construct { } for 0, 1, or more repetitions.
1. Define a formal language for the framework of Social Security Numbers, consisting of the format AAA-GG-SSSS, where each AAA is a 3-digit combination of numbers, GG a 2-digit combination of numbers, and SSSS a 4-digit combination of numbers. It yields potential Social Security Numbers (pSSNs).
While valid social security numbers have certain restrictions on the combination of numbers, this framework considers only the particular format that valid SSNs need to adhere to.
2. Modify the SSN wff (Task 1) such that only SSNs valid prior to June 25, 2011 are captured. Prior to June 25, 2011, a valid SSN could not have an area number between 734 and 749, or above 772.
3. Given the following WFF for integers, which yields single-digit and multi-digit numbers which may be marked as positive (+) or negative ():
3a
Make minimal modifications to this wff so that the new wff still yields all usual singledigit and multi-digit numbers, but no wff has a signum in front of a single 0 or in front of combinations of 0s (i.e., no +0, +00, etc., -0, -00, etc.). It may still yield, however, something like +03 or -000000400.
3c.
Modify the wff obtained in Task 3b such that a comma separates every third digit from the right (e.g., 1,000 or 12,345,678 or 98,765 but has no comma for numbers smaller than 1,000).
3d
Modify the wff obtained in Task 3b such that it still yields all usual single-digit and multi-digit numbers, but no wff has only multiples of 0s (i.e., no 00, 000, 0000, etc.).
3e
Based on the wff obtained in Task 3d define a wff for rational numbers of the form
start : = signum stringofDigits signum : :="+" | "-" stringofDigits : := digit [stringofDigits] digit : := "0"| "1"| "2"| "3"| "4"|Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started