Midterm

  Home Up Work My Stuff UMKC

CS 441
Programming Languages: Design & Implementation
Winter '01 Midterm Exam

Due March 14th
150 points
INDIVIDUAL EFFORT

Design a programming language with respect to data types required, typed vs. typeless, statement types required, modularity, and implementation issues for a system that interactively and remotely guides an underwater robot for identifying and collecting in salvage operations.

Develop a regular grammar for only the data types and decision statements that you include.

REMEMBER this is a midterm exam.  Therefore you should remember that depth of thinking counts; don't just rattle something off and expect to get a good grade.  I'm looking for critical thinking skills. Your format might be as follows:

Determine requirements of the language.
Determine implementation issues of project.
Determine (and justify) language features and characteristics which can meet those requirements.
Justify inclusion and/or exclusion of features based on requirements and implementation issues.
Develop the regular grammar.

What you decide is not nearly as important as HOW you make the decision(s).

Be sure to include appropriate references.  You may NOT simply reproduce an existing language.  And you may NOT work with another student on this.  I need to be able to tell that YOU have done your own work on this. If I can't OR if you have plagiarized from an existing language, expect to receive a grade that reflects those circumstances, i.e., a failing grade.

Underwater Robot Control Language (URCL)

Preliminary Considerations:

Underwater robotic system is most useful when it can successfully interact with external world. The notion of "external world" includes the underwater environment where robot conducts its operation, as well telemetry commands from the remote control center. Several important concepts need to be described before programming language for the underwater robot can be designed and implemented:

Elementary Robotic Action

    Elementary Robotic Action is a lowest-level procedure which can accomplish a single task, such as movement of an arm, turn or stop. Actions of this level involve direct interaction with the robot's hardware which may include sensors, servos and actuators.

Robot-Tasks

    Robot-tasks represent the next level of control hierarchy and consist of any combination of Elementary Robotic Actions needed to complete a certain process.

  1. Depth &Heading and  Surface tasks govern the robot's actions to reach desired depth and heading.
  2. GotoPoint, Homing, and Station Keeping tasks allow robot to achieve and maintain its position using the Cartesian Coordinates.
  3. FollowWall and GoToWall tasks allow the robot to achieve and maintain its position using telemetric information such as the reading of acoustic sensor.
  4. VisualServoing task coordinates the robot's position based on the input from the image processing device.
  5. Teleoperation task puts the robot in the manual control mode.
Subgoal

Subgoal consists of a combination of robot-tasks guarded by safety conditions corresponding to a variety of exceptions raised by environment, robot's and operator's actions. An example of Subgoal is FindTarget  which contains several robot-tasks performed in required sequence.

The Mission Program

The Mission Program consists of a sequence of Subgoals needed to a achieve a high-level goal such as "Find target and operate with obstacle avoidance"

There is no need to burden the programmer with the low-level details of robot operation such as Elementary Robotic Actions or Robot-Tasks. These can be hardware-implemented for higher speed, reliability and greater design simplicity. Consequently, the Subgoal will be the lowest-level structure of the language.

Language Requirements and Implementation Issues:

Speed: For the robot operating in hostile environment the speed is critical. 
Reliability: There is no room for errors, which may mean destruction of the robot. To provide the highest possible reliability, the URCL :
  1. Will not support pointers
  2. Will be strongly typed
  3. Will not support global variables
  4. Will encourage encapsulation
Readability and ease of use. Underwater Robots are primarily used by non-computer scientists.  Therefore, the language should be easy enough to understand and use to allow end-users to program the robot on-site. To provide better readability, the URCL will use encapsulation and modularization of functions and tasks as discussed above.
Conservative use of resources. Memory and computing resources in the robot are limited. No complicated data structures will be allowed (see below).

Language Features:

Following are considerations for various data types and structures:

Integer Both signed and unsigned integers will be provided for a variety of numeric quantities.
Floating Point Will be provided for speed and coordinate calculations.
Character Characters will be supported for variable identification and readability.
String Character array will be used to provide strings if needed. There will be no built-in type string.
Arrays Arrays will be used to store data such as speed, depth, distance. Arrays will allow for fast, reliable and easy access to data. Since there is no requirement for searches array are sufficient for data storage.
Multidimensional arrays Will be used to store 3-dimensional coordinates. Although multidimensional arrays require additional overhead, they will simplify storage.
Slices  Will provide an easy way to access one set of coordinates.
Records Will be useful to store  heterogeneous combinations of data, such as speed/coordinate at a point of time. Will provide for better readability and reliability.  
Lists Efficient way to store sequences of Subgoals. Allow for easy insertion/deletion of Subgoal into sequence.
Character strings Will not be supported because of the efficiency and storage conservation reasons. 
Pointers Will not be supported for safety reasons.
Sets Will not be supported. If set operations will be needed, arrays will be used instead.
Data Files Files are not supported. All robot operations are real-time.
Variant records Will not be supported, because of reliability concerns.

 

 

 

 

 

 

 

 

 

 

 

 

 

 


                        

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Additional considerations:

  1. All calculations will be performed in Metric System. No other system will be supported. (Remember the Mars Probe :-))
  2. Language will provide basic mathematic operations (addition, subtraction, multiplication and division) as well as exponentiation and logarithmic operations.
  3. Degrees and Radians will be supported
  4. Constants, such as p will be supported.
  5. Scoping: variables will only be visible within the procedure where they were declared.
  6. Initialization: No un-initialized variables will be allowed.
  7. All names (procedure, variable, etc.) MUST BE CAPITALIZED.

Language Grammar:

Declarations:

<integer> ::  0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9

<character>::= <upper_case> | <lower_case>

<upper_case>::= "A" | "B" | "C" | "...etc..." | "Z"

<lower_case>::= "a" | "b" | "c" | "...etc..." | "z"

<array>::ARRAY[index] | ARRAY[index1][index2] |ARRAY[index1][index2][index3]

Control Statements:

<MISSION>::<Subgoal>|<MISSION><Subgoal>|<MISSION><SEQUENCE>

<START_SUBGOAL>::START <Subgoal> (parameters)|
Used to start a Subgoal. Parameters could be either explicit or variables.
                              START <Subgoal> (parameters):<variable>
Used to start a Subgoal that returns a value.

<SEQUENCE DEFINITION>::SEQUENCE(<Subgoal1>,<Subgoal2>,....)
Defines a sequence of Subgoals.

<LOOP>::REPEAT(<Subgoal>)
Repeats a Subgoal indefinitely.

<DO>::DO <Subgoal> UNTIL <interrupt>|
Repeats Subgoal until interrupt occurs
           DO <Subgoal1> UNTIL <interrupt>THEN <Subgoal2>
When interrupt occurs stop Subgoal1 and move on to Subgoal2

<IF STATEMENT>::IF <interrupt> THEN <Subgoal>
In response to interrupt start Subgoal, i.e.
IF <waterLeak> THEN <surface>

<EMERGENCY EXIT>::ABORT<interrupt>
In emergency abort the whole operation

REFERENCES:

Eve Coste-Maniere, H. H. Wang, S. M. Rock, A. Peuch, M. Perrier, V. Rigaud, and M. J. Lee.
Joint evaluation of mission programming for underwater robots.
In Proceedings of IEEE International Conference on Robotics and Automation, pages 2492--2497, Minneapolis, MN, April 1996. IEEE.

Sebesta, Robert W. Concepts of programming languages 4th ed.

 

 

 


 

 

 

 

 

 


 

 

 

 

 

e-mail Mikhail Viron

Write to Your Representative