Mealy Machine Exercises Specify Design Implement General Representation Mealy Machine Set Q37169380

Mealy Machine Exercises

  1. Specify, design, and implement a general representation for aMealy Machine as a set of Scala definitions implementing anabstract data type. It should hide the representation of themachine behind an abstract interface and should have, at least, thefollowing public operations.

    • Constructor MealyMachine(s) creates a new machine with initial(and current) state s and no transitions.

    • Mutator method addState(s) adds a new state s to this machineand returns an Either wrapping the modified machine or an errormessage.

    • Mutator method addTransition(s1,in,out,s2) adds a new transitionto this machine and returns an Either wrapping the modified machineor an error message. From state s1 with input in,

      OR
      OR

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.