19740013725_1974013725_GOAL_to_HAL_S_Translator_Dec73 19740013725 1974013725 GOAL To HAL S Translator Dec73
19740013725_1974013725_GOAL_to_HAL_S_Translator_Dec73 19740013725_1974013725_GOAL_to_HAL_S_Translator_Dec73
User Manual: 19740013725_1974013725_GOAL_to_HAL_S_Translator_Dec73
Open the PDF directly: View PDF .
Page Count: 173 [warning: Documents this large are best viewed by clicking the View PDF Link!]
(NASA-CE-136159)
?BE
GCAL-IO-HAi/S
~74-2183a
TRARSLAICE
SFECIFICAIICL
Einal
:.€port
(Intermettics,
Inc.)
172
F
HC
111.73
CSCL
09B
'Jnclas
U/08
37567
IllTERIllETRICS
THE
GOAL-TO-IWL/S
TRANSLATOR
Sl’ECIFICATION
Item
14,
Contract
NAS
10-8385
December
15,
1973
ST:3DARD
TITLE
PAGE
I
4.
Tnrlt
0-3
SLbr,rlc
THE
GOAL-TO-HAL/S
TRANSLATOR
SPECIFICATION
-_
j.
hccuptent's
Catalog
No.
1
I.
Report
N;.
I
2.
Goverimenr
Accoi.on
ha.
5.
Report
Dore
December
15,
1973
~-__
7.
Abth
.
s'p
Saul
F.
Stanten and
James
H.
Flanders
INTERNETRICS
,
mc.
---
___
9.
Peril-
-;
0tgari::'~cn
\me
md Address
701 Concord Avenue
-
6.
Performing
Orgonixotton
Code
I
8.
Perfomtnq
Organtiorion Report
No.
10.
Work
Unit
No.
-__
-
_.
_.
-
_---
1
I.
Conrroct
or
Grant
No.
NAS
10-8385
13.
Trpe
of
Report.ond
Period
Covered
Final
Report
DRL
Item
14
19.
SeCvIty
Clusi.f.cof
thtr
report\
2".
Security
Clorsil.(ol
this
page)
21.
No.
of
Pages
Uncl.7
s
si
fied
Unc1asr;i
fied
Cambridge,
Mass.
02138
22.
Price
12.
Soonsorirg
Apt-cy
Name
and
Ad&est
National Aeronautics and
Space
Awn.
John
F.
Kennedy
Space
Center
Kennedy
Space
Center, Florida 32899
I
15.
Supplementary
Notes
16.
Abstract
This report comprises
a
Specification for
a
GOAL
Language
to
HAL
Language
Translator.
Ground
Cperdtions Aerospace Language, or
GOAL,
is
a
test-oriented
higher order language developed by
NASA's
John
F.
Kennedy Space Center for
use
in
the
checkout and launch
of
the Space Shuttle.
HAL
is
a
structured higher
order language developed
by
NASA's
Zohnson Space Center
for
manned space flight.
HAL/S
is
the version of
HAL
selected by
NASA
for writing the flight software for
the o:lboard Data Processing System. Since the
onboard
computers
will
extensively
support ground checkout of the Space Shuttle
and
their
operational system
works
exclusively
with
HAL/S,
the translation
of
COAL-to-HAL/S
assumes
significance.
The
Specification
sets
forth
a
technical framework within which
10
deal with
the
transfer of specific
GOAL
features
to
W/S.
Translator are described which commiicate with
the
data
bank,
handle repeat
statements, and
deal
with
software interrupts.
GOAL
programs, databank informa-
tion, and
GOAL
system subroutir.es
are
integrated into one
GOAL
MASTER-PROGRAM
in
HAL/S.
into the
HAL/S
compiler.
Key
technical features
of
the
This output
is
fully compatible
HAL/S
source code read? for insertion
The Translator
uses
a
PASS1
to
establish
all
the
"global"
data needed for
the
HAL/S
output program. Individual
GOP-,
statenents are translated in
PASS2.
The
Specification docwent
makes
extensi;re
use
of flowcharts
to
specify exactly
how
each variation of each
GOAL
statment
is
to
be
translated. The Specification
alsi
deals
with
Definitions and Assumptions, Executive Support Structure and fmplernen-
tation.
An
Appendix, entitled GOAL-to-H=iL :.:agping, provides examples of trans-
lated
G?AL
statenents.
This
Translation Specification
is
based
upon
an
earlier
Final
Rr
*,art
on
Ci;,iL--to-tiAL
Tra.ii~sl&i
SJudv.
,&RS
9
-
12391.
dc
17.
Kcy"0ds
Test
Oriented
Language
Space
Shuttle
GOAL
HAL
18.
Dlstr8tutton
Stotcrment
1
NOTICE
This
report
wo's
prepared as an account of Government-sponsored
work.
Neither
the
United
States,
nor the National Aeronautics
and Space Admi.iistration
(NASA),
nor any person acting on behalf
of
WSA:
(1)
Makes
any warranty
or
representation, expressed
or
implied,
with respect
to
the
accuracy, completeness,
or
usefulness
of
the information contained in this
report,
or
that
the
use
of
any information, apparatus, method,
or
process disclosed in
this
report
may not infringe privately-owned rights;
or
(2)
Assumes
any
liabilities
with
respect
to
the
use of,
or
for
damages
resulting
from
the use of,any information, appara-
tus,
method
or
process disclosed in
this
report.
As
used above, "person acting
on
behalf
of
NASA" includes any
employee
or
contractor of
NASA,
or
employee of such contractor,
to
the extent that such employee
or
contractor of
NASA
or
employee
of such contractor prepares, disseminates,
or
provides
access
to
any information pursuant
to
his employment
or
contract with NASA,
or
his
employment with such contractor.
INTEHMETRICS INCORPORATED
701
CONCORD AVEFJUE
CAMBRIDGE,
tAASSACHUSETTS 02138 (61
7)
661
-1340
THIS
PAGE
INTENTIONALLY'
LEFT
BLANK.
IhTFRh4FTRIC.C
INCORPOilATED
701
CONCORD AVENUE CAMBRIDGE, MASSACHUSElTS
02138
(617)
661
-1840A
TABLE
OF
CONTENTS
Page
1.0
SCOPE
1
1.1 Introduction
1.2 Genesis of
GOAL
1.3 Genesis
of
HAL/,C
1.4 Purpose
of
the Specification Document
1.5 Scope of the Specification Document
1.6 Outline of the Specification Document
2.0 APPLICABLE DOCUMENTS
2.1
GOAL
Documents
2.2
HAL/S
Documents
3.0
DISCUSSION
OF
KEY
TECHNICAL
FEATURES
3.1 The
GOAL
Master Program
(GMP)
Concept
3.2 Structure of
a
Translated Goal
Program
3.3
Communication with the Databank
3.4
REPEAT
Statements
3.5 Software Interrupts
4.0
DEFINITIONS AND ASSUMPTIONS
4.1 Definitions and Notation
4.2 Assumptions
4.2.1 Overall Scope
4
.
2.2 Features
4.2.3 Ground-Based Operating System
(GBOS)
4.2.4 Undefined
5.0 TRANSLATION REQUIREMENTS
5.1 Structure
of
the Translator
5.1.1 Introduction
5.1.2
PASS
1
5.2 Translator Subroutines
5.2.1
CO!.NERT
NUMERIC
5.2.2
CO:~ERT-TIME
5.2.3
EVAL
INT
NAME
-
5.2.4
EVAL-ED
5.2.5
EVAL-NUM
FORM
5.2.7
REL-FOP*
-
5.2.6
LIM
FOPaJl-
5
5
5
7
7
12
16
18
21
27
27
27
27
29
32
32
33
33
33
33
41
41
41
41
43
44
45
46
NTERMETRICS
INCOhPORki
ED
701
CONCORD
AVENUE
*
CAMBFIIDGE.
MASSACHUSETTS
02138
(61
7)
661
-1
840
5.3 Flowcharts
5.3.1 Declaration Statements
5.3.2 Procedural Statements
5.3.3 System Statements
5.4 Output Processor
6.0 EXECUTIVE SUPPORT STRUCTURE
6.1 Introduction
6.2 Recommended Approach
7.0 IMPLEMENTATION, VERIFICATION
&
DWUMENTATION
REQ.
7.1 Implementation
7.2 Verification
7.3 Operations, Maintenance and Update
7.4 Documentation
7.4.1 Specifications
7.4.2 Translator Code Documentation Listing
7.4.3 Translator User’s Manual
7.4.4 Translator Test Plan
7.4.5 Translator Test Zesults
7.4.6
Translator Maintenance Manual and
Update Procedure
7.5
Translator Schedule
8.0
RECOMMENDATIONS
8.1 Choice
of
Host Machine
8.2 Choice
of
Translator Language
APPENDIX
A.
49
49
67
111
114
115
115
115
117
117
118
121
121
122
122
122
122
122
123
123
127
127
127
tNTERMETRICS INCORPORATED
701
CONCORD
AVENUE
CAMBRIDGE,
MASSACHUSETTS
02138
*
(61
7)
661
-1840
1.0
SCOPE
1.1
Introduction
GOAL
is
a
higher
order
language developed
at
the
NASA
Kennedy Space Center
to
fulfill
a
need
for
a
standard ground
test
language in manned space.flight. This language
will
be
used by
NASA
and contractor personnel
to
write
software for
ground maintenance, checkout, and launch of the Space Shuttle.
the
NASA
Johnson Space Center for the flight
software
which
is
to
be
resident in the Space Shuttle's onboard computers.
W/S
is
a
higher
order
language which
was
developed by
A
need exists for
a
capability for running
test
programs
written in
GOAL
in the
onboard
computers during ground maintenance
and checkout for the Space Shuttle.
These
onboard computers
will
have
a
Flight Computer Operating System
(FCOS:
which
is
uniquely
designed
to
be
driven by application scrftware written in
HAL/S.
To
provide
a
different
FCOS,
which can
be
driven by
GOAL,
is
not practicable (Ref.
1).
Thus, the requiremsnt
for
a
GOAL
to
HAL/S
translation capability
has
arisen. The feasibility and
approach
for
such
a
translation
was
studied in an
earlier
document
(Ref.
2).
The favorable results
of
that study
formed
the
foundation
and justification for this docxment, The
GOALzto-HAL
Translator
Specification.
1.2
Genesis
of
GOAL
The development
of
GOAL
was
brought about by the need
for
a
standard
test
language
to
he used
for
maintenance,
refurbishment, checkout, and 1au:ich
of
the Space Shuttle.
Apollo experience had already poven the value
of
computer-
automated checkout
pxoqrzms,
while
at
the
same
time
high-
lighting the importance
of
early source language
capabilities.
ATOLL
was
such
a
language and was applied
to
Saturn
V
checkout
and launch.
As
the requirements
of
the Shuttle program unfolded,
it
was
evident that
a
high degree of checkout computer auto-
mation would be required
to
meet
schedule and
cost
objectives.
Furthermore, the opportunity existed
to
develop
a
high order
language early in the program
so
that,
fi
m
the beginning,
it
was
an integral part of the system. Requirements
contracts
were
let
by
KSC
in July
of
1970. In May 1971,
a
language requirements document
was
published
(KSC-TR-111).
Currently, three documents nave been published which define
the language. These
are
the
GOAL
Overview Document, the Syntax
Diagrams Handbook (KSC-TR-1213)
,
and the
GOAL
Textbook
(KSC-
TH-1228).
Also,
a
GOAL
compiler
is
currently being developed.
1
1.3
Genesis
of
HAL/S
The
development
Df
HAL
was
stimulated
by
the
same
combina-
tion
of
Apollo experience and anticipated Shuttle requirements
that stimulated
GOAL,
except that
HAL
is
oriented towards
the
onboard mission software for manned spaceflight with
its
great
emphasis on
1)
the
mathematical requirements of navigation,
guidance, and
control
and
2)
the
need
for
highly
reliable
real
time
control progl-ams. Apollo experience had
shown
t-hat
the
resources needed
to
program mission software in assembly language
in
a
multi-prosram environment
were
excessive.
Development
of
H-9L
began
with
a
contract
let
by
JSC
early
in 1970. This contract supported the generation
of
requirements,
a.survey
of
other languages, synthesis
of
a
new language, and
the building
of
a
HAL
zompiler
to
run
on
the
IBM
360/75
at
the
JSC
Real
Time
Control Center. This effort
was
augmented
a
year
and one-half
later
by
a
JSC
contract
to
advance
HAL
to
an operationa:
status.
As
a
result of this last contract, the
HAL
language
was
ready when
the
decision to specify the onboard software for
Shuttle
came up, and HALIS, the Shuttle version,
was
chosen
as
the language in whichmlight software
will
be
written.
1.4
Purpose
of
the Specifization
Document
This document
is
intended to:
treat
the
GOAL
to
HAL/S
translation process
as
a
complete software system,
to
define completely and definitively
all
aspects
of
the translation process where the facts
are
known
(the
GOAL
Specification, the
HAL/S
Specification,
etc.),
and
to
identify, segregate, and define in concept and scopz
all
remaining aspects
of
the translation process
where
tte
facts are incomplete,
in
transition,
or
not known
(the Databank,
FCOS,
etc.
)
.
1.5
Scope
of
the Specification Document
It
is
the objective
of
this document that
it
will
form
the basis for an implementation
of
the Translator once
a
host
computing
system
and
a
Translator language have been designated.
Accordingly,
it
is
necessary
that
this
Specification go beyond
the
mere
mapping
of
GOAL
statements into
HAL/S
statements znd arrive
at
a
technical structure which can encompass
all
the powerful
GOAL
features
of
databank resource and control, concurrent program
execution, and software interrupts and many other features.
2
Ih'TKm
*cTnrS
~~~~nRPORATED
701
CONCORD
AVENUE
CAMBRIDGE,
MASSACt
,I!Si-TTS
32
132
(2
17)
c
,
i
,
1.6
Outline
of
the Specification
Document
The main body of the Specification begins by presenting
the technical approach in the
critical
areas of communication
with the databank, software interrupts, repeats,
etc.
(See
Section
3.0
DISCUSSION OF
KEY
TECHNICAL
FEATURES). There then
follows
a
section devoted to
1)
spelling out assumptions that
have been made for the translation process and
2)
setting
forth definitions and
conventions
applicable
to
the
translator
itself
(See
Section
4.0
ASSUNPTIONS
AND
DEFINITIONS). The heart
of
the
Specification
is
presented
next
(Section
5.0
TRANSLATION
REQUIREMENTS). This begins with
a
presentation
of
the
overall
transiator
structure,
followed by dcfinition
of
various
translator
subroutines which
have
been found
to
be
useful.
The
translation
process
is
then
defined in
terms
of
a
first
or
global
look
at
the
GOAL
source (PASS
11,
followed
by
a
statement
by statement
translation
(PASS
2)
of
specific
GOAL
source
statements.
In
keeping
with the specific technical app’oach adopted in this Specification,
it
was
decided that flow charts
ty~lil
be
the
best
means
for
presenting the processing
of
individual
GOAL
statements
by
the
translator.
Most
ststements
involve
alternatives
and
a
textual
treatment
was
deemed
very
inadequate compared with the flow chart
approach.
The interface
to
the
FCOS
that
results
from the proposed
technical approach to translation
is
discussed
next
(Section
6.0
EXECUTIVE
SUPPORT STRUCTURE). The
last
sectior,
deals with
reliable implementation
of
the
Translator
(Section
7.0
IMPLEMENTATION,
VERIFICATION,
AND
DOCUMENTATION
REQUIREMENTS)
.
Appendix
A
presents the
GOAL
to
HAL
MAPPING
material which
illustrates
the
translation
process without getting into the
intricate
details
of
implementation.
THIS
PAGE
1RTENTIOXAI.LY-
LEFT
SLAM.
2.0
APFLICABLE
DOCUMENTS
2.1
GOAL
Documents
Ground
Opcrat
ions Aerospace Lanquagc (GOAL)
--
Syntax
Diagrams
Handbook,
TR-1213,
16
April 1973,
NASA
John
F.
Kennedy
Space Center.
a)
I_
--
b)
Ground
Operations Aerospace Language (GOAL) Textbook,
TR-1228, 16
April
1973,
NASA
John
E'.
Kennedy Space
Center.
2.2
HAL/S
Documents
a)
H?&/S
Language Specification,
15
September 1973,
Intermetrics, Inc.
b)
HAL/S
Language
Forms,
Rev.
1,
8
May
1973, Intermetrics,
Inc.
c)
H&/S-360 Coinpiler System Functional Specification,
13
July
1973,
Intermetrics, Inc.
-
THIS
PAGE
INTENTIONALLY'LEFT
BLANK.
6
INTEHIXETRICS
INCORPORATED
701
CONCORD AVENUE CAMBRIDGE. MASSACHUSETfS
02138
(617)
661
-1840
3.0
DISCUSSION
OF
KEY
TECHNICAL
FEATURES
3.1
The
GOAL
Master
Program
(GMP)
Concept
be
handled together
by
a
single unified strategy
-
the
concept
of
a
"GOAL
blaster
Prograxn* written in
HAL/S,
pr*uced
by
the
translator
program,
and responsible
for
coordinating
all
the
HU/S
blocks
produced
by
the
translation
process.
The
situations
which
lead
to
use of
this
strategy
are
several:
The;,
are
several translation situations which can
I
a)
GOAL
has
a
'TERqNATE
SYSTEM"
statement which
is
supposed
to
cause "complete
GOAL
application
program
system
shutdom'.
Thus,
a
means
must
be
provided
to
make
its
effects global
to
all
translated
GOAL
modules
at
execution
time.
b)
GOAT,
allows
a
"CONCUEREXTLY
PERFORM
PROGRAM"
statement
with
n3
restrictions on
the
number
of
such statements
referencing
a
single
PROGRAM
and
how
many such concurrent
uses
exist
simultaneously
off
a
single
program module.
The
translator
shall
force
the
situation whereby
a
program
can only
be
concurrently
performed
by one process
at a
time.
i.e.,
if
A
and
B
are
concurrent
programs,
then
A
and
B
cannot concurrently perform program
C.
The
first statewent
to
gai.1
access
will
win
the
race.
The
second statement
will
have
to
wait
for the
first
to
finish.
c)
The
set
of
translated
GOAL
programs
have
their
own
internal system
of
aftware
interrupts
and
other
signals,
Which,
for
reliability, should
be
kept
self-contained
to
prevent unwanted interaction with the other
HAL/S
applications
software.
d)
Data
Bank information needs
to
be
inserted
jato
the
translated program.
This
is
contained within the
GOAL
Master
Prog-
'am.
e)
GOAL
System Subroutines can
be
employed
by
all
GOAL
translated
programs.
Procedures
at
the
GMP
level.
These
arc
declared
as
HAL/S
f)
.
The
software interrupt mechanism requires processing
external
to
a
GOAL
program.
In
order
to
treat
these
situations
properly,
a
GOAL
Master
Program
shall
be
provided, with
the
following
characteristics:
Figures
3-1
and
3-2
indicate
the
structure
of
the
GMP.
7
a)
When
the
GOAL
system
is
to
be
initiated in
the
flight
computer,
it
is
the
GOAL
MASTER
-
PROGRAM*
which
is
scheduled and executed:
b)
Esch
GOAL
Program which
is
to
be
?art
of
the
running
GOAL
system
will
become
a
single
HAL/S
Procedure within
the
GOAL
MASTER
PROGRAM,
nested
at
the
program level.
If
the
oFiginal-bOAL
Program
is
subject
to
multiple
concurrent
perform
statements,
then
real
time
Lttributes
of
EXCLUSIW
will
be
applied in
order
to
assure
no conflicts.
c)
Each
concurrent statement
will
generate
a
uniquely
named
HAL/S
task
block nested
at
the
program
level.
The
executable action
C0-Y
will
consist
of
a
SCHEDULE
for
the
task
so
ge,lo,rated.
d)
At
the.GOAL
MASTER
PROGRAM
level,
a
Boolean
array
INT
is
maintains.
Thzs array
carries
the
set
of software
interrupts available
to
all
the
GOAL
system's
blocks,
The
array
INTNUM,
used
Cor
interrupt communication,
is
also
maintained.
e)
The Boolean
array
TERMSYS
indicates which
Goal
processes
have executed
a
TERMXNATE
SYSTEM
command.
9)
%c!
array
of
data
bank
buffers
NUMBER,
DIMENSION,
STATE,
TEXT,
CONTROL
are
declared
at
the
GMP
level,
g) The
GMP
will
contain
all
function designator informatlon
organized
so
tha,
the
hAL/S
procedure
DATABANK
can
access
the appropriate
data
by using
t,?e
function designator
number
FD
as
an index.
For
example,
Control
words
used by the
HALIS
procedure
DFTABANK
FD1
----
-.--
-.--
FD2
=I==
.
*
Written
here
in
caps
and with underscores
to
conform
to
HAL/S
requirements.
8
'YiEii:XTSiCS
!PX'.~~ORATED
701
CONCORt)
AVENUE
CAMBRIDGE.
MASSACtGZIY:;
02138
(617)
C
Ji-y
,
:ri
I-
=>
h
z
Y
Notes
for Figure
3-2:
PR,
PNW
and
Pw
are
defined in
Figure
5-1,
p.
36.
INT
and
INTNUM
are arrays utilized in
'-he
processing
of
--
----
software interrupts
(See
Section
3.5,
p.
21).
TERMSYS
is
used
to
implement
the
TERMINATE
SYSTEM Statement.
___
-
(See
Flowchart
78,
p.
SpL.
These
are
the
5
DATABANK
Buffer Arrays discussed in, Section
-
-
--
3.3-6, p.16.
<GOAL
PROGRAM
NAME>
is
the
name
of
the
first
Goal
-
---
-
-
Program in
the
group being translated.
I
The implementation
of
concurrent processes within
a
HAL/S
8
I
--
program
is
accomplished through
the
use of
HAL/S
TASK
blocks.
Therefore,
the
Translator
will
geTerate an appropriate
HBL/S
TASK
for
every
CONCURRENTLY
PERFORM,
VERIFY,
or
RECORD
statement
which
appears in
a
GOAL
program.
See
Section
5.1.2,
Item
3,
and Concurrent Statement Flowchart
(15)
.
----
FD
and
PN
are
the
function designator number and the process
number received as parameters
by
the
procedure
DATABANK.
The,,
attribute
of
REENTRANT
allows more than one prxess
to
8
execute "simultaneously" the procedure
DATABANK.
I
I
Ficrure
3-2:
Structure
of
the
GOAL MASTER PROGRAM
(GMP)
-
GOAL
-
MASTER
.-
CROGRAM: PROGRAM;
I'
DECLA'SE
J
JT ARRAY (<PR>)BOOLEAN INITIAL
(OFF)
;
-
-I
'
6-
DECLFtRE AJTNUM ARRAY (<PR>)INTEGER SINGLE;
I
G
<GOAL
PROGRAM NN.3 l>:PROCEDURE EXCLUSIVE;
--
---
-
&an4
"ed
god
pfiognam
c
G <GOAL PROGRAM NAME 2':PROCEDURE EXCLUSIVE;
TASK1
:
TASK
;
---..
.c
c--
DATABANK:PHOCEDIJRE REENTRANT(FD,PN)
;
p~
cedwie
wUen
in
UALIS.
.WCP
~eb,
idved
(troll
GUAL
ayh.tem
bubmLLtine6,
used
by
Patabad
L
,dLcated
by
de&z .ed
(unction
designatok
i116;mmation
CLOSE
GOAL
-
MASTEE
-
PROGRAM;
h)
The
GMP
contains
the
HALIS
procedure
DATABANK
as
well
as
any other procedures required
to
service
function
designator
calls.
with
the
translated
Goal
Program.
i)
All
Goal
subroutines bacorne
HAL/S
procedures nested
3.2
Structure
of
a
Translated
Goal
Proqram
Each
Goal program
or
subroutine
is
translated into
a
HAL/S
procedure
with
the
structure as indicated in Figure
3-3.
The
following features should
be
noted:
a)
Declaration
of
interrupt
related
variables
ENVIRON,
ACTIVE.
b)
Declaration
of
variables
associated
with
processing
Repeat Instructions;
HEAD,
TAIL,
RPTCTR,
RPTACT,
SAW,
RPT,
RS.
c)
A
place
is
reserved
for
all
the
declarations
created
by
the
Translator such
as
the
loop
indices
I,
J,
K,
...
d)
The
functions
FLUSH,
RPTCONT,
and
HANDLER
appear in
each program
or
subroutine contingent,
of
course, on
whether
or
not
WHEN
INTERRUPT
or
REPEAT
statements
are
present.
e)
The
DOCASE
label and
RETURN
LABEL
CASE
label
contain
the
GO
TO
statements used
iE
retu3ning from interrupts
and
repeat staternents respectively.
12
IhTERMETRlCS
INCORPORATED
701
CONCORD
AVENUE
CAMBRIDGE,
MASSACHUSETTS
02138
(61
7)
6bl-1840
THIS
PAGE
INTENTIONALLY-LEFT
BLANK.
13
ERMETR:SS
INCORPORATED
701
CONCORD
AVErJUE
CAMBRIDGE,
MASSACHUSETTS
02138
(617)
661
-1840
Notes
for Figure
3-3:
--
I---
I
A
translated
GOAL
subroutine from
a
translated
GOAL
Program
subroutine should read:
-
only in
ths
first
statement.
The
first
statement for
a
I
'I
I
I
ACTIVE
and
ENVIRON
are
associated
with
software
interrupt
I
handling
at
the
program and subroutine levels (See.Section
I
3.5-3,
pp.
23-25)
I
I
G
<Csal
NAME>
:
Procedure
(C)
Assigr,
(<Parameters>)
;
-
I
--
--
..where
C
is
the
critical
bit.
ACTIVE
is
the
total
number
of
interrupts specified wiL!in
a
GOAL
program
or
subroutine.
It
It
is
determined in
Pass
i
and
'1
I-
-
is
a
static
value.
<FDI(K)>
is
the
interrupt function designator number
asso-
ciated
with
the
Kth
interrupt.
These
statements
or
functions
are
eliminated
if
no
WHEN
INTERRUPT
statements appear in
the
program
or
subroutine.
The
GOAL
REPEAT
Statements require these declaration
statements. Section
3.4
describes the purpose
of
each
of
these
variables and how they
are
used.
The
Procedure
FLUSH
is
used
to
re-initialize nestedREPEAT groups
if
a
GO
TO
statement
is
encountered whicn
causes
execution
outside
of
an activated
REPEAT
group.
The
declaration
statements, procedures, and functions
associated
with
.APEAT
statements
are
encountered in translating
the
propram.
!
I
I
I
-
-1
I
I
-c
I
I
I---
I
I
1
-Dl
14
lYTCnMEiRlCS
INCORPORATED
701
CONCORD
AVENUE CAMBRIDGE, MASSACHUSETTS 02138
(617)
661-184C
1
I
t
I
I
I
I
I
-
-7
I
I
I
I
I
I
I
I
I
Figure
3-3:
Structure
of
a
Translated
Goal
Program
---
G-CGOAL NAME>
:
PROCEDURE EXCLUSIVE
:
‘%:CLARE ACTIVE INTEGER SINGLE INITIAL (<ACTIVE>)
;
I
-
-
-
DECLARE XNVIRON ARRAY (3,<ACTIVE>) INITIAL (<FDI
(1)
>
, ,
I
<FDI(ACTIVE)>,
0,
..-,
O,O,
...
0);
1-
-
---
DECLARE HEAD ARRAY (RSmax) INTEGER SINGLE
INITIAL (<HEAD1>,<HEAD2>,
...
<HEAD RSmax>);
DECLARE TAIL ARRAY ,RSmax) INTEGER
INITLAL (<TAIL(l)>,<TAIL(2)>,
..
-
<TAIL(RSmax)>);
DECLARJ2 RPTCTR INTEGER SINGLE;
DECLARE RFTACT ARRAY
(Rsmax)
BOOLEAN
INITIAL
(OFF);
EECLARE SAVE ARRAY (NDL)
;
/*
(NDL
=
number
of
dynamic
nesting
levels
alloweL,)
*/
DECLARE RPT INTEGER SINGLE;
DECLARE
Rs
INTEGER SINGLE;
DECLARE LOC INTEGER SINGLE;
DECLARE
I
INTEGER
SINGLE;
DZCLARE
K
INTEGER
SINGLE;
and
0th~
WtaaWc
genehLtted
fDECLAitZ
L
J
1iJTEGE.R
SINGLE;
4tuXenienh
ubed
604
tempommy
v&h.
[FLUSH
:
PROCEDURE
;
-
[RPTCONT: FUNCTION
BOOLEAN;
1-
--
HANDLER: FUNCTION
BOOLEAN;
[
Tm&d
God
SaWemeutt;
IF
INT<PN>
THEN
IF
HANDLER THEN
GO
TO
DOCASE;
.
DOCASE:
[
RETURN
LABEL CASE:
[
CLOSEG
-
<GOAL
NAMa>;
15
FJTEZ!.’ETFi;CS
I::E0RP37r-TF9
7C1
CCNCPYD
AVFb!IJE
CA>.4BRIDGE.
FAASSACHUSETTS
02138
(61
7)
€61
-1
443
3.3
CommunicatLon with
the
Databank
In order
to
provide the features
of
function designators,
as
described in the Goal Text,
the
following design features
have been incorporated into
the
Translator. Figure
3-4
indi-
cates
the
various
major
features.
All
function designator names
are
resolved into uni-
que numbers during
Pass
1.
Function Designator number
0
is
reserved for the
"Stop and
Restart"
display.
Function Designator
1
is
reserved
for
the interrupt
service
routines.
Function Designator
2
is
reserved
for
the system
de-
vice
referred
to
in the RECORD and
OUTPUT
EXCEPTION
statements
.
Any function designator
can
be
reached by the
HAL/S
statement:
CALL
DATABANK
(function designator number,
process
number)
;
DATABANK
is
a
procedure
at
the
GOAL
MASTER
PROGRAM
level
which
is
unspecified
at
this
time
with respect
t5
internal
functioning.
the
f
UnCtiGiI designator
.
It
performs whatever function
is
specified
by
A
procesv
is
defined,
for
the purposes
of
this
Translator,
as
any
Goal
translated program or any task
created
by
the
trans-
lator
as
a
result
of
a
Goal
Concurrefit statement.
6) Communication with
DATABANK
occurs through
5
DATABANK
buffer arrays declared
at
the
GOAL
-
MASTER
-
PROGRAM
level
:
NUMBER
scalar
DIMENSION
integer
STATE boolean
TEXT
character string
CONTROL
integer
These arrays
3ct
as
a
communication buffer
for
data
transfer
between Goal processes and
the
DATABANK
pro-
cedure. The length of these arrays equals the maxi-
mum
number of processes. These arrays
are
indexed
16
INTERMETRICS INCORPORATED
701
CONCORD
AVENUE
CAMBRIDGE,
FvlASSACHUSETTS
02138
(61
7)
6~1-1840
NUMBER
DIMENSION
STAT
E
4
DATABAXK
BUFFERS
(ONE
PER
PROCESS)
I
01
3
1
J
I
e
e
Figure
3-4:
Function
Desiqnator
Communication
17
by
the
process number
(CPN>).
For
example, Number
<PN>
is
the
DATABANK
buffer
for
numeric
data
dedicated
to
process
number
<PN>.
7)
The
function designator information used by the pro-
cedure
DATABANK
will
be
assembled
by
the
Translator.
3.4
REPEAT
Statements
Under
the
restriction
of.:nc, overlapping
repeat
groups,
the
Translator shall implement
the
following features
in
order
to
execute Goal
REPEAT
statements
as
specified in
the
Goal
Reference
Manual.
1)
The
Repeat translption process
is
handled separately
for each Goal Program
or
subrwtine.
2)
The
following variables
are
used in the implementation.
RPT
is
an integer which
records
the dynamic nest-
ing level
of
repeat group execution.
RS
is
an integer representing the Repeat
state-
ment number currently being executed.
RSMAX
is
the
total
number
of
repeat statements in the
Goal
program or subroutine being translated.
RPTACT
is
an
array
of
booleans
of
length
RSMAX.
Each
bit
corresponds
to
a
Repeat
statement.
It
is
set
if
the
Repeat statement
is
in
the process
of
being executed. Many
bits
in the array
RPTACT
may
be
set
simultaneously due
to
the possibility
of
dynamic nesting
of
repeat groups. Normal
flow
through
a
group
of
statements may not
be
the result
of
a
REPEAT
command. Then
RPTACT
is
not
set.
SAVE
is
an array used to
save
the
current value
of
RS
when nesting
of
repeat groups occur.
array
is
of
length
NDL
which
is
the maximum
level
of
dynamic nesting
allowr-?.
This
RPTCTR
is
an array
of
repeat counters. Each
counter
is
associated
with
a
Repeat statement.
HEAD
is
an
array
of
step numbers which indicate
the step number
of
the first statement
of
the
repeat group.
HEAD
is
indexed by
RS
to
find
the
starting location of
the
repeat
group.
18
INTERMETRICS
INCORPORATED
701
CONCORD
AVENUE
*
CAMBRIDGE, MASSACHUSETTS
02138
(617)
6b1-184C
g)
TAIL
is
an
array
of
step numbers associated
with
the
last
statement
of
a
repeat group.
TAIL(RS)
is
the
last
GOAL
statement
of
the Repeat
state-
ment
RS
.
h)
RETURN
LABEL
<RSN>:
is
the
HAL/S
statement
lauel
to
whizh
conTrol
is
to
be
transferred
after
execu-
tion
of
the
repeat
group initiated
by
Repeat
statement
RSN
.
i)
LOC
is
a translator
declared
variable
used by
the
function
FLUSH.
The
value
of
LOC
is
set
eqlial
t
the
target
of
the
GO
TO
statement when
this
targ
is
outside
of
the
repeat group.
See
floi.whart
GO
TO
(34).
3)
Each
Repeat statement
is
translated
into
the
following
in-line
HAL/S
code
wit.h
RSN
=
repeat number
of
the
repeat instruction being translated
and
N
=
number
of
iterations.
(See
Figure
5.2)
RPT
=
RPT
4-
1;
increment repeat nesting depth
RPTACT<RSN>
=
ON:
active repeat group
SAVERpT
=
RS:
.tave old repeat statement no.
RS
<RSN>;
establish
new repeat statement
no.
RPTCTRRS
=
<N>;
20
TO
HEADRS;
establish no.
of
iterations
transfer control
to
repeat
group
mrIjm
LABEL
<EN>:
return to
this
label
-
-
RS
=
SAVERpT:
RPT
=
Rer
-
1;
decrement repeat nesting depth
restore
old repeat statement no-
4)
At
the
TAIL
of
each
repeat group
there
shall be in-
serted:
--I---_------
REPEAT
GROUP
-------------
HEADRS
:
TAILRS
:
IF
RPTACTRs
=
TRUE
AND
RPTCONT
=
TRUE
TFIEN
/*
RPT CXIT.
is
a
HAL/S
function
which
controls the execution
of
the
Repeat
graup.
(See
Note
6)
next page)
*/
GO
TO
HEADRS:
ELSE
GO
TO
RETURN
LABEL
CASE;
-
-
19
JTER‘AfTFICS
II!C3EPQ?4TED
7c)l
COtdCORD
I”.L’EP!IJE
C:\I.!CZ’DGE,
hlPSSACHUSETTS
02138
(617)
CC;I-I?.?O
5)
Once
per Goal
program
or subroutine translated il.to
HAL/S
there
shall
be
inserted
the
followifiy
state-
ments:
RETURN
LABEL
I
CASE:
DO
CASE
RS;
-
GO
TO
RETURN-LABEL
1:
GO
TO RETURN
LABEL
2;
I
-
.
GO
TO
RETURN
LABEL
-
<PSMAx>
;
-
6)
The
RPTCONT
function
call
shall consist
of
the
fol-
lowing
HU/S
code:
RPTCONT: FUNCTION:
F@TCTRRS
=
RPTCTRRS
-
1;
/*Decrements repeat
counter
by
1*/
IF
RPTCTSs
=
0
THEN
DO;
RESET -TACTRS;
RETURN FA1LSE;
END
;
ELSE
RETURN
TIAJE;
CLOSE:
7)
The
FLUSH
procedure
is
called
wkenever
a
GO
TO
statement
is
encountered within
an
activated repeat
group
snd
when the target
of
the
GO
TO
statement
is
outside the
repeat group.
The
FLUSH
function
shall
consist
of
the
following
HAL/S
statements:
FLUSH
:
PROCEDURE
;
BACK:
RPTCTRRS
=
0;
RESET
FU?TACTRS;
RS
=
SAVERpT;
RPT
=
RPT
-
I;
IF
RPT
=
0
THEN
FETURN;
20
!NTERMETRICS INCORPORATED
701
CONCORD
AVENUE
CAMBRIDGE, MASSACHUSETTS
02138
(61
7)
661 -184(
IF
NOT
(HEADRS
-
<
LOC
AND
TAILRs
-
>
LOC)
THEK
GO
TO
BACK;
ELSE
RETURN;
CLOSE;
3.5
Software I'nterrupts
GOAL
soft\-
ITS
interrupts possess
the
following qualities:
1)
2)
3)
4)
In
PROGRAM,
An
interrupt
may
only
$2
serviced
at
the-end
of
a
Goal
statement.
Every
GOAL
program anG
siibzcctine
possesses
its
own
interrupt environment created by
WHEN
INTERRUPT
ana
DISABLE
statements.
Subrmtines
which
are performed in
he
critical
mode
ignore all interrupts.
If
enabled,
an interrupt may cause one
or
both
of
the
following
actions
to
occur:
a)
a
subroutine may
he
performed
b)
control
may
be
passed
to
a
specified
step
num-
ber.
(GO
TO
or
RETURN
TO
options)
order
to
provide
these
features in
the
GOAL
MASTER
each
translated
GOAL
program,
and
each
tranzlated
-
GOAL
subroutine
are Fmpitcted.
cified for handling interrupts. Figure
3-5
shows
the
overall
in forma
tion
flow.
The
following structure
is
spe-
1)
At
the
GOAL
-
MASTER
-
PROGRAM
level
two
arrays
are
de-
clared.
a)
INT
is
an
array
of
booleans indicating
that
an
interrupt
is
pending. Each
Goal
program
pos-
sesses
one
bit.
b)
INTNUM
is
an array of integers which indicate
the
number
of
the function designator associatad
with
the penriiny
htermpt.
There
is
one
inte-
5er
€or
3ach
GOAL
program.
2)
Function Desiqnator
number
one
-.i
is
reserved
to
provide
all
tha
logic necessary
to
control
interrupts.
1
INTERRUPT
F'JNCTION
DESIGNATOR
-
-
-
INTERRUPT
COi.¶MUNICATION
TABLE
I
.
SNVIRON
-
PRCCESS
NUMBER
4
ACTIVE
e
T'JNCTION
a1
ENABLE
DESIGNATOR
E)
I
SABLE
RECOGNIZE
SAVE
(interrupt
servicing
routines)
-
JEs--
I
J
Translator
Interface
Figure
3-5:
Interrupt
Information
Flow
22
INTERMETRICS INCORPORATED
701
CONCORD
AVENUE
9
CAMBRIDGE,
l:l.:,Sitl
;;iiJ':i
I
i
.
:
Function designator
1
or
FD(1)
is,
in actuality,
a
series
of
procedures
which
can
be
called
via the
HAL/S
procedure
DATABAEK.
The
following services
are
provided:
FD(1)
maintains
the
enabled
or
disabled
status
of
all
the
interrupts associated
with
each
GOAL
Program,
It
provides
a
stack mechanism
so
that
the
inter-
rupt status may
be
PUSHED
(saved
and
cleared)
as
well
as
POPPED
(restored).
The
interrupt condition
associated
with the vari-
ous interrupt function designators
are
all
commu-
nicated
to
FDI1).
Depending upon
the
interrupt
status,
associated
with
the
interrupt, the array
INT
and
INTNUM
are
written into.
Any priority issue
associated
with
interrupt con-
flicts
is
resolved
by
FD(1).
Because interrupt function designators
are
not
completely specified in the
GOAL
Reference Manual,
all
the interrupt mechanisms requiring definition
are
placed within
FD(
1).
3)
Each
Goal
program and subroutine maintains
its
own
interrupt environment in
a
local
two
dimensional
array
called
ENVIRON.
ENVIRON
(1,K)
contains
the
number
of
the
Kth
in-
terrupt function designator used in the program
or
subroutine.
The
contents
of
ENVXRON
(1,K)
are
established in
PGSS
1
of
the
Translator
and
do
not change during
the
life
of
the translated pro-
gram.
ENVIRON
(2,H)
contains
the
number
of
the
sub-
routine
to
be
performed when
the
Kth
interrupt
occurs.
A
0
will
indicate
that
no subroutine
is
to
be
performed.
The
WHEN
INTERR'WT
statement
causes
ENVIRON
(2,K)
to
be
written in\to.
ENVIRON
(3,K)
contains the
case
number
of
the
GO
TO
statement
to
be
executed during the servi-
cing
of
interrupt
K.
A
0
indicates no
GO
TO
option
is
present.
The
WHEN
INTERRUPT
statement
causes
ENVIRON
(3,K)
to
be
written into.
23
4
)
The
translation
of
the
WHEN
INTERRUPT
statement
will
cause
the
interrupt to
be
activated
with
the
follow-
ing
HAL/S
code,
where
<FD>
is
the interrupt
function
designator associated with
the
WHEN
INTERRUPT
statement:
IF
NOT C
DO;
/*not
a
critical
subroutine*/
END
;
5)
Dispbling
of
a
specified interrupt
is
accomplished
bY
CONTROL,
PN>
=
<disable
interrupt>;
NUMBER<pN>
=
<FD>;
CALL
DATABANK
(1,
<PN>);
6)
The
saving and clearing
of
the
interrupt status asso-
ciated with
a
GOAL
program
is
accomplished
by
CONTROL<
PN
>
=
CALL
DATABANK
(1,
<PN>)
;
<push interrupt environment,;
7)
Restoration
of
the interrupt status
is
accomplished
by
CONTROL,pN,
a
<pop
interrupt environment>;
CALL
DATABANK
(1,
WN>)
;
8)
At
the
end
of
every goal statement
the
following
is
inserted
9)
HANDLER
is
a
translator defined
function
associated
with
each
program or subroutine.
HANDLER:
TUNCTION
BOOLEAN;
DO FOR
I=1
TO
ACTIVE;
24
INTERMETRICS INCORPORATED
701
CONCORD
AVENUE CAMBRIDGE, MASSACHUSETTS
02138
(61
7)
661
-184C
IF
ENVIRON
(l,I),
=
INTNUMCPN, THEN EXIT:
ELSE
SIGNAL
ERRORX;
END;
CONTROL <INT BEING SERVICED>;
<PN>
CALL DATABANK
(1
I
<PN>)
;
DO
CASE
ENVIRON
(2,I)
ELSE;
CALL
...
CALL
...
END;
IF
ENVIRON
(3,I)
>
0
THEN RETURN TRUE; ELSE
RETURN
FALSE;
CLOSE
;
10)
At
the end
of
every translated
GOAL
program
or
sub-
routine (excluding those with no interrupt statements)
is
the following:
DOCASE:
LOC=O;
CALL FLUSH;
/*
Resets
appropriate
repeat counters
*/
DOCASE
ENVIRON (3,I) ELSE;
GO
TO
...
GO
TO
...
END
;
THIS
PAGE
INTENTIONALLYLEFT
BLANK.
26
INTERMETRICS
INCORPORATED
701
CONCORD
AVENUE CAMBRIDGE,
MASSACHUSETTS
02138
(617)
661
-184C
4.0
DEFINITIONS
AND
ASSUMPTIONS
4.1
Definitions and
Notation
<
>
means
scbstitute the contents
of.
For
example:
where
Nm
=
SAUL
S
LI
=
INDEX
then
IMPORTANT
NOTE
:
The
Translator
must
substitute
underscores for spaces
in
GOAL
source
identifiers.
-
<A>=
SAUL
-
SDINDEX
(Kj
means
that
K
is
a
variable
of
an
element.
NAME(K)
Means
that
NAME
is
a
function
of
K.
For
example,
Data
=
<TN>DK,<CI,
where
TN
=
TABLE
CI
=
COLW
<DATA(K)>
=
TABLEDK,
<DATA(3)>
=
See subroutine
section
5.2
for
notations
associated
with
CONVERT
NUMERIC,
CONVERT
TIME,
EVAL
--
INT
NAME,
EVAL
-
ED,
EVAL
-
NUM
-
FORM,
LIM
-
FORM
and
@L
-
FORM.
In
the Flowcharts,
GOAL
Source input
is
indicated
by
’
‘,
whereas
HAL/S
Source
output
is
indicated
by
‘I
”.
4.2
Assumptions
4.2.1
Overall
Scope
a)
Output
of
the
Translator
(Reference:
GOAL-to-HAL
Translator
Final
Report,
Section 2.2.la,
Page
2-15)
27
JTERh”ETRICS It\iCZ?:<PQRATED
701
COP:CO!7D
AVENUE
CAF,IBRIDGE.
MAS3ACHUSETTS
02128
(617)
661
-1E:O
The
GOAL-to-HAL
Translator
will
produce
HAL/S
code
in
full conformance
with
the appropriate
(see
Section
2.2)
HAL/S
documentation including:
HAL/S
Language Specifications
HAL/S
Language
Forms
HAL/S
Compiler Systeii Functional Specifications
b)
.
"
Two-Pass"
Structure
Conceptually,
the
first
pass
is
required
to
take
inventory
of
that
GOAL
program
data
which must
be
viewed from
a
ffglobal'l
point
of
view.
The
first pass
also
processes
the
declare
statements.
The
second pass processes the individual
GOAL
procedural- and system statements, The
HAL/S
code
generated in
PASS
1
becomes
the front end
of
HAL/S
code
generated in
PASS
2.
The
Translator
will
operate in
more
than
one
pass.
C)
Interface
to
the
Flight
Computer Operating System
(FCOS)
(Reference: Shuttle Avionics and the
GOAL
Language Final
Report, Section 3.1.4 and Figure
3-4,
Pages
3-9,
3-10)
GOAL
programs translated into
HAL/S
will
have the
same
interface specification
as
that provided for
the
mission
application
programs.
The
basic
interfaces
to
the
FCOS
arise
from
HAL/S
real
time
and
error
control statements. These
interfaces
will
also
apply
to
code
derived from
GOAL
statements
translated into
HAL/S.
A
corollary
to
this
specification
of
the
FCOS
interface
is
that the Translator
is
not necessarily configured
to
supply
HAL/S
code
for
other
computing systems in the
overall
Shuttle
progcam, such
as
the Software Development Laboratory
(SDL)
,
Shuttle Avionics Integration Laboratory
(SAIL),
etc.
-
GQAL-
translated programs
will
run
in these
facilities
to
the
extent
that
the
operating systems
are
similar.
a
Use
of
the
GOAL
Master
Program (Reference:
GOAL-to-W
Translation Final Report, Section
3.2,
Pages
3-14
to
3-22)
The
referenced text proposed
a
technical approach
for
dealing with
GOAL
capabilities in
the
areas
of
software
interrupts, system terminations, and concurrent operations.
This
approach, designated
the
GOAL
Master
Program,
is
expanded
29
INTERMETRICS
INCORPORATED
701
CONCORD
AVENUE
CAMBRIDGE,
MASSACHUSETTS
02138 (617) 661 -184~
in Section 3.0 of this Specification document and
will
be
the
basis for implementing the translation process.
e)
Non-GOAL (Reference: GOAL-to-HAL Translation Final
Report, Section 3.1.5, Page 3-7)
The Translator
will
not have any capability for dealing
with
Non-GOAL
source code.
f)
Databank (Reference:
GOAL-to-HAL
Translation Final
Report,
Section
3.1.6,
Pages
3-8
to
3-12)
The
Translator
plays no
role
in the creation and management
of
the Databank, which
is
unspecified
at
this
time.
However,
the Translator, in addition
to
processing the
GOAL
source code
into
HAL/S,
wFll
provide
a
complete software system in
the
GOAL
MASTER
PROGRAM
for
communicating correctly and efficiently
with-the DaFabank. This
is
described in Section
3.3
of
this
Specification.
by
an
4.2.2
a)
Creation and management
of
the Databank
is
accomplished
unspecified
Data
Management System on
the
ground.
Features
Revision Numbers (Reference
:
GOAL-to-HAL
Translation
Final Report, Section 3.1.1,
Page
3-1)
Revision
labels
are
always part
of
a
GOAL
program name
.or
a
databank
name.
There
are
no run-time decisions
involving
revision number values.
bl Unrestricted
STOP
(Xeference:
GOAL-to-HAL
Translation
Final Report, Section
3.1.2,
Page 3-2)
The Translator
will
provide the capability
of
stopping
and restarting
at
selected points.
any point, the unrestricted
STOP,
will
not be provided.
The ability
to
restart
at
29
NTERZETRICS
lidCGFi,’Oi<ATflD
7G1
C0:JCOFID
AVE?!IIE
CA:,:E:RIDCE,
FXkSSACtil
’SETTS
021
38
(61
7)
661
-1
C)
Overlapping
RFnEATS
(Reference
:
GOAL-to-HAL
Translation
Final Report, Section 3-1-38 Pages
3-2
through
3-6)
As
recommended by
the
referenced
text,
REPEAT
groups
are
to
be
limited
to
non-overlapping groups with
the
grouping
performed
by
the
programer.
d)
Dimensional
Labels
in
GOAL
Quantities (Reference:
GOAL-to-HAL
Trmslation Final Report, Section
4.18
Pages
4-28
4-48
4-5,
and
4-9)
GOAL
quantities
will
be
treated
as
in the referenced
text
by developing
a
label
declaration, arrayed if necessary, to
match
the
parameter
declared
as
a
Quantity in
GOAL.
The
label
is
to
be
used
for
output
labeling
only and plays
no
role
in
dimension checking
or
automatic scaling.
e)
Table
Activation (Reference:
GOAL-to-HAL
Translation
Final Report, Section 2.1.3.8, Page 2-13, and Section
4.13, Pages
4-7
through
4-12)
The
activation
of
function designators
and
their
associated
rows
of
data
will
be
har,dled
by arrays
of
HAL/S
BOOLEANs
as
described
in
the
referenced text.
f)
CONCURRENTLY
(Reference:
GOAL-to-HAL
Translation
Final Report, Section
3-2-28
Pages 3-21 and
3-22)
HAL/S
does
not permit use
of
a
program module by
more
than one
user
process
at
a
time.
Accordingl.7,
the
Translator
shall generated from each concurrent statement
a
uniquely
named
HAL/S
task block, which
will
be
executed via
a
HAL/S
SCHEDULE
statement.
9)
Time
Values
seconds
(or
other
FCOS-defined unit of
time)
in floating point
Tormat. Conversion back
to
days,
hours,
minutes, and
seconds
can
be
performed by
b
function designator when required.
All
time
values
are
converted
to,
and maintained
as,
h)
Comparisons
tested,
then
all
the
tests
must
be
true in
order
for
the
condition
of
the Statement
to
be
true.
If
tables
are
being tested, then
tests
are
performed only
on
activated
function designators.
In
a
comparison
test,
if an array
of
elements
is
being
30
INTERbiE7HICS INCORPORATED
701
CONCORD AVENUE CAMBRIDGE, MASSACHUSETS 02138
9
(61
7)
661
-1841
Number
data
is
single precision floating point.
Integer
is
a
subset
of
floating point with
a
zero exponent.
All
number patterns
may
be
converted to single precision
floating point
format
without
loss
of precision.
designators
will
perform
the
appropriate conversion
for
output.
Function
j)
.
SET
For
Time
Value
The SET
discrete
statement
will
accomplish
the
FOR
time-value option by calling the referenced function designator
twice.
The
latter
will
have
its
own built-in toggle.
k)
RECORD
Statement Features
The system
device
default option in the
RECORD
tatement
will
be
activated through
the
function designator <system
device>.
The
I,'
in the
RECORD
statement
will
be
passed
to
the
appropriate function designator for interpretation
as
a
Line
Feed
or
other formatting action consistent with
the
device
being addressed.
1)
Assumptions Concerning Present Value
of
(PVO)
*
The
number
of
elements in
the
first
External Designator
must equal
the
number of elements in the second
External Designator.
*
One External Designator may
be
a
Table
name,
the
other
may
be
a
list
of
Function Designators.
*
In
order for the
PVO
to
transfer
data
from
a
sender
to
a
receiver, the
activate
bits
of
both
sender and
receiver must
be
1.
Illegal
GOAL:
Send
PVO
<FD1>
TO
<FD2>,
<FD3>;
Send
PVO
<FD1>,
<FD2>
TO
<FD3>:
31
ITER!.'ETRiCS
li:C@F'?OFIATED
701
COFlCOiiC
h'lCi~4UE
CAI,:ZR!JGE,
MI
SSACHUSETTS
02138
(617)
€61
-1L40
Legal
GOAL:
SEND ALPHA FUNCTIONS
TO
<FDl>,
<FD2>,
<FD3>
;
(Table
ALPHA
must
have 3
rows)
4.2.3 Groune-Based Operating System (GBOS)
a)
GBOS
Support
Services
(Reference: None)
During run-time, the GBOS may be called upon
to
support
the
flight computer with
services
requiring the downlink of
data
to
CRT's
and printers controlled on the ground. The
details
of accessing ground-based peripheral equipment from
the
flight computer
is
external
to
the GOAL-HAL/S Translator.
The flight computer interface
is
handled through
an
appropriate
function designator.
4.2.4
Undefined
a)
FEEDBACK
LOOPS
(Reference:
GOAL-to-HAL
Translat-on
Final Report, Section
2.1.4,
Page
2-i4)
The
GOAL
syr,t,ax
Loops presently have limit*:tions designated
by
letter
symbols.
TIACSG
,;.mbols
are
sma-.ized in the feedback
letters
in the
GOAL
Syntax
Dia7-
ams
naIruoook, NASA/KSC Document
TR-1213, dated
16
April, 1973. Values have
not
yet been assigned
to
these
letter
symbols. Tentatively,
the
GOAL-to-HAL
Translator could
be
designed
to
flag
an
error
if the number
of
executions
of
the loop exceeds the
letter.
At
a
later
time,
the
letter
would have
to
be specified.
32
INTERMETRICS
INCORDORATED
701
CONC~RU
AVENUE
CAMBRIDGE,
MASSACHUSETTS
02138
(617)
661-1840
5.0
TRANSLATION
REQUIREMENTS
5.1
Structure
of
the
Translator
5.1.1
Introduction
The implementation
of
the
translator mal- ultimately
consists
of
one
or
many passes through
the
GOAL
source code.
The
actual number
of
passes
is
a
matter
of
detailed design
of
the
Translator
for
efficiency.
In
order
to
isolate
all
the
functions involved in the
Translator,
a conceptual division into
t”7o
passes
will
be made.
This
is
done mainly
for
the
purpose of achieving clarity in
this
specification. Much of
the
effort expended in one
pass
of
the
Translator
could
just
as
well
be
accomplished
in another
pass.
Some
freedom
to
choose
should
be
available
to
the
imple-
mentation
stage.
Conceptually, the Translator consists
of
two
sequential
processing sections called
PASS
1
and
PASS
2
and
a
final Output
Processor
which
generates
the
GOAL
MASTBR
PROGW
and organizes
the
translated statements in an appropriare
format.
This
for-
mat
is
determined by
the
output device used by
the
machine in
which
HAL/S
compilation
is
to
take
place.
Processor
is
a bit arbitrary, but
it
was
done in
order
to
make
the
Translator
more
modular and place any machine dependent
(the
machine
in
which
the
compiler
is
to run) features in
the
OWput
Processor.
The
segregation
of
functions between
PASS
2
and Output
5.1.2
PASS
1
The fcllowing operations shall
be
performed in
Pass
1:
1)
Prozess.GOAL
Declarations
All
GOAL
Declaration statements shall
be
processed
in
order
to
place into the Translator’s symbol
table
the following
information:
a)
For single element
variables
<NAME>TYPE
where
<N.NlE>
is
the
name
c.
the
variable
as
it
appears
in
the
GOAL
declaration scatesent.
<NAME>
TYPE
can
assume one
of
four values:
0
-
Numeric
data
1
-
Quantity
data
2
-
State
data
3
-
Text
data
For
list
declarations
<LISTN~>TYPE
=
0,1,2,3
as
for single elements
<LISTNAME>
=
length
of
the
list
as
described
in
the
GOAL
declaration statement.
For
table
declarations
<TABLENAEIE>TYPE
=
0,1,2,3
as
with
single elements.
<NAME>TYPE
<TABLENAME>-C
=
This
is
an array
of
column
names
as
declared
in the
GOAL
declaration stacement. This
array
is
an optional feature of
the
GOAL
declara-
tion an(- consequently may not appear in
the
synlbol
table.
<TABLENAME>CS
=
Tkis
is
the column size
of
the
table
as
declared
in
the
GOAL
declaration statement.
<TABLENAME>RS
=
This
is
the
row size
of
the
tab:?
as
declared
in
the
GOAL
declaration stattcsnt.
The
actual generation of
the
appropriate
HAL/:?
declaration
statements,
23
preser,ted in flow
charts,
can
either
be
performed
in
Pass
1
or in
Pass
2.
This
is
implementation dependent
&-ad
iloes not impact the final output of the Translator.
2)
Step
E.rumber
Resolution
Pass
1
will
assign
step
numbers
to
all
GOAL
statemer.ts in
sequential
order.
When
Pass
2
processes the
GOAL
statements,
all
statements
will
possess step nmbers.
Pass
1
will
substitute
anv
GOAL
source step numbers with
the
appropriate translator
supplied step numbers.
3)
Assign
Process
Number
(PN)
A
process
is
defined
as
any
GOAL
?rogram
or
HAL/S
gen-
erated Task
(created
by
a
Concurrently Verify, Concurrently
Re-
cord
or Concurrently Perform statement).
Pass
1
will
assign
a
process nmber
(PN)
to
each process.
The maximum number
of
processes
(PNmax)
t?q~~ls tho number
of
GOAL
programs plus the kotal number
of
concurrent; statements
34
INTERMETRICS INCORPORATED
701
SONCORD
AVENUE CAM6;3IDGE, MASSACHUSETTS
02138
(61
7)
661
-1840
which zppi'ar in
all
the
Goal
Programs
being
translated.
A
Process Array
will
be
generated
for
use by
Pass
2.
The organi-
zation
of
this
array
is
shown in Figure 5-1.
All
GOAL
programs
are
assigned
process
nwiers
first,
fol-
lowed by Concurrently Verify,
Recorc!
2nd
Perform statements.
The Conctrrent1.y Perform statements
are
placzd
last
in this
array
so
that the numbers
PR,
PNmax,
and Pmax
ccn
be
differen-
tiated.
These numbers
are
later
used in the creation of declara-
tion statements in the
GOAL .h2ASTER
PROGRAM.
-
-
The process array
is
utilized many places in
Pass
2.
For
convenience the task nuiier
associated
with each
concurrent statement
will
be
made
equivalent
to
the
process number which appears in
the
process
array.
Whenever
<PN>
is
indicated
ir,
a
Pass
2
flow
chart,
thc
r;
>cess
number
associated
with the
GOAL
process
being translated
(as
indicated in the
process
array)
will
be
used.
RELEASE
statene~ts
require
the
tsscciation
of
a
step
number in
a
progran with the task nane. The task name
is
generated by concatenating the process number
asso-
ciated
with the
step
number with
the
letters
TASK,
i.e.,
TASK
<PN>.
In
Pass
2,
when
tasks
are
generated by concurrent
statements the task number (process number)
is
obtained
from
the
process array.
41
?.cp
at
Stat
enen
t
Ana lysis
In order
to
generate the appropriate
HAL/S
code
associated
with
Reseat
Statements
the
following information must
be
gathered
in
Pass
1
and placed in
the
Repezt Array
(Figure
5-2).
This
is
done for each
GOAL
program
or
subroutine:
a)
Each repeat statement
is
assigned
a
number
(RSN)
ac-
cording
to
th?
order
in which they
are
processed.
SMAX
equals the number
of
repeat statements.
b)
The repeat
statenent
step
number
(e.g.,
ste2
5)
is
used for identification purposes.
c)
Associated with each Repeat statement
is
the
step
number
of
the first
GOAL
statement
of
the
repeat
gixp.
Tnrs
is
piaceli
in
ths
SB~*LZZ
::ZaJ.
Figure
5-1:
Process
Array
Identifiers
-
Name
of
First
Goal
program
Second
Goal
Program
Last
Goal
Program
Program
name
and step number
associated
with
first Concurrently
Verify
state-
ment
Program
number
and
step number
associa-
ted
with
second Concurrently Verify
s
tztement
0
0
0
with
last
Concurrently Verify statement
Program
name
and step
Dumber
associated
with
first Concurrently
Record
state-
ment
Program
name
and step number
associated
with
second Concurrently
Record
state-
ment
.
with
last
Concurrently Record statement
Program name and step numbt3r
asemiated
viith
first
Concurrently Perform
state-
ment
Program
name
and step number
associated
with
second Concurrently
Perform
state-
ment
0
0
0
Program name
and
step
number
associated
with
last
Concurrently
Perform
state-
ment
PR
PV
=
number
of
concurrently
verify
statements
PREC
=
number
of
concurrently
record
statements
PPER
=
number
of
concurrently perform statements
=
number
of
goal programs
36
INTERMETfiICS
INCORPORATED
701
CONCOAO
AVENUE
CAMBH;DGE,
bASSACttLISETTS
02138
(617)
661
-1841
Figure
5-2:
REPEAT
Array
1
2
3
RSMAX
Re
pe
at
S
t
a
terne
n
t
N
umbe
r
Step
5
-
Step
12
-
HEAD
Step-7
Step
-
103
TAIL
Step-19
.
s
tep-10
3*
RSMAX
=
number
of
repeat statements within
the
Goal
program
or
subroutine being translated.
*
In
the
case
of
a
REPEAT
group containing one statement
HEAD
and
TAIL
refer
to
the
same
statement number.
d)
Associated
with
each Repeat statement
is
ihe step
number
of
the
last
Goal
statement in the repeat
group.
This
is
placed in
column
TAIL.
The following declarations
are
created
and
are
to
be
in-
corporated into
the
translation
of
the
GOAL
program
or
GOAL
subroutine.
DECLARE
HEAD
ARRAY
(RSmax)
INTEGER
SINGLE
INITIAL
(<Head(l)>,
cHead(2)>,
..
.
cHead(RSmax)>);
INITIAL
(<TAIL(
1)
>
,
cTAIL(2)
>
,
.
<TAIL(RSmax)
>)
;
DECLARE
TAIL
ARRAY
(RSmax)
INTEGE!?
SINGLE
DECLARE
RPTCTR
INTEGER
SINGLE:
DECLARE
RPTACT
ARRAY
(RSmax)
BOOLEAN
INITIAL
(OFF)
;
DECLARE
SAVE
ARRAY
(NDL);
(NDL
=
number
of
dynamic nesting
levels
allowed]
DECLARE
RPT
INTEGER
SINGLE;
DECLARE
Rs
INTEGER
SINGLE;
HE%
and
TAILK
are
the
Kth
entries in
the
repeat array.
e)
If
no
Repeat
statements
are
encountered in
the
program
or
a
subroutine being translated,
a
flag
is
set
so
that
all
Repeat Mechanisms
will
be
eliminated
in
Pass
2.
SI
Replace
All
the
Replace statements encountered in the
GOAL
source
are
executed in
Pass
1
prior
to
code
generation
in
Pass
2.
6)
Macros
All
macros
are
expanded in
both
Pass
1
and
Pass
2.
The
contents
of
the expanded
macros
are
processed identically
to
other
Goal
statements.
7)
Interrupts
In
order
to
generate
the
appropriate
code
and
data
to
handle
software
interrupts the following action must be per-
formed
in
Pass
1.
These
actions
are
performed
for
each
GOAL
program
and
subroutine.
38
INTERMETRICS
INCORPORATED
701
CONCORD AVENUE
CAMBRIDGE.
hlASSACHUSETTS
02138
(61
7)
661-1840
Ar.
interrupt number
(IN)
is
assigned
to
each
interrupt
function designator encountered in
the
programmer
subroutine.
The
list
of
interrupt function designa-
tors
is
determined by analyzing
all
the
WHEN
INTERRUPT
statements
encountered.
The
interrupt numbers
are
assigned on a first come,
first
served basis.
The
variable
ACTIVE
will
contain
the
total
number
of
in-
terrupts used in
the
program
or
subroutine being
pro-
cessed.
A
list
of
aJ.1
subroutines referenced in the
WHEN
INTERRUPT
statement
is
assembled.
A
subroutine num-
ber,
SN,
is
assigned
to
each
subroutine on
a
first
come,
first
served
basis.
A
list
of
all
the
GO
TO
or
RETURN
TO
step numbers
is
assembled
and
a
case
number
(CN)
is
assigned
to
each
case.
The
arrays
IN,
SN,
CN
will
be used in translating
WHEN
INTERRUPT
statements as
well
as
in synthesizing
the
final structure
of
each
GOAL
program
or
subroutine.
The
followirlg
declaration
statements
are
created
by
Pass
1
and
entered
at
the
beginning
of
the translated
GOAL
program
or
subroutine.
DECLARE
ENVIRON
ARRAY
(3
,<active>)
INTEGER
<FDI(K)>
is
the
number
of
the
function designator
associated
with
the
Kth
interrupt.
DECLARE
ACTIVE
INTEGER
SINGLE
INITIAL
(<ACTIVE>)
;
A
list
must
be
generated which
relates
the
step
nu-
ber
of
the
WHEN
INTERRUPT
Statement
to
the interrupt
function designator number. This
list
is
used in
translating
the
DISABLE
statement in
Pass
2.
If
no
WHEN
INTERRUPT
statements
are
encountered by
Pass
1
in
a
program
or
subroutine, then
a
flag
is
set
in
the translator
so
that
all interrupt mechanisms
are
eliminated in
the
code generation part
of
Pass
2.
8)
Function Designators, External Designators
and
the Databank
In
order
to provide a proper communication
to
databank in-
formation
the
following actions
are
performed
by
Pcss
1:
a)
All
the function
desiyators
referenced in
the
GOAL
source being compiled
are
gathered.
This
includes
all
GOAL
programs and subroutines in the
GOAL
Trans-
lation
submittal.
Each
function designator
is
assigned
a
function designator number on
a
first-encountered
basis.
b)
Every
time
an external designator
is
encomtered
which
consists
of
a
grouping
of
function designators
(rather
than
a
table
name)
the
array
of
function
designator numbers
(AJ?D)
is
declared
DECLARE
AFD<N>
ARRAY
(<WAX>)
INTEGER
SINGLE
where
<FD(K)>
is
the
Km
function designator number
encountered in
the
external designator.
INITIAL
(G'D(l)>,
<FD(2)>,
...
<FD(KMAX)>);
<KMAX>
is
the
number
of
function designators in the
exte
ma1
des
ipator
.
<N>
is
the number of
the
external designator assigned
on
a
first
come
basis.
c)
The
list
of
function designator numbers
gathered
in
Pass
1
is
sufficient inforination
to
extract
from
the
ground based
data
bank
all
the information required
for
the
flight machine.
This
process
will
be
performed by the Translator.
9)
GOAL
Comments
All
the
GOAL
comments appearing within
a
GOAL
statement
will
be
collected
by
Pass
1,
and inserted into the
GOAL
Source
after
the
semicolon
(:I
of
the
GOAL
statement. The translated
GOAL
comments
will
then
be
handled according
to
the
rules of
the
HAL/S
output
write:.
40
INTERMETRICS INCORPORATED
9
701 CONCORD AVENUE
9
CAMBRIDGE, MASSACHUSETTS
92138
(617) 661-1840
5.2
Translater Subroutines
5.2.1
CONVERT
NUMERIC
-
The
CONVERT
NUMERIC
subroutine
shall
take
a
GOAL
number
or
a
GOAL
number pattern and convert
it
to
single
precision
format.
The
size
of
the
number
pattern
(BIN,
OCT,
HEX),
shall
be
such
as
to
fit
into
the
fraction portion
of
the
ilsating
point
format
without any
loss
of
information.
This
routine
shall
return
the
result
as
the
Translator
variable
<VALUE>.
5.2.2
CONVERT
TIME
-
This
is
a
procedure which accepts
TIME
VALUE
and Returns
:
TIM
=
number
(e.g.8
3)
or
name
(e.g.,
ALPHA)
The
literal
time
value returned
is
converted into
a
HAL/S
scalar
in units
of
seconds
or
other
FCOS
defined unit
Of
time-
5.2.3
EVAL
INT
NAME
--
The
Translator
shall
provide
a
subroutine
called
EVAL
INT
-
NAME
which
shall
accept
the
GOAL
internal name and return
the
parxneters
NAME,
DATA,
DIM,
ACT,
w,
and
T
as
defined in
the
cLrt
below.
F
Parameter
NAME
DATA
DIM
ACT
KMAX
T
Single
Name
<->DIM
1
0
List
(1)
<LISTNAME>
1
0
41
1
l2
Notes:
LI
is
the
list
index.
It
can either be an integer (e.g.,
3)
or
an alphanumeric name (e.g.,
K)
.
RI
is
the table
row
index.
It
can either be an integer
or
an
alphanumeric name.
CI
is
the table
column
index. The column name
is
converted
to
a
column
number by searching
the
array
<TABLENAME>
C
created in Pass
1.
A
degeherate
table
of
1
row
will
be returned with
T=l,
DATA=
<TN>Dl,<CI>'
ACT=<TN>A1,
KMAX=l.
If
TABLENAME
is
not specified then the tablename previously
defined in
the
statement being translated
is
used.
KMAX
=
number of elements in internal name.
T
=
Tag, identifying the
cases
shown
on the previous page.
5.2.4 EVAL
-
ED
The Translator shall provide
a
subroutine called
EVAL
ED
which accepts the
GOAL
external designator and
returns the parameters
T,
AE’D(K;,
KEJw(,
and
TK
as
defined
in the table
below.
KMAX
!rN
Array
of
Function Designators
0
Array
of
function designators
AJ?D(K)
=
AF’D<N>
K
length of array
Pass
1
will generate .the
following declaration
Table Name
1
<TABLENAME>RS
<TABLENAME>
DECLARE
AE’D<N>
ARRAY<KMAX>
INTEGER;
Where
N
=
a
unique external designator
identification number assigned in Pass
1.
5.2.5
EXAL
NUM
FORM
--
The Translator
shall
include
a
subroutine designated
EVAL
NUM
FORM.
This
subroutine shall generate
a
HAL/S
equivalent
numeric Formula.
EVAL
NUM
FORM
shall:
--
1)
Return
NF(K)
=
Numeric
Formula
The
index
K
is
u5,ltd
if
the
numeric formula contains
table names
as
variables. In this
case,
K
is
used
to
index
down
the
rows
of
table.
For
example,
if
A
and
B
are
table
names in
GOAL,
the
GOAL
numeric formula:
(A)
I-
(B)
+
1;
would
hecome
the
HAL/F
wmeric
formula:
mL/S
will
perform an element by element addition
if
AAK
and
JAK
are
True.
2)
Return
TNA
which
is
an array
of
table
names used in the
numeric formulae.
Example:
<TNA(K)
>A
=
jth
xtivation
tit
of
the Kth
table
na
j
3)
Return
LMAX
=
length
of
TNA
array.
and number data
is
assumed
to
be
singlc
precision
floating point.
All
quantity
data
4)
Return
T,
which
is
a
control flag.
T
=
0,
if
no
table
names
are
in
the
formula.
T
=
1,
if there
are
table
names
in the formula.
4
4'
5.2.6
LIM
FORM
-
The
Translator
shall contain
a
subroutine
called
LIM
FORM
which accepts the
GOAL
limit
formula, without the
optzonal
internal
name. The internal name, if necessary,
will
be
evaluated separately. The following
items
are
returned by
LIM
FOW
to
the
caller.
-
1)
Lower
Limit
Information
If
an internal name
is
indicated the
EVAL
INT
NAME
is
called and the following
parameters
are
rezurned.
UT
=
<T>
LLNAME
=
<NAME>
LLDATA
=
<DATA>
.
LLACT
=
<ACT>
A
number
will
return:
LLT
=
0
LLDATA
=
<NUMBER
VALUE>
A
Quantity
will
return:
LLT
=
0
LLDATA
=
<QUANTITY
VALUE>
All
of
the above parameters
are
character strings
to
be
used by the
Translator.
2)
Upper
Limit Information
This
is
evaluated
similar
to
the
iower
limit.
The
following parameters
are
returned:
ULT
=
<T>
ULNAME
=
<NAME>
ULDATA
=
<DATA>
ULACT
=
<ACT>
A
number
will
return:
ULT
=
0
ULDATA
=
<nunber
value>
A
Quantity
will
return:
ULT
=
0
ULDATA
=
<Quantity
value>
45
iTFR:.'El
!:ICs
".TGF?R3,"YTE3
701
CC!,:?Cn3
t'5'.'EY!9C
*
C
*,:
,
.
7.'
31
4)
LF
=
'OR'
if
the
Not option
is
used
'AND'
if
the
Not
option
is
not used.
Lower and
Upper
limit
information
is
reversed
for
the
Not option.
EXDATA
=
'NUMDER,pN,
'
This
is
used only when external designators
are
employed
in conjunction with
the
limit
formi-la.
5.2.7
REL
-
FORM
The Translator
shall
contain
a
subroutine
called
REL
FORM
which accepts the
GOAL
relational
formula
without
the
optional
internal
name.
The
internal name, if necessary,
will
be
evaluated
separately.
The
following
items
are
returned
by
REL
-
FaFU-4.
1)
The
relation
RF
which
is
either
=,>,
<,
2,
f
2)
RT
=
0
single
ni
3
or
type:
RNAME
=
number, converted number pattern
or
quantity value, single
name,
<LIST
NAME><LI2,
TEXT
data,
STATE
data.
RT
=
1:
RNAME
=<TABLENAME>
<RI><CI>
RAZT
(K)
=
<TABLENAME>A,RI,
RT
=
2:
REAME(K)
=
cTABLENAME>~,
<cI>
RACT(K)
=
<TA13LENAME>AK
KMPX
=
<TABLENAME>RS
I
3)
EXDATA
=
'NUMBER,pN,
,
STATE<pN,',
(TEXT,pN,l
(used for external designator8 only.)
46
INTERMETRICS INCORPORATED
701
CONCORD AVENUE
CAMBRIDGE
I.
'A'.:\
t'
i
I
;
0.
ouirui
ExcrrrioN
SUIIKOUTINL
(s~
'1
"TEXT<pN>
*
OUTPUT
HALPLIS
a
'<TEXT
CONSTANT
>'*"
ENTLR
S
OUTPUT HALISZ
0
*ltXT<p~> ~CDATQ>
I"
1
"IF
ACT
THEN
DO;
TEXT<~N>
1
<
DATA>r
"
2
"DO
FOR
J
*
1
TO
OMAX>z
l€XTcp~>
~cOATA(J~>~
..
IF
<ACT
(I)>
THEN
00
I
b
A
1
CAll
EVA-ED
R-CT>
J
NOTE
:
All
MESSAGES
Wlll
8E
SENT
TO
ALL DEVICES.
-
J
S
OUTPUT dALlS
8
0
I
"ENDS"
2
"ENOs€NDi*
-
-
-,
OUlPW
HALlS
1
"CALL DATABANK
(<SY
s
MV
..<PN>);"
i
NEXT
044K1
IO1
1
47
PRESCNT
VAL'JC
OF
(YVO)
SUIIKUUTINL
I
I
"CALL
DATABANK :<SIN>RK.<PV+I
I
OUTPUT
HALlS
*
ENDS"
NE
Ill
CtIART
1
OF
1
48
5.3
Flowcharts
5.3.1
Declaration Statements
UhlPlC
ENTER
NEXT
N
h
'WANTITI'
I
IXCLAKAI
ION
SlAlLMLNlS
(17)
NE
IT
OUTPUT
Wls
8
OVlPuT
bIAltS
*
..
DECLARE
'INIIIAL
(COWNTITV
INTEGER
D€CC&R€
<NAME>MM,
INlECER
SIFICX
INlTlAl
1
COUANTITY
DIMENSION
>);
"
VALUE;.):
.<NAME>
DIM,
SINGLE
;'
1
b
CIIAKT
1
Of
2
SIMPLL
DLCI.ARATION STAll
LILNTS
(17)
,
(CONT.)
i
I
N
Q-,
NOTE
1:
<
NO.
CHAR.
>
1
NO.
OF
CHARACTFRS
IN
1HE
1EXI
COMTLNT.
<MA%.
CHAR.,
*
MAX.
NO.
Of
CHADAC1ERf
OeTAlNED
FROM
GOAL
STATEM€NT.
NOlE
?:
c
I
I
NEXT
MnWT
HALlS
*
"
DECLARE
<NAME>D"
ERROR
OUtPUl
HALIS
*
"CHARACTER
I
I<
NO
CWR
>)
lNlIlA1
(<TEXT
CONST
>I;"
OUTPUT
HAlrS
"CHARACI
E
R
(<MA%
Q(AR>I:'
NEXT
CIIART
2
01'
2
51
DECLARE NULKRIC
LIST
STATthlLNT
(IS)
CItART
1
OF
1
52
DECLARE
Qb
'4TITY
LIST
51
A
I
Ch4LNT
(20)
ERROR
NUM
a
INTEGER
YPUT
WLIS
*
;DECLARE
<NAME>
DIM
ARRAV
(<NUM>)
ISSUE
ISSUE
HALlf
*
1
--
+
WlAIN
VALUE
AND DIMENSION
USE
0
AS
FAULT
-
i
+
c
1
Vis
*
VALUE,
QK)*
DIMENSION
OUIWT
HALIS
*
..
(K1
"
K*K*l
1
I
.
WIFWT
NALISs
<
D{ K)>"
K*K*I
I
t
ISSUE
ISSUE
HALlf
*
-It-
rL
I
WrS
I:
DIKI
IS
THE NUMERICAL
OLSGNATION
OF
THE
DIMENSION.
ERROR
OUlPUl
HALIS
i:i
I
OUTPUT
HAllS
*
"),DKlARE
<N
'
"E
>
I
INTEGER
SINGLE
INITIAL
I"
DIM
bRRAV
(hUMJ
I
I[*
I
I
I
WrS
I:
DIKI
IS
THE NUMERICAL
OLSGNATION
OF
THE
DIMENSION.
ERROR
NE'XT
CHART
1
OF
1
53
DECLARE STATE
LIST
STATEMENT
OBTAIN
STAlE
OR
USE
FALSE
A!5
DEFAUlT
WTER
i
OUTPUT
HALIS
"(
C
STATE
>)
'DECLARE
<NAML>D
INTEGER
NO.
OUTPUT
WIS
*
"(CNUM
>)
BOOLEAN"
OUtPut
HALIS
NEil
t
NEXT
CHART
1
OF
1
54
THIS
PAGE
INTENTIONALLY'LEFT
BLANK,
55
ERtdETP,\CS
I!<COEBOiV\TCD
701
CO:.ICOED
AVENUE
9
CAMBRIDGE,
MASSACHUSETTS
02136
(617)
661-1840
OEUARE TEXT
LIST
STATEMENT
(24)
ENTER
OUTPUT
HAllS
'DECLARE
<NAME
>D
ARRAY"
NUM
*
INTEGER NUMBER
K=
I
I
r
I
FEICHTLXT
CONST.
USE
0
AS
DEFAULT
LE1
Tclu)*cTrexr
CONST.
>
NC(K)
NO
OF
CMARACl
-
ERS
IN
TC[K)
I1
I
CHART
1
OF
2
56
OECLARC
TEXT
LIST
STATEMENT
(24).
(CONT.)
CHART
2
OF
2
57
DECLARE
NUMERIC
TABLE STATEMENT
(19)
ENTER
I
OUlpT
HAL
IS
*
<NAME
>O
ARRAY
“
I
INTEGER
NWBER
INTEGEP NUMBER
Of
COLUMNS
ERROR
Q-
OUTPUT
HAUS
*
“(<NR>.<NC>)”
PASS
1
EXTRACTS COLUMN
NAMES
AN0
PLACES
THEM.
IN
THE
5’..UsoC
1PdlE.
PASS
2
DOES
NO1
USE THEM.
t
I
I(*
I
I
CHART
1
OF
2
58
OECLARE
NUMERIC
TABLE
STATEMENT
(19).
(CONT.)
FETCH
FUNCTION DESICNAlOR
FDlK)
1
FUNCI.
DLSIG. NO.
FETCH NUMBER PATTERN
USING
0
AS
DEFAULT.
CALL CONVERT -NUMERIC
LET
VAL [U,L
I
*
VALUE
Of
NUMBER
OR
NUMEPIC PATTERN.
ERROR
L
-
WTPW
HALIS
1
"INITIAL [cVAL
[
1
.I
I
>,-
-
-
<VAL
[
I
.NC
I
>.
<VAL(P.I)>,---*VALIZ.NC)~.
I'
<VAl[NR.l)>, CVAL(NR.NC)+I;
DECLARE <NAME>
R
ARRAY ICNR>) INlllAl
[<FDtI)>.<FO{?\>,
-
- -
--
4FDINRI
>I;
DECLARE CNAME>A ARRAY
(<NR>)
BOOLEAN INITIAL
(ON);"
NEXT
CHART
2
OF
2
59
DECLARE
QUANTITY TABLE STATEMENT
(21)
ENTER
c
ERROR
9+
INTEGER
NUMBER
OF
COLUMNS
+
ERROR
.if1
06
COLUMNS
OUTPUT
HALIS
8
"(<N
R>.
<NC>J"
~ ~
NOTE:
PASS
1
EXTRACTS COLUMN
NAMES
ANC
PLACES
THEM
IN
THE
SYMBOL
TABU.
PASS
I
DOES
NDT
USE
THEM.
I
1.
t
CHART 1
OF
2
60
DECLARE
QUANTITY
TAIILE
STATLMLNT
(21)
,
(CONT.)
~ ~
OUTPUT HAL
IS
"INITIAL (<VAL(
I
.I)
>
-
-
-
<VAL
(1,
NCI
a,
WAL
(
1.1)
%
-
-
'<VAL
(
2 ,NC
)
>.
<VAL
(NR.l)>.-
-
cVAl(NR.NCI+):
(<FD(
I
)>,<fDl?l>,--
---
fD(NR)>l:
~
DECLARf<NAME>R ARRAY (CNR>) INITIAL
1
DKLARE CNAME+A ARRAY (<NR>)
BWJLCAN
INlllAL (ON):
'
DICLARE
c
NAME
>DIM
ARRAY
~CNR>..;NW
INTEGER SINGLE INITIAL
1
C0lMlI.I
>,*DIMI
I
.?I>.-
<OIM(I,NC)>,
CDIM(?.I)>,<DIM
I?.?I>.
-
CDIMI?.NCb,
<DIM
INR,l)>,<DIM (NR.?)>;
-
-
'
<DIM
INR.NC
I>
I;*
FETCH
IUNCTICN DESIGNATOR
fD(K) FUNCT.
DESIC
NO
fETCH QUANTITY
AND
DIMENSION VALUES, USING
0
AS DEFAULT.
VAL(K,L) 'VALUE
OF
QUANT.
DIM(K.1)
*
DIMENSION
40.
OF
QUANfIlY.
4
I
L'L*l
I
I
K.K+!
Lr'
<
.
I
I
NIX1
CHART
2
Of
2
61
DECLARE STATE TABLE STATEMENT
(23)
ENTER
.1
PNEX1
SA?
E
CXJ?!UT
HAllS
*
DECLARe
<NAME
>O
f
t
INTEGER
NUMBER
CO~UMNS
OUTPUT
HALfS
a
W
<NR
>
~
CNC
>
I"'
NOTE
:
PASS
1
EXTRACTS
COLUMN
NAMES
ANC PLACES
THEM
IN
THE
SYMBOL
TABLE.
PASS
2
DOES
NOT
USE
THEM.
ERROR
t
CHART
1
OF
2
62
I
DECLARE
STAlE
TABLE
STAILULNT
(23).
(CONT.)
FCTCH
CUNLTON
DESIGNATOR
FD(k)*FUNCT.
DESIC.
NO.
NEXT
CHART
20F
2
63
DECLARE
TEXT
TAOLE STATEMENT
(25)
ENTER
c
EX1 TAnlE
*
1
~ ~~~~~
NOTE
:
PASS
I
EXTRACTS
CUUMN
NAMES
AND
FLACES
THEM
IN
TH€
SYMBOL
TABLE.
.
ERROR
I
I
K*I
I
CHART
1
OF
2
DECLARE
TEXT
TABLE
SfATtMENT
(IS).(CONT.)
d
-
-
I
fETCH FUNCTION DESIGNATOR
FD[Kl
*
FUNCTION DtSlG.
NO.
I
&
CONS
A
-
1
1
-
L
VAL
(K.ll*
NCIK.11~NUMBEU
OF
CHARACTERS
IN
T.C.
<TEXT CONSTANT>
.
I
<INTCCtR
NO.>
LET
NC
1
MAXIMUM
OF
All NC
[W.ll
OUTPUT
WAlIS
1
‘CHARACTER INCI INITIAL
<VAL
[I
.I’
.<VAL1
I.?]>.
--
-
---
-VALIl.NCl>,
<VAL
I?
,<
-
-
-
-
-
-
--
------
CVALI
2.NC
I>,
e
VAL
INR.I;>.
-
-
-
-
-
-
-
--
-
-CVALINR.NC)>):
IXClARE<NAPME>R ARRAV
ICNRY
INITIAL
DECLARC <NAME>A APRAV (<NR>)
BOOLEAN INiTlAL
Iotil;”
l<fD11)>.<f012)>,
-
--
------<CDlNR)+I;
NfXl
65
CtIAKl
?OF
2
THIS
PAGE INTENTIONALLY'
LEFT
BLANK.
66
INTFR~~~ETRICS.lNCORPORATED
701
GCNCORD-AVENUE
CAMPRIDGE.
MASSACHUSETTS
021
138
(61
7)
661
-18
5.3.2
PROCEDURAL
STATEMENTS
PROCEDURAL STATEMENT PREFIX
-
STEP
NUMBER
PREFIX
(73).
TIME
PREFIX
(W),
AND
VERIFY PREFIX
(83)
OUTPUT
HALlS
*
"FLAG
*
0
;
00
WHILE
FLAG
1
0:
CALL
DATAI)ANI( (CFD>.
CPN>);
If
NUMBER
CpN>
>
'eTIM>*CAX>
THEN FLAG
*
I
;
END;"
-
'INC
KOS
-
DEPENDENT INCREMENT
Of
TIME.
CllhRT
1
OF
6
68
PROCEDURAL
STATEMENT
PREFIX
(CONT.)
€VAL,_
IN1
-
NAME
Go
10
VERIFY
(CHART
4)
CAlL PELFORM
L*
I
UMITFORM
1.0
b
7
t
OUTPUT
wuis
0
"K*I;*
1
"Ksl:
IF
~ACl>THEN"
NEXT
CHAR1
2
OF
6
69
c
C
D.%TA
>
5
<ULNAME
>)
THEN
"
I
OUTPUT HALIS
*
OUTPUT
HALlS
*
OUTPUT
MAUS
*
"IF
K*CKMAX>
THEN
DO;
"
+
NEXT
NOTE
1
:
AN
"END: STATEMENT MUST
BE
INCWOED AT
THE
EM,
OF
THE
W
lH€
COMPLETE TRANSLATION
OF
TME
GOAL
STATEMENT.
CHART
3
OF
6
70
PROCEDURAL
STATCMENT
PREFIX
(CONT.)
VERIFY
PREflX
(83)
VERIFY
1
CALL CALL
LIMITFORM
PELF3RM
1.1
1.0
1
*
1
CALL
TV*l
I
V
CONVERT-TIME
TV.0
a
+
I
CONVERT-TIME
I
:;
I
"START-TIME
*
RUN-VIM€; FLAG
00;
W
WILE
FLAG
SO:
COND
*
FALSE
;
FLAG
=
;
:
END;"
IF
RUNTIME
-
START-TIME
><TlM>THEN
DO;
OUTPUT
HAL6
'W
FOR
U*I
TOCKMAX?;"
"&ALL OATABANU(<AFD(KI>,C PN>);"
"IF<TN>AI(
THEN
CALL DATABANK (<IN>
RE.
<PN>I;"
f
CHART
4
OF
6
71
PROCEDURAL
STATEMENT
PREFIX (CONT.)
VERIFY PREFIX
183).
(CONT.)
ULT
0
I
2
3
1
OUTPUT
HAlIS
1
"IF
CUlACT
>THEN"
"IF
<UlACT(K)
>TH€N"
"
I<RNAME>)THEN"
I
"If
<RACT>
]HEN
IF
NOT
I<EXDATA>
'
2
A
I"lf
NOT
[<EXDATA>CRF>
I
CR)>CRNAME>)
THEN"
"IF
RACT
(I:
I
>
THEN
IF
NOT
EXDATA
>c
RF
>
C
RUM€
(Ul>
)
THEN"
OUTPUT HAllS
*
"IFNOT(<DATA>2 <LLNAME>
<tF>
<DATA>
5
<ULNAME>)THEN"
c
6
-
I
OUTPUT HAL
IS
1
"EXIT;
CHART
5
OF
6
OUTPUT
HAllS
8
"I(10;
.
END;"
72
PROCEDURAL STATEMENT PREFIX (CONCLUDED)
VERIFY PREFIX
(83),
(CONCLUDED)
FlAG
a
I;
END;
ELSE
REPEAT;
ERROR
NEXT
CHART
6
OF
6
73
ISSUE,
SEND,
OR
APPLY
ANALOG
STATEMENT
(40,
2)
-
ENTER
c
NEXT
CALL
€VAL
-
ED
CHART
1
OF
2
CAU
€VAL-ED
74
T
OUTPUT
HAl13'
O
"CALL DATABANK (<AFD(KJ>,CPN>):"
1
"lF<TN>Ag THEN
_I-
CALL
DATABANK lCTN>Rg ,<PN>),'
i
NOTE:
WE
RECEIVING EXTERNAL
DESIGNATOR
IS
EVALUATED
OUTPUT HALIS
a
THE
SENDING
OUTPUT
HAL/S
8
"END,"
"00
fOR Krl
TO
<KMAX,t"
ELEMENTS.
1
ISSUE.
SEND.
OR
APPLY
ANALOG
STATCLILNI
(40,
Z),(CONT.)
1
4
7
FETCH
StNDlNC
ELEM€NT
1
NEXT
CIIART
2
OF
2
75
SET
DISCRETE
SlhlthlLNT
(701
I
fa0
I
.)
N
OUTPUT
natss
OUTPUT
HAllS
"STATE
<PN,
g
"STATE
'
ON
I
OFF;"
I
A
I
NEXT
NOTE
:
MULTIPLE
SENDER
TEST
RECEIVER
FXlERNAL
DESIGNATOR
ARE
DONE
FIRST.
'
AND
EVALWAIION
OF
.
ERROR
OUIPUT HALlS
1
"END,"
KT
DISCRETE
STATLULNT
(70).
(CONT.)
I
INTERNAL'
+
CALL
-
€VAL
-
INT-
..\ME
JHAX
C
KMAX
>
CHART
2
Of
3
77
SET
DISCRETL
STATCLIENT
(70)
.
(CONT.)
I
R
1
"CALL DATABANK
(<AfDlKI>.
<PN>);'
'IF
<IN>
AK TMN CALL DATLLBAIYK
(<IN>
RK
,<PN>);-
[<AFD
[
K)>.
<PN>);
'IF<ACT>
THEN
IF
<TN>Ay
:HEN CALL
OATABANK (<TN> RK.<PN>);"
'IF
aCT
(J]>
THEN
CALL OATABANK
kAFD(K)>.tPN>)
j
K
*
K
*I.
EN@."
A
0
CHART
I
I
NE
Xl
THIS
PAGE
INTENTIONALLY-LEFT
BLANK.
79
ERMETRlCS
INCOfiPORATED
701
CONCORD
AVENUE
CAMBRIDGE,
IviASSACHUSEll'S
92138
(617)
661-1840
RECORD
DATA STATLMLNl(61)
NOT€:
RECEWEU
ELEMENT
EVALUATED
BEFOUL
SEWING ElEMENlS.
FLTCA
SENWNG
CHART
1
OF 2
80
RECORD DATA
STATEMENT
(61)
JCONT.)
P
"IF<ACT>THEN
IF
<TN>At
TWEtI
CALL DATABANK I<TN>% .<PN>J
:
"IF~TlJ,~
THEN
CAli
DATABANK
(AFDlL)>.<PN>)
:"
-
'IF
tTN>
At
THEN
IF
<MT[
I)>
THEN
CALL
DATABANK
(<lN>Rl
.<PZ:>);"
WWI
Huts
*
'END:'
QIART
2
OF
2
9
AVERAGE
STATEMENT
(4)
EVIL
-
ED
SAVE
As'
0
CHART
1
OF
2
82
AVERAGE
STATEMENT
(4),
(CONT.)
1'
OUTPUT
HA1
IS
*
"CALL
DATASANK
[QN>
Rc.<PN,I;"
t
OUTPUT
wts
'
"AV SAV
NO.<PN>;
END;
COATAB
*
AV/CNUM*
;
EM);'
WPUl
HALIS
a
"PNDz"
0
NEXT
?
OUTPUT HALIS
8
"CALL
DATABANK
lWFD(KP,<PW]:
1
MART
2
OF
2
83
KEA0
I'IIOCCIWRAL
STATLULNT
(GO)
EVAl
INTNAME
R
.<f>
NE'XI
CHAR7
t
OF
1
84
THIS
PAGE INTENTIONALLY-
LEFT
BLANK.
85
REQUEST
KCYUOAKD
STATLhlLNT
(a)
R
a<T>
REC
=
<
3MA>
RACI
1
<ACT>
RECOIM
*<DIM>
OUTPUT
HALIS*
"00
TOR
I:
I
Q
.ERROR
I
CD
*
FUNCTION
DESIC.
I
NUMBER
I
I-
REQUEST
KEYBOARD
STATEMENT
(GG)
,
(CONT.)
OUlPl'T HAL15
a
"CONTROL *<INPUT>:
CALL DATABANK
(CFD
>
.<PN>
I
;*
P
NAMl
<TVPE>
0
NUMERIC
w
R
OUTPUT
HALlSI
01
I
OUTPUT
HALfS
"CREClK)>
*
NUMBER<pN>
."
1
"lF<RACT>
THEN
00;"
2
("lF<ZACllJl>THEN
DO:"
I
I
'END:"
f
'IC
*
k
1
;
END;
FNOI
"
'END:"
OUTPUT
HAllS
'
c
NbXt
CIIART
2
OF
2
87
"UCLAY"
PROCCDUKAL
31
A1
LMI.NT (26)
CNTER
*
r
OUTPUT
HALIS
"WAIT
TIM
I*
I
NIX:'
CHART
1
OF
2
88
"DCLAY" I'ROCEDUKAL
SI
AlChlENl
(2G)
,
(CONT.)
-
1
0
"CALL DAlAB4NU [<AFD(Kl>.<PN>):*'
I
"IF
<TN>AK THEN CALL DATABANK [<TN>RK.<PN>;"
ULT
0
I
2
"IF NOT [<€XDATA>
<Rf>
<RNAME>) THEN"
"IF<RACT>
THENIF
NOT
[<EXDATi>.<RF..
<RNAMEIKI>)
THtN"
"IF
<RACT(K)>
THEN
IF
NOT
(<€XDATA>. <RF>.
CRNAME IK)
>
1
THEN"
OUTPUT HALIS
I
"IF
<ULACT> THEN"
"IF
<ULACT[K]> IHEN'
A
111
OUTPUT HALIS
*
I
1
I
"IF
<TLACT> THEN"
"IF
<LLACf(Kl> THEN"
LLL_T__I
WTPUT YALlS
s
I
"EXIlt
I
END
I
"
"KSOi
I
OUTPUT HAL/S*
'IF
K
t<UMA+.>
THEN
FLAG~I.ELSE
U
REPEAT;
END;
CHART
2
OF
2
89
"GO
TO
PROCEDURAL STATEMENT
(34)
c
-
OUTPUI HALIS
"IF
RPTACT
THEN
00;
LOC'CSN>;
CALL
FLUSH
;
EN0
i
A
-
11
r-$
<SN>;
ROR
NEXT
CdART
1
OF'1
90
THIS
PAGE
INTEHTIONALLY~
BLIWK.
91
TERX:ETXCS
IFICORPOR4TED
701
CONCORD
AVENUE
CAMURlCGE.
MASSCHUSETTS
02139
(6:7)
661-1040
I
CHARTlOF2
92
Q
QURf2OF2
93
CHART
1
OF
1
94
INCREMENT
REPEAT
NESTING
MPTH
ACTIVATE REPEAT
GROUP
SAVE
OLD REPEAT SVAlEMEMt NWPR
ESTABLISH NEW REPEAT STAlEMCh(1
NUMBER
ESTABLISH
NUMBER
OF
IlERAllONS
TRANSFER
CONTROL
TO
REPEAT
GROUP
REIURN
TO
THIS
lAn3EL
RESTORE
QD
REPEAT STAWMENI
MJM6fR
MCRLHENl REPEAT
YESTING
DEPTH
I
*AS
DETERMlNtO
IN
THE
REPEAT ARRAY
OF
PASS
1
NEXT
CHART
I
OF
1
95
ASSW
STATCULM
(3)
1
L
NEXT
CHART
1
OF
I
96
LE1
EQUAL
STATLMNT
(42)
EWER
NEXT
CAU
€VAl,INT,NAME
I
0
I
I
.-If
<ACT>
THEN'
I
WTpm
Wf*
"
ENDiEND;
"
I
I
NEXT
II
\liI
I
01
I
nc)
CONCUHKCNT
STATEMENT
(is)
CREATE
THE
FOLLOWNG
TASK
TO
BE
INCORPOfcATEO
INTO
WE
GOAL
-
MASTER
-
PROGRAM
:
OutPuT
WlS*
'TASK
C
NUM
>
:
TASK
:
RESET TERM
-
SYST<NUM>;
BAO:
:
10~0
s
RUNTIME
:
IF
TERM
-
SVST
~NUM>
THE
005
RESET TERM,
SYST,NUM>
RETURN
2
END;
CALL
G<PROCN>:"
d
1v*
I
FETCH
TIME
VALUE.
CALL
CONVERl
,TIME
I
-
OUTPUT
HAL
IS
t
"WAIT
UNTIL
*<TIM>);
GO
TO
BACK
i
CLOSE
;
"
0ut_puTHA~
;a
CLOSEi
.
!
1,
CONCURRENT STATCMCNT
(IS)
,
(CONT.)
FT-l
ENTER ICONCURRENTLY
CHART
I
DISPLAY
1
NUM
*NUMBER
ASSOC
WITH
TASK
TO
BE
GENERAT ED.
+
OUTPUT
HALIS.
"XHEOULE
TASK CNUM>
,"
-
1
CREATE
THE
FOLLOWING TASK
TO
BE
INCORPORATEO
INTO
THE
COAL
-
MASTEL
PROGRAM:
OUTPUT
HALIS*
'TASK <NUM>
:
TASK;
BACK:
10~0
1
RUNTIME
:"
RESET
TERM-
SYST<NUM>
c
ri:r1
CONCURRENT STATEILNT
(1s)
,
(COrUT.)
0
"CALL
DATABANK
I<AFD(K)>,<PN>)g"
1
"IF
<TN>AK THEN CALL DATABANK (CTN>RK.CPN+;"
-
NUM
NuMaEe
ASSOCIATED WITH 1ASK
TO
BE
GENERATED.
.
4
4
OUTPUT HACIS
*
"SCHEDULE
TASK
CNUM>
;"
CREATE
THE
FOLLOWING
TASK
TO
8E
INCOPPORATEO
INTO
THE
GOAL,
MASTER, PROGRAM:
OUTPUT
HALIS*
"TASK
<NUM>:
TASK:
RESET
TERM,
SVST<NUM>;
BACK:
TOLO
RUNTIME
;
"
1
OUTPUT HALIS*
100
CONCUKKENT STATEMENT
(15)
,
(CONT.)
OUTPUT HALIS.
"IF
NOT
(<EXDATA>
>,
<LLAME>,
<
1
F
>,<
EXDATA
>&
<ULNAME>;
T*i;N"
-
RT
0
I
-
-
"If
CRACT, THEN
IF
NO? (<EXDATA>.CRf
>..
CRNAMEIKI>J
THEN"
I
"IF
CRACT(K)> THEN
IF
NOT (CEXDAl.&>,<RF>,
CRNAME
IKI>)
THEN"
EXIT
8
ENDI"
CHART
4
OF
5
101
CONCURRCNT STATEMENT
(15).
(CONT.)
"IF
1:
NOT:
OUTPUT
HALIS*
c
P
O~PUT,HAllS
'
OUTPUT
HAllS
a
CLOSE
I"
"WAIT
UNTIL
[Toto
*<TIM>):
GO
TO
BACK,
CLOSE:"
-
1
ERROR
102
l-----l
I
1r
.i
-
FETCH STEP NO. FROM
RELEASE STATEMENT
LET PROGN PROCESS
NUMBER
OF
TASK
AS~OCIATED WITH
STEPNO. THIS
IS
MIERMINED fROM THE
PROCES' ARRAY CREATED
IN
PASS
I.
i
FROM PROCESS ARRAY
GENERATE
AN
ARRAY
r--
OF
CONCURRENT
STATEMENT PROCESS
NUMBERS ASSOCIATE0
WITH
THE PRESENT
PN.
CALL
THIS
ARRAY *ANUM
LET
IT'S
LENGTH BE
1
-
NEXT
4
CHART
1
OF
1
10
3
PERFORM
PROGRAM
STATEMEN?
(55)
1
WRf
1
W
I
105
WEN
HUiCREUPT
STAl
-..ICNT
(84)
I
I
e
NEXT
DE
SIGN41OP
NOTE
I:
NOTE
2:
PASS
I
DECLARES
ENVIRON
I
:.<N>I
OUTPW
HAUS
A
US1
IS
AVAILABLE
IN
PASS
1
WlCH
RELATES
(3,<IN>l*
CCN>;
EN&-
NUMBERS
TO
INTERRUPT
NUM8ER
Of
NUMBf
RS
.
tNTERRUPTS.
FUNCIION DESIGNATOR
WHERE
N
IS
tne
"ENVIRON
ERROR
o-.-.
NEXT
OW
INTERRUPT STATEMEM
(2s)
ENVIRONMENl*;
UU
MTA8ANK
(I
,<PN+
)I*
107
ACllVATE
TABLE
STATEM€ENT
(11
AC
TIVAT€
ALL
ROWS
I
CHART
1
OF
1
108
INHIBIT
TABLE
STATEMENT
(37)
C-.
UTIVATE
AU
ROWS
CHART
1
OF
1
109
THIS
PAGE
INTENTIONALLY'
LEFT
BLArUR.
110
'
5*1fCri'
'7TG:F.C
IGCO9POl7ATED
701
CONCORO
AVENUE
CAMBRIDGE,
MASSACHUSETTS
02t38
(617)
681-1C
STORE
NAME
AS
<TEMP
NAME+
SYSlEM
STATEMENTS
CROUP
tNtEI
1
STORE
WE
AND
REvISIau
lABE1
As
CTOMP
NAME>
I
A
i
1,1
I
SYSTEM
STATEMENTS
GROUP,
(CCsJT.)
OUTPUT
HALIS
“ClOSEI”
COMMENT
AND
STORE
AS:CMNT
i
OUTPUT
HALIS
8
“/*<CMNT
>.I”
I
NEXT
CHART20F2
113
5.4
Output
Processor
Translator.
It
performs
its
role
last
in
the
translation
sequence. This
role
shall
consist
of
two
parts.
First,
it
assembles
the
GOAL
MASTER
PROGRAM
according
to
the
format
specified in Section
3.1
and
3.2
and depicted in Figures
3-2
and
3-3.
Secondly,
it
generates an output file
of
HAL/S
source
whose format
is
compatible
with
the
machine upon which
HAL/S
compilation
is
to
take
place.
It
also
shall generate support-
ing outputs consisting
of
error
messages, block
summaries,
program layouts,
etc.
The
output processor shall be an integral part of the
114
J'lTrn'~FTRIC'S
INCORPORATED
701
CONCORD AVFNUE CAMBRIDGE, MASSACHUSETTS
02138
(617)
661
-184
6.0
EXECUTIVE:
SIjPPORT
STRUCTURE
6.1
Introduction
Executive Support Structure
is
defined
as
the
software
support system required
in
the
mboard
Shuttle computers in
order
to
permit
the
full potential
of
GOAL-in-HAL
to
be
realized.
6.2
Recommended Approach
GOAL
MASTER
-
PROGRAM
contains all
software
and
data
required
to
execute.
The
only external software required
will
be
the
FCOS.
By
design,
the
output of
the
translator
is
an
assembly
of
HAL/S
code
which
contains not only translations
of
each
of
the
individual
GOAL
programs including
all
relevant
data-
bank information, but
also
the
procedure
DATABANK
used
for
interpreting function designator
information
in
the
Flight
Computer Operating System
(FCOS)
environment.
The
output
of
the translator
is
submitted
to
the
HAL/S
compiler
like
any
other
HAL/S
applicatiofis
program.
The
result
is
object
code
for
the
flight
computer.
The
GOAL
Master
Program
is
self-suffi-
cient
and,
by
design, requires no
-
executive support structure
other
than
the
FCOS.
As
set
forth in
Section
3.0
of
the
Specification,
the
THIS
PAGE
INTENTIONALLY’LEFT
BLANK.
156
UJTFR!,ETRICS
INCORF’OnATED
701
CONCORD
AVENUE
CAfJL3RIDGE.
MASSACHUSETTS
02133
(617)
G51-II
7.0 IMPLEMENTATION, VERTFICATION,
AND
DOCUMENTATIOK REQU~AXEMENTS
This section provides a plan and
a
recommended sequ- dnce
01
steps by which the GOAL-to-PAL Translator can be implemented,
documented, verified, maintained, and placed into operational
use. This is accomplished by presenting the topic in three
seG,.tential groupings. These groupings are implementation,
verification, and operation. In each grouping. the pertinent
documents are identified, and then they are set forth again
in Section 7.4. Section
7.5
is a suggested schedule for
the Translator.
7.1 Implementation
Two
key decisions have to
be
part of the implementation
phase of the GOAL-to-HAL Trmslator. The first of these is
the choice
@F
the host machine upon which the Translator is
to be operated. Technical considerations involved in this
choice include the host machine for the
KSC
GOAL compiler,
the destination
of
the HAL/S source output, and the requirements
for utility software, peripherals, operating modes, and output
writer capability.
The second key decision involves the language in which
the Transl-cor
is
to be written. This decision could affect
the host machine decision. Eor example, Fortran
4
will .:un
on almost any system, but XPL (which is a qood media
fcz
writing
translators) is only supported on the
IBM-360
and Univac 1108.
To the present document, the Translator Specification,
must be added a
Host
Machine and Languagz Addendum which will
specify the interface between the Translator, its language,
and the host machine. This document can be brief, but
it
should deal with the interface questions, and the desired
inputs as well as PASS 1 and
PASS
2
outputs.
The implementation would
now
proceed to the coding phase
in the language for the chosen machine. The rssult
of
this
effort would be the Translator Code.
Concurrently, with the actual coding of the Translator,
two subsidiary but important effcrts should be going
on.
The
first
of
these is to produce
a
Translator User's
Manual
which
117
NTERMETRICS
INCORPORATED
701
CONCORD
AVENUE
CAMBRIDGE,
MASSACHUSETTS
02
138
(61
7)
661-1340
would tell the user how to set up
and
run
the
Translator,
how
to prepare the input,
and
what the supporting
and
final
outputs consist
of.
The seconi document is the Translator Test Plan. This
must deal with two levels. First the Test Plan must provide
proof
se=onaly, it must
show
that the logical transformations
performed are valid.
hat the Translator is generating valid
ML/S
and,
7.2
Verification
The two-level Test Plan is now brought into operation.
Translator output in
the
form
of
a
GOAL
-
The
€iAL/S
compiler
can
effectively deal with the first level
of
verificatioc.
valid
HAL/S
code.
MASTER
PROGRAM
is,
by
design, supposed to meet completely
the necessary characteristics
of
a
program, and can therefore
be
submitted
as
an
input to
thu
compiler.
That is, whether the Translator has produced
applications sof Ware
The Test
Plan
will have
to
provide
for
successive levels
of
complexity in the
GOAL
source inpJts.
levels
are
suggested in Table 7-1. These successive
The
HAL/S
Compiler will provide completely adequate
diagnosis
of
the
HALIS
source.
items in Table
7-2.
This, then, is the fundamental approach
to
syntactical verification via the use of the
BAL/S
compiler.
This
diagnosis includes the
The
second verification level ir?-Jolves making
a
valid
functional check of the resulting
W/S.
the project in
the
very
fundamental question of Shuttle
software
verification. It is expected
that
the
HAL/S-360
Compiler
will
have,
in addition to
the
HAL/S
compiler function,
some
form
of
HAL
Statemenc Simulator
(HSS)
which will simulate
execution
of
HAL/S
programs on
a
flight computer.
If
this
simulator is provided with virtual function designator data
which interacts with
the
HAL/S
DATABANK procedure, then a
degzGe of functional verification can be accomplished.
A
dii'terent functional
v,
-fication
at
this level
can
and
should
be accomplished
by
running GOAL-in-HAL on the
AP-101
target
machine which is scheduled tc
b?
.ntr31
element
in
the
Shuttle
Avionic& Integr
-tior,
-.
P
r;
(SAIL)
.
This level involves
0)
Single
GOAL
Statements (Visual Verification
against SpeciLication)
1)
Sing&
GOAL
Program,
No
Stops,
No
Repeats,
No
Interrupts,
No
Tables
2)
Single
GOAL
Program,
Add
Stops,. Repeats,
Interrupts,
and
Tables
3)
Multiple
GOAL
Programs
4)
Multiple
GOAL
Programs
with
sets
of
CONCURRENTLY
Perform,
Verify
and
Record
Statements
Tabie
7-1.
Successive Levels
of
GOAL
Source
Complexity
for
Translator
Verification
119
.ITERMETRICS
INCORPORATED
701
CONCORD AVENUE
CA'IBRIDGE,
MASSACHUSETTS
02138
(617)
8c1-1840
Block
Summary
Program
Layout
Symbol
Table
Listing
Cross
Reference Listing
Macro
Text
Listing
Etc
.
Outer
Variables
Outer Replaces
Programs
8
Functions
and Procedures
Name8
Type,
Class,
Length, Precision
,
Nesting
,
etc.
Flags
&
Statement
No.
Table
5-2.
HAL/S
Compiler
Diagnosis
of
Source
120
I
INTFRMFTRICS
INCORPORATED
701
CONCORD AVENUE CAMBRIDGE. MASSACHUSETTS
02138 (617)
66l-l84\
A
third
test
of
the
overall
GOAL
system, which includes
the
GOAL
compiler, Translator, and
HAL/S
compiler,
will
be
in
the execution
of
a
translated
GOAL
program in the
SDL
using
simulated equipment and environment.
The results
of
these
two
levels
of
verification testing
carried
out in accordance with
the
Translator
Test
Plan
are
documented in
the
Translator
Test
Results document. This
will
only
be
issued
in
final
form
when
all
aspects
of
the
Specification have been verified. Preliminary versions would
include
the
results of the
two
levels
of
testing previously
described.
7.3
Operations, Maintenance and Update
It
is
important
to
recognize that
the
Transla-or
acts
as
a
bridge between
two
languages
each
of
whom
will
be
subject
to
change. Accordingly,
it
is
necessary
to
have
a
Translator
Maintenance and Update Procedure.
Under such
a
plan, the Translator would
be
under the
aegis
of
a
Change Control
Board
(CCB)
at
KSC.
Computer
Program
Change Rzquests
(CPCR's)
would
be
brought
to
this
CCB
in
response
to
three
categories
of
events:
A
GOAL
Change
or
CPCR
a)
b)
A
HAL/S
Change approved by
the
Software
Control
Board
(SCB)
at
JSC
using
a
Languagc
Change
Request
(LCR)
as
the
vehicle.
c)
A
Translator Discrepancy Report
(DR).
The
Translator
CCB
would
act
on
the
CPCR.
a
Translator change,
it
would
also
specify the
tests
to
be
run and
test
reports
to
be
written.
If
it
approved
7.4
Docmentation
is
given
below:
A
list
of
proposed
GOAL-to-HAL
Translator
documentation
121
<\ITERMETRICS
INCORPORATED 701 CONCORD AVENUE CAMBRIDGE.
MASSACHUSETTS
02138.
(617)
661-1840
7.4.1 Specifications
7.4.1.1 Translator Specificat.ion
(Per
NAS
10-8385)
7
.
4.1
.
2
Host Machirrt:
and
Language Addendum
7.4.2
Translator
Code
Documentation
Listinq
7.4.3 Translator User's Manual
7.4.3.1
How
to
Run
the
Translator
Basic Procedures
Run-Time Options
7.4.3.2
Preparing
GOAL
Source Input
7.4.3.3 Supporting Output
Optional Primary
GOAL
Source Listing
GMP
Structure Outlines
Translated
GOAL
Program Structure
Function Designator Utilization List
7.4.3.4 Final
IEBL/S
Source
Output
7.4.4 Translator Test
Plan
7.4.4.1 Valid
HALJS
Check
by
Compilation
7.4.4.2
Valid Functional
Check
by:
HAL
Statement.
Simulator
SAIL
Test
SDL Simulation
7.4.5 Translator
Test
Results
7.4.5.1
Compilation Results
7.4.5.2
Functional
Results
122
'r'TEnr"~TRtCS
tNCORPORATE0
f01
CONCORD
AVENUE
CAMBRIDGE,
MASSACHUSETTS
02138
(617)
661-18L
..-_
-
~
.
7.4.6
Translator
Maintenance Manual and Update Procedure
7.4.6.1
CCB
Procedure
7.4.6.2
GOAL
Changes
7.4.6.3
HAL/S
Changes
7.4.6.4
7.4.6.5 Change
Validation
7.4.6.6
How
to
Debug the Translator
Translator
DR's
and
Host
Machine Changes
7.5 Translator Schedule
See
Figure
7-1.
12
3
JTERMETRICS INCORPORATED
701
CONCORD
AVENUE
CAMBRIDGE,
MASSACHUSETTS
02138
(611)
661-1640
THIS
PAGE
INTENTIOMALLY-
LEFT
BLANK,
124
INTERhtETRlCS
INCORPORATED
701
CONCORD
AVENUE
CAMBRIDGE,
MASSACt(USETTS
02138
(617)
661
-1t
I
*
Fr
Fr
I
I
!
I
I
n
i
..
tc
--
I
I
I
;
f
I
i
I
!
f
!
;i
t
1
!
:
iq:
!
I
t
!
rn'
.r
a
!
!
I
ua
i
s3
Bal
m.
n
-44
SBNO&S3'II#
S/WH
THIS
PAGE
INTENTIONALLY*
LEFT
PLANK.
126
IFtTFnflFTRICS
INCORPORATED
701
CONCORD
AVENUE
CAMBRIDGE.
MASSACHUSETTS
02138
(617)
631
-1:
8
0
RX:OMI!ENDATIONS
8.1 Choice
of
Host Machine
The GOAL-to-HAL Translator should
be
implemented on the
IBM 360 or equivalent. This is because the HAL/S ianguage,
as defined in the
HAL/S
Language Specification, is going to
be implemented on
a
HAL/S-360 compiler system resident on
a
IBM 360.
will be compatible with the IBM 370 computer series.
The same compiler system, with minor modifications,
By choosing the
IBM
360 as the host machine, the transla-
tion and the compilation can be run end-to-end with immediate
syntactical verification of the overall results. Furthermore,
a
HAL
Statement Simulator
(HSS)
will be resident on the machine
and it will provide a flight computer functional simulation
for functional checking.
8.2
Choice
of
Translator Language
Translator Writing System
(TWS)
as the primary tool.
TWS
is
a
tool which
is
intended to assist in the writing
of
translator-
compilers, interpreters, assemblers, etc. Its usefulness lies
in its ability to supply uniform functional modules for standard
functions such as text scanning and to automate the production
of language-dependent portions of
the
Translator. This special-
ized language is very close to machine language form, although
it has the convenient block-structure
of
PL/1
or
HAL.
It is
an
easy language to use for strings, indexing, etc. since
it doesn't have the bulk
of
assembly language nor does it have
The Translator should
be
implemented using the
XPL
'
Fortran's inappropriate mathematical orientation.
The
HAL
compiler
was
written in
XPL
and it was found
to be an efficient and powerful tool.
127
4TERNIETRICS
INCORPORATED
9
701
CONCORD
AVENUE
CAMBRIDGE, MASSACHUSETTS
02138
(617)
661
-1840
THIS
PAGE
It?TENTIONAI;LY*
LEFT
BLAHK.
128
INTBRk!ETRlCS
lNCOi3POHATEO
701
CONCORD
AVENUE
CAMI3RIDGE.
MASSACHUSETTS
02138
(617)
661
-1L
APPENDIX
A.
GOAL-TO-HAL
MAPPING
NTERMETRICS INCORPORATED
701
CONCORD AVENUE
9
CAMBRIDGE, MASSACHUSETTS
02138
(61
7)
661
-1840
APPENDIX
A.
GOAL-TO-sAL
MAPPING
In
this
section, the proposed relationships between
the
GOAL
and
HAL
statements
are
described
in
some
detail.
This description
has
been designated "mapping" in
order
to
distinguish
it
from
the Translntm Specification. Mapping
will
give
an
explanation
or
example
of
each
complete
GOAL
statement.
The
Specification
rigorously defines
all
variations,
permutations, and combinations
of
each
GOAL
statement.
A.l
Declaration Statements
~.l.l
Single
Data
GOAL
Statement:
DECLARE
NUMBER(RESULTS)
;
Purpose
:
This statement
declares
a
numeric
data
item
with
the symbolic
name
(RESULTS)
for
purposes
of
general computa-
tion
within the
GOAL
program.
Equivalent
HAL/S
foim:
DECLARE
RESULTS:
This statement
will
declare
an
unarrayed single precision
scalar
variable
which can
be
used
in
the
same context
as
the corresponding
GOAL
form.
GOAL
Statement:
DECLARE
QUANTIm
(OFFSET)
=
,5
PSI
,
(PUMP
PRESS)
;
Purpose:
This
statement declares
a
GOAL
"quantity"
(a
real
number
and
an
associated dimension)
as
a
variable
for
use
A-1
NTERMETRICS
INCORPORATED
701
CONCORD AVENUE CAMBRIDGE,
MASSACHUSETTS
0212'
*
!.
il7)
661
-1840
in
a
program.
exist
for annotation purposes only, the equivalent
HAL/S
declarations include
a
scalar
declaration and
a
character
string dimension.
Since the
units
associated with these
entities
HAL/S Equivalent Form:
DECLNiE OFFSET3 INITIAL(O.5);
DECLARE
OFFSETXM
INTEGER
SINGLE INITIAL(3); DECLARE
PUYP
-
PRESSD;
DECLARE
PUMF
-
PRESSDIM
INTEGER
SINGLE:
Note
that
the
initialization
value
of
0.5
was
provided
in
the
GOAL
form
as
a
compile
time
assignment (the equal-sian)
which
becomes
the
initial
value
0.5
in
the
HAL/S
form.
The
OFFSETDIX
value
oL
three (3)
is
presumed
to
correspond
to
the
PSI label.
GOAL
Statement:
DECLARE
STATE (FLAG
A)
=
ON,
(FLkr
B)
;
Purpose
:
This
statement
is
used
in
the
context
of
a
GOAL
program
to
declare the
existence
of
the
single
bit booleans
FLAG
A
and
FLAG
B.
The
initial
tralue
of
the
variable
FLAG
A
is
set
to
be
ON.
FLAG
B
is
not
initialized.
'
Equivalent
HAL/S
Form:
GOAL
Statement:
DECLARE TEXT(ERR0R
MESSAGE)
=
(6D10
BATTERY
VOLTAGE
LOW)
;
A-2
INTFRMFTRICS
INCORPORATED
701
CONCORD
AVENUE
CAMBRIDGE,
MASSACHUSEnS
02138
(617)
661-1&1
Purpose
:
This statement
is
used in
a
GOAL.program
to
declare
a
fixed
character
message
which
will
be
used
in
some
14'0
operation.
ment in
GOAL,
this
message
must
always
be
either
fix&
or
defined in
some
input operatior..
Since
there
is
no
character
manipulation
or
assign-
Equivalent
HAL/S
Statement:
DECLARE
ERROR
-
MESSAGED
CHARACrER(24)
INITIAL
(
'6D10
BATTERY
VOLTAGE
UIW'
;
A.1.2
List
Type
GAL
Statement:
DECLARE
NUMERIC
LIST(L1ST
NUM)
WITH
4
ENTRIES;
Purpose
:
This
statement
declares
to
the
GOAL
compiler
that
the
programer
wishes
to
create
a
linear array
of
4
numeric
elements without
any
initialization.
Equivalent
HAL/S
Fom:
DECLARE
LIST
NUHD
ARRAY
(4)
t
-
GOAL
Statemnt:
DECLARE
NUMERIC
LIST
(m
3)
WITH
10
ENTRIES
1.000,
1.260,
1.442,
1.587,
1,710,
1.8=7,
1,903,
2.000,
2.080,
2.154;
A-3
-dTERMETRICS INCORPORATED
701
CONCORD AVENUE CAMBdlDGE. MASSACHUSETTS
02138
(817)
661-1840
Purpose:
This
statement
declares
to
the
GOAX,
conyiler
that
the
programer
wishes
to
create
a
linear array
of
10
numeric
eleinents
with
the
indicated initialization.
Equivalent
HAL/S
Form:
DECLARE
ROOT
30
ARRAY(10)
INITIAL(l.00,1.260,1.442,
1.587,1.710,~.817,1.903,2.000,2.080,2.154);
.
GOAL
Statement:
DECLARE
QUANTITY
LIST (LIST
A)
WITH
3
ENTRIES;
Purpose
:
This
statement
creates
a
list
of
3
GOAL
quantities
Each
quantity
has
a
scalar
value in
a
linear array
form.
and
a
physical units dimension.
HAL/S
Equivalent
Form:
DECLARE
LIST
-
AD
ARRPY
(3)
;
DECLARE
LIST
ADIM
ARRAY
(3)
INTEGER
SINGLE;
G9AL
Statement:
DECLARE
QUANTITY
LIST(VOLTAGE LIST)
WITH
6
ENTRIES
28V,+0.5V,-0.5V,0V,50Vf10
SECS;
Purpose
:
with
initialization to
the
values indicated.
This
statement
sets
up
a
list
of
6
GOAL
quantities,
A-4
HAL/S
Equivalent
Form:
DECLARE
VOLTAGE LISTDIM ARRAY(6) INTECER SINGLE
INITIAL
(1,171
,1
a
1
2)
;
Note
that
the
units
are
presented in
a
coded
form,
assuming
1
=
volks
and
2
=
seconds.
GOAL
Statement:
DECLARE
STATE LIST
(FLAG
LIST) WITH
10
ENTRIES;
Purpose
:
reference within
the
GOAL
program.
performed.
This
statement
sets
up
an
array
of
10
booleans
for
No
initialization
is
HAL/S
Equivalents:
DECLARE
FLAG
-
LISTD
ARRAY
(10)
BOOLEAN;
GOAL
Statement:
DECLARE
STATE LIST (LIST STATE)
WITH
6
EMTRIES
ON
,ON
,ON
,OFF
8
OFF
8
ON
;
Purpose:
This
statement
declares
an
array
of
6
binary
values (Booleans)
for
use
within
the
GOAL
program
to
store
the
states
of
discretes.
Equivalent
HAL)S
Form:
DECLARE
LIST
STATED
ARRAY
(6)
BOOLEAN
INITIAL(ON~ON,ON,OFF~OFF,ON)
;
A-5
i~~~~~~~~~~~
INCORPORATED
701
CONCORD
AVENUE
CAMBRIDGE.
MASSACHUSETTS
02138
(617)
~1-1~0
-
--
~
-
-.
--I_.-
--
1._11-
-L_
-
-
--
GOAL
Statement:
DECLARE
TEXT
LIST(1NPUT)
WITH
2
ENTRIES
WITH
A
MAXIMUM
OF
25
CHARACTERS
;
Purpose
:
This
statement
sets
up an array
of
two
text strings
for
use
as
the
receiver
of
some input followed by
later
use
as
the
source
of
some
output (no internal manipulations
of
text
are
provided by
GOAL).
Equivalent
HAL/S
Form:
DECLARe
INPUTD
ARRAY
(2)
CHARACTER(25)
;
Note
that
in
this
example
the
original name duplicated
a
HAL/S
keyword
and
thus
had
to
be
modified
in
some
way follow-
ing
the
translation. In
the
example,
:he
lettsr
D
was
appended
to
the
original
name
thereby resolving
the
keyword
conflict.
The
maximum
length
of
25
carries
over
directly.
GOAL
Statement:
DECLARE
TEXT
LIST (OPERATOR INSTRUCTION)
WITH
2
ENTRIES
(PLACE
SWITCHES
INDICATED),
(*PREFLIGHT
TM
CAL
IN
PROGRESS")
;
Purpose
:
This
statement
declares
an
array
of
two
character
strings
which
are
initialized
to
the values indicated, with
a
maximum length determined by implication
from
the
length
of
the
initial values.
Equivalent
HAL/S
Form:
DECLARE
OPERATOR
INSTRUCTIOND
ARRAY
(2)
CHARACTEP.
(30)
'
INITIAL
(
'PLACE
SWITCHES
INDICATED'
I
'*PRELIG€I"
TM
CAL
IN
PROGRESS*')
;
This
is
a
direct
translation,
with
the
only subtlety
being
the
determination
of
the
maximum
length
found
among the
initial values
so
that
the character string
maximum
length
may
be
declared.
A-6
INTFRUFTRICS
INCORPORATED
701
CONCORD
AVENUE
CAMBRIDGE,
MASSACHUSETTS
02138
(617)
661-184
"_
I
I
A.1.3 Table Types
The translation
of
GOAL
table data types requires a
strategy employing several
HAL/S
arrays to accomplish
t4e
same ends within the framework
of
a
HAL/S
program. A set
of
arrays which will accomplish this is the following:
1. A main data array with
row
and
column
dimensions
identical to
the
row
and column dimensions
of
the original
GOAL
table. The
HAL/S
data type
of
this table will be SCALAR,
BOOLEANS,
'or
CHARACTER depending upon the original
GOAL
table's data type (QUANTITY
6
NUMERIC,
STATE,
or
TEXT respectively). This array will store data
in the
HAL/S
version.
an auxiliary character array
of
dimensions
is
required.
For
GOAL
QUANTITY
tables,
2. An
auxiliary "activation array"
of
BOOW
elements controlling whether
or
not
the
given
row is to
be
active at
some
time during execution.
These two arrays cover all the variable information
about
a
GOAL
table as translated into
mr
GOAL
Statement:
DECLARE
NUMERIC
TABLE(H1GH
LOW
RUN)
WITH
3
ROWS
(NIGH),
(LOW),
(RUN),
(CUR)
WITH
ENTRIFS
AND
4
COLUMNS TITLED
<El
GG
CHAMBER
P>
,
1000.1, 1.0,
500.0,
#
<E2
GG
CHAMBER
P>
I
1001.2,
.9#
500.0,
I
<E3
GG
CHAMBER
P>
,
999.8,
1.2,
500.0,
I
Purpose
:
This statement sets
up
a
GOAL
table with initial values
in
3
colurnns,
and
3
rows
of
function-designators.
A
fourth
column
is left uninitialized.
Equivalent
HAL/S
Form:
Main Data
Array:
DECLARE
HIGH
LOW
RUND
ARRAY
(3,4)
INITIAL(
--
Note
here
that
the
HALl'S
initialization cannot
embed
uninitial-
ized values within
its
list
so
a
"0"
has
been used .in
the
fourth-
column entries.
DECLARE
HIGH
LOW
RLWR
ARRAY
(3)
INITIAL
(CFD(1)
>8+D
(27>
,<FD
(3)
>)
f
DECLARE
HIGH
-
LOW
-
RUNA
ARRAY
(3)
BOOLEAN
INITfAL(0N;)
;
GOAL
Statement:
DECLARE
QUANTITY
TABLE
(MAIN
FUEL FLOW)
WITH
5
ROWS
AND
3
COLUMNS
WITH
ENTRIES
Purpose
:
This
statement
sets
up
a
GOAL
quantity
table
with
5
function designators
and
3
columns,
Since
this
is
a
quantity
table,
and
since
quantity
units
can
change
as
date,
the
HAL/S
equivalent
will
have
two
main
data
arrays,
the
second containing
dimensional data.
Equivalent
HAL/S
Form:
Main
Data
Arrays:
DECLARE
MAIN
FUEL
-
FLOWD
ARRAY
(5,3)
INITIAL
(
-
A-8
INTERMETRICS
INCORPORATED
701 CONCORD AVENUE CAMBRIDGE, MASSACHUSETTS 02136 (617) 661-164
DECLARE MAIN FUEL FWWR
ARRAY
(5)
INITIAL
(<ET
MA13
FUEL>
p
<E2
MAIN FUEL>
,<E3
MAIN
FUEL>,
<E4
MAIN
FUEL>,<ES
MAIN
FUEL>);
.
DECLARE
MAIN
FUEL FLOWA
ARRAY
(5)
BOOLEAN
TNITIXL
(ON);
GOAL
Statements:
DECLARE STATE TABLE (THRUST
OK)
WITH
5
ROWS
AND
3
COLUMi~S TITLED (THRUST
OK),
(THRUST NOT
OK),
(STATE) WITH ENTRIES
<THRUST
OK
1El>
p
ON, OFF,
8
<THRUST
OK
1E2>
8
ON, OFF8
8
<THRUST
OK
1E3>
8
ON,
OFF,
8
<THRUST
OK
1E4>
,.
ON8
OFF,
I
<THRUST
OK
1ES> ON,
OFF8
8
Purpose
:
TMs
statement
sets
up
a
GOAL
“state
table”
with
3
columns
and
5
rows8
initialized
as
shown.
A99
dTERMETRICS INCORPORATED
701
CONCORD
AVENUE
CAMBRIDGE,
MASSACHUSETTS
02138
(617)
661-1840
-
---_
l-__lll^-_-l.l.
I
--llll-l-._.
_I~II--
-
-___._
DECLARE THRUST
OKD
ARRAY
(583)
BOOLEAN
INITIAL (TRUE,
FALSE, FALSE, TRUE, FALSE, FALSE, TRUE, FALSE,
FALSE)
;
DECLARE THRUST
OKR
ARRAY
(5)
INITIAL (<THRUST
OK
1E1>
8
<THRUST
OK
iE2>,<THRUST
OK
lE3>,<THRUST
OK
1E4>,
<THRUST
OK
1E5>);
DECLARE THRUST
-
OKA
ARRAY
(5)
BOOLEAN
INITIAL
(ON)
;
GoAt
Statement:
DECLARE TEXT
TABLE
(MESSAGE
TABLE)
WITH
2
ROWS
AND
1
COLUMN
TITLED
(MESSAGE
A)
WITH
ENTRIES
~224
.DISPLAY
B35>
#
(SWITCH
SCAN
IN
PROGRESS)
8
<224
DISPLAY
B42>
,
(PLACE
ABOVE
SWITCHZS
AS
INDICATED);
Purpose:
string
data
associated
with
two
function
designators.
table
has
but
a
single
column.
This
GOAL
statement
prepares
a
table
of
character
The
Equivalent
HAL/S
Form:
Main
Data
Array:
DECLARE
MESSAGE
TABLED
ARRAY
(2
1)
CHARACTER
(33)
INITIAL
(
'SWITCH SCAN-IN PROGRESS',
'PLACE
ABOVE
SWITCHES
AS
INDICATED');
DECLARE
MESSAGE
TABLER
ARRAY(2)
INITIAL
(C224
DISPLAY
B35>
&24
DIsPmY
B42,)
;
DECLARE
MESSAGE
-
TABLEZ4
ARRAY
(2)
BOOLEAN
INITIAL
(ON)
;
A-10
INTFRMETRICS
INCORPORATED
701
CONCORD AVENUE CAMBRIDGE, MASSACHUSETTS
02138
(617)
661-1&
A.2
Procedural Statements
A.2.1
Prefixes
GOAL
Step Number Prefix:
STEP
163
...
rest
of
GOAL
statement
...
HAL/S
Equivalent
Form:
STEP
163:
...
rest
of
HAL
statement
...
-
GOAL
The
Prefix:
WHEN
<COUNT
DOWN
CLOCK>
IS
-80
HRS
'27
MIW
00
SEC
THEN
...
rest.
of
GOAL
statement
Purpose
:
Cause
the
GOAL
program
to
wait until
the
<COUNT
-
DOWN
-
CLOcE(>
value
is
greater than
or
equal
to
-80:27:00.
Equivalent
HAL/S
Form:
FLAG
=
0;
DO
WHILE
FLAG
=
0;
-
C?LL
DATABANK
(COUNT
DOWN
CLOCK>,<PN>)
i
-
-
IF
NUMBERCPN,=
-289620
THEN
FLAG
--
1;
END:
In
this
example,
-80
hrs.
8
27
minutes,
was
converted
to
absolute
time
in
"machine
units"
by
the Translator subroutine
CONVERT
-
TIME.
of
any
following statements
(it
is
not
a
"prefix"
as
in
GOAL).
The
effect
of
tk.2
WAIT
statement
of
HAL/S
is independent
A-11
4TERMETRlCS
I
.
INCORPORATED
_.
701
CONCORD
I
__
AVENUE CAMBRIDGE, MASSACHUSETTS 02138 (617) 661-1840
However, by delaying processing
of
statements which follow
it, the WAIT works as if it were the prefix. The effec: is
also identical to the
GOAL
"WHEN"prefix since any clock time
greater than or equal to the specified time will cause the
halt to be ended and/or ignored.
Note also that all
HAL/S
Real Time statements assume a single
real time clock. In order to allow the possibility of multiple
clocks
(not rules out
by
GOAL
specification), the Translator
will have to incorporate a scaling and offset algorithm
so
that all clock function designators can be driven by the single
HAL/S
Real Time Operating System clock.
GOAL
Time Prefix:
AFTER <COUNT
DOWN
CLOCK>
IS
-80
HRS
27
MINUTES
00
SECS
THEN
...
brlrpose:
Delay execution of the particular statement until
after
the time named. In any time-dependent digital system,
'after"
may
only mean "one system clock tick" later than
the
specified time. Thus, this statement
is
the same as a WHEN
statement with a time value increased by
the
unit
of
the
basic clock period.
Equivalent
HAL/S
Porn:
FLAG
=
0;
DO
WHILE
FLAG
=
0;
CALL
DATABANK
(CCOUHT
-
DOWN
-
CLOCK>,
<PN>)
;
IF NUMBER
>=
~(289620
-b
<AX>)
THEN
FLAG
=
1;
END:
where
289620
is the machine-unit (absolute) equivalent
of
the specified time and
AX
is the granulasity
of
time
in
the clock, expressed in "machine units".
~~-~.-~~~~~..-~.~--~.-~~~~~~~~~o.~~ow~~ow~o~wD.o~~o~~~.oo~.~~~
A-12
INTERMETRICS
INCORPORATED
701
CONCORD
AVENUE
CAMBRIDGE,
MASSACHUSETTS
02138
(617)
661-184
GOAL
Statement:
IF
(MIDDLE GIMBAL ANGLE)
IS
GREATER
THAN
(MIDDLE
GIMBAL LIMIT)
THEN
The
HAL/S
Equivalent
Form
is
generated with
the
assistance
of
the
EVAL INT
NAME
and
REL
-
FORM
Translator subroutines:
--
K
=
1;
IF
NOT (MIDDLE GIMBAL
-
ANGU-D
>
MIDDLE
-
GIMBAL
-
LIMIT)
THEN
K
=
0:
IF
K
=
1
THEN
DO:
.--
._---
(Procedural
Statement)
END:
(Provided
by
Translator)
GOAL
Verify
Pre-ix:
VERIFY
<MIDDLE GIMBAL
ANGLE>
IS
LESS
THAN
(MIDDLE GIMBAL LIMIT) ELSE
...
The
HAL/S
Equivalent
Form
is
generated
with
the
assistance
of
the
EVAL
ED
and
REL
-
FORM
Translator
subroutines:
FLAG
=
0:
DO WHILE
FLAG
=
0:
DO
FOR
K
=
1
TO
1
’
CALL
DATASANK
(<MIDDLE
-
GIMBAL
-
ANGLE>)
:
IF
NOT <MIDDLE
-
GIMBAL
-
LIMIT>) THEN
K
=
0:
END:
IF
K
=
1
THE6
D3;
COND
=
TRUE:
FLAG
=
1:
END:
ELSE
FUPEAT:
END
:
IF
COND
=
FALSE
THEN DO;
.o.~.~I~.o~~~~..~.~~~~o~~.~o~~.~~.~.~~..~o~.~~.~~.~~~o...~o~~
A-13
NTERMETRICS INCORPORATED
701
CONCORD AVENUE CAMBRIDGE. IdASSACHlJSETTS
02138
(617)
661-1840
A.2.2 External
Test
Actions
GOAL
Statement:
SEND 1OV
to
<POWER SELECTOR
l>,<POWER SELECTOR
2>;
Purpose
:
'
This
statement
is
used to implement an
I/O
operation to
some specific external device.
DO
FOR
K
=
1
TO
2;
DIMISNSION,pN,
=
<QUANTITY DIMENSION>
;
NUmER<pN>
=
<QUANTITY
VALUE>;
CALL
DATABANK
(<AFD(K)
>
<PN>)
;
END
;
GOAL
Stateme.
.:
APPLY
PRESENT
VALUE
OF
<POWER BUS
1>
TO
<POWER BUS
2>;
Purpose
:
This statement
is
used to implement an input operation
from
power-bus
1
and
a
corresponding output operation to power
bus
2
with
no
intermediate storage in program variables.
HAL/S
Equivalent
Form:
A-14
INTERMETRICS INCORPORATED
701
CONCORD AVENUE CAMBRIDGE, MASSACHUSETTS
02138
(617)
661-18.
GOAL
Statement:
ISSUE
(OCTAL SEVENS), (OCTAL
ONES)
TO
<PANEL LIGHTS
32>,
<PANEL LIGHTS
31>;
Purpose
:
This
statement
is
supposed
to
send
a
"digital
pattern"
in
.the
form
of
a
numeric internal
variable
to
a
selected
1/0
word
identified
by
the
selected
function designators.
In
this
case,
the
internal variable
(OCTAL SEVENS)
is
sent
to
"PANEL
LIGHTS
32"
and
(OCTAL ONES)
is
sent
to
"PANEL LIGHTS
31";
HAL/S
Equivalent
Form:
DO
FOR
K
=
1
TO
2;
NU*ER<PN,
=
<OCTAL
SEVENS>;
CALL DATABANK (<PANEL LIGHTS
32>
,<PN>)
;
K-K+1
NUMBER<pN>
=
<OCTAL ONES>;
CALL DATABANK (<PANEL LIGHTS.
31>
,<PN>)
;
END
;
GOAL
Statement:
ISSUE
PRESENT
VALUE
OF
<CH
63>
TO
<CH
11,;
Purpose
:
As
in
the
above
example,
this
ie
simply
some
1/0
of
data
to
a
_articular
set
of
channal addresses
in
some
channel
or
channels
of
the
1/0
hardware.
A-
15
JTERMETRICS INCORPORATED 701 CONCORD AVENUE CAMBRIDGE, MASSACHUSETTS 02138 (617) S61-1840
HAL/S
Equivalent
Form:
DO
FOR
K
=
11'0
1;
GOAT,
Statement:
S
104
AFTER
<CLOCK>
IS
-1
HRS,
OPEN
<!IELIUM
SUPPLY>;
Purpose
:
This
GOAL
statement
has
a
time
prefix,
and
a
label
prefix,
used
to control
when
arld
under what conditions
the
action
of
sending
a
bit
valve corresponding
to
an
OPEN
valve
to
an
external
register
symbolically identified
by
the
function
designator
"HELIUM
SUPPLY".
HAL/S
Equivalent Form:
STEP
-
104:
WAIT
UNTIL
-3600.001;
STATE<pN>
=
OFF;
GOAL
Statement:
STEP
5:
TURN
ON
(THWST
OK
ING:
FCXCTIONS;
Purpose
:
This
GOAL
statement
is
suppose..
-,
set
all
the
bits,
in
all
the
active function
designators
of
a
STATE
tzble
to
the
"ON"
value.
A-16
INTERMETRCS
INCORPORATED
731
CONCORC
',VENUE
CAMBRIDGE,
:+cSA'aHUEZTTS
02138
(617)
6$1-184
HAL/S
Equivalent
Form:
SYP
5:
STATEcpN,
=
ON;
uc)
FOR
K
=
1
TO
<KNAx>;
IF
TEWST
--
OK
IND%
THEW
CALL
DATABANK
(<THRUST
--
OK
INDS,
,CPN>)
;
END;
GOAL
Statement:
RECORD
(INTERNAL
TIME)
TO
<MAG
2-5>;
Purpose
:
This
statement
is
supposed
to
send data
from
a
GOAL
This
means
in
effect
that
an
I/O
internal variable named 'Internal
time'
to
the
function
designator identified.
opsration
of
writing
the
internal value
to
the
implicit
I/O
address
of
the function designator
is
required.
HAL/S
Equivalent
Form:
GOAL
Statement:
DISPLAY
TEXT
(ALL
SYSTEMS
READY
FOR
POWER
TRAMSFER)
To
CCRT
9,;
Purpose
:
This
statement
is
supposed
to
write
the
given
text
out
onto
a
character-oriented
Z/O
device,
namely
a
display.
Since
this
output
is
charactor-oriented,
the
equivalent
HAL/S
form
will
have
a
character
output
statement
form.
A-17
;
htTFRIITTRIC;S
INCORPORATED
701
CONCORE,
&VENUE
CAMBRIDGE,
MASSACHUSETTS
02138
(617) 661-1840
HAL/S
Equivalent
Form:
=
'ALL
SYSTEMS
READY
FOR POWER
TEXT
PN
- -
--
-
TRANSFER'
;
DO
FOR
L
=
1
TO
1;
GOAL
Statement:
AVERAGE
10
READINGS
OF
<IU
COOLANT
TEMPERATURE>
AND
SAVE
AS
(COOLANT
TFM?);
Purpose
:
The
purpose
of
this
statement
is
to
read
a
hardware
input
channel
10
times, averaging
the
readings.
No
time
delay
other
than
the
response
time
of
the
software
is
to
be
employed
explicitly
between
successive
readings.
HAL/S
Equivalent
Form:
Do;
AV
='O;
DO
FOR
I
=
1
TO
3.0;
CALL
DATABANH(C1U
COOLANT
TEMPERATURE>,<PM>)
;
AV
=
AV
f
NUM8ER,pH>;
END;
OOOLANT.TEPIPD
-
=
AV/NUM;
EMD;
GOAL
Statement:
READ
<PC
STAGS
INLET
PRESSURE>
AND
SAVE
AS
(IMm
PRESSURE)
;
A-18
INTERMETRICS
INCORPORATED
701
CONCORD
AVENUE
CAMBRIDGE,
MASSACHUSETTS
W138
(617)
661-184
HAL/S
Equivalent
Form:
Cau
DATABANK
(<PC
STAGE
INLET
PRESSURE,,
<PN>)
;
INLET
-
PRESSURED
=
NUMBER,pN,;
GOAL
Statement:
READ
(TABLE
A)
FUNCTIONS
AND
SAVE
AS
(CURRENT
VALUE);
Purpose
:
The
purpose
of
this
statement
is
to
evaluate
+e
current
value
of
all
the
function designators
(which
are
active)
in
the
TABLE A
and assign
the
results into corresponding positions
in the
tdle
column indicated.
HA&/S
Equivalent
Form:
DO
FOR
K
=
1
TO-<KMAx>;
IF
TABLE
-
%
THEN
IF
CALL
DATABANK
(<TABLE
-
%>,
<PN>)
;
CURRENT
-
VALUEDK,cI,
=
rJUMBER,pN,;
END;
CURRENT
-
VALU-
THEN
DO;
I
GOAL
Statement:
REQUEST TEXT
(DEGREES
PITCH)
FROM
CCRT
7,
AND
SAVE
AS
(DEG
PTCH);
Purpose
:
Display
a
request on
the
console
and
then
reads
in
the
result.
to
scalar
is
involved,
a
conversion function in the
HAL/S
version
will
be
used.
Since
a
character-oriented operation
with
conversion
HAL/S
Equivalent
Form:
DO
FOR
K
=
1
TO
1;
CONTROL,pN,
=
<INPUT>:
CALL
DATAB&JK(<CRT
7>
,<PN>)
:
CDEG
L
PTCH>
=
TEXTcpN,:
END;
A-19
dTERMETRICS INCORPORATED
701
CONCORD
AVENUE
CAMBRIDGE,
MASSACHUSETTS
02138
(617)
661
-1840
A.2*3
Internal Sequence Control
GOAL
Statement:
DELAY
5
SECS;
Purpose
:
Cause
the
program
to
"go
to
sleep"
for
a
time
interval
of
5
seconds.
HAL/S
Equivalent
Form:
WAIT
5;
GOAL
Statement:
WAIT
UNTIL
CSIVB
3200 PSIA
SUP
VENT,
XS
OPEN;
Purpose
:
Cause the
program
to
"go
to
sleep"
for
a
time
interval
of
unspecified length until the boolean
(state)
function
designator
is
recognized
as
being
"OPEN".
XAL/S
Equivalent
Form:
A-20
INTERMETRICS
INCORPORATED
701
CONCORD
AVENUE
CAMBRIDGE,
MASSACHUS3TS
m138
(817)
06l-lSq
GOAL
Statement:
Go
To
s
20;
W/S
Equivalent
Form:
GO
TO STEP
20;
where
the
label
S
20
of
GOAL
has
been
translated
into
a
W/S
identifier.
GOAL
Statement:
STOP
AND INDICATE
RESTART
LABELS
S100,
S20O;
Purpose
:
To
give the
GOAL
program
an
ability
to
cease
active
execution
and
wait
for
operator
intervention,
followed
by
a
jump
to
one
of
the
indicated labels.
W/S
Equivalent
Form:
=
'PROGRAM
HAS
STOPPED
AT
UNNUMBERED
STA!CEMEMT.
TEXT<pN>
INDICATE RESTART
AT;
CALL
DATABANK
(0,
<PN>
;
=
'STEP
100';
CALL
DATABANK
(0
I
<PN>)
;
TE*<PN>
-
=
'STEP
200';
CALL
DATABANK(O,<PN>)
;
TEXT<pN>
-
AGAIN:
CONTROL,pN,
=
CILJBUT
RESTART LABEL>;
CALL
DATABANK
(0
8
CPN>)
;
A-21
:JTERMETRICS INCORPORATED
701
CONCORD AVENUE CAMBRIDGE, MASSACHUSETTS
02138 (617)
661-1640
LOC
=
0;
CALL
FLUSH;
IF
TEXT
=
'STEP
-
100'
THEN
GO
TO
STEP
-
100;
IF
TEXT
=
'STEP
200'
THEN
GO
TO
STEP
-
200;
CONTROL<pN,
=
'ERROR';
CALI,
DATABANK{O,<PN>)
;
GO
TO
AGAIN;
GOAL
Statement:
TERMINATE
:
Purpose
:
The
TERMINATE
statement
of
GOAL
is
used
to:
Return control
to
the calling program
if
it
is
found in
a
GOAL
subroutine.
Stop execution
of
a
program
if
found
at
the
program
level,
returning control
to
the
caller.
Purpose
:
This statement
shuts
down
an
entire
system
of
programs.
A-22
!NTERMETRICS INCORPORATED 701 CONCORD AVENUE
GAMBRIDGE.
MASSACHUSETTS 02138
(617)
661-184
€IAL/S
Equivalent
Form
:
SET
TERMSYSCpN,;
RETURN:
GOAL
Statement:
REPEAT
STEP
5
THRU
STEP
7:
HAL/S
Equivalent
Form:
OUTPUT
HAL/S:
"RPT
=
RPT
+
1;
RPTACT,sE;,
=
ON;
=
Rs;
SAVERPT
RS
=
<EN>:
RPT
CTk
=
1;
GO
TO
STEP
5:
%TURN
-
LA3EL<RSN>:
RS
=
SAVEReT;
RPT
=
RPT
1;
-
-
A-23
t
NTERMFTRICS
INCORPORATED
701
CONCORD
AVENUE CAMBRIWE, MASSACHUSETTS
02138
(617)
681-1640
A.2.4
Arithmetic/Logical Operations
GOAL
Statement:
ASSIGN
(FLAG
B)
=
ON;
Purpose
:
-
Set
a new value
of
"ON"
into
the
(FLAG
B)
internal
name
HAL/S
Equivalent
Form:
FLAG
B
=
TRUE;
-
This equivalence
assumes
the
convention that
"ON"
has a binary value
of
"1"
or
"true".
FLAG
B
is
assumed
to
be
a
HAL/S
BOOLEAN.
-
GOAL
Statement:
LET
(A)
=
(A)
+
1:
Purpose
:
Assign
a
new value
to
GOAL
internal
variable
(A)
calculated
as
shown.
HALIS
Equivalent
Form:
A=A+1;
A.
Execution
Control
GOAL
Statement:
CONCURRENTLY
PERFORM
PROGRAM
(BEO1);
A-24
'b'Trn''~TRlrC
INCORPORATED
701
CONCORD
AVENUE
CAMBRIDGE,
MASSSHL':"
'
T.5
32138
(617)
661-184
HAL/S
Equivalent
Form:
SCHEDULE TASK <BE%Il>;
GOAL
Statement:
CONCURRENTLY
VERIFY
<PRESS ENG 102
GIMBAL>
IS
BETWEEN 1665PSIA
and
1465PSIA
and
DISPLAY
EXCEPTION TO <CRT12>
;
HAL/S
Equivalent
Form:
SCHEDULE TASK
<NUM>;
TASK
<NUN>:
TASK;
RESET TERM
-
SYS,NuM,;
BACK
:
DO
FOR
END;
=
RUN
TIME;
TOLD
-
K
=
1
TO
1;
CALL DATABANK
(<PRESS
ENG 102
GIMBAL>,
<PN>)
;
If
NQT (<NUMBER,pN,
>
>=
<1465>)
AND
<NUMBER<PN,
>
=<
<16657>)
THEN
K
=
0;
A-25
NTERMETRICS INCORPORATED
701
CONCORD AVENUE CAMBRIDGE, MASSACHUSETTS
02138
(617)
061-1840
GOAL
Statement:
RELEASE
STEP
10;
Purpose
:
Step
10
had "concurrently"
set
up
some
concurrent process
at a previous
time.
This statement "releases" the concurrent
process initiated,
by
removing
it
from
the implicit executive
queues involved.
NAL/S
Equivalent
Form:
TERMINATE
TASK
<PROGN>
;
GOAL
Statement:
RELEASE
ALL
Purpose
:
the current
GOAL
component.
Terminate
all
concurrently scheduled operations within
HAL/S
Equivalent
Form:
TERMINATE
TASK
CANUplk>;
SET
TERM
-
SYST
em&$>;
where
k
is
cycled
from
1
to
the
maximum
provided
in
the
arrays.
A-26
INTERMETRICC INCORPORATED
701
CONCORD AVENUE CAMBRIDGE, MASSACHUSETTS
02136
(617)
661-184
I
GOAL
Statement:
PERFORM
PROGRAM
(LVDC
POWER
ON)
;
Purpose
:
Branch
to
the program selected, execute
it
and
return.
&/S
Equivalent
Form:
CONTROL,pN,
=
<PUSH INT ENVIRONmNT>;
CALL
DATABANK
(1,
<PN>)
;
/*SAVE
INT ENVIRONMENT*/
RESET TERM
-
SYST,NUM>;
CALL
G
-
L\DC
POWER
ON;
CONTROL
=
<POP
INT
ENVIRONMENT>
CALL
DATABANK(l,<PN>); /*RESTORE INT ENVIRONMENT*/
-L
IF
TERM SYSTcwM, THEY
DO;
-
RESET
TERM
-
SYST,NUM,;
SET
TERM
-
SYSTCpN>;
RETURN;
END
;
GOAL
Statement:
PERFORM CRITICAL SUBROUTINE
(CALCULATE
DELAY
TIME)
;
Purpose
:
Inhibit all software-level interruptions
by
other
system
components
(this
does not
refer
to
physical interrupts
which
the
OS
handles)
during the execution
of
the subroutine.
A-27
JTERMETRICS INC3RPORATED
701
CONCORD
AVENUE
CAMBRIDGE,
MASSACHUSETTS
02138 (617)
661-1840
HAL/S Equivalent Form:
CONTROL<pN>
=
<PUSH INT ENVIRONMENT>;
CALL DATABANK
(1,
<PN>)
;
CALL
G
CALCULATE
DELAY
TIME (TRUE);
CONTROL,pN,
=
<:POP INT ENVIRONMENT>;
IF TERM
-
SYSTCpN, THEN
DO;
RESET TERM
-
SYST,pN,i
RETURN
;
END;
GOAL
Statement:
WHEN INTERRUPT <POWER FAILURE> OCCURS
GO
TO
STEP
9000:
Purpose
:
Send control
to
step
9000
when
the
indicated interrupt
occurs
HAL/S
Equivalent
Form:
IF
NOT C
THEN
DO;
CONTROL,pN,
=
<ENABLE INTERRUPT>;
NUMBER<pN>
=
<POWER FAILURE>;
CALL
CATABANK
(1,
<PN>)
i
ENVIRON(2,<IN>)
=
0;
ENVIRON(3,<IN>)
=
qN>:*
INTERMETRICS INCORPORATED
701
CONCORD
AVENUE
CAMBRIDGE,
MASSACHUSETTS
021
38
*
(61
7)
681
-l&,
i
GOAL
Statement-:
WHEN INTERRUPT <CLOCK
T-22
MINS> OCCURS
PERFORM
SUBROUTINE
(START
-
TANK CHILLDOWN) AND RETURK
TO
STEP
9999:
Purpose
:
.
When the indicated interrupt occurs, perform
a
subroutine
then unconditionally branch
to
the
indicated
step
number.
HAL/S
Equivalent
Form:
IF
NOT
C
THEN DO;
CONTROL <PN,
=
<ENABLE
INTERRUPT>;
=
<CLOCK T-22 MINS-
;
m=R<pN>
CALL
DATABANK
(
1
8
<PN'
t
ENVIRON(2,<IN>)
=
<NS>:
ENVIRON
(3,
<IN>)
=
<CN>
;
*
END
;
*
IN
=
No.
Assoc.
with Interrupt.
CN
=
Case
Number
Assoc.
with
GO
TO
or
RETURN
TO
option.
NS
=
Number
Assoc.
with Subroutine
GOAL
Statement:
DISABLE STEP
20;
Purpose
:
INTERRUPT"
at
the
step
indicated
(STEP
20);
Inhibit
a
software interrupt
set
up
by
a
"WHEN
A-29
JTERMETFIICS
INCORPOHATED
701
CONCORD AVENUE CAMBRIDGE, MASSACHUSETTS
.-
-
02138
e
(817)
661
-1840
-.
HAL/S
Equivalent
Form:
CONTROLCpN,
=
<DISABLE>;
mmER<pN>
=
<FD>;
CALL
DATABANK
(1,
<PN>)
:
A.2.7
Table
Control
GOAL
Statement:
.
ACTIVATE
(TABLE
A)
ROW
1,
ROW
3;
Purpose
:
Activate
the function designators
assocjated
with
tha
indicated
rows
so
that future
1/0
to
this
table
will
include
the
rows
in
question.
HAL/S
Equivalent
Form:
The
HAL/S
translation
of
a
GOAL
table
involves
a
data
array and
an
activation
array
of
BOOLEANS. Assuming
that
"TABLE
AA
is
TABLE
A's
activation
array,.and
that
"TRUE'
mean?
de
corresponding
row
is
active,
then
the
NAL/S
equivalent
is
simply:
TABLE
-
AA1
=
ON:
TABLE
AA-
=
C.;:
s
-
GOAL
Statement:
INHIBIT
(TABLE
Ti)
ROW
2,
ROW
3;
A030
INTERMETRICS INCORPORATED
701
CONCORD
AVErJUE
CAMBRIDGE,
MASSACHUSETTS
02138
(61
7)
661
-18
Purpose
:
Disable
the
function designators associated with
the
izdicated
rows,$
so
that
future
1/0
to
this
table
will
exclude
the
rews
in
question.
HAL/S
Equivalent
Fora:
.
Analogous
to
the ACTIVATE
case:
TABLE
-
AA2
=
OFF;
A-31
"
ORATED
701
COIKORD
AVENUE CAMBRIDGE, MASSACHUSETTS
02138
e
(617)
681-1840
_yI_II
.
..
1
-.ld...."IIY-.~-I^.-I..",-.
..
--
--
.---I-
:
\ITERMETF'C"
24.3
System Statements
governing
the
course
of
the
GoAL-HAL/S
trenslator's operation.
Some
of
these statements have implications which are reflected
in
the
W/S
code produced.
The
GOAL
system
statements
serve
primarily
as
inputs
A.3.1 Boundary Statements
GOAL
Statement:
BEGIN DATA
BANK
(S2
DATA
BANK)
REVISION
0;
Purpose
:
Mark
the beginning of the Data
Bank
named for input
to
an
appropriate data
bank
compilation. This statement should
not
be
in
the
GOAL
source.
error message.
The
Translator will generate
an
GOAL
Statement:
BEG'CN PROGRAM
(LV
TM
CAL)
REVISION
0;
Purpose
:
Mark
the
beginning of a
GOAL
program.
HAL/S
Equivalent
Form:
G
---
LV
TM
CAL
-
0:
PROCEDURE
EXCLUSIVE;
GOAL
Statement:
BEGIN
SUBROUTINE
(FORCE
-
TERM)
(PARAME3%R-l)
;
A-32
INTERMETRICS INCORPORATED
701
CONCORD AVENUE
CAMBRIDGE,
krnSSACHUSETTS
02138
(617)
681-184
i
Purpose
:
This
statement begins
a
GOAL
subroutine
block,
passintj
one
formal
parameter.
HAL/S
Equivalent
Form:
G
-
FORCE
-
TERM:
PROCEDURE
(C)
ASSIGN
(PARAM'J!ER
-
1D);
GOAL
Statement:
BEGIN
MACRO
A2
(PARAMETER
1);
Purpose
:
This
statement
specifies
the
start
of
a
GOAL
source
language
macro.
Since
macros
only
refer
to
the
source
code
and
are
expanded
within
the
translator,
there
is
no
HAL/S
equivalent.
This
does
not exclude use
of
a
HAL/S
macro
form
as
part
of
the
generated
HAL/S
source
code
if
a
GOAL-to-IiAL/S
translation
is
done
at
the
source language
level.
But
such use
is
completely separate
from
the
GOAL
macro
and
its
use.
.
GOAL
Statement:
END
DATA BANK;
END
PROGRAM;
END
SUBROUTINES:
END
MACRO;
1
.pose:
Mark
the
end
of
the
particular
GOAL
block
(OK
component).
A-33
YTERMETRICS
INCORPORATED
701
CONCORD
AWENUE
CAMBRIDGE,
MASSACHUSETTS
02138
(617)
681-1840
HAL/S
Equivalent
Fom:
Since
MACRO
forms exist cnly in the source inputs
to
the
GOAL-HAL
translation, the
END
statement
for
this block
is
devoid
of
a
HAL/S
equivalent.
The
HAL/S
equivalents
of
END
PROGRAM
and
END
SUBROUTINE
are provided
by
the
HAL/S
CLOSE
statement;
i.e.
CLOSE
;
LEAVE:
Purpose
:
Link to
some
other language subroutine (in object
form).
This is
an
operating system function which has no equivalent
in
HAL/S
and
is
illegal.
GOAL
Statement:
RESUME;
Purpose
:
Return
to
GOAL
compiling after
LEAVE.
See
comment
in
the discussion
of
RLEAVE"
above.
A-
34
INTERMETRICS INCORPORATED
701
CONCORD
AVENUE CAMBRIDGE, MASSACHUSETTS
021%
(617)
661-1
A.3.2
System
Directive Statements
The
GaAL
system
directive
statements
are
USE,
FREE,
and
SPECIFY
-
all
of
which
refer
to
the
DATA
BANK.
These statements have
no
HAL/S
equivalent
(see
Section
3.0)
and
are
system-oriented inputs
to
the
translation
process.
All
data
bank
references
are
resolved
by
the
translator
-
the
data
bank
(as
such)
does
not appear
in
the
output
of
the
translator.
A.
3
.
3
Special
Aid
Statements
GOAL
Comment Statement:
$
POWER
TRANSFER
SWITCH VERIFICATION:
Purpose
:
Annotate listing.
HAL/S
Equivalent
Form:
a.
b.
Embedded
Comment
/*
POWER
TRANSFER
SWITCH
VERIPICATION
*/
Comment
Line
pos
1
C
POWER
TRANSFER
SWITCH
VERIFICATION
Note:
Comments
map
directly into comments
with
identical
text
and
minor syntax
changes.
A935
NTERMETRICS
INCORPORATED
701
CONCORD
AVENUE
CAMBRIDGE,
MASSACHUSETTS
02138
(617)
661-1840
GOAL
Statement:
EXPAND
MACRO
ADJUST,
<AC
SIGNAL>,
(0.
SV)
,
5340
,
;
Purpose
:
compilation
.
Expand
a
GOAL
substitution
macro
prio
to
further
HAL/S
Equivalent
Form:
None.
All
macros
involve expanding
GOAL
source
statements,
so
the
macro
itself
and
its
expansion
disappear
in
the
transla-
tion
process.
GOAL
Statement:
REPIACE
<POWER SUPPLY
NO
1,
WITH
<POWER
SUPPLY
NO
2>;
Purpose
:
Replace
is
a
source
level
substitution
of
characters
prior
to
compilation, a
sort
of
"mini-macro" facility.
As
with
macros,
it
disappears following translation
because
it
must
be
expanded
in order
to
translate.
A-36
INTERMETRICS
INCORPORATED
701
CONCORO
AVENUE
CXUIBRIDGE,
MASSACHUSETTS
E138
(617)
661-1
REFERENCE
LIST
1)
Flanders,
et
al;
Final Report
on
Shuttle Avionics and
the
GOAL
Language, including
the
Impact
of
Error
Detection
and Redundancy Management, Intermetrics, Inc., Cambridge,
Mass.,
June
1973.
2)
Flanders,
et
al;
Final Report on
GOAL-t0-W
Translation
Study,
Intermetrics, Inc., Cambridge,
Mass.,
1973.
NTERMETRICS “‘JCORPORATED
701
CONCORD AVENUE CAMBRIDGE,
MASSACHUSETTS
02133
(617)
661
-1840