Question: Can you help me code problem 1 and 2 . To compile your code and run the testbench press F 9 in an Emacs buffer
Can you help me code problem and
To compile your code and run the testbench press F in an Emacs buffer in a properly set up
account. The testbench will apply inputs to several instantiations of modules pmatchbase and
pmatchmark. The instantiations differ in the length of the string. At the end of execution the
number of errors for each module at each size are shown. The output below is from a correctly
solved assignment:
Total pmatchbase n: Errors: clopmk
Total pmatchbase n: Errors: clopmk
Total pmatchbase n: Errors: clopmk
Total pmatchbase n: Errors: clopmk
Total pmatchbase n: Errors: clopmk
Total pmatchbase n: Errors: clopmk
Total pmatchmark n: Errors: clopmk
Total pmatchmark n: Errors: clopmk
Total pmatchmark n: Errors: clopmk
Total pmatchmark n: Errors: clopmk
Total pmatchmark n: Errors: clopmk
Total pmatchmark n: Errors: clopmk
Each line starting with Total shows a tally of results. After Total the line shows the module name,
either pmatchbase or pmatchmark, and n the length of the string. A tally of each output's error
is shown after Errors:, cl is the number of incorrect closingparentheses values, op is the number
of openingparenthesis values, and mk is the number of incorrectly marked strings.
Further up the testbench shows sample output and error details. For each instantiation the
first nerrorsshow incorrect outputs are shown on lines starting with Error. If it would
help to see more then feel free to search for nerrorsshow and increase the value. In addition the
details of the first nsamplesshow correct outputs are shown on lines starting with Sample.
The output below shows correct outputs:
Starting pmatchbase tests for n
Sample pmatchbase n: close open both correct
Sample pmatchbase n: close open both correct
Sample pmatchbase n: close open both correct
Sample pmatchbase n: close open both correct
Sample pmatchbase n: close open both correct
Sample pmatchbase n: close open both correct
Sample pmatchbase n: close open both correct
Sample pmatchbase n: close open both correct
Sample pmatchbase n: close open both correct
In the sample above the first Error line indicates that for input both the leftoutnunmatclose
and rightoutnunmatopen outputs were which is correct because there were no unmatched
parentheses. The second sample is also properly matched. It consists of parentheses, a dot which
is just an ordinary character and spaces. The third sample has both one unmatched opening
parenthesis and an unmatched closing parenthesis.
The testbench starts applying patterns found in strspecial. Feel free to add your own to
help with debugging. After the patterns in strspecial are used the testbench will make up
random patterns.
The output below is of a run using a partially correct pmatchbase:
The testbench starts applying patterns found in strspecial. Feel free to add your own to
help with debugging. After the patterns in strspecial are used the testbench will make up
random patterns.
The output below is of a run using a partially correct pmatchbase:
Sample pmatchbase n: close open both correct
Sample pmatchbase n: close open both correct
Sample pmatchbase n: close open both correct
Sample pmatchbase n: close open both correct
Error pmatchbase n: close correct
Sample pmatchbase n: close open both correct
Error pmatchbase n: close correct
Error pmatchbase n: close correct
The errors reported above seem to show that the leftoutnunmatclose is wrong when the
string starts with two consecutive opening parentheses.
The strmarked output of module pmatchmark is supposed to show the string with the cor
rectly matched parentheses replaced by angle brackets actually lessthan and greaterthan sym
bols Appearing below is sample output of the module in a correctly solved assignment. Two lines
are used to show the result of each input. The first shows the input string, such as in the first
sample, the second line shows the marked string, such as
Sample pmatchmark n: close open both correct
Sample pmatchmark nmarkedoutpuut
Sample pmatchmark n: close open both correct
Sample pmatchmark nmarkedoutpuut
Sample pmatchmark n: close open both correct
Sample pmatchmark nmarkedoutpuut
Sample pmatchmark n: close open both correct
Sample pmatchmark nmarkedoutpuut
Sample pmatchmark n: close open both correct
Sample pmatchmark nmarkedoutpuut
Sample pmatchmark n:
of
Problem : Module pmatc
S
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
