Answered step by step
Verified Expert Solution
Question
1 Approved Answer
To achieve the top end of marks for Task A, develop the simple RobotMonitor specification from Lab 3 further as detailed below. Add an
To achieve the top end of marks for Task A, develop the simple RobotMonitor specification from Lab 3 further as detailed below. Add an extra restriction that the Robot cannot immediately return to a square it has occupied. For example, if a Robot at (1,1) moves RIGHT to (1,2) 2 3 4 3 1 2 6 its next move cannot be a move LEFT back to (1,1). The UML diagram has been adapted to record the last move by making use of an enumerated Move type: RobotMonitor row: Integer col: Integer move: Move MoveRight() MoveLeft() MoveUp() MoveDown() GetRow(): Integer GetCol(): Integer GetMove(): Move Exit() < > Move LEFT RIGHT UP DOWN Initially, the robot at 1,1 will have no move allocated to it. Modify your initial RobotMonitor specification accordingly to include a move attribute, again using VDMTools (or VDMPad) to ensure it is free of syntax and type errors. 5
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