0
$\begingroup$

I want to define a DPDA based on a set of rules:

one or more uppercase letters ('A'-'Z') is a formula. one or more lowercase letters ('a'-'z') is a formula. if X and Y are formulas, then this is a formula: X followed by '&' followed by Y. if X is a formula, then this is a formula: 'μ' followed by one or more lowercase letters followed by '(' followed by X followed by ')'. if X is a formula, then this is a formula: 'v' followed by one or more lowercase letters followed by '(' followed by X followed by ')'.`

I have defined my tokens:

Upper: ‘[A-Z]+’

Lower: ‘[a-z]+’

Startpar: ‘(‘

Stoppar: ‘)’

And: ‘&’

My: ‘μ’

Ny: ’v’

The dpda cannot have any limits to the nesting levels. Only one instance of 'μ' and 'v' will be in each nested level. And 'μ' and 'v' will also alternate between each nested level, for example: μ y (ν z (z)) but this will not work μ y (μ z (z))

I was thinking that a smart way to solve it is to implement a way in the DPDA checks if 'μ' appears (once or multiple times) at the third parenthesis nested level in a string so that it doesnt allow same sign too appears after the nesting level. And also in that case checks if 'v' would appear (once or multiple times) at the fourth parenthesis nesting level - if that level contains any operators at all. But how would i do this in a DPDA?

$\endgroup$

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Browse other questions tagged or ask your own question.