Compute the weakest precondition for the following sequence of statements and the given post condition.
Hint: Start by deciding what variable or variables should be mentioned in the precondition. Recall the rule for sequences: the precondition for a statement in a sequence is equal to the postcondition for the statement that preceeds it.
Compute the weakest precondition for the following statements and the given post condition.
Hint: Analyze the two cases that the if-then-else creates: one where x is greater than y and one where it is not. Figure out what are the weakest preconditions for each. Find the strongest single precondition that is logically implied by both.
Give a regular expression that recognizes the following
A valid UMBC campus ID. A campus ID should start with two capital letters followed by 5 integers.
A positive floating point number given in expotential notation. Assume the exponent is positive as well. Valid examples are
Draw the DFA that recognizes the following. These are the same as the regular expressions above.
A valid UMBC campus ID. A campus ID should start with two capital letters followed by 5 integers.
A positive floating point number given in expotential notation. Assume the exponent is positive as well. Valid examples are