Browse Prior Art Database

ON CONTROL CONSTRUCTS FOR CONSTRUCTING PROGRAMS

IP.com Disclosure Number: IPCOM000148432D
Original Publication Date: 1977-Jan-31
Included in the Prior Art Database: 2007-Mar-29

Publishing Venue

Software Patent Institute

Related People

Keller, Roy F.: AUTHOR [+2]

Abstract

ON CONTROL CONSTRUCTS FOR CONSTRUCTING PROGRAMS* by Roy F. K e l l e r T e c h n i c a l Report 1177-1 January 1977 On Control Constructs for Constructing Programs* Roy F. Keller Iowa State University Ames Laboratory, ERDA Two very specific control constructs, incase and forcase, are motivated and defined. Two examples are given to demonstrate the effective use of these constructs in program readability and clarity. These examples are taken from Kernighan and Plauger's books [7,81, however, almost any of their examples could have been used for demonstration. Key Words and Phrases: Refinement, structured programing into programming, control constructs, parallel processing, programming. *This work was supported by the U. S. Energy Research and Development Administration under Contract No. W-7405-eng-82. 1. INTRODUCTION In a number of publications [1,2,3,4,5] a case is made for programming "into" a programming language and also ideas for teaching "into programming" are presented.

This text was extracted from a PDF file.
At least one non-text object (such as an image or picture) has been suppressed.
This is the abbreviated version, containing approximately 27% of the total text.

Page 1 of 14

ON CONTROL CONSTRUCTS FOR

CONSTRUCTING PROGRAMS*

by

Roy F. K e l l e r

T e c h n i c a l Report 1177-1

January 1977

[This page contains 1 picture or other non-text object]

Page 2 of 14

[This page contains 1 picture or other non-text object]

Page 3 of 14

On Control Constructs for Constructing Programs*

   Roy F. Keller
Iowa State University
Ames Laboratory, ERDA

    Two very specific control constructs, incase and forcase,
are motivated and defined. Two examples are given to demonstrate
the effective use of these constructs in program readability and
clarity. These examples are taken from Kernighan and Plauger's
books [7,81, however, almost any of their examples could have
been used for demonstration.

Key Words and Phrases: Refinement, structured programing
into programming, control constructs, parallel processing,
programming.

*This work was supported by the U. S. Energy Research and Development
Administration under Contract No. W-7405-eng-82.

[This page contains 1 picture or other non-text object]

Page 4 of 14

1. INTRODUCTION

    In a number of publications [1,2,3,4,5] a case is made for
programming "into" a programming language and also ideas for teaching
"into programming" are presented.

    The whole issue of into programming, which includes structured
and/or modular programming, centers around what data structures and
control constructs should, or may, a programmer use as the programmer
is thinking and constructing a program. He should feel free to go beyond
the constructs of any programming language.

    In [51 a case is made for the general control constructs;
if-then, if-then-else, while-do, repeat-until and repeat-exit. These
constructs are beyond any given programming language for in their
most general form any value type is permissible. For example a
programmer should feel free to write a statement such as:

while color is red

-

end while

without worrying if a given programing language has a value type
of color. If a language does fine, that language may be chosen;
if not, a color value type can be simulated in further refinement
steps.

    In this paper two more control constructs are presented, a
forcase and incase.

2. The Incase and Forcase constructs.

    Many programming languages have a case statement as a control
construct. Such a statement is clearly motivated by the variety of
uses of cases in a mathematical sense. For example, we commonly
write for Case 1 do something

Case 2 do something
etc.

    In a most general way a construct such as Dijkstra's i Q f i [6J
(which he calls an alternative construct) covers almost all alternative
selection one needs for programming including "nondeterminancy", and
if-then and if-then-else constructs.

[This page contains 1 picture or other non-text object]

Page 5 of 14

    It is clear in constructing programs we are often faced with
a decision where it is desired to select exactly one from many (more than two) cases (or alt...