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 PDF.
Page Count: 173

Download19740013725_1974013725_GOAL_to_HAL_S_Translator_Dec73 19740013725 1974013725 GOAL To HAL S Translator Dec73
Open PDF In BrowserView PDF
~74-2183a

(NASA-CE-136159) ? B E G C A L - I O - H A i / S
TRARSLAICE S F E C I F I C A I I C L E i n a l :.€port
( I n t e r m e t t i c s , Inc.)
172 F HC 1 1 1 . 7 3

'Jnclas

CSCL 09B

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.

-_

I 2.

R e p o r t N;.

Goverimenr A c c o i . o n h a .

I

1

j. hccuptent's

5. Report Dore

4. Tnrlt 0 - 3 SLbr,rlc

D e c e m b e r 15, 1973

THE GOAL-TO-HAL/S TRANSLATOR SPECIFICATION

~
7. Abth .

_

I

_

S a u l F. S t a n t e n and James H. F l a n d e r s

---

6. Performing Orgonixotton Code
8.

s'p

9. Peril-

Catalog No.

Perfomtnq Organtiorion Report No.

___

10. Work Unit No.

\ m e m d Address

-;
0tgari::'~cn

INTERNETRICS

, mc.

701 Concord Avenue
Cambridge, Mass.
02138
Apt-cy

- _
_
..

1 I . Conrroct or Grant No.

NAS 10-8385

12. Soonsorirg

- - -_

-__

13. T r p e of Report.ond Period Covered

Final Report
DRL Item 14

Name and Ad&est

National Aeronautics and Space A w n .
John F. Kennedy Space Center
Kennedy Space Center, Florida 32899
I

15. Supplementary Notes

16. Abstract

This r e p o r t comprises a S p e c i f i c a t i o n f o r a GOAL Language t o HAL Language
Translator. Ground Cperdtions Aerospace Language, o r GOAL, is a t e s t - o r i e n t e d
higher order language developed by NASA's John F. Kennedy Space Center f o r
use i n the checkout and launch of t h e Space S h u t t l e . HAL is a s t r u c t u r e d h i g h e r
o r d e r language developed by NASA's Zohnson Space Center for manned space f l i g h t .
HAL/S is t h e version of HAL s e l e c t e d by NASA f o r w r i t i n g t h e f l i g h t software f o r
t h e o:lboard Data Processing System. Since t h e onboard computers w i l l e x t e n s i v e l y
support ground checkout of t h e Space S h u t t l e and their o p e r a t i o n a l system works
e x c l u s i v e l y w i t h HAL/S, t h e t r a n s l a t i o n of COAL-to-HAL/S assumes s i g n i f i c a n c e .

The S p e c i f i c a t i o n sets f o r t h a t e c h n i c a l framework w i t h i n which 10 d e a l w i t h the
t r a n s f e r of s p e c i f i c GOAL f e a t u r e s t o W / S .
Key t e c h n i c a l f e a t u r e s of t h e
T r a n s l a t o r a r e described which commiicate with t h e d a t a bank, handle r e p e a t
statements, and deal w i t h software i n t e r r u p t s . GOAL programs, databank informat i o n , and GOAL system subroutir.es are i n t e g r a t e d i n t o one GOAL MASTER-PROGRAM i n
HAL/S. This output is f u l l y compatible HAL/S source code read? f o r i n s e r t i o n
i n t o t h e HAL/S compiler.
The T r a n s l a t o r uses a PASS1 t o e s t a b l i s h a l l t h e "global" d a t a needed f o r the
HAL/S output program.
Individual GOP-, s t a t e n e n t s a r e t r a n s l a t e d i n PASS2. The
S p e c i f i c a t i o n d o c w e n t makes extensi;re u s e of flowcharts t o s p e c i f y e x a c t l y how
each v a r i a t i o n of each GOAL s t a t m e n t is t o be t r a n s l a t e d . The S p e c i f i c a t i o n alsi
d e a l s w i t h D e f i n i t i o n s and Assumptions, Executive Support S t r u c t u r e and fmplernent a t i o n . An Appendix, e n t i t l e d GOAL-to-H=iL :.:agping, provides examples of t r a n s l a t e d G?AL statenents. This T r a n s l a t i o n S p e c i f i c a t i o n is based upon an e a r l i e r
F i n a l Rr *,art on Ci;,iL--to-tiAL Tra.ii~sl&i
SJudv. ,&RS 9 1 2 3 9 1 . dc

Test Oriented Language
Space S h u t t l e
GOAL
HAL
19.

SeCvIty

Clusi.f.cof thtr report\

Uncl.7s s i fied

1

-

18. Dlstr8tutton Stotcrment

17. K c y " 0 d s

2". Security

C l o r s i l . ( o l this page)

Unc1asr;i f i e d

21. No. of Pages

22. Price

NOTICE

This r e p o r t wo's prepared a s an account of Government-sponsored
work. N e i t h e r t h e U n i t e d S t a t e s , nor t h e National Aeronautics
and Space Admi.iistration ( N A S A ) , nor any person a c t i n g on behalf
of W S A :
(1) Makes any warranty or r e p r e s e n t a t i o n , e x p r e s s e d or implied,
w i t h r e s p e c t t o t h e accuracy, completeness, o r u s e f u l n e s s of
t h e i n f o r m a t i o n c o n t a i n e d i n t h i s report, o r t h a t t h e u s e of
any i n f o r m a t i o n , a p p a r a t u s , method, or p r o c e s s d i s c l o s e d i n
t h i s report may n o t i n f r i n g e privately-owned r i g h t s ; o r
(2)

A s s u m e s any l i a b i l i t i e s w i t h r e s p e c t t o t h e u s e o f , o r f o r
damages r e s u l t i n g from t h e u s e o f , a n y i n f o r m a t i o n , apparat u s , method or p r o c e s s d i s c l o s e d i n t h i s r e p o r t .

"person a c t i n g on b e h a l f of NASA" i n c l u d e s any
employee o r c o n t r a c t o r of NASA, o r employee o f such c o n t r a c t o r ,
t o t h e e x t e n t t h a t such employee or c o n t r a c t o r of NASA o r employee
of such c o n t r a c t o r p r e p a r e s , d i s s e m i n a t e s , o r p r o v i d e s access t o
any information p u r s u a n t t o h i s employment o r c o n t r a c t w i t h NASA,
or h i s employment w i t h such c o n t r a c t o r .

As used above,

INTEHMETRICS INCORPORATED 701 CONCORD AVEFJUE

CAMBRIDGE, tAASSACHUSETTS 02138

(617) 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

1.1
1.2
1.3
1.4
1.5
1.6
2.0

3.0

Introduction
Genesis of GOAL
Genesis of HAL/,C
Purpose of the Specification Document
Scope of the Specification Document
Outline of the Specification Document

APPLICABLE DOCUMENTS

5

2.1
2.2

5
5

GOAL Documents
HAL/S Documents

DISCUSSION OF KEY TECHNICAL FEATURES
3.1
3.2
3.3
3.4
3.5

4.0

1

SCOPE

The GOAL Master Program (GMP) Concept
Structure of a Translated Goal Program
Communication with the Databank
REPEAT Statements
Software Interrupts

7
12
16
18
21

DEFINITIONS AND ASSUMPTIONS

27

4.1
4.2

27
27
27
29
32
32

Definitions and Notation
Assumptions
4.2.1
Overall Scope
4 2.2 Features
4.2.3
Ground-Based Operating System (GBOS)
4.2.4
Undefined

.

5.0

7

TRANSLATION REQUIREMENTS

33

5.1

33

5.2

Structure of the Translator
5.1.1
Introduction
PASS 1
5.1.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.6
LIM FOPaJl5.2.7
REL-FOP*

-

NTERMETRICS INCOhPORki ED 701 CONCORD AVENUE

*

CAMBFIIDGE. MASSACHUSETTS 02138

33

33
41
41
41
41
43
44
45
46

(617) 661 -1 840

5.3

5.4
6.0

7.0

49
67
111
114

EXECUTIVE SUPPORT STRUCTURE

115

6.1
6.2

115
115

Introduction
Recommended Approach

REQ.

117

Implementation
Verification
Operations, Maintenance and Update
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

117
118
121
121
122
122
122
122
122

Translator Schedule

123

IMPLEMENTATION, VERIFICATION
7.1
7.2
7.3
7.4

7.5
8.0

49

Flowcharts
5.3.1
Declaration Statements
5.3.2
Procedural Statements
5.3.3
System Statements
Output Processor

& DWUMENTATION

127

RECOMMENDATIONS
8.1
8.2

123

Choice of Host Machine
Choice of Translator Language

127
127

APPENDIX A.

tNTERMETRICS INCORPORATED 701 CONCORD AVENUE

CAMBRIDGE, MASSACHUSETTS 02138

*

(617) 661-1840

1.0

SCOPE

1.1 I n t r o d u c t i o n

GOAL i s a h i g h e r order language developed a t t h e NASA
Kennedy Space Center t o f u l f i l l a need f o r a s t a n d a r d ground
test language i n manned s p a c e . f l i g h t . T h i s language w i l l be
used by NASA and c o n t r a c t o r p e r s o n n e l t o write s o f t w a r e f o r
ground maintenance, checkout, and launch o f t h e Space S h u t t l e .
W / S i s a h i g h e r order language which w a s developed by
t h e NASA Johnson Space C e n t e r f o r t h e f l i g h t software which i s t o be
r e s i d e n t i n t h e Space S h u t t l e ' s onboard computers.
A need e x i s t s f o r a c a p a b i l i t y f o r running t e s t programs
w r i t t e n i n GOAL i n t h e onboard computers d u r i n g ground maintenance
and checkout f o r t h e Space S h u t t l e . T h e s e onboard computers w i l l
have a F l i g h t Computer Operating System (FCOS: which i s uniquely
designed t o be d r i v e n by a p p l i c a t i o n scrftware w r i t t e n i n HAL/S.
To provide a d i f f e r e n t FCOS, which can be d r i v e n by GOAL, is
n o t p r a c t i c a b l e (Ref. 1). Thus, t h e r e q u i r e m s n t for a GOAL t o
HAL/S t r a n s l a t i o n c a p a b i l i t y has a r i s e n .
The f e a s i b i l i t y and
approach for such a t r a n s l a t i o n w a s s t u d i e d i n a n e a r l i e r document
(Ref. 2). The f a v o r a b l e r e s u l t s of t h a t s t u d y formed t h e f o u n d a t i o n
and j u s t i f i c a t i o n f o r t h i s docxment, The GOALzto-HAL T r a n s l a t o r
Specification.

1.2

Genesis of GOAL

The development of GOAL w a s brought a b o u t by t h e need
f o r a s t a n d a r d t e s t language t o he used f o r maintenance,
refurbishment, checkout, and 1au:ich of t h e Space S h u t t l e .
Apollo e x p e r i e n c e had a l r e a d y p o v e n t h e v a l u e of computerautomated checkout pxoqrzms, w h i l e a t t h e s a m e time highl i g h t i n g t h e importance of e a r l y s o u r c e language c a p a b i l i t i e s .
ATOLL w a s such a language and was a p p l i e d t o S a t u r n V checkout
and launch.
A s t h e requirements of t h e S h u t t l e program unfolded,
i t w a s e v i d e n t t h a t a h i g h d e g r e e of checkout computer a u t o mation would be r e q u i r e d t o m e e t s c h e d u l e and cost o b j e c t i v e s .
Furthermore, t h e o p p o r t u n i t y e x i s t e d t o develop a h i g h o r d e r
language e a r l y i n t h e program so t h a t , f i m t h e beginning,
it w a s an i n t e g r a l p a r t of t h e system. Requirements
c o n t r a c t s w e r e l e t by KSC i n J u l y of 1970. I n May 1971,
a language requirements document w a s published ( K S C - T R - 1 1 1 ) .

C u r r e n t l y , t h r e e documents nave been published which d e f i n e
t h e language. These are t h e GOAL Overview Document, t h e Syntax
Diagrams Handbook (KSC-TR-1213) , and t h e GOAL Textbook (KSCTH-1228). A l s o , a GOAL compiler i s c u r r e n t l y being developed.
1

1.3

Genesis of HAL/S

The development D f HAL was s t i m u l a t e d by t h e same combinat i o n of Apollo e x p e r i e n c e and a n t i c i p a t e d S h u t t l e r e q u i r e m e n t s
t h a t s t i m u l a t e d GOAL, e x c e p t t h a t HAL i s o r i e n t e d towards t h e
onboard mission s o f t w a r e f o r manned s p a c e f l i g h t w i t h i t s g r e a t
emphasis on 1) t h e mathematical requirements of n a v i g a t i o n ,
guidance, and c o n t r o l and 2) t h e need for h i g h l y r e l i a b l e r e a l
t i m e c o n t r o l progl-ams. Apollo e x p e r i e n c e had shown t - h a t t h e
r e s o u r c e s needed t o program mission s o f t w a r e i n assembly language
i n a multi-prosram environment were e x c e s s i v e .

Development of H-9L began w i t h a c o n t r a c t l e t by J S C e a r l y
i n 1970. T h i s c o n t r a c t supported t h e g e n e r a t i o n of r e q u i r e m e n t s ,
a . s u r v e y of o t h e r languages, s y n t h e s i s of a new language, and
t h e b u i l d i n g of a HAL zompiler t o r u n on t h e IBM 360/75 a t t h e
J S C Real Time C o n t r o l Center. T h i s e f f o r t w a s augmented a y e a r
and one-half l a t e r by a J S C c o n t r a c t t o advance HAL t o a n o p e r a t i o n a :
s t a t u s . As a r e s u l t of t h i s l a s t c o n t r a c t , t h e HAL language w a s
ready when the d e c i s i o n t o s p e c i f y t h e onboard s o f t w a r e f o r
S h u t t l e came up, and HALIS, t h e S h u t t l e v e r s i o n , w a s chosen as
t h e language i n w h i c h m l i g h t s o f t w a r e w i l l be w r i t t e n .
1.4

Purpose of t h e S p e c i f i z a t i o n Document
T h i s document i s intended t o :

t r e a t t h e GOAL t o HAL/S t r a n s l a t i o n p r o c e s s a s a
complete s o f t w a r e system,

t o d e f i n e completely and d e f i n i t i v e l y a l l a s p e c t s

of t h e t r a n s l a t i o n p r o c e s s where t h e f a c t s are known
( t h e GOAL S p e c i f i c a t i o n , t h e HAL/S S p e c i f i c a t i o n , e t c . ) ,
and

t o i d e n t i f y , s e g r e g a t e , and d e f i n e i n concept and scopz
a l l remaining a s p e c t s of t h e t r a n s l a t i o n p r o c e s s where
t t e f a c t s a r e incomplete, i n t r a n s i t i o n , o r n o t known
( t h e Databank, FCOS, etc. )

.

1.5

Scope of t h e S p e c i f i c a t i o n Document

I t i s t h e o b j e c t i v e of t h i s document t h a t i t w i l l f o r m
t h e b a s i s f o r a n implementation of t h e T r a n s l a t o r once a h o s t
computing s y s t e m and a T r a n s l a t o r language have been d e s i g n a t e d .
Accordingly, i t i s n e c e s s a r y t h a t t h i s S p e c i f i c a t i o n go beyond t h e
mere mapping of GOAL s t a t e m e n t s i n t o HAL/S s t a t e m e n t s znd a r r i v e
a t a t e c h n i c a l s t r u c t u r e which can encompass a l l t h e powerful
GOAL f e a t u r e s of databank r e s o u r c e and c o n t r o l , c o n c u r r e n t program
e x e c u t i o n , and s o f t w a r e i n t e r r u p t s and many o t h e r f e a t u r e s .
2
Ih'TKm

*cTnrS~ ~ ~ ~ n R P O R A T
701
E DCONCORD

AVENUE

CAMBRIDGE, MASSACt ,I!Si-TTS 32 132 ( 2 17) c

,i

,

1.6

O u t l i n e of t h e S p e c i f i c a t i o n Document

The main body of t h e S p e c i f i c a t i o n b e g i n s by p r e s e n t i n g
t h e t e c h n i c a l approach i n t h e c r i t i c a l a r e a s of communication
w i t h t h e d a t a b a n k , s o f t w a r e i n t e r r u p t s , r e p e a t s , e t c . (See
S e c t i o n 3 . 0 DISCUSSION OF KEY TECHNICAL FEATURES). There t h e n
f o l l o w s a s e c t i o n devoted t o 1) s p e l l i n g o u t a s s u m p t i o n s t h a t
have been made f o r t h e t r a n s l a t i o n p r o c e s s and 2 ) s e t t i n g
f o r t h d e f i n i t i o n s and c o n v e n t i o n s a p p l i c a b l e t o t h e t r a n s l a t o r
i t s e l f (See S e c t i o n 4 . 0 ASSUNPTIONS AND DEFINITIONS).
The h e a r t
of t h e S p e c i f i c a t i o n i s p r e s e n t e d n e x t ( S e c t i o n 5.0 TRANSLATION
REQUIREMENTS). T h i s b e g i n s w i t h a p r e s e n t a t i o n of t h e o v e r a l l
t r a n s i a t o r s t r u c t u r e , f o l l o w e d by d c f i n i t i o n of v a r i o u s t r a n s l a t o r
s u b r o u t i n e s which have been found t o be u s e f u l .
The t r a n s l a t i o n
p r o c e s s i s t h e n d e f i n e d i n t e r m s o f a f i r s t or g l o b a l look a t
t h e GOAL s o u r c e (PASS 1 1 , f o l l o w e d by a s t a t e m e n t by s t a t e m e n t
t r a n s l a t i o n (PASS 2 ) of s p e c i f i c GOAL s o u r c e s t a t e m e n t s .
I n keeping
w i t h t h e s p e c i f i c t e c h n i c a l app’oach a d o p t e d i n t h i s S p e c i f i c a t i o n ,
it w a s d e c i d e d t h a t f l o w c h a r t s t y ~ l i lbe t h e b e s t means f o r
p r e s e n t i n g t h e p r o c e s s i n g of i n d i v i d u a l GOAL s t a t e m e n t s by t h e
translator.
Most s t s t e m e n t s i n v o l v e a l t e r n a t i v e s and a t e x t u a l
treatment was deemed v e r y i n a d e q u a t e compared w i t h t h e f l o w c h a r t
approach.
The i n t e r f a c e t o t h e FCOS t h a t r e s u l t s from t h e proposed
t e c h n i c a l approach t o t r a n s l a t i o n i s d i s c u s s e d next ( S e c t i o n
6.0 EXECUTIVE SUPPORT STRUCTURE). The l a s t sectior, d e a l s w i t h
r e l i a b l e implementation of t h e T r a n s l a t o r ( S e c t i o n 7.0
IMPLEMENTATION, V E R I F I C A T I O N , AND DOCUMENTATION REQUIREMENTS)
Appendix A p r e s e n t s t h e GOAL t o HAL MAPPING m a t e r i a l which
i l l u s t r a t e s t h e t r a n s l a t i o n process without g e t t i n g i n t o t h e
i n t r i c a t e d e t a i l s of i m p l e m e n t a t i o n .

.

THIS PAGE 1RTENTIOXAI.LY- LEFT S L A M .

2.0

APFLICABLE DOCUMENTS

2.1

GOAL Documents

--

G r o u n d Opcrat ions Aerospace Lanquagc (GOAL)
Diagrams Handbook, TR-1213, 16 April 1973,
NASA John F. Kennedy Space Center.

a)

-Syntax

b)

Ground Operations Aerospace Language (GOAL) Textbook,
TR-1228, 16 April 1973, NASA J o h n E'. Kennedy Space

I

_

Center.
2.2

HAL/S

Documents

Language Specification, 15 September 1973,
Intermetrics, Inc.

a)

H?&/S

b)

HAL/S

Language Forms, Rev. 1, 8 May 1973, Intermetrics,

Inc.
c)

-

H&/S-360
Coinpiler System Functional Specification,
13 J u l y 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

The;, are s e v e r a l t r a n s l a t i o n s i t u a t i o n s which can
be handled t o g e t h e r by a s i n g l e u n i f i e d s t r a t e g y
the
concept of a "GOAL b l a s t e r Prograxn* w r i t t e n i n HAL/S, pr*uced
by t h e t r a n s l a t o r program, and r e s p o n s i b l e for c o o r d i n a t i n g
all t h e HU/S blocks produced by t h e t r a n s l a t i o n process.
The s i t u a t i o n s which lead to u s e of this s t r a t e g y are s e v e r a l :

-

I

a)

GOAL has a 'TERqNATE SYSTEM" s t a t e m e n t which is
supposed t o c a u s e "complete GOAL a p p l i c a t i o n program
system shutdom'.
Thus, a means must be provided
to make its e f f e c t s g l o b a l t o all t r a n s l a t e d GOAL
modules a t e x e c u t i o n t i m e .

b)

GOAT, allows a "CONCUEREXTLY PERFORM PROGRAM" s t a t e m e n t
with n 3 r e s t r i c t i o n s on t h e number of such s t a t e m e n t s
r e f e r e n c i n g a s i n g l e PROGRAM and how many such c o n c u r r e n t
u s e s e x i s t s i m u l t a n e o u s l y off a single program module.
The t r a n s l a t o r s h a l l force t h e s i t u a t i o n whereby a program
can o n l y be c o n c u r r e n t l y performed by one p r o c e s s at a
time. i.e., i f A and B are c o n c u r r e n t programs, t h e n
A and B c a n n o t c o n c u r r e n t l y perform program C .
The
f i r s t s t a t e w e n t t o gai.1 access w i l l win t h e race. The
second s t a t e m e n t w i l l have to w a i t f o r t h e first to
finish.

c)

The s e t of t r a n s l a t e d GOAL programs have t h e i r own
i n t e r n a l system of a f t w a r e i n t e r r u p t s and other s i g n a l s ,
Which, for r e l i a b i l i t y , should be kept s e l f - c o n t a i n e d
to p r e v e n t unwanted i n t e r a c t i o n w i t h t h e o t h e r HAL/S
a p p l i c a t i o n s software.

d)

D a t a Bank i n f o r m a t i o n needs t o be i n s e r t e d jato the
t r a n s l a t e d program. T h i s i s c o n t a i n e d w i t h i n t h e GOAL
Master Prog-'am.

e)

GOAL System S u b r o u t i n e s can be employed by a l l GOAL
t r a n s l a t e d programs. These arc d e c l a r e d as HAL/S
Procedures a t t h e GMP l e v e l .

f)

s o f t w a r e i n t e r r u p t mechanism r e q u i r e s p r o c e s s i n g
e x t e r n a l t o a GOAL program.

. The

I n o r d e r to t r e a t these s i t u a t i o n s properly, a GOAL Master Program
s h a l l be provided, w i t h t h e f o l l o w i n g characteristics: F i g u r e s
3-1 and 3-2 i n d i c a t e t h e s t r u c t u r e of the GMP.
7

a)

When t h e GOAL system i s t o be i n i t i a t e d i n t h e
f l i g h t computer, it is t h e GOAL MASTER PROGRAM*
which is scheduled and executed:

b)

Esch GOAL Program which is to be ?art of t h e running
GOAL system w i l l become a s i n g l e HAL/S Procedure w i t h i n
the GOAL MASTER PROGRAM, n e s t e d a t the program l e v e l .
If the oFiginal-bOAL Program is s u b j e c t to m u l t i p l e
c o n c u r r e n t perform s t a t e m e n t s , then real t i m e
L t t r i b u t e s of EXCLUSIW w i l l be a p p l i e d i n order t o
assure no c o n f l i c t s .

c)

Each c o n c u r r e n t s t a t e m e n t w i l l g e n e r a t e a u n i q u e l y
named HAL/S task block n e s t e d a t t h e program l e v e l .
The e x e c u t a b l e a c t i o n C0-Y
w i l l c o n s i s t of a
SCHEDULE for t h e t a s k so ge,lo,rated.

d)

level, a Boolean array INT
is maintains. Thzs a r r a y carries the set of s o f t w a r e
i n t e r r u p t s a v a i l a b l e t o a l l t h e GOAL s y s t e m ' s blocks,
T h e a r r a y INTNUM, used C o r i n t e r r u p t communication, i s
also maintained.

-

A t t h e . G O A L MASTER PROGRAM

e) The Boolean a r r a y TERMSYS i n d i c a t e s which Goal p r o c e s s e s
have executed a TERMXNATE SYSTEM command.
a r r a y of data bank b u f f e r s NUMBER, DIMENSION, STATE,
TEXT, CONTROL are declared at the GMP level,

9)

%c!

g)

The GMP w i l l c o n t a i n a l l f u n c t i o n d e s i g n a t o r i n f o r m a t l o n
o r g a n i z e d so tha, the hAL/S procedure DATABANK c a n access
t h e a p p r o p r i a t e data by u s i n g t,?e f u n c t i o n d e s i g n a t o r
number FD as a n index. For example,

FD1

----.--C o n t r o l words used
-.--

by t h e HALIS

procedure DFTABANK

FD2

=I==

.
*

W r i t t e n here i n caps and w i t h u n d e r s c o r e s to conform t o HAL/S
requirements.
8

'YiEii:XTSiCS ! P X ' . ~ ~ O R A T E 701
D CONCORt) AVENUE

CAMBRIDGE. M A S S A C t G Z I Y : ; 02138 (617) C J i - y ,:ri

I-

=>

h

z
Y

Notes f o r F i g u r e 3-2:

PR, P N W and Pw

are d e f i n e d i n F i g u r e 5-1, p. 36.

INT and INTNUM a r e a r r a y s u t i l i z e d i n '-he p r o c e s s i n g of
software i n t e r r u p t s (See S e c t i o n 3.5, p. 2 1 ) .

-- - - - -

___

TERMSYS is used t o implement the TERMINATE SYSTEM Statement.
(See Flowchart 7 8 , p. S p L .

These are t h e 5 DATABANK B u f f e r Arrays d i s c u s s e d i n , S e c t i o n

3.3-6,

p.16.

 i s the name of t h e f i r s t Goal
Program i n t h e group b e i n g t r a n s l a t e d .

-

- - --

- --- - -

The implementation of c o n c u r r e n t p r o c e s s e s w i t h i n a HAL/S
program i s accomplished through t h e use of HAL/S TASK blocks.
Therefore, t h e T r a n s l a t o r w i l l g e T e r a t e an a p p r o p r i a t e HBL/S
TASK for every CONCURRENTLY PERFORM, VERIFY, o r RECORD
statement which appears i n a GOAL program. See S e c t i o n 5.1.2,
I t e m 3, and Concurrent Statement Flowchart (15)

I
I

--

8

----

.

FD and PN are t h e f u n c t i o n d e s i g n a t o r number and t h e p r o c e s s
number r e c e i v e d a s parameters by t h e procedure DATABANK. The,,
a t t r i b u t e of REENTRANT allows more t h a n one p r x e s s t o
execute "simultaneously" t h e procedure DATABANK.

8

I

I

Structure of the GOAL-MASTER PROGRAM (GMP)

Ficrure 3-2:

-

GOAL MASTER.-CROGRAM:

'-

I

--

-I

PROGRAM;

I'

DECLA'SE J J T ARRAY ()BOOLEAN I N I T I A L (OFF);

6-

DECLFtRE AJTNUM ARRAY ( < P R > ) I N T E G E R S I N G L E ;

--- G-:PROCEDURE

g o d pfiognam

G  : Procedure (C) A s s i g r , ();

-

'

-- --I

I

I

pp. 2 3 - 2 5 )

I

I
ACTIVE is t h e t o t a l number of i n t e r r u p t s s p e c i f i e d wiL!in
a GOAL program o r s u b r o u t i n e . I t i s determined i n P a s s i and 'I-

is a static value.

t

1

!

 i s the i n t e r r u p t f u n c t i o n d e s i g n a t o r number assoc i a t e d w i t h the K t h i n t e r r u p t .
These s t a t e m e n t s o r f u n c t i o n s are e l i m i n a t e d i f no WHEN
INTERRUPT s t a t e m e n t s appear i n t h e program o r s u b r o u t i n e .

I
I

I

- -1

I

-c

The GOAL REPEAT Statements r e q u i r e t h e s e d e c l a r a t i o n
s t a t e m e n t s . S e c t i o n 3 . 4 d e s c r i b e s t h e purpose of e a c h of
these v a r i a b l e s and how t h e y are used. T h e Procedure
FLUSH is used t o r e - i n i t i a l i z e nestedREPEAT groups
i f a GO TO s t a t e m e n t is encountered whicn causes e x e c u t i o n
o u t s i d e of an a c t i v a t e d REPEAT group. The d e c l a r a t i o n

I

s t a t e m e n t s , procedures, and f u n c t i o n s associated w i t h
.APEAT s t a t e m e n t s are encountered i n t r a n s l a t i n g t h e
propram.

1

I

I
I

I--I

-Dl

14
lYTCnMEiRlCS INCORPORATED 701 CONCORD AVENUE

CAMBRIDGE, MASSACHUSETTS 02138 (617) 661-184C

F i g u r e 3-3:

S t r u c t u r e of a Translated G o a l Program

- - - G-CGOAL NAME> PROCEDURE EXCLUSIVE
‘%:CLARE
ACTIVE INTEGER S I N G L E I N I T I A L ( < A C T I V E > )
I
- - - DECLARE XNVIRON ARRAY ( 3 , < A C T I V E > ) I N I T I A L ( < F D I (1)> ,
:

:

;

C T I V E ) > , 0, ..-, O , O , ... 0 ) ;
- -I DECLARE
-- < F D I ( AHEAD
ARRAY ( R S m a x ) INTEGER S I N G L E

,

1-

1

I

t

...  ) ;

I N I T I A L (,,

I

DECLARE T A I L ARRAY , R S m a x )

INTEGER

INITLAL ( < T A I L ( l ) > , < T A I L ( 2 ) > ,

I

..-

);

I

DECLARJ2 RPTCTR INTEGER S I N G L E ;

I

DECLARE RFTACT ARRAY (Rsmax) BOOLEAN I N I T I A L ( O F F ) ;

I

EECLARE SAVE ARRAY (NDL) ;
/* (NDL = number of dynamic n e s t i n g levels alloweL,)*/

I

- -7
I

I
I

I

I

DECLARE RPT INTEGER S I N G L E ;
DECLARE Rs INTEGER S I N G L E ;
DECLARE LOC INTEGER S I N G L E ;
DECLARE I INTEGER SINGLE;
fDECLAitZ
L
J 1iJTEGE.R S I N G L E ;
DZCLARE K INTEGER SINGLE;

I

4tuXenienh ubed

I
I

1-

--

and 0 t h W
~ t a a W c genehLtted
604 tempommy v & h .

[FLUSH : PROCEDURE ;

-[RPTCONT:

FUNCTION

BOOLEAN;

HANDLER: FUNCTION BOOLEAN;

[

G o d SaWemeutt;

Tm&d

IF I N T < P N > THEN I F HANDLER THEN GO TO DOCASE;

.

DOCASE: [

RETURN LABEL CASE: [

-

CLOSEG ;

15

FJTEZ!.’ETFi;CS I::E0RP37r-TF9

7C1 CCNCPYD AVFb!IJE

CA>.4BRIDGE.FAASSACHUSETTS 02138

(617) €61 - 1 4 4 3

3.3

CommunicatLon w i t h t h e Databank

I n o r d e r to provide t h e f e a t u r e s of f u n c t i o n d e s i g n a t o r s ,
as d e s c r i b e d i n t h e Goal T e x t , t h e following d e s i g n f e a t u r e s
have been i n c o r p o r a t e d i n t o the T r a n s l a t o r . F i g u r e 3-4 i n d i cates t h e v a r i o u s major f e a t u r e s .
A l l f u n c t i o n d e s i g n a t o r names are r e s o l v e d i n t o unique numbers d u r i n g Pass 1.

Function Designator number 0 i s r e s e r v e d f o r t h e
"Stop and R e s t a r t " d i s p l a y .
Function Designator 1 i s reserved for t h e i n t e r r u p t
service r o u t i n e s .
Function Designator 2 is r e s e r v e d f o r t h e system dev i c e referred t o i n t h e RECORD and OUTPUT EXCEPTION
statements

.

Any f u n c t i o n d e s i g n a t o r can be reached by t h e HAL/S
statement:

CALL DATABANK ( f u n c t i o n d e s i g n a t o r number,
process number) ;
DATABANK i s a procedure a t t h e GOAL MASTER PROGRAM l e v e l
which i s u n s p e c i f i e d a t t h i s t i m e w i t h r e s p e c t t5 i n t e r n a l
functioning. I t performs whatever f u n c t i o n i s s p e c i f i e d by
t h e f UnCtiGiI d e s i g n a t o r

.

A procesv i s d e f i n e d , f o r t h e purposes of t h i s Translator,
as any Goal t r a n s l a t e d program o r any t a s k created by the t r a n s l a t o r as a r e s u l t of a Goal Concurrefit s t a t e m e n t .

6)

Communication w i t h DATABANK o c c u r s through 5 DATABANK
b u f f e r a r r a y s d e c l a r e d a t t h e GOAL MASTER PROGRAM
level :

-

NUMBER

DIMENSION
STATE
TEXT
CONTROL

-

scalar
integer
boolean
character string
integer

These a r r a y s 3ct as a communication b u f f e r for data
transfer between Goal p r o c e s s e s and t h e DATABANK procedure. The l e n g t h o f t h e s e a r r a y s e q u a l s t h e maximum number of p r o c e s s e s . These a r r a y s are indexed

16
INTERMETRICS INCORPORATED 701 CONCORD AVENUE

CAMBRIDGE, FvlASSACHUSETTS 02138

(617) 6 ~ 1 - 1 8 4 0

DATABAXK BUFFERS (ONE

PER PROCESS)

NUMBER

DIMENSION
STAT E
J

4

1
e

3

I

01

I

e

Figure 3-4:

Function Desiqnator Communication
17

by the p r o c e s s number ( C P N > ) .
For example, Number 
is t h e DATABANK b u f f e r f o r numeric data dedicated t o
p r o c e s s number .
7)

3.4

The f u n c t i o n d e s i g n a t o r i n f o r m a t i o n used by t h e procedure DATABANK w i l l be assembled by t h e T r a n s l a t o r .

REPEAT Statements

Under t h e r e s t r i c t i o n of.:nc, overlapping repeat groups,
t h e T r a n s l a t o r s h a l l implement t h e f o l l o w i n g f e a t u r e s i n order
t o execute Goal REPEAT s t a t e m e n t s as s p e c i f i e d i n the Goal
Reference Manual.
1) The Repeat t r a n s l p t i o n p r o c e s s i s handled s e p a r a t e l y
f o r each Goal Program o r s u b r w t i n e .

2)

The f o l l o w i n g v a r i a b l e s are used i n t h e implementation.
RPT i s an i n t e g e r which records t h e dynamic n e s t -

i n g l e v e l of r e p e a t group e x e c u t i o n .
RS i s an i n t e g e r r e p r e s e n t i n g t h e Repeat statement number c u r r e n t l y b e i n g executed. RSMAX i s t h e
t o t a l number of r e p e a t s t a t e m e n t s i n t h e Goal
program o r s u b r o u t i n e being t r a n s l a t e d .
RPTACT i s an a r r a y of booleans of l e n g t h RSMAX.
Each b i t corresponds t o a Repeat s t a t e m e n t . I t
is set i f t h e Repeat s t a t e m e n t i s i n t h e p r o c e s s
of b e i n g executed. Many b i t s i n t h e a r r a y RPTACT
may be s e t s i m u l t a n e o u s l y due t o t h e p o s s i b i l i t y
of dynamic n e s t i n g of r e p e a t groups. Normal flow
through a group of s t a t e m e n t s may n o t be t h e r e s u l t
of a REPEAT command. Then RPTACT is not set.
SAVE i s an a r r a y used t o save t h e c u r r e n t v a l u e
o f RS when n e s t i n g of r e p e a t groups occur. This
a r r a y i s of l e n g t h NDL which i s t h e maximum level
of dynamic n e s t i n g allowr-?.

RPTCTR i s an a r r a y of r e p e a t c o u n t e r s .
Each
c o u n t e r i s associated w i t h a Repeat s t a t e m e n t .
HEAD is an array of s t e p numbers which i n d i c a t e

t h e s t e p number of t h e f i r s t s t a t e m e n t of t h e
r e p e a t group. HEAD i s indexed by RS t o f i n d t h e
s t a r t i n g l o c a t i o n o f t h e r e p e a t group.

18
INTERMETRICS INCORPORATED 701 CONCORD AVENUE

*

CAMBRIDGE, MASSACHUSETTS 02138 (617) 6b1-184C

g)

TAIL i s a n a r r a y of s t e p numbers a s s o c i a t e d w i t h
t h e l a s t s t a t e m e n t of a r e p e a t group. T A I L ( R S )
i s t h e l a s t GOAL s t a t e m e n t of t h e Repeat s t a t e ment RS

.

h)

RETURN LABEL : is t h e HAL/S s t a t e m e n t l a u e l
t o whizh conTrol i s t o be t r a n s f e r r e d a f t e r execut i o n of t h e repeat group i n i t i a t e d by Repeat
s t a t e m e n t RSN

.

i ) LOC is a t r a n s l a t o r declared v a r i a b l e used by t h e
f u n c t i o n FLUSH. The v a l u e of LOC is set eqlial t
t h e t a r g e t of t h e GO TO s t a t e m e n t when t h i s t a r g
i s o u t s i d e of t h e r e p e a t group. See floi.whart
GO TO ( 3 4 ) .

3)

Each Repeat s t a t e m e n t i s t r a n s l a t e d i n t o t h e following
i n - l i n e HAL/S code w i t . h RSN = r e p e a t number of t h e
r e p e a t i n s t r u c t i o n being t r a n s l a t e d and N = number of
i t e r a t i o n s . (See F i g u r e 5.2)

RPT = RPT 4- 1;

increment r e p e a t n e s t i n g depth

RPTACT = ON:

a c t i v e r e p e a t group

SAVERpT = RS:

.tave o l d r e p e a t s t a t e m e n t no.

RS

e s t a b l i s h new r e p e a t s t a t e m e n t

;

no.
RPTCTRRS = < N > ;

e s t a b l i s h no. of i t e r a t i o n s

20 TO HEADRS;

transfer control t o repeat
group

mrIjm-LABEL-< E N > :

r e t u r n t o t h i s label

restore o l d r e p e a t s t a t e m e n t no-

RS = SAVERpT:
RPT = Rer

4)

-

decrement r e p e a t n e s t i n g d e p t h

1;

A t t h e TAIL of each r e p e a t group there s h a l l be i n -

serted:
HEADRS :

--I---_------

REPEAT GROUP
TAILRS :

-------------

IF RPTACTRs = TRUE AND RPTCONT = TRUE TFIEN
/* RPT CXIT. is a HAL/S f u n c t i o n which
c o n t r o l s t h e e x e c u t i o n of t h e Repeat
graup.
(See Note 6 ) n e x t 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 p e r Goal program o r s u b r o u t i n e t r a n s l a t e d il.to
HAL/S there s h a l l be i n s e r t e d the f o l l o w i f i y s t a t e -

ments:

-

RETURN LABEL CASE: DO CASE RS;
I

GO TO RETURN-LABEL 1:

-

GO TO RETURN LABEL 2 ;
I

.

-

GO TO RETURN-LABEL  ;

6)

The RPTCONT f u n c t i o n call s h a l l c o n s i s t of t h e f o l -

lowing H U / S code:
RPTCONT: FUNCTION:
F@TCTRRS = RPTCTRRS

-

1; /*Decrements r e p e a t

c o u n t e r by 1*/
I F R P T C T S s = 0 THEN
DO;

RESET -TACTRS;
RETURN FA1LSE;
END ;
ELSE RETURN TIAJE;
CLOSE:

7)

The FLUSH procedure i s called wkenever a GO TO s t a t e m e n t
i s encountered w i t h i n a n a c t i v a t e d r e p e a t group snd
when t h e t a r g e t of the GO TO s t a t e m e n t i s o u t s i d e t h e
r e p e a t group. T h e FLUSH f u n c t i o n s h a l l c o n s i s t of t h e
following HAL/S s t a t e m e n t s :
FLUSH : PROCEDURE ;
BACK:

RPTCTRRS = 0 ;

RESET FU?TACTRS;
RS = SAVERpT;
RPT = RPT
I;
I F RPT = 0 THEN FETURN;

-

20
!NTERMETRICS INCORPORATED 701 CONCORD AVENUE

CAMBRIDGE, MASSACHUSETTS 02138 (617) 661-184(

-

-

IF NOT (HEADRS < LOC AND TAILRs > LOC)
THEK GO TO BACK;
ELSE RETURN;

CLOSE;
3.5

Software I ' n t e r r u p t s
GOAL soft\-ITS

i n t e r r u p t s p o s s e s s the f o l l o w i n g q u a l i t i e s :

1) An i n t e r r u p t may o n l y
Goal s t a t e m e n t .

$2

serviced a t t h e - e n d of a

2)

Every GOAL program anG siibzcctine p o s s e s s e s i t s own
i n t e r r u p t environment c r e a t e d by WHEN INTERRUPT ana
DISABLE s t a t e m e n t s .

3)

S u b r m t i n e s which a r e performed i n h e c r i t i c a l mode
ignore a l l i n t e r r u p t s .

4)

If e n a b l e d , an i n t e r r u p t may cause one or both of
the following actions t o occur:

a)

a s u b r o u t i n e may he performed

b)

control may be passed t o a specified step number. (GO TO or RETURN TO o p t i o n s )

-

I n o r d e r t o provide these f e a t u r e s i n the GOAL MASTER
PROGRAM, each t r a n s l a t e d GOAL program, and each t r a n z l a t e d
GOAL s u b r o u t i n e a r e Fmpitcted.
The following s t r u c t u r e is spec i f i e d f o r handling i n t e r r u p t s . F i g u r e 3-5 shows the o v e r a l l
i n forma tion flow.

-

-

1) A t the GOAL MASTER PROGRAM level t w o a r r a y s are declared.

a)

INT is an a r r a y of booleans i n d i c a t i n g that a n
i n t e r r u p t i s pending. Each G o a l program pos-

sesses o n e bit.
b)

2)

INTNUM i s an a r r a y of i n t e g e r s which i n d i c a t e
t h e number of t h e f u n c t i o n d e s i g n a t o r a s s o c i a t a d
with t h e penriiny h t e r m p t . There is one i n t e 5er €or 3ach GOAL program.

Function Desiqnator number one -.i i s r e s e r v e d to
provide all tha l o g i c n e c e s s a r y t o c o n t r o l interrupts.

1

INTERRUPT
F'JNCTION
DESIGNATOR

.

I

SNVIRON

ENABLE
E)ISABLE

RECOGNIZE
SAVE
JEs-

--

e

-

T'JNCTION
DESIGNATOR

a 1
(interrupt
servicing
routines)

J

I

INTERRUPT COi.¶MUNICATION
TABLE

PRCCESS
NUMBER

4
ACTIVE

Translator
Interface
Figure 3-5:

Interrupt Information F l o w

22
INTERMETRICS INCORPORATED 701 CONCORD AVENUE

9

CAMBRIDGE, l:l.:,Sitl

-

;;iiJ':i I i

.

:

-

Function d e s i g n a t o r 1 or F D ( 1 ) i s , i n a c t u a l i t y , a
series of procedures which can be c a l l e d v i a t h e
HAL/S procedure DATABAEK.
The f o l l o w i n g s e r v i c e s
are provided:
F D ( 1 ) m a i n t a i n s t h e enabled or disabled s t a t u s
of a l l t h e i n t e r r u p t s a s s o c i a t e d w i t h each GOAL
Program,

I t p r o v i d e s a s t a c k mechanism so t h a t t h e i n t e r r u p t s t a t u s may be PUSHED (saved and cleared) as

w e l l as POPPED ( r e s t o r e d ) .
The i n t e r r u p t c o n d i t i o n associated w i t h t h e v a r i ous i n t e r r u p t f u n c t i o n d e s i g n a t o r s are a l l commun i c a t e d t o F D I 1 ) . Depending upon the i n t e r r u p t
s t a t u s , associated w i t h t h e i n t e r r u p t , t h e a r r a y
I N T and INTNUM are w r i t t e n i n t o .

Any p r i o r i t y i s s u e associated w i t h i n t e r r u p t conf l i c t s i s r e s o l v e d by F D ( 1 ) .
Because i n t e r r u p t f u n c t i o n d e s i g n a t o r s are n o t
completely s p e c i f i e d i n t h e GOAL Reference Manual,
all t h e i n t e r r u p t mechanisms r e q u i r i n g d e f i n i t i o n
are p l a c e d w i t h i n F D ( 1).
3)

Each G o a l program and s u b r o u t i n e m a i n t a i n s i t s own

i n t e r r u p t environment i n a local two dimensional
a r r a y called ENVIRON.
c o n t a i n s the number of t h e Kth i n t e r r u p t f u n c t i o n d e s i g n a t o r used i n t h e program
or s u b r o u t i n e . The c o n t e n t s of ENVXRON ( 1 , K ) are
e s t a b l i s h e d i n PGSS 1 of the Translator and do
n o t change d u r i n g t h e l i f e of t h e t r a n s l a t e d program.
ENVIRON ( 1 , K )

ENVIRON ( 2 , H ) c o n t a i n s t h e number of t h e subr o u t i n e t o be performed when t h e Kth i n t e r r u p t
occurs. A 0 w i l l i n d i c a t e t h a t no s u b r o u t i n e i s
to be performed. The WHEN INTERR'WT s t a t e m e n t
c a u s e s ENVIRON ( 2 , K ) to be w r i t t e n in\to.

ENVIRON (3,K) c o n t a i n s t h e case number of t h e
GO TO s t a t e m e n t t o be executed d u r i n g t h e s e r v i c i n g of i n t e r r u p t K. A 0 i n d i c a t e s no GO TO o p t i o n
is p r e s e n t . The WHEN INTERRUPT s t a t e m e n t causes
ENVIRON (3,K) t o be w r i t t e n i n t o .

23

4)

The t r a n s l a t i o n of t h e WHEN INTERRUPT s t a t e m e n t will
c a u s e t h e i n t e r r u p t t o be a c t i v a t e d w i t h t h e followi n g HAL/S code, where  i s t h e i n t e r r u p t f u n c t i o n
d e s i g n a t o r a s s o c i a t e d w i t h t h e WHEN INTERRUPT
statement:

I F NOT C DO; /*not a c r i t i c a l s u b r o u t i n e * /

END ;

5)

D i s p b l i n g of a s p e c i f i e d i n t e r r u p t i s accomplished
bY
CONTROL, PN> =  ;
NUMBER = ;
CALL DATABANK (1, < P N > ) ;

6)

The s a v i n g and c l e a r i n g of the i n t e r r u p t s t a t u s assoc i a t e d w i t h a GOAL program is accomplished by
CONTROL< PN> =

 ) ;

7)

R e s t o r a t i o n of t h e i n t e r r u p t s t a t u s i s accomplished

by
CONTROL,pN,

a

;

CALL DATABANK (1, W N > ) ;
the end of every g o a l s t a t e m e n t the following is
inserted

8)

At

9)

HANDLER i s a t r a n s l a t o r d e f i n e d f u n c t i o n a s s o c i a t e d with
each program o r s u b r o u t i n e .
HANDLER:

TUNCTION BOOLEAN;

DO FOR I=1 TO ACTIVE;

24
INTERMETRICS INCORPORATED 701 CONCORD AVENUE

CAMBRIDGE, MASSACHUSETTS 02138

(61 7) 661-184C

I F ENVIRON ( l , I ) , = INTNUMCPN,
E L S E SIGNAL ERRORX;

THEN E X I T :

END;
CONTROL



< I N T BEING SERVICED>;

CALL DATABANK (1 I ) ;
DO CASE ENVIRON (2,I) E L S E ;
CALL

...

CALL

...

END;
I F ENVIRON (3,I) > 0 THEN RETURN TRUE; E L S E
RETURN FALSE;
CLOSE ;

1 0 ) A t the end of every translated GOAL program or sub-

routine (excluding those with no interrupt statements)

i s the following:
DOCASE:

LOC=O; CALL FLUSH;

DOCASE ENVIRON ( 3 , I ) E L S E ;
GO TO

...

TO

...

GO

END ;

/*

Resets appropriate
repeat counters */

THIS PAGE INTENTIONALLYLEFT BLANK.

26

INTERMETRICS INCORPORATED 701 CONCORD AVENUE

CAMBRIDGE, MASSACHUSETTS 02138 (617) 661-184C

4.0

DEFINITIONS AND ASSUMPTIONS

4.1

D e f i n i t i o n s and Notation

< > means s c b s t i t u t e t h e c o n t e n t s of.

For example:

where
IMPORTANT NOTE :

N

m = SAUL S
LI = INDEX

-

The Translator must s u b s t i t u t e
u n d e r s c o r e s f o r s p a c e s i n GOAL
source i d e n t i f i e r s .

then

-

= SAUL SDINDEX

(Kj means t h a t K is a v a r i a b l e of an element.
NAME(K)

Means t h a t NAME i s a f u n c t i o n of K.

For example,

Data = DK, = TABLEDK,

 =
See s u b r o u t i n e section 5.2 for n o t a t i o n s associated w i t h
CONVERT NUMERIC, CONVERT TIME, EVAL I N T NAME, EVAL ED, EVAL
NUM FORM, LIM FORM and @L
FORM.

-

’ ‘,
4.2

-

- -

-

-

-

I n t h e F l o w c h a r t s , GOAL S o u r c e i n p u t is i n d i c a t e d by
whereas HAL/S Source output is i n d i c a t e d by ‘I

”.

Assumptions

4.2.1 O v e r a l l Scope

a)

Output of t h e T r a n s l a t o r ( R e f e r e n c e : GOAL-to-HAL
T r a n s l a t o r F i n a l Report, S e c t i o n 2 . 2 . l a , Page 2-15)

27
JTERh”ETRICS It\iCZ?:. The I , ' i n t h e RECORD s t a t e m e n t w i l l be passed t o
t h e a p p r o p r i a t e f u n c t i o n d e s i g n a t o r f o r i n t e r p r e t a t i o n as a
Line Feed o r o t h e r f o r m a t t i n g a c t i o n c o n s i s t e n t w i t h t h e device
b e i n g addressed.
1)

Assumptions Concerning P r e s e n t Value of (PVO)

*

T h e number of elements i n t h e f i r s t E x t e r n a l Designator
must e q u a l t h e number of elements i n t h e second
E x t e r n a l Designator.

*

One E x t e r n a l Designator may be a Table name, the other
may be a l i s t of Function Designators.

*

I n o r d e r f o r t h e PVO t o t r a n s f e r data from a s e n d e r
t o a r e c e i v e r , t h e activate b i t s of both s e n d e r and
r e c e i v e r must be 1.

I l l e g a l GOAL:
Send PVO < F D 1 > TO , ;
Send PVO < F D 1 > ,  TO :

31
ITER!.'ETRiCS li:C@F'?OFIATED 701 COFlCOiiC h'lCi~4UE CAI,:ZR!JGE, M I SSACHUSETTS 02138 (617) €61 -1L40

Legal GOAL:
SEND ALPHA FUNCTIONS TO < F D l > ,
, ;
(Table ALPHA must have 3 rows)
4.2.3 Groune-Based O p e r a t i n g System (GBOS)
a)

GBOS Support Services (Reference:

None)

During run-time, t h e GBOS may b e c a l l e d upon t o s u p p o r t
t h e f l i g h t computer w i t h services r e q u i r i n g t h e downlink of
d a t a t o C R T ' s and p r i n t e r s c o n t r o l l e d on t h e ground. The
d e t a i l s of a c c e s s i n g ground-based p e r i p h e r a l equipment from
t h e f l i g h t computer i s e x t e r n a l t o t h e GOAL-HAL/S T r a n s l a t o r .
The f l i g h t computer i n t e r f a c e i s handled through an a p p r o p r i a t e
function designator.
4.2.4

a)

Undefined

FEEDBACK LOOPS (Reference: GOAL-to-HAL T r a n s l a t - o n
F i n a l Report, S e c t i o n 2.1.4, Page 2-i4)

The GOAL syr,t,ax Loops p r e s e n t l y have l i m i t * : t i o n s d e s i g n a t e d
by l e t t e r symbols. TIACSG,;.mbols are s m a - . i z e d i n t h e feedback
letters i n t h e GOAL Syntax D i a 7 - a m s naIruoook, NASA/KSC Document
TR-1213, d a t e d 16 A p r i l , 1973. Values have n o t y e t been a s s i g n e d
t o t h e s e l e t t e r symbols. T e n t a t i v e l y , the GOAL-to-HAL
T r a n s l a t o r c o u l d be designed t o f l a g an error i f t h e number
of e x e c u t i o n s of t h e loop exceeds t h e l e t t e r . A t a l a t e r t i m e ,
t h e l e t t e r would have t o b e s p e c i f i e d .

32
INTERMETRICS INCORDORATED 701 C O N C ~ R U
AVENUE

CAMBRIDGE,MASSACHUSETTS02138 (617) 661-1840

5.0

TRANSLATION REQUIREMENTS

5.1

S t r u c t u r e of t h e T r a n s l a t o r

5.1.1 I n t r o d u c t i o n
The implementation of t h e t r a n s l a t o r mal- u l t i m a t e l y
c o n s i s t s of one o r many p a s s e s through t h e GOAL s o u r c e code.
The a c t u a l number of passes i s a m a t t e r of d e t a i l e d d e s i g n of
the Translator for efficiency.
I n o r d e r t o i s o l a t e a l l t h e f u n c t i o n s involved i n t h e
T r a n s l a t o r , a conceptual d i v i s i o n i n t o t”7o p a s s e s w i l l be made.
T h i s i s done mainly for t h e purpose of a c h i e v i n g c l a r i t y i n
t h i s s p e c i f i c a t i o n . Much of t h e e f f o r t expended i n one pass of
t h e T r a n s l a t o r c o u l d j u s t as w e l l be accomplished i n a n o t h e r
pass. Some freedom to choose s h o u l d be a v a i l a b l e t o t h e implementation stage.

Conceptually, t h e T r a n s l a t o r c o n s i s t s of t w o s e q u e n t i a l
p r o c e s s i n g s e c t i o n s c a l l e d PASS 1 and PASS 2 and a f i n a l Output
Processor which g e n e r a t e s t h e GOAL MASTBR P R O G W and o r g a n i z e s
t h e t r a n s l a t e d s t a t e m e n t s i n an a p p r o p r i a r e format.
T h i s form a t i s determined by t h e o u t p u t d e v i c e used by t h e machine i n
which HAL/S compilation is t o t a k e p l a c e .
The segregation of f u n c t i o n s between PASS 2 and Output
P r o c e s s o r i s a b i t a r b i t r a r y , b u t i t w a s done i n order t o make
t h e T r a n s l a t o r more modular and p l a c e any machine dependent
( t h e machine i n w h i c h t h e compiler i s t o run) f e a t u r e s i n t h e
OWput Processor.
5.1.2

PASS 1

The f c l l o w i n g o p e r a t i o n s s h a l l be performed i n Pass 1:
1)

Prozess.GOAL D e c l a r a t i o n s

A l l GOAL D e c l a r a t i o n s t a t e m e n t s s h a l l be p r o c e s s e d i n
o r d e r to p l a c e i n t o t h e T r a n s l a t o r ’ s symbol t a b l e t h e f o l l o w i n g
information:

a)

For s i n g l e element v a r i a b l e s
TYPE

where  i s t h e name c . t h e v a r i a b l e as it appears
i n t h e GOAL d e c l a r a t i o n s c a t e s e n t .  TYPE can
assume one of f o u r v a l u e s :
0
1
2

3

- Numeric d a t a
- Quantity data
- S t a t e data
-

Text d a t a

For l i s t d e c l a r a t i o n s
< L I S T N ~ > T Y P E= 0 , 1 , 2 , 3 as f o r s i n g l e elements
 = l e n g t h of t h e l i s t as described i n t h e
GOAL d e c l a r a t i o n s t a t e m e n t .

For t a b l e declarations
TYPE = 0,1,2,3 as w i t h s i n g l e elements.

TYPE

= This i s an a r r a y of column names as
declared i n t h e GOAL d e c l a r a t i o n stacement. T h i s
a r r a y i s an o p t i o n a l f e a t u r e of t h e GOAL declarat i o n an(- consequently may n o t appear i n t h e synlbol
table.

-C

CS = Tkis i s t h e column s i z e of t h e t a b l e

as declared i n t h e GOAL d e c l a r a t i o n s t a t e m e n t .
RS = T h i s i s t h e row s i z e of t h e tab:?
declared i n t h e GOAL d e c l a r a t i o n s t a t t c s n t .

as

The a c t u a l g e n e r a t i o n of t h e a p p r o p r i a t e HAL/:? d e c l a r a t i o n
s t a t e m e n t s , 23 preser,ted i n flow c h a r t s , can e i t h e r be performed
i n P a s s 1 o r i n Pass 2. T h i s i s implementation dependent &-ad
iloes n o t impact t h e f i n a l o u t p u t of t h e T r a n s l a t o r .
2)

S t e p E.rumber Resolution

Pass 1 w i l l a s s i g n s t e p numbers t o a l l GOAL statemer.ts i n
s e q u e n t i a l order. When Pass 2 p r o c e s s e s t h e GOAL s t a t e m e n t s ,
a l l s t a t e m e n t s w i l l p o s s e s s s t e p n m b e r s . Pass 1 w i l l s u b s t i t u t e
anv GOAL s o u r c e s t e p numbers w i t h t h e a p p r o p r i a t e t r a n s l a t o r
s u p p l i e d s t e p numbers.

3)

Assign Process Number (PN)

A p r o c e s s i s d e f i n e d as any GOAL ?rogram or HAL/S gene r a t e d Task (created by a Concurrently V e r i f y , C o n c u r r e n t l y Record o r Concurrently Perform s t a t e m e n t ) .

Pass 1 w i l l a s s i g n a p r o c e s s n m b e r (PN) t o each process.
The maximum number of p r o c e s s e s (PNmax) t ? q ~ ~t hl os number of
GOAL programs p l u s t h e k o t a l number of concurrent; s t a t e m e n t s

34
INTERMETRICS INCORPORATED 701 SONCORD AVENUE

CAM6;3IDGE, MASSACHUSETTS 02138

(617) 661-1840

which zppi'ar i n a l l t h e Goal Programs being t r a n s l a t e d . A
Process Array w i l l be generated for u s e by Pass 2 . The o r g a n i z a t i o n of t h i s a r r a y is shown i n F i g u r e 5-1.
A l l GOAL programs are a s s i g n e d process n w i e r s f i r s t , f o l lowed by Concurrently V e r i f y , R e c o r c ! 2nd Perform s t a t e m e n t s .
The Conctrrent1.y Perform s t a t e m e n t s are p l a c z d l a s t i n t h i s
a r r a y so t h a t t h e numbers PR, PNmax, and Pmax ccn be d i f f e r e n t i a t e d . These numbers are l a t e r used i n t h e c r e a t i o n o f d e c l a r a t i o n s t a t e m e n t s i n t h e GOAL-.h2ASTER-PROGRAM.

The p r o c e s s a r r a y i s u t i l i z e d many p l a c e s i n Pass 2.
For convenience t h e t a s k n u i i e r associated w i t h each
c o n c u r r e n t s t a t e m e n t will be made e q u i v a l e n t t o t h e
p r o c e s s number which appears i n the process array.

Whenever  i s i n d i c a t e d ir, a Pass 2 f l o w c h a r t ,
t h c r; >cess number associated w i t h t h e GOAL p r o c e s s
b e i n g t r a n s l a t e d (as i n d i c a t e d i n t h e process a r r a y )
w i l l be used.
RELEASE s t a t e n e ~ t srequire the t s s c c i a t i o n of a step
number i n a p r o g r a n w i t h t h e t a s k nane. The t a s k name
i s g e n e r a t e d by c o n c a t e n a t i n g t h e p r o c e s s number assoc i a t e d w i t h t h e step number w i t h the letters TASK,
i.e., T A S K .

I n Pass 2 , when t a s k s are g e n e r a t e d by c o n c u r r e n t
s t a t e m e n t s t h e t a s k number ( p r o c e s s number) is o b t a i n e d
f r o m t h e process array.
41

? . c pa t S t a tenen t

Ana l y s i s

I n o r d e r t o g e n e r a t e t h e a p p r o p r i a t e HAL/S code associated
w i t h Reseat S t a t e m e n t s the following i n f o r m a t i o n must be g a t h e r e d
This is
i n Pass 1 and p l a c e d i n t h e Repezt Array (Figure 5 - 2 ) .
done f o r each GOAL program or s u b r o u t i n e :
a)

Each r e p e a t s t a t e m e n t is assigned a number (RSN) according t o t h ? order i n which t h e y are processed.
S M A X e q u a l s t h e number of r e p e a t s t a t e m e n t s .

b)

The r e p e a t s t a t e n e n t s t e p number (e.g.,
used f o r i d e n t i f i c a t i o n purposes.

c)

Associated w i t h each Repeat s t a t e m e n t is t h e step
number of t h e f i r s t GOAL s t a t e m e n t of the r e p e a t
g i x p . Tnrs is piaceli in t h s SB~*LZZ ::ZaJ.

ste2 5 ) i s

Process Array

Figure 5-1:

Identifiers

-

Name of F i r s t G o a l program
Second Goal Program
L a s t Goal Program

Program name and s t e p number associated
with f i r s t Concurrently Verify statement
Program number and s t e p number associated w i t h second Concurrently V e r i f y
stztement
0
0

0

w i t h l a s t Concurrently V e r i f y s t a t e m e n t
Program name and s t e p Dumber associated
w i t h f i r s t Concurrently Record statement
Program name and s t e p number associated
with second Concurrently R e c o r d statement

.

with l a s t Concurrently Record s t a t e m e n t

Program name and s t e p numbt3r asemiated
Concurrently Perform statement
Program name and s t e p number associated
with second Concurrently Perform statement
v i i t h first

0

0

0

Program name and s t e p number associated
with l a s t Concurrently Perform statement

PR
PV
PREC
PPER

= number of
= number of
= number of
= number of

g o a l programs
concurrently v e r i f y s t a t e m e n t s
c o n c u r r e n t l y record s t a t e m e n t s
c o n c u r r e n t l y perform s t a t e m e n t s

36
INTERMETfiICS INCORPORATED 701 CONCOAO AVENUE

CAMBH;DGE, bASSACttLISETTS 02138

(617) 661 -1841

Figure 5-2:

REPEAT Array

R e pe a t S t aterne nt N umbe r

-

HEAD

TAIL

Step-19

1

Step 5

Step-7

2

Step -12

Step -103

. s tep-10

3*

3

RSMAX

RSMAX = number of repeat statements within the Goal program

or subroutine being translated.

*

I n the c a s e of a REPEAT group containing one statement
HEAD and TAIL refer t o t h e same statement number.

d)

Associated w i t h each Repeat s t a t e m e n t i s i h e s t e p
number of t h e l a s t Goal s t a t e m e n t i n t h e r e p e a t
group. T h i s i s placed i n column TAIL.

The following d e c l a r a t i o n s are created and are t o be i n corporated i n t o the t r a n s l a t i o n of t h e GOAL program or GOAL
subroutine.
DECLARE HEAD ARRAY (RSmax) INTEGER SINGLE

... cHead(RSmax)>);
DECLARE TAIL ARRAY (RSmax) INTEGE!? SINGLE
) ;
I N I T I A L ( , c T A I L ( 2 ) > , .
INITIAL ( < H e a d ( l ) > , cHead(2)>,

DECLARE RPTCTR INTEGER S I N G L E :
DECLARE RPTACT ARRAY (RSmax) BOOLEAN
I N I T I A L (OFF);
DECLARE SAVE ARRAY ( N D L ) ;

(NDL = number of dynamic n e s t i n g levels allowed]
DECLARE RPT INTEGER SINGLE;

DECLARE Rs INTEGER S I N G L E ;

HE%

and TAILK are t h e Kth

e)

SI

e n t r i e s i n the r e p e a t a r r a y .

If no Repeat s t a t e m e n t s are encountered i n the
program or a s u b r o u t i n e being t r a n s l a t e d , a f l a g is
set so t h a t a l l Repeat Mechanisms w i l l be e l i m i n a t e d
i n Pass 2.

Replace

A l l the Replace s t a t e m e n t s encountered i n t h e GOAL source
are executed i n Pass 1 p r i o r t o code g e n e r a t i o n i n Pass 2.

6)

Macros

A l l macros are expanded i n both Pass 1 and Pass 2 . The
c o n t e n t s of t h e expanded macros are processed i d e n t i c a l l y t o
o t h e r Goal s t a t e m e n t s .

7)

Interrupts

I n order t o g e n e r a t e the a p p r o p r i a t e code and data to
handle software i n t e r r u p t s t h e following a c t i o n must b e performed i n Pass 1. These actions are performed for each GOAL
program and subroutine.

38
INTERMETRICS INCORPORATED 701 CONCORD AVENUE

CAMBRIDGE. hlASSACHUSETTS 02138 (617) 661-1840

i n t e r r u p t number ( I N ) i s a s s i g n e d t o each i n t e r r u p t
f u n c t i o n d e s i g n a t o r encountered i n t h e programmer
s u b r o u t i n e . The l i s t of i n t e r r u p t f u n c t i o n designators i s determined by a n a l y z i n g a l l t h e WHEN INTERRUPT
s t a t e m e n t s encountered. The i n t e r r u p t numbers are
a s s i g n e d on a f i r s t come, f i r s t s e r v e d b a s i s . The
v a r i a b l e ACTIVE w i l l c o n t a i n t h e t o t a l number of i n t e r r u p t s used i n t h e program o r s u b r o u t i n e b e i n g processed.
Ar.

A l i s t of aJ.1 s u b r o u t i n e s r e f e r e n c e d i n t h e WHEN
INTERRUPT s t a t e m e n t i s assembled.
A s u b r o u t i n e number, S N , i s a s s i g n e d t o each s u b r o u t i n e on a f i r s t
come, f i r s t served basis.
A l i s t of a l l t h e GO TO or RETURN TO s t e p numbers i s
assembled and a case number ( C N ) i s a s s i g n e d t o each
case.
The a r r a y s I N , SN, CN w i l l be used i n t r a n s l a t i n g
WHEN INTERRUPT s t a t e m e n t s a s w e l l as i n s y n t h e s i z i n g
t h e f i n a l s t r u c t u r e of each GOAL program or s u b r o u t i n e .

The followirlg d e c l a r a t i o n s t a t e m e n t s are created by
Pass 1 and e n t e r e d a t t h e beginning of t h e t r a n s l a t e d

GOAL program o r s u b r o u t i n e .
DECLARE ENVIRON ARRAY (3, < a c t i v e > ) INTEGER

< F D I ( K ) > is t h e number of t h e f u n c t i o n d e s i g n a t o r
associated w i t h t h e Kth i n t e r r u p t .
DECLARE ACTIVE INTEGER S I N G L E I N I T I A L

() ;

must be g e n e r a t e d which relates t h e step n u ber of t h e WHEN INTERRUPT Statement t o t h e i n t e r r u p t
f u n c t i o n d e s i g n a t o r number. T h i s list is used i n
t r a n s l a t i n g the DISABLE s t a t e m e n t i n Pass 2.
A list

If no WHEN INTERRUPT s t a t e m e n t s are encountered by
Pass 1 i n a program or s u b r o u t i n e , t h e n a f l a g i s s e t
i n t h e t r a n s l a t o r so t h a t a l l i n t e r r u p t mechanisms
are e l i m i n a t e d i n t h e code g e n e r a t i o n p a r t of Pass 2 .

8)

Function D e s i g n a t o r s , E x t e r n a l Designators and t h e Databank

I n order t o provide a p r o p e r communication t o databank i n formation the f o l l o w i n g a c t i o n s are performed by P c s s 1:
a)

A l l t h e f u n c t i o n d e s i y a t o r s r e f e r e n c e d i n the GOAL
s o u r c e b e i n g compiled are gathered. T h i s i n c l u d e s
a l l GOAL programs and s u b r o u t i n e s i n t h e GOAL Transl a t i o n s u b m i t t a l . Each f u n c t i o n d e s i g n a t o r i s a s s i g n e d

a f u n c t i o n d e s i g n a t o r number on a f i r s t - e n c o u n t e r e d
basis.
b)

Every t i m e an e x t e r n a l d e s i g n a t o r i s e n c o m t e r e d
which c o n s i s t s of a grouping of f u n c t i o n d e s i g n a t o r s
(rather t h a n a t a b l e name) t h e a r r a y of f u n c t i o n
d e s i g n a t o r numbers (AJ?D) i s declared
DECLARE AFD ARRAY ( < W A X > ) INTEGER SINGLE
INITIAL ( G ' D ( l ) > , < F D ( 2 ) > ,
);

...

where < F D ( K ) > is t h e Km f u n c t i o n d e s i g n a t o r number
encountered i n t h e e x t e r n a l d e s i g n a t o r .
 i s t h e number of f u n c t i o n d e s i g n a t o r s i n t h e
e x t e ma1 des i p a t o r

.

 i s t h e number of t h e e x t e r n a l d e s i g n a t o r a s s i g n e d
on a f i r s t come basis.
c)

9)

The l i s t of f u n c t i o n d e s i g n a t o r numbers gathered i n
Pass 1 i s s u f f i c i e n t inforination t o extract from the
ground based d a t a bank a l l t h e i n f o r m a t i o n r e q u i r e d
f o r t h e f l i g h t machine. T h i s p r o c e s s w i l l be
performed by t h e T r a n s l a t o r .

GOAL Comments

A l l t h e GOAL comments a p p e a r i n g w i t h i n a GOAL s t a t e m e n t
w i l l be collected by P a s s 1, and i n s e r t e d i n t o t h e GOAL Source
a f t e r t h e semicolon (:I of t h e GOAL s t a t e m e n t . The t r a n s l a t e d
GOAL comments w i l l t h e n be handled according t o the r u l e s o f
t h e HAL/S o u t p u t write:.

40

INTERMETRICS INCORPORATED 701 CONCORD AVENUE
9

9

CAMBRIDGE, MASSACHUSETTS 92138

(617) 661-1840

5.2
5.2.1

T r a n s l a t e r Subroutines
CONVERT-NUMERIC

The CONVERT NUMERIC s u b r o u t i n e s h a l l t a k e a GOAL number
or a GOAL number p a t t e r n and c o n v e r t it t o s i n g l e p r e c i s i o n
format. The size of t h e number p a t t e r n ( B I N , OCT, HEX), s h a l l
be such as t o f i t i n t o t h e f r a c t i o n p o r t i o n of t h e i l s a t i n g
p o i n t format w i t h o u t any loss of information. T h i s r o u t i n e s h a l l
r e t u r n t h e r e s u l t a s the T r a n s l a t o r variable .

5.2.2

-

CONVERT TIME

T h i s is a procedure which a c c e p t s TIME VALUE and Returns :
TIM

= number (e.g.8

3)

or
name (e.g., ALPHA)
The l i t e r a l time v a l u e r e t u r n e d i s c o n v e r t e d i n t o a HAL/S
scalar i n u n i t s of seconds o r other FCOS d e f i n e d u n i t Of t i m e -

5.2.3

- -

EVAL I N T NAME

The T r a n s l a t o r shall p r o v i d e a s u b r o u t i n e called EVAL INTNAME which s h a l l a c c e p t t h e GOAL i n t e r n a l name and r e t u r n the
p a r x n e t e r s NAME, DATA, DIM, ACT, w, and T as d e f i n e d i n the
c L r t below.

F
Parameter

Single
Name

NAME

List (1)


DATA
DIM

<->DIM

ACT
KMAX

1

1

T

0

0

1

41

l 2

Notes:
L I i s t h e l i s t index.

I t can e i t h e r be a n i n t e g e r (e.g.,
or an alphanumeric name (e.g., K)

R I i s t h e t a b l e row index.
alphanumeric name.

.

3)

I t c a n e i t h e r be a n i n t e g e r o r an

C I i s t h e t a b l e column index.

The column name i s converted
t o a column number by s e a r c h i n g t h e a r r a y  C
c r e a t e d i n P a s s 1.
A degeherate table of 1 r o w w i l l be r e t u r n e d w i t h T = l , DATA=
Dl,' ACT=A1, KMAX=l.

I f TABLENAME i s n o t s p e c i f i e d t h e n t h e tablename p r e v i o u s l y
d e f i n e d i n the s t a t e m e n t being t r a n s l a t e d i s used.
KMAX = number of elements i n i n t e r n a l name.
T = Tag, i d e n t i f y i n g t h e cases shown on t h e p r e v i o u s 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 T K as defined

in the table below.

Array of Function Designators

Table Name

1

0

Array of function designators
AJ?D(K) = AF’D
K
KMAX

length of array

RS


!rN

Pass 1 will generate .the
following declaration
DECLARE AE’D ARRAY INTEGER;

Where N = a unique external designator
identification number assigned in Pass
1.

5.2.5

- -

EXAL NUM FORM

The T r a n s l a t o r s h a l l i n c l u d e a s u b r o u t i n e d e s i g n a t e d
T h i s s u b r o u t i n e s h a l l g e n e r a t e a HAL/S e q u i v a l e n t
numeric Formula. EVAL NUM FORM s h a l l :
EVAL NUM FORM.

- -

1) Return N F ( K ) = Numeric Formula
The index K i s u5,ltd i f t h e numeric formula c o n t a i n s

t a b l e names as v a r i a b l e s . I n t h i s case, K i s used
t o i n d e x down t h e rows of table.

For example, i f A and B are t a b l e names i n GOAL,
t h e GOAL numeric formula:
(A) I- (B) + 1;
would hecome t h e HAL/F wmeric formula:

mL/S will perform an element by element a d d i t i o n i f
AAK and JAK are True.

2)

Return TNA which i s a n a r r a y of table names used i n t h e
numeric formulae.
Example:

= jth x t i v a t i o n t i t of t h e Kth table na
j
Return LMAX = l e n g t h of TNA a r r a y . A l l q u a n t i t y data
and number d a t a i s assumed t o be s i n g l c p r e c i s i o n
floating point.
A

3)

4)

Return T , which i s a c o n t r o l f l a g .
T = 0 , i f no table names are i n t h e formula.
T = 1, i f t h e r e are table names i n t h e formula.

4 4'

5.2.6

-

LIM FORM

The T r a n s l a t o r s h a l l c o n t a i n a s u b r o u t i n e called
LIM FORM which a c c e p t s t h e GOAL l i m i t f o r m u l a , w i t h o u t t h e
o p t z o n a l i n t e r n a l name.
The i n t e r n a l name, i f n e c e s s a r y , w i l l
be e v a l u a t e d s e p a r a t e l y .
The f o l l o w i n g i t e m s are r e t u r n e d by
LIM F O W t o t h e caller.

-

1) Lower L i m i t I n f o r m a t i o n

If a n i n t e r n a l name i s i n d i c a t e d t h e EVAL I N T NAME
i s c a l l e d and t h e f o l l o w i n g parameters are r e z u r n e d .
U T

=



LLNAME

=



LLDATA

=



. LLACT

=



A number w i l l

LLT
LLDATA

=

return:

0

= 

A Quantity w i l l return:

LLT
LLDATA

= 0
= 

A l l of t h e above p a r a m e t e r s a r e c h a r a c t e r s t r i n g s
be used by t h e T r a n s l a t o r .

2)

Upper L i m i t I n f o r m a t i o n
T h i s is evaluated s i m i l a r t o t h e iower l i m i t .
f o l l o w i n g p a r a m e t e r s are r e t u r n e d :
ULT

= 

ULNAME

= 

ULDATA

= 

ULACT

= 

number w i l l r e t u r n :
ULT = 0
ULDATA = 
A Quantity w i l l return:
ULT = 0
ULDATA = < Q u a n t i t y value>

A

45
iTFR:.'El !:ICs ".TGF?R3,"YTE3

701 CC!,:?Cn3 t'5'.'EY!9C

*

C *,:

,

.

7.'

The

to

31

LF = 'OR'

i f the Not o p t i o n is used

'AND' if t h e N o t o p t i o n i s n o t used.
Lower and Upper l i m i t i n f o r m a t i o n i s r e v e r s e d for t h e
Not o p t i o n .
4)

'

EXDATA = 'NUMDER,pN,

T h i s is used o n l y when e x t e r n a l d e s i g n a t o r s are employed
i n c o n j u n c t i o n w i t h t h e l i m i t formi-la.
5.2.7

-

REL FORM

The T r a n s l a t o r s h a l l c o n t a i n a s u b r o u t i n e called REL FORM
which a c c e p t s t h e GOAL r e l a t i o n a l formula w i t h o u t t h e o p t i o n a l
i n t e r n a l name. The i n t e r n a l name, i f n e c e s s a r y , w i l l be e v a l u a t e d
s e p a r a t e l y . The f o l l o w i n g i t e m s are r e t u r n e d by REL FaFU-4.

-

1) T h e r e l a t i o n

RF which is either =,>,
2)

RT = 0 s i n g l e ni

RNAME

RT

<,

2,

f

o r type:

3

= number, converted number p a t t e r n o r
q u a n t i t y v a l u e , s i n g l e name, < L I S T NAME>< R I > < C I >
RAZT (K) = A,RI,

RT

= 2: REAME(K) = cTABLENAME>~, 

RACT(K) = AK
KMPX
3)

= RS

EXDATA = 'NUMBER,pN,

I

, STATE *
''*"

S

OUTPUT HALISZ

0

* l t X T < p ~ > ~CDATQ>I"

1

"IF

2

"DO FOR J * 1 TO OMAX>z
I F 
THEN 00 I
l € X T c p ~ >~ c O A T A ( J ~ > ~

ACT THEN DO;
TEXT<~N> 1 < DATA>r

.

b

-

"

-

A

-,
OUlPW HALlS 1
"CALL DATABANK
M V ..);"

(
J

-

J

S

OUTPUT d A L l S 8

0

i

NEXT
0 4 4 K 1 IO1 1

47

I

"ENDS"

2

"ENOs€NDi*

PRESCNT VAL'JC OF (YVO) SUIIKUUTINL

I

I "CALL DATABANK :RK. DIM,
INTEGER
SINGLE ;'

VALUE;.):

D€CC&R€ MM,
INlECER S I F I C X
I N l T l A l 1 COUANTITY
DIMENSION>); "

1

CIIAKT 1 O f 2

b

SIMPLL DLCI.ARATION S T A l l LILNTS (17)

, (CONT.)

i
I

Q-,

c

I

MnWT HALlS
" DECLARE

*

I

NEXT

NOTE 1:

< NO. CHAR. > 1 NO. OF
CHARACTFRS IN 1HE
1EXI COMTLNT.

D"

NOlE ?:

)
l N l I l A 1 (I;"

N

OUTPUT H A l r S
"CHARACI E R
(I:'

NEXT
CIIART 2 01' 2

51

DECLARE N U L K R I C LIST STATthlLNT (IS)

CItART 1 OF 1

52

DECLARE Q b '4TITY LIST 51A ICh4LNT (20)

ERROR

-

NUM a INTEGER

-

+

WlAIN VALUE
AND DIMENSION

-

USE 0 AS
FAULT

i

V i s * VALUE,

+..

i:i
I
OUlPUl H A L I S

QK)* DIMENSION

OUIWT HALIS
(K1

c

.
Y P U T WLIS *
;DECLARE
 DIM
ARRAV ()

K*K*l

1

W I F W T NALISs
< D { K)>"
K*K*I

I

*

"

1

ISSUE

t
ISSUE H A L l f

*

- I t -

I
1
rL

I

OUTPUT H A l l S *
"),DKlARE < N ' "E >
DIM bRRAV (hUMJ
INTEGER SINGLE INITIAL I"

I

I[*

II

I

I

ERROR

W r S I: D I K I IS THE NUMERICAL
OLSGNATION OF THE
DIMENSION.

NE'XT

C H A R T 1 OF 1

53

DECLARE STATE LIST STATEMENT

WTER

i

'DECLARE
D

OBTAIN STAlE
OR
USE FALSE
A!5 DEFAUlT

OUTPUT HALIS
"( C STATE >)

INTEGER NO.

OUTPUT W I S
"(CNUM >)
BOOLEAN"

*
OUtPut HALIS

NEil

t

NEXT
CHART 1 OF 1

54

THIS PAGE INTENTIONALLY'LEFT BLANK,

55

ERtdETP,\CS I!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 T E X T LIST STATEMENT (24). (CONT.)

CHART 2 OF 2

57

DECLARE NUMERIC TABLE STATEMENT (19)
ENTER

I

OUlpT HAL I S *

I

OUTPUT H A U S *
“(.)”

O
ARRAY “

PASS 1 EXTRACTS COLUMN
NAMES AN0 PLACES THEM.
IN THE 5’..UsoC 1PdlE.
PASS 2 DOES NO1USE THEM.

INTEGER NWBER

INTEGEP NUMBER
Of COLUMNS

I

Q-

ERROR

CHART 1 OF 2

58

t
I(* I

I

OECLARE NUMERIC TABLE STATEMENT ( 1 9 ) . (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 H A L I S

1

--

"INITIAL [cVAL [ 1 .II >,,---*VALIZ.NC)~.
I

I >.

'

,
CVAL(NR.NC)+I;
DECLARE  R ARRAY ICNR>) I N l l l A l
[.,
4 F D I N R I >I;
DECLARE CNAME>A ARRAY ()
BOOLEAN I N I T I A L (ON);"

- - - --

NEXT

CHART 2 OF 2

59

DECLARE QUANTITY TABLE STATEMENT (21)
ENTER

c

OUTPUT HALIS 8
"(. J"

9+
ERROR

~

+

~

NOTE:
PASS 1 EXTRACTS COLUMN
NAMES ANC PLACES THEM
IN THE SYMBOL TABU.
PASS I DOES N D T USE THEM.

INTEGER NUMBER
OF COLUMNS

I
1.

.if1
ERROR

0 6 COLUMNS

t

CHART 1 OF 2

60

DECLARE QUANTITY TAIILE STATLMLNT (21) , (CONT.)

FETCH IUNCTICN DESIGNATOR
f D ( 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

I

L'L*l

I

I

<

Lr'
K.K+!

.
~

~

OUTPUT HAL I S
"INITIAL (

%

-----

.

-

~

1
'

.cVAl(NR.NCI+):
DECLARfR ARRAY (CNR>) INITIAL
(,,-fD(NR)>l:
DKLARE CNAME+A ARRAY () BWJLCAN
I N l l l A L (ON):
DICLARE c NAME >DIM ARRAY ~CNR>..;NW
INTEGER SINGLE INITIAL
1 C 0 l M l I . I >,*DIMI I .?I>.- ,
CDIM(?.I)>,. CDIMI?.NCb,
,;
'
 I;*

---

I
NIX1

CHART 2 O f 2

61

--

DECLARE STATE TABLE STATEMENT (23)

PNEX1
ENTER

.1

S A ?E

CXJ?!UT

HAllS *

OUTPUT HALfS a

DECLARe

W 

O

~

CNC > I"'

f

t
NOTE:
PASS 1 EXTRACTS COLUMN
NAMES ANC PLACES THEM
IN THE SYMBOL TABLE.
PASS 2 DOES NOT USE THEM.

ERROR

INTEGER NUMBER
CO~UMNS

t

CHART 1 OF 2

62

I

DECLARE S T A l E TABLE S T A I L U L N T (23).(CONT.)

FCTCH CUNLTON DESIGNATOR
FD(k)*FUNCT. DESIC. NO.

NEXT

CHART 2 0 F 2

63

DECLARE TEXT TAOLE STATEMENT (25)

ENTER

c

E X 1TAnlE *

~

~~~~~

NOTE :
PASS I EXTRACTS C U U M N
NAMES AND FLACES THEM
IN TH€ SYMBOL TABLE.

.

I

1

ERROR

I

CHART 1 OF 2

K*I

I

DECLARE TEXT TABLE SfATtMENT (IS).(CONT.)

-

-

d

I

fETCH FUNCTION DESIGNATOR
FD[Kl * FUNCTION DtSlG. NO.

I

-

&

-

1

A

1

L

VAL ( K . l l *

NCIK.11~NUMBEU OF
CHARACTERS IN T.C.

CONS

.
< I N T C C t R NO.>

LET NC 1 MAXIMUM OF A l l N C [ W . l l
OUTPUT WAlIS 1
‘CHARACTER I N C I INITIAL
.
,
- - - - - - -- -----e
INR.I;>.
- - - - - - -I C--N R- Y
l.,
- - - ------R

ARRAV

-VALIl.NCl>,
CVALI

-CVALINR.NC)>):
INITIAL

DECLARC A APRAV ()
BOOLEAN I N i T l A L Iotil;”

N f X l

65

C t I A K l ?OF 2

I

THIS PAGE INTENTIONALLY' LEFT BLANK.

66

INTFR~~~ETRICS.lNCORPORATED
701 GCNCORD-AVENUE

CAMPRIDGE. MASSACHUSETTS 021138

(617) 661 -18

5.3.2

PROCEDURAL STATEMENTS

PROCEDURAL STATEMENT PREFIX

-

STEP NUMBER PREFIX (73).

TIME PREFIX (W), AND VERIFY PREFIX (83)

-

'INC

OUTPUT HALlS *
"FLAG * 0 ;
00 WHILE FLAG 1 0:
CALL DATAI)ANI( (CFD>. CPN>);
If NUMBER CpN> > 'eTIM>*CAX>
THEN FLAG * I ; END;"

-

KOS DEPENDENT INCREMENT Of TIME.
CllhRT 1 OF 6

68

PROCEDURAL STATEMENT PREFIX (CONT.)

NEXT
€VAL,_
IN1
NAME

G o 10
VERIFY
(CHART 4 )

CAlL
UMITFORM

PELFORM
1.0

L* I
b

t

OUTPUT

0

"K*I;*

1

"Ksl:

7

wuis

IF ~ A C l > T H E N "

CHAR1 2 OF 6

69

c

I
OUTPUT HALlS

C D.%TA > 5 ) THEN

*

OUTPUT HALIS *

OUTPUT M A U S *
"IF K*CKMAX>
THEN DO; "

NOTE 1 :
AN "END:
STATEMENT MUST BE
INCWOED AT THE E M , OF THE W
lH€COMPLETE TRANSLATION OF
TME GOAL STATEMENT.

+

NEXT

CHART 3 OF 6

70

"

PROCEDURAL STATCMENT PREFIX (CONT.)
V E R I F Y P R E f l X (83)

VERIFY

1
CALL
LIMITFORM
1.1

*

1

I ;:+ I
CALL
CONVERT-TIME
TV*l

CALL
PELF3RM
1.0

1

V
TV.0

a

I

"START-TIME
* RUN-VIM€; FLAG 00;
W WILE FLAG SO:
I F RUNTIME START-TIME >THEN DO;
C O N D * FALSE ;
FLAG = ;:

-

END;"

OUTPUT H A L 6
'W FOR U * I
TOCKMAX?;"

"&ALL OATABANU(,C PN>);"
"IFAI( THEN CALL DATABANK ( < I N > RE.
I;"

f
CHART 4 OF 6

71

I

PROCEDURAL STATEMENT PREFIX (CONT.)
VERIFY PREFIX 183). (CONT.)

3

I

I"lf NOT [CRF>

" I)THEN"
A

ULT

OUTPUT H A l I S 1

0

 ]HEN IF NOT I
' I "If
CR)>CRNAME>) THEN"

2

1

RACT ( I : I > THEN I F NOT
EXDATA >c RF > C R U M € (Ul> )
THEN"

"IF

I

"IF C U l A C T >THEN"

2

" I F < U l A C T ( K ) >TH€N"

OUTPUT H A l l S *
" I F N O T ( < D A T A > 2  < t F >
 5 )THEN"

c

-

I

OUTPUT H A l l S 8
OUTPUT HAL I S

"EXIT;

1

6

"I(10;
END;"

CHART 5 OF 6

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

T

OUTPUT HAl13'

_
I

O

"CALL DATABANK (,CPN>):"

1

"lFAg THEN
CALL DATABANK lCTN>Rg ,),'

CAU
€VAL-ED

i
OUTPUT HALIS a
K r l TO


I

CHART 2 O f 3

77

.

SET DISCRETL STATCLIENT (70) (CONT.)

R

I

"CALL DATABANK
(. );'

FI'

 AK T M N CALL DATLLBAIYK
(RK ,);-

1

[. );

'IF

THEN IF Ay :HEN CALL

OATABANK ( RK.);"
'IF a C T (J]> THEN CALL OATABANK
kAFD(K)>.tPN>) j K * K *I. EN@."

A

I

CHART I

NE X l

0

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 D A T A STATEMENT (61) JCONT.)

P

"IFTHEN IF < T N > A t TWEtI
CALL DATABANK I < T N > % .J :
" I F ~ T l J THEN
, ~
C A l i DATABANK
(AFDlL)>.) :"

-

'IF t T N > A t THEN I F < M T [ I ) > THEN
CALL DATABANK ( < l N > R l .);"

WWI H u t s *
'END:'

Q I A R T 2 OF 2

9

EVIL

AVERAGE STATEMENT (4)

- ED

0
SAVE As'

CHART 1 OF 2

82

AVERAGE STATEMENT (4), (CONT.)

1'
OUTPUT H A 1 I S

*

OUTPUT HALIS 8
"CALL DATABANK
lWFD(KP, Rc.;
END;
COATAB* AV/CNUM* ;

EM);'

1

WPUl HALIS a
"PNDz"

0

NEXT

M A R T 2 OF 2

83

?

KEA0 I'IIOCCIWRAL STATLULNT (GO)

EVAl

INTNAME

R .

NE'XI

CHAR7 t OF 1

84

THIS PAGE INTENTIONALLY- LEFT BLANK.

85

REQUEST KCYUOAKD STATLhlLNT

(a)

Q

R a

REC = < 3 M A >
R A C I 1 
RECOIM *

OUTPUT H A L I S *
"00TOR I: I

.ERROR

I

CD * FUNCTION
DESIC.
NUMBER

I

I

I

REQUEST KEYBOARD STATEMENT (GG)

,(CONT.)

P
w

I

OUTPUT H A L l S I

R

0 1
1

I

"lF THEN 0 0 ; "

2 ("lFTHEN

DO:"

OUlPl'T HAL15 a
"CONTROL *:
CALL DATABANK
(CFD > . I ;*

OUTPUT HALfS

NAMl 
0

NUMERIC

"CREClK)>

*

NUMBER

."

OUTPUT H A l l S '

'END:"

c

I 'END:"
f

'IC

*k

1 ;END; FNOI

NbXt

CIIART 2 OF 2

87

"

"UCLAY" PROCCDUKAL 31A 1 LMI.NT (26)

CNTER

*

r

OUTPUT HALIS
"WAIT
TIM I *

I

NIX:'

CHART 1 OF 2

88

"DCLAY" I'ROCEDUKAL

SI A l C h l E N l

(2G)

, (CONT.)

1
-

0

"CALL DAlAB4NU [.):*'

I

"IF AK THEN CALL DATABANK [RK.;"

*
111 OUTPUT H A L I S

"IF NOT [<€XDATA> < R f >

) THEN"

I1 I

" I F < R A C T > THENIF NOT [.) THtN"

"IF  THEN I F NOT (<€XDATA>.
CRNAME IK) > 1 THEN"

" I F  THEN"

"IF 

THEN"

LLL_T__I

.

ULT OUTPUT H A L I S

I

0

I

W T P U T YALlS s

I

"EXIlt
END I "

I

"KSOi

U
OUTPUT HAL/S*
'IF K t
THEN FLAG~I.ELSE
REPEAT; END;

CHART 2 OF 2

89

I

"IF  THEN"

2

"IF 

IHEN'
A

"GO T O PROCEDURAL STATEMENT (34)

c

OUTPUI HALIS
"IF RPTACT
THEN
00; LOC'CSN>;
CALL FLUSH ;

11

EN0 i

r-$

-

A

;

ROR

NEXT

CdART 1 OF'1

90

THIS PAGE I N T E H T I O N A L L Y ~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 I l E R A l l O N S
TRANSFER CONTROL TO REPEAT GROUP
REIURN TO THIS lAn3EL
RESTORE Q D REPEAT STAWMENI MJM6fR
M C R L H E N l REPEAT YESTING DEPTH

I

NEXT

*AS DETERMlNtO IN THE

REPEAT ARRAY OF PASS 1

CHART I OF 1

95

A
S
S
W 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 

THEN'

I

WTpm W f *

"ENDiEND; "

I
NEXT

II \liI I 0 1 I
nc)

I

CONCUHKCNTSTATEMENT (is)

1v* I
FETCH TIME
VALUE. CALL
CONVERl ,TIME

I

-

CREATE THE FOLLOWNG TASK TO BE INCORPOfcATEO
INTO WE GOAL MASTER PROGRAM :

-

OutPuT W l S *

-

'TASK C NUM > :TASK : RESET TERM

-

SYST;

BAO: :1 0 ~ 0s RUNTIME : CALL G:"

-

IF TERM SVST ~ N U M >
THE 005 RESET TERM, SYST,NUM>
RETURN 2 END;
d

OUTPUT

0ut_puTHA~;a

HAL I S t

"WAIT UNTIL

*); GO TO BACK i CLOSE ;"

1,

CLOSEi .

!

CONCURRENT STATCMCNT (IS)

FT-l

ICONCURRENTLY DISPLAY 1

ENTER

CHART I

NUM *NUMBER ASSOC
WITH TASK TO BE
GENERAT ED.

+

OUTPUT H A L I S .

"XHEOULE
TASK CNUM>

1

-

,"

CREATE THE FOLLOWING TASK TO BE INCORPORATEO INTO
THE COAL MASTEL PROGRAM:
OUTPUT H A L I S *
'TASK < N U M > : TASK; RESET TERM- SYST
BACK: 1 0 ~ 01 RUNTIME :"

-

c

ri:r1

, (CONT.)

CONCURRENT STATEILNT ( 1 s ) , (COrUT.)

-

NUM NuMaEe
ASSOCIATED WITH 1ASK
TO BE GENERATED.

. 4

OUTPUT HACIS *
"SCHEDULE
TASK CNUM> ;"

4
CREATE THE FOLLOWING TASK TO 8E INCOPPORATEO INTO
THE GOAL, MASTER, PROGRAM:
OUTPUT H A L I S *
"TASK : TASK: RESET TERM, SVST;
BACK: TOLO RUNTIME ;"

1

OUTPUT H A L I S *

0 "CALL DATABANK I,)g"
1

" I F AK THEN CALL DATABANK (CTN>RK.CPN+;"

100

CONCUKKENT STATEMENT (15)

-

, (CONT.)

RT

0
I

"If CRACT, THEN IF N O ? (.CRf

>..

CRNAMEIKI>J THEN"
"IF CRACT(K)> THEN IF NOT (CEXDAl.&>,,
CRNAME I K I > ) THEN"

I

OUTPUT H A L I S .
"IF NOT ( >, ,
< 1F >,< EXDATA >& ;

T*i;N"

EXIT 8

ENDI"

CHART 4 OF 5

101

CONCURRCNT STATEMENT (15). (CONT.)

" I F 1: NOT:

OUTPUT H A L I S *

c

P

O~PUT,HAllS
'
CLOSE I "

OUTPUT H A l l S a
"WAIT UNTIL

[Toto *):

GO TO BACK, CLOSE:"

1

ERROR

102

l-----l
FETCH STEP NO. FROM
RELEASE STATEMENT
LET PROGN PROCESS
NUMBER OF TASK
AS~OCIATEDWITH
STEPNO. THIS IS
MIERMINED fROM THE
PROCES' ARRAY CREATED
IN PASS I.

r--

I

FROM PROCESS ARRAY
GENERATE AN ARRAY
OF CONCURRENT
STATEMENT PROCESS
NUMBERS ASSOCIATE0
WITH THE PRESENT PN.
CALL THIS ARRAY *ANUM
LET IT'S LENGTH BE 1

-

i

.i

1r

-

NEXT

4

CHART 1 OF 1

103

PERFORM PROGRAM STATEMEN? ( 5 5 )

1

W R f 1W I

105

WEN HUiCREUPT STAl -..ICNT (84)

e
NEXT

I

I

DESIGN41OP

ERROR

NOTE I:
OUTPW HAUS
"ENVIRON

o-.-.

(3,l* CCN>; EN&-

NEXT

A U S 1 IS AVAILABLE IN
PASS 1 W l C H RELATES
F U N C I I O N DESIGNATOR
NUMBERS TO INTERRUPT

NUMBf RS .

NOTE 2:
PASS I DECLARES
E N V I R O N I :.I
WHERE N IS tne
NUM8ER Of
tNTERRUPTS.

O

W INTERRUPT STATEMEM (2s)

ENVIRONMENl*;

UU MTA8ANK ( I ,

SYSTEMSTATEMENTS GROUP, (CCsJT.)

COMMENT AND
STORE AS:CMNT

OUTPUT HALIS

“ClOSEI”

i

OUTPUT HALIS 8
“/*.I”

I

NEXT

CHART20F2

113

5.4

Output Processor

The o u t p u t p r o c e s s o r s h a l l be an i n t e g r a l p a r t of t h e
T r a n s l a t o r . I t performs i t s r o l e l a s t i n the t r a n s l a t i o n
sequence. T h i s role s h a l l c o n s i s t of t w o p a r t s . F i r s t , i t
assembles t h e GOAL MASTER PROGRAM according t o t h e format
s p e c i f i e d i n S e c t i o n 3.1 and 3.2 and d e p i c t e d i n F i g u r e s 3-2
and 3-3.
Secondly, it g e n e r a t e s an o u t p u t f i l e of HAL/S s o u r c e
whose format i s compatible w i t h t h e machine upon which HAL/S
compilation i s t o take p l a c e . It also s h a l l g e n e r a t e supporti n g o u t p u t s c o n s i s t i n g of error messages, block summaries,
program l a y o u t s , etc.

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 S t r u c t u r e i s d e f i n e d a s t h e software
s u p p o r t system r e q u i r e d i n t h e mboard S h u t t l e computers i n
order t o permit t h e f u l l p o t e n t i a l of GOAL-in-HAL t o be
realized.
6.2

Recommended Approach

As s e t f o r t h i n S e c t i o n 3.0 of t h e S p e c i f i c a t i o n , t h e
GOAL MASTER PROGRAM c o n t a i n s a l l software and data r e q u i r e d
t o execute. The o n l y e x t e r n a l s o f t w a r e r e q u i r e d w i l l be t h e

-

FCOS. By d e s i g n , t h e o u t p u t of t h e t r a n s l a t o r i s an assembly
of HAL/S code which c o n t a i n s n o t o n l y t r a n s l a t i o n s of each
of the i n d i v i d u a l GOAL programs i n c l u d i n g a l l relevant databank i n f o r m a t i o n , b u t also t h e procedure DATABANK used f o r
interpreting function designator information i n the Flight
Computer Operating System (FCOS) environment. The o u t p u t of
t h e t r a n s l a t o r i s submitted t o t h e HAL/S compiler l i k e any
o t h e r HAL/S applicatiofis program. T h e r e s u l t i s object code
f o r t h e f l i g h t computer. The GOAL Master Program i s s e l f - s u f f i c i e n t and, by d e s i g n , r e q u i r e s no e x e c u t i v e s u p p o r t s t r u c t u r e
o t h e r t h a n the FCOS.

-

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

dnce 01
This section provides a plan and a recommended sequsteps 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,.tentialgroupings. 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 (617) 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 hat the Translator is generating valid ML/S and,
se=onaly, it must show that the logical transformations
performed are valid.

7.2

Verification

The two-level Test Plan is now brought into operation.
The €iAL/S compiler can effectively deal with the first level
of verificatioc. That is, whether the Translator has produced
valid HAL/S code. Translator output in the form of a GOAL
MASTER PROGRAM is, by design, supposed to meet completely
applications sofW a r e
the necessary characteristics of a
program, and can therefore be submitted as an input to thu
compiler.

-

The Test P l a n will have to provide f o r successive levels
of complexity in the GOAL source inpJts. These successive
levels are suggested in Table 7-1.
The HAL/S Compiler will provide completely adequate
diagnosis of the HALIS source. This diagnosis includes the
This, then, is the fundamental approach
items in Table 7-2.
to syntactical verification via the use of the BAL/S compiler.

The second verification level ir?-Jolvesmaking a valid
This level involves
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
.ntr31 element in the
machine which is scheduled tc b?
Shuttle Avionic& Integr -tior,
-. P
r; (SAIL)

.

0)

S i n g l e GOAL Statements (Visual V e r i f i c a t i o n
against SpeciLication)

1)

Sing& GOAL Program, N o Stops, N o Repeats,
No Interrupts, N o Tables

2)

S i n g l e 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

Outer Variables
Outer Replaces

Program Layout

Programs 8 Functions
and Procedures

Symbol Table L i s t i n g

N a m e 8 Type, Class,

Length, Precision ,
Nesting , etc.

Cross Reference L i s t i n g

Flags

&

Statement No.

Macro Text Listing
Etc

.
T a b l e 5-2.

HAL/S Compiler Diagnosis

of Source

120
I

INTFRMFTRICS INCORPORATED 701 CONCORD AVENUE

CAMBRIDGE. MASSACHUSETTS 02138 (617) 66l-l84\

A t h i r d test of t h e o v e r a l l GOAL system, which i n c l u d e s
t h e GOAL compiler, T r a n s l a t o r , and HAL/S c o m p i l e r , w i l l be i n
t h e e x e c u t i o n of a t r a n s l a t e d GOAL program i n t h e SDL u s i n g
s i m u l a t e d equipment and environment.
The r e s u l t s of these t w o l e v e l s of v e r i f i c a t i o n t e s t i n g
carried o u t i n accordance w i t h t h e T r a n s l a t o r T e s t P l a n
are documented i n t h e T r a n s l a t o r T e s t R e s u l t s document. T h i s
w i l l o n l y be i s s u e d in f i n a l form when a l l aspects o f t h e
S p e c i f i c a t i o n have been v e r i f i e d . P r e l i m i n a r y v e r s i o n s would
i n c l u d e the r e s u l t s of t h e t w o levels of t e s t i n g p r e v i o u s l y
described.
7.3

O p e r a t i o n s , Maintenance and Update

It is i m p o r t a n t t o r e c o g n i z e t h a t the T r a n s l a - o r acts
as a b r i d g e between t w o languages each of whom w i l l be subject
t o change. Accordingly, it i s n e c e s s a r y t o have a T r a n s l a t o r
Maintenance and Update Procedure.

Under such a p l a n , t h e T r a n s l a t o r would be under t h e
aegis of a Change C o n t r o l Board (CCB) a t KSC. Computer Program
Change Rzquests ( C P C R ' s ) would be brought t o t h i s CCB i n
response t o three categories of e v e n t s :

a)

A GOAL Change o r CPCR

b)

A HAL/S Change approved by the Software Control
Board (SCB) a t J S C u s i n g a Languagc Change

Request (LCR) as t h e vehicle.

c)

A T r a n s l a t o r Discrepancy Report (DR).

The T r a n s l a t o r CCB would a c t on t h e CPCR.

I f it approved

a T r a n s l a t o r change, it would also s p e c i f y t h e tests t o be
r u n and test r e p o r t s t o be w r i t t e n .
7.4

Docmentation
A l i s t of proposed

GOAL-to-HAL Translator documentation

is given below:

121
<\ITERMETRICSINCORPORATED 701 CONCORD AVENUE

CAMBRIDGE. MASSACHUSETTS 02138. (617) 661-1840

7.4.1

Specifications
7.4.1.1

. .

7 4.1 2

Translator Specificat.ion
(Per NAS 10-8385)
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.4

7.4.5

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

Translator Test P l a n
7.4.4.1

Valid HALJS Check by Compilation

7.4.4.2

Valid Functional Check by:
HAL Statement.Simulator
SAIL Test
SDL Simulation

Translator Test Results

7.4.5.1

Compilation Results

7.4.5.2

Functional Results

122
'r'TEnr"~TRtCStNCORPORATE0 f01 CONCORD AVENUE

CAMBRIDGE, MASSACHUSETTS
02138 (617) 661-18L
..-_- .
~

7.4.6

7.5

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

Translator DR's and Host Machine Changes

7.4.6.5

Change Validation

7.4.6.6

How to Debug t h e Translator

Translator Schedule
See Figure 7-1.

123
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

I

!

n

i

..

I

I
I

I

f

I

!

*
Fr
Fr

!

t

;

I

;
!

:

I

i

I

i

f
t1

iq:
!

I

rn'

!

.
r

!
a

!

I

ua
i
m .

s3

Bal

n

- 4 4

tc

--

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. The same compiler system, with minor modifications,
will be compatible with the IBM 370 computer series.
By choosing the IBM 360 as the host machine, the translation 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

The Translator should be implemented using the XPL
Translator Writing System (TWS) as the primary tool. TWS is
a tool which is intended to assist in the writing of translatorcompilers, 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 specialized 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
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 701 CONCORD AVENUE
9

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

NTERMETRICS INCORPORATED 701 CONCORD AVENUE

9

MAPPING

CAMBRIDGE, MASSACHUSETTS 02138 (617) 661-1840

APPENDIX A.

GOAL-TO-sAL

MAPPING

I n t h i s s e c t i o n , t h e proposed r e l a t i o n s h i p s between
t h e GOAL and HAL s t a t e m e n t s are described i n some d e t a i l .
T h i s d e s c r i p t i o n has been d e s i g n a t e d "mapping" i n order
t o d i s t i n g u i s h it from t h e T r a n s l n t m S p e c i f i c a t i o n . Mapping
w i l l g i v e an e x p l a n a t i o n o r example of each complete GOAL
statement. The Specification r i g o r o u s l y d e f i n e s a l l v a r i a t i o n s ,
permutations, and combinations of each GOAL s t a t e m e n t .
A.l

Declaration Statements

~ . l . lS i n g l e Data

GOAL Statement:

DECLARE NUMBER(RESULTS) ;
Purpose :
T h i s s t a t e m e n t declares a numeric data i t e m w i t h
t h e symbolic name (RESULTS) for purposes of g e n e r a l computat i o n w i t h i n t h e GOAL program.
Equivalent HAL/S foim:

DECLARE RESULTS: T h i s s t a t e m e n t w i l l declare an
unarrayed s i n g l e p r e c i s i o n scalar variable which can be used
i n the same c o n t e x t as t h e corresponding GOAL form.
GOAL Statement:

DECLARE QUANTIm (OFFSET) = , 5 PSI

, (PUMP

PRESS) ;

Purpose:

This s t a t e m e n t d e c l a r e s a GOAL " q u a n t i t y " (a real
number and an a s s o c i a t e d dimension) as a variable f o r use

A-1
NTERMETRICS INCORPORATED 701 CONCORD AVENUE

CAMBRIDGE, MASSACHUSETTS 0212' *

!. il7)

661-1840

i n a program. S i n c e t h e u n i t s a s s o c i a t e d w i t h t h e s e e n t i t i e s
e x i s t f o r a n n o t a t i o n purposes o n l y , t h e e q u i v a l e n t HAL/S
d e c l a r a t i o n s i n c l u d e a scalar d e c l a r a t i o n and a c h a r a c t e r
s t r i n g dimension.
HAL/S E q u i v a l e n t Form:
DECLNiE OFFSET3 INITIAL(O.5); DECLARE OFFSETXM INTEGER
SINGLE INITIAL(3); DECLARE PUYP PRESSD; DECLARE PUMF PRESSDIM
INTEGER SINGLE:

-

-

Note t h a t the i n i t i a l i z a t i o n value of 0.5 w a s provided
i n t h e GOAL form as a compile t i m e assignment ( t h e e q u a l - s i a n )
which becomes t h e i n i t i a l value 0.5 i n t h e HAL/S form. The
OFFSETDIX v a l u e oL t h r e e ( 3 ) i s presumed t o correspond t o t h e
PSI l a b e l .

GOAL Statement:
DECLARE STATE (FLAG A) = ON,

(FLkr B) ;

Purpose :
This statement i s used i n t h e c o n t e x t of a GOAL
program t o d e c l a r e t h e e x i s t e n c e of t h e s i n g l e b i t booleans
FLAG A and FLAG B.
The i n i t i a l tralue of t h e variable FLAG A
i s set t o b e ON. FLAG B is n o t i n i t i a l i z e d .

'

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 i n a GOAL.program t o declare a
fixed c h a r a c t e r message which w i l l be used i n some 14'0
operation. Since there is no character manipulation or assignment i n GOAL, t h i s message must always be e i t h e r fix& or
defined i n some i n p u t operatior..
Equivalent HAL/S Statement:

-

DECLARE ERROR MESSAGED CHARACrER(24) I N I T I A L ( '6D10 BATTERY

A.1.2

VOLTAGE UIW' ;

L i s t Type

GAL Statement:

DECLARE NUMERIC LIST(L1ST NUM) WITH 4 ENTRIES;

Purpose :
T h i s statement declares to the GOAL compiler that
t h e programer wishes to create a l i n e a r a r r a y of 4 numeric
elements without any i n i t i a l i z a t i o n .

Equivalent HAL/S Fom:

-

DECLARE LIST NUHD ARRAY (4) t

GOAL S t a t e m n t :

DECLARE NUMERIC LIST (m3) 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 t o the GOAX, conyiler t h a t the
p r o g r a m e r wishes t o create a l i n e a r a r r a y of 10 numeric
eleinents w i t h the i n d i c a t e d i n i t i a l i z a t i o n .

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 L I S T (LIST A) W I T H 3 ENTRIES;
Purpose :
T h i s statement creates a list of 3 GOAL q u a n t i t i e s
i n a l i n e a r a r r a y form. Each q u a n t i t y has a scalar v a l u e
and a p h y s i c a l u n i t s dimension.

HAL/S Equivalent Form:

-

DECLARE L I S T AD ARRPY ( 3 ) ;
DECLARE LIST A D I M ARRAY (3) INTEGER SINGLE;

G9AL Statement:

DECLARE QUANTITY LIST(VOLTAGE LIST) WITH 6 ENTRIES
28V,+0.5V,-0.5V,0V,50Vf10
SECS;
Purpose :

This s t a t e m e n t sets up a l i s t of 6 GOAL q u a n t i t i e s ,
w i t h i n i t i a l i z a t i o n t o the values indicated.

A-4

HAL/S E q u i v a l e n t Form:

DECLARE VOLTAGE LISTDIM ARRAY(6) INTECER SINGLE
INITIAL (1,171,1a 1 2 ) ;

N o t e that the u n i t s are p r e s e n t e d i n a coded form, assuming
1 = v o l k s and 2 = seconds.

GOAL Statement:
DECLARE STATE LIST (FLAG L I S T ) WITH 10 ENTRIES;

Purpose :
T h i s s t a t e m e n t sets up an a r r a y of 10 booleans for
r e f e r e n c e w i t h i n the GOAL program. No i n i t i a l i z a t i o n is
performed.

HAL/S Equivalents:

-

DECLARE FLAG LISTD ARRAY (10) BOOLEAN;

GOAL Statement:
DECLARE STATE L I S T ( L I S T STATE) W I T H 6 EMTRIES
ON ,ON ,ON ,OFF 8 OFF 8 ON ;

Purpose:

This s t a t e m e n t declares an a r r a y of 6 b i n a r y
v a l u e s (Booleans) for use w i t h i n the GOAL program t o store
the states of discretes.
E q u i v a l e n t HAL)S Form:
DECLARE LIST STATED ARRAY ( 6 ) BOOLEAN INITIAL(ON~ON,ON,OFF~OFF,ON)
;

A-5
i~~~~~~~~~~~
INCORPORATED

-

--

~

701 CONCORD AVENUE
- -.

CAMBRIDGE. MASSACHUSETTS02138 (617) ~ 1 - 1 ~ 0
-- --

I
_
.
-

1
.
_
1
1
-

-L_

GOAL Statement:
DECLARE TEXT LIST(1NPUT) WITH 2 ENTRIES W I T H A
MAXIMUM OF 25 CHARACTERS ;

Purpose :
T h i s s t a t e m e n t sets up an a r r a y of t w o t e x t s t r i n g s
for use as the r e c e i v e r of some i n p u t followed by later
use as t h e source of some o u t p u t (no i n t e r n a l m a n i p u l a t i o n s
of t e x t are provided by GOAL).

E q u i v a l e n t HAL/S Form:
DECLARe INPUTD ARRAY ( 2 ) CHARACTER(25) ;

Note t h a t i n this example the o r i g i n a l name d u p l i c a t e d a
HAL/S keyword and t h u s had t o be modified i n some way followi n g the t r a n s l a t i o n . I n the example, :he lettsr D w a s appended
t o t h e o r i g i n a l name t h e r e b y r e s o l v i n g the keyword c o n f l i c t .
The maximum l e n g t h of 25 carries over d i r e c t l y .

GOAL Statement:
DECLARE TEXT L I S T (OPERATOR INSTRUCTION) W I T H 2 ENTRIES
(PLACE SWITCHES INDICATED), (*PREFLIGHT TM CAL I N

PROGRESS") ;
Purpose :
T h i s s t a t e m e n t declares an a r r a y of t w o c h a r a c t e r
s t r i n g s which are i n i t i a l i z e d t o t h e v a l u e s i n d i c a t e d , w i t h
a maximum l e n g t h determined by i m p l i c a t i o n from the l e n g t h
of the i n i t i a l values.

E q u i v a l e n t HAL/S Form:

DECLARE OPERATOR INSTRUCTIOND ARRAY (2) CHARACTEP.( 3 0 )
'

INITIAL ( 'PLACE SWITCHES INDICATED'
TM CAL IN PROGRESS*') ;

I

'*PRELIG€I"

This is a d i r e c t t r a n s l a t i o n , with the o n l y s u b t l e t y
being the d e t e r m i n a t i o n of the m a x i m u m l e n g t h found among t h e
i n i t i a l v a l u e s so t h a t t h e c h a r a c t e r s t r i n g maximum l e n g t h
may be d e c l a r e d .
A-6
INTFRUFTRICS INCORPORATED 701 CONCORD AVENUE
I

CAMBRIDGE, MASSACHUSETTS 02138 (617) 661-184I
" _

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. For GOAL QUANTITY tables,
an auxiliary character array of dimensions is
required.

2.

An auxiliary "activation array" of B O O W

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 m
r

GOAL Statement:
DECLARE NUMERIC TABLE(H1GH LOW RUN) WITH 3 ROWS
AND 4 COLUMNS TITLED
(NIGH), (LOW), (RUN), (CUR) WITH ENTRIFS





,
I

,

1000.1,
1001.2,
999.8,

1.0,
.9#

1.2,

500.0,
500.0,
500.0,

#

I

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.

E q u i v a l e n t HAL/S Form:
Main Data Array:

- -

DECLARE HIGH LOW RUND ARRAY ( 3 , 4 )

INITIAL(

Note here t h a t t h e HALl'S i n i t i a l i z a t i o n c a n n o t embed u n i n i t i a l i z e d v a l u e s w i t h i n i t s l i s t so a "0" has been used .in the fourthcolumn e n t r i e s .
DECLARE H I G H LOW RLWR ARRAY (3) INITIAL
( C F D ( 1 ) >8+D (27> ,) 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 :
T h i s s t a t e m e n t sets up a GOAL q u a n t i t y table w i t h 5
f u n c t i o n d e s i g n a t o r s and 3 columns, S i n c e this i s a q u a n t i t y
table, and since q u a n t i t y units can change as date, the HAL/S
e q u i v a l e n t w i l l have t w o main data a r r a y s , t h e second c o n t a i n i n g
dimensional d a t a .

E q u i v a l e n t 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 ( p  ,,
,);
.
DECLARE MAIN FUEL FLOWA ARRAY ( 5 )
BOOLEAN TNITIXL (ON);

GOAL Statements:
DECLARE STATE TABLE (THRUST OK) W I T H 5 ROWS AND
3 COLUMi~S TITLED (THRUST OK), (THRUST NOT OK),
(STATE) WITH ENTRIES


p

ON,

OFF,

8



8

ON,

OFF8

8



8

ON,

OFF,

8



,. ON8

OFF,

I



ON,

OFF8

8

Purpose :
T M s statement sets up a GOAL “state t a b l e ” w i t h 3 columns
and 5 rows8 i n i t i a l i z e d as shown.

A99
dTERMETRICS INCORPORATED 701 CONCORD-AVENUE
CAMBRIDGE, --llll-l-._.
MASSACHUSETTS 02138 (617) 661-1840
---_ l-__lll^-_-l.l.
- -___._
I

_ I ~ I I - -

DECLARE THRUST OKD ARRAY (583) BOOLEAN INITIAL (TRUE,
FALSE, FALSE, TRUE, FALSE, FALSE, TRUE, FALSE,
FALSE) ;
DECLARE THRUST OKR ARRAY (5) I N I T I A L (8
,,,
);

-

DECLARE THRUST OKA ARRAY (5) BOOLEAN INITIAL (ON);

GoAt Statement:
DECLARE TEXT TABLE (MESSAGE TABLE) WITH 2 ROWS
AND 1 COLUMN TITLED
(MESSAGE A) W I T H ENTRIES

~ 2 2 4.DISPLAY B35>

#

(SWITCH SCAN I N PROGRESS) 8

<224 DISPLAY B42>

,

(PLACE ABOVE SWITCHZS AS INDICATED);

Purpose:
T h i s GOAL statement p r e p a r e s a table of c h a r a c t e r
s t r i n g data associated with t w o function designators. The
table h a s b u t a s i n g l e column.
E q u i v a l e n t HAL/S Form:

Main Data Array:
DECLARE MESSAGE TABLED ARRAY ( 2 1) CHARACTER (33) I N I T I A L (
'SWITCH SCAN-IN PROGRESS',
'PLACE ABOVE SWITCHES AS INDICATED');
DECLARE MESSAGE TABLER ARRAY(2) INITIAL (C224 DISPLAY
B35> &24
D I s P m Y B42,) ;

-

DECLARE MESSAGE TABLEZ4 ARRAY (2) BOOLEAN INITIAL (ON);

A-10
INTFRMETRICS INCORPORATED 701 CONCORD AVENUE

CAMBRIDGE, MASSACHUSETTS 02138 (617) 661-1&

A.2

A.2.1

Procedural Statements
Prefixes

GOAL Step Number Prefix:
STEP 1 6 3

... rest of GOAL statement ...

HAL/S Equivalent Form:

-

STEP 163:

... rest o f

HAL statement

...

GOAL T h e Prefix:

WHEN  IS
-80 HRS '27 MIW 00 SEC THEN
rest. of GOAL statement

...

Purpose :

- -

Cause the GOAL program to wait u n t i l the  value i s greater than or equal t o - 8 0 : 2 7 : 0 0 .

-

Equivalent HAL/S Form:
FLAG = 0;

DO WHILE FLAG = 0 ;
C?LL DATABANK (COUNT DOWN CLOCK>,)i
I F NUMBERCPN,= -289620

- -

THEN FLAG -- 1;
END:

In this example, -80 hrs. 8 27 minutes, was converted to
absolute time i n "machine u n i t s " by the Translator subroutine
CONVERT TIME.

-

The e f f e c t of t k . 2 WAIT statement of HAL/S is independent
of any following statements ( i t is not a "prefix" as i n GOAL).

A-11
4TERMETRlCS INCORPORATED
.
_ .
701 CONCORD
_ _ AVENUE
I

I

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  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 P o r n :

FLAG = 0;
DO WHILE FLAG = 0 ;
CALL DATABANK (CCOUHT DOWN CLOCK>,);
IF NUMBER >= ~ ( 2 8 9 6 2 0-b )
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

.

~

~

o

w

~

A-12
INTERMETRICS INCORPORATED 701 CONCORD AVENUE

CAMBRIDGE, MASSACHUSETTS 02138 (617) 661-184

~

o

w

~

o

~

w

GOAL Statement:

I F (MIDDLE GIMBAL ANGLE) I S GREATER THAN (MIDDLE
GIMBAL LIMIT) THEN

The HAL/S Equivalent Form is generated with the a s s i s t a n c e of
the EVAL INT NAME and REL FORM Translator subroutines:

-

- -

K = 1;

-

-

-

> MIDDLE GIMBAL LIMIT)

I F NOT (MIDDLE GIMBAL ANGU-D

THEN K = 0:

I F K = 1 THEN DO:

.-._---

(Procedural Statement)
(Provided by Translator)

END:

GOAL Verify Pre-ix:
VERIFY  I S LESS THAN
(MIDDLE GIMBAL LIMIT) ELSE

...

The HAL/S Equivalent Form i s generated w i t h the assistance
of t h e EVAL ED and REL FORM Translator subroutines:

-

FLAG = 0:
DO WHILE FLAG = 0:

DO FOR K = 1 TO 1 ’
CALL DATASANK () :
IF NOT
) THEN
K = 0:

-

-

-

END:

I F K = 1 THE6 D3;
COND = TRUE:
FLAG = 1:
END:

ELSE FUPEAT:
END :
I F COND = FALSE THEN DO;
.

o

.

~

.

~

I

~

.

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 ,;
Purpose :
'

This statement i s used to implement an I/O operation to
some specific external device.

DO FOR K = 1 TO 2;
DIMISNSION,pN,

=  ;

NUmER = ;

CALL DATABANK (

);

END ;

GOAL Stateme. .:

APPLY PRESENT VALUE OF  TO
;

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
, ;
Purpose :

This s t a t e m e n t is supposed t o send a " d i g i t a l pattern"
i n .the form of a numeric i n t e r n a l variable t o a selected 1/0
word i d e n t i f i e d by the selected f u n c t i o n d e s i g n a t o r s . In this
case, the i n t e r n a l v a r i a b l e (OCTAL SEVENS) i s s e n t t o "PANEL
LIGHTS 32" and (OCTAL ONES) i s s e n t t o "PANEL LIGHTS 31";
HAL/S Equivalent Form:
DO FOR K = 1 TO 2;
NU*ER;

CALL DATABANK ( ,) ;

K - K + 1
NUMBER = ;
CALL DATABANK ( ,);
END ;

GOAL Statement:
ISSUE PRESENT VALUE OF  TO  IS -1 HRS, OPEN ;
Purpose :
T h i s GOAL s t a t e m e n t has a t i m e prefix, and a label
p r e f i x , used t o c o n t r o l when arld under what c o n d i t i o n s the
a c t i o n of s e n d i n g a b i t v a l v e corresponding to an OPEN v a l v e
t o an e x t e r n a l register s y m b o l i c a l l y i d e n t i f i e d by t h e f u n c t i o n
d e s i g n a t o r "HELIUM SUPPLY".

HAL/S E q u i v a l e n t Form:

-

STEP 104:
WAIT UNTIL -3600.001;

STATE

= OFF;

GOAL Statement:
STEP 5:

TURN ON (THWST OK ING: FCXCTIONS;

Purpose :
This GOAL s t a t e m e n t i s suppose.. - , s e t all the b i t s ,
i n all t h e a c t i v e f u n c t i o n designators of a STATE tzble t o
t h e "ON" value.

A-16
INTERMETRCS INCORPORATED 731 CONCORC ',VENUE

CAMBRIDGE, :+cSA'aHUEZTTS 02138 (617) 6$1-184

HAL/S Equivalent

Form:

STATEcpN, = ON;
uc) FOR K = 1 TO ;
IF TEWST OK IND% THEW
SYP 5:

- -

- -

CALL DATABANK () ;

END;

GOAL Statement:
RECORD (INTERNAL TIME) TO ;

Purpose :

This statement is supposed to send data f r o m a GOAL
internal variable named 'Internal time' to the function
designator i d e n t i f i e d . This means i n effect that an I/O
opsration of writing the internal value to the i m p l i c i t I/O
address of the function designator i s required.
HAL/S Equivalent Form:

GOAL Statement:

DISPLAY TEXT (ALL SYSTEMS READY FOR POWER TRAMSFER)
To CCRT 9,;
Purpose :
T h i s statement i s supposed t o write the given t e x t o u t
onto a character-oriented Z/O device, namely a display. Since
this output is charactor-oriented, t h e equivalent HAL/S form
w i l l have a character output statement form.

A-17

;htTFRIITTRIC;S INCORPORATED 701 CONCORE, &VENUE CAMBRIDGE, MASSACHUSETTS 02138 (617) 661-1840

HAL/S Equivalent Form:

TEXT PN

-

- -

-

-

= 'ALL SYSTEMS READY FOR POWER

TRANSFER' ;

DO FOR L = 1 TO 1;

GOAL Statement:
AVERAGE 10 READINGS OF  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 t o
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>,);
AV = AV f NUM8ER,pH>;
END;
OOOLANT.TEPIPD = AV/NUM;
EMD;

-

GOAL Statement:
READ  AND SAVE AS
(IMm PRESSURE) ;

A-18
INTERMETRICS INCORPORATED 701 CONCORD AVENUE

CAMBRIDGE, MASSACHUSETTS W138 (617) 661-184

HAL/S Equivalent Form:
Cau DATABANK () ;

-

INLET PRESSURED = NUMBER,pN,;

GOAL Statement:

READ (TABLE A) FUNCTIONS AND SAVE AS (CURRENT VALUE);
Purpose :
T h e purpose of t h i s s t a t e m e n t is t o e v a l u a t e +e c u r r e n t
v a l u e of a l l the f u n c t i o n d e s i g n a t o r s (which are active) i n
the TABLE A and a s s i g n t h e r e s u l t s i n t o c o r r e s p o n d i n g p o s i t i o n s
i n t h e t d l e column i n d i c a t e d .

HA&/S E q u i v a l e n t Form:
DO FOR K = 1 TO-;

-% THEN IF

IF TABLE

-

CURRENT VALU-

CALL DATABANK (,

-

CURRENT VALUEDK,cI,

THEN DO;

);

= rJUMBER,pN,;

I

END;

GOAL Statement:
REQUEST TEXT (DEGREES PITCH) FROM CCRT 7,
AS (DEG PTCH);

AND SAVE

Purpose :
Display a r e q u e s t on the c o n s o l e and then reads i n the
r e s u l t . Since a character-oriented operation w i t h conversion
t o scalar is involved, a c o n v e r s i o n f u n c t i o n i n t h e HAL/S version
w i l l be used.

HAL/S E q u i v a l e n t Form:
DO FOR K = 1 TO 1;
CONTROL,pN,

= :

CALL DATAB&JK( ,) :
CDEG PTCH> = TEXTcpN,:
L

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 t o sleep" for a t i m e interval
of 5 seconds.

HAL/S Equivalent Form:
WAIT 5;

GOAL Statement:

WAIT UNTIL C S I V B 3200 PSIA SUP VENT, XS OPEN;
Purpose:
Cause the program to "go to sleep" for a t i m e i n t e r v a l
of unspecified length u n t i l the boolean (state) function
designator is recognized as being "OPEN".
X A L / S Equivalent Form:

A-20
INTERMETRICS INCORPORATED 701 CONCORD AVENUE

CAMBRIDGE, MASSACHUS3TSm138 (817) 06l-lSq

GOAL Statement:

Go To s 20;
W / S

Equivalent Form:
GO TO STEP 20;

where the l a b e l S 20 of GOAL has been translated i n t o a
W / S identifier.

GOAL Statement:
STOP

AND INDICATE RESTART LABELS S100, S20O;

Purpose :

To g i v e the GOAL program an a b i l i t y to cease active
execution and w a i t for operator intervention, followed by
a jump to one of the indicated l a b e l s .
W / S

Equivalent Form:

TEXT

= 'PROGRAM HAS STOPPED AT UNNUMBERED STA!CEMEMT.
INDICATE RESTART AT;

CALL DATABANK (0, ;
TE*

= 'STEP-100';

CALL DATABANK (0 I ) ;

-

TEXT = 'STEP 200';

CALL DATABANK(O,);

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);
GO TO AGAIN;

GOAL Statement:
TERMINATE :

Purpose :
The TERMINATE statement of GOAL is used to:

Return control to the c a l l i n g program i f it i s
found i n a GOAL subroutine.
Stop execution of a program i f found a t the
program level, returning control to the c a l l e r .

Purpose :
This statement shuts down an e n t i r e 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
RPTACT,sE;,

+

1;

= ON;

SAVERPT

= Rs;

RS = < E N > :

RPT C T k = 1;
GO

TO STEP-5:

%TURN

-LA3EL:

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 :

-

S e t a new value of "ON" i n t o 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 E q u i v a l e n t Form:
SCHEDULE TASK ;

GOAL Statement:

CONCURRENTLY VERIFY 
IS BETWEEN 1 6 6 5 P S I A and 1 4 6 5 P S I A and
DISPLAY EXCEPTION TO  ;

HAL/S E q u i v a l e n t Form:
SCHEDULE TASK ;
TASK :

TASK;

-

RESET TERM SYS,NuM,;
BACK :

-

TOLD = RUN TIME;

DO FOR K = 1 TO 1;
CALL DATABANK (,) ;

If NQT( >= < 1 4 6 5 > ) AND
 =< < 1 6 6 5 7 > )
THEN K = 0;

END;

A-25
NTERMETRICS INCORPORATED 701 CONCORD AVENUE

CAMBRIDGE, MASSACHUSETTS 02138 (617) 061-1840

GOAL Statement:
RELEASE STEP 1 0 ;

Purpose :
Step 10 had "concurrently" set up some concurrent process
a t a previous t i m e . This statement "releases" t h e concurrent
process i n i t i a t e d , by removing i t from the i m p l i c i t executive
queues involved.

NAL/S Equivalent Form:
TERMINATE TASK  ;

GOAL Statement:
RELEASE ALL

Purpose :
Terminate a l l concurrently scheduled operations within
t h e current GOAL component.

HAL/S Equivalent Form:
TERMINATE TASK C A N U p l k > ;

-

SET TERM SYSTe m & $ > ;

where k is cycled from 1 t o t h e maximum provided i n 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 s e l e c t e d , execute it and return.

&/S

Equivalent Form:
= ;

CONTROL,pN,

CALL DATABANK (1,) ; /*SAVE

INT ENVIRONMENT*/

-

RESET TERM SYST,NUM>;

-

CALL G L\DC POWER ON;
CONTROL = 
-

L

CALL DATABANK(l,); /*RESTORE

INT ENVIRONMENT*/

-

I F TERM SYSTcwM, THEY DO;

-

RESET TERM SYST,NUM,;

-

SET TERM SYSTCpN>;

RETURN;

END ;

GOAL Statement:
PERFORM CRITICAL SUBROUTINE
(CALCULATE DELAY TIME) ;

Purpose :
I n h i b i t a l l 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 E q u i v a l e n t Form:
CONTROL = ;
CALL DATABANK ( 1 , ) ;
CALL G CALCULATE DELAY TIME (TRUE);
CONTROL,pN,

= <:POP INT ENVIRONMENT>;

-

I F TERM SYSTCpN, THEN DO;

-

RESET TERM SYST,pN,i
RETURN ;

END;

GOAL Statement:
WHEN INTERRUPT  OCCURS
GO TO STEP 9000:
Purpose :

Send control to s t e p 9000 when the indicated interrupt
occurs

HAL/S Equivalent Form:
I F NOT C THEN DO;
CONTROL,pN,

= ;

NUMBER= ;

CALL CATABANK (1,) i
ENVIRON(2,) = 0;
ENVIRON(3,) =

qN>:*

INTERMETRICS INCORPORATED 701 CONCORD AVENUE

CAMBRIDGE, MASSACHUSETTS 02138 * (617) 681-l&,

i

GOAL Statement-:
WHEN INTERRUPT  OCCURS PERFORM
SUBROUTINE (START TANK CHILLDOWN) AND RETURK TO
STEP 9 9 9 9 :

-

Purpose :
. When the indicated interrupt occurs, perform a subroutine
then unconditionally branch to the indicated s t e p number.

HAL/S Equivalent Form:
I F NOT C THEN DO;
CONTROL 

= ;

= )

t

= :

ENVIRON ( 3 , ) =  ;*

END ;

*

I N = No. Assoc. with Interrupt.
CN = Case Number Assoc. with GO TO or RETURN TO option.
N S = Number Assoc. with Subroutine

GOAL Statement:
DISABLE STEP 20;

Purpose :
I n h i b i t a software interrupt set up by a "WHEN
INTERRUPT" a t the s t e p indicated (STEP 2 0 ) ;

A-29
JTERMETFIICS INCORPOHATED 701 CONCORD AVENUE

-.

CAMBRIDGE, MASSACHUSETTS
.
- 02138 e (817) 661-1840

HAL/S E q u i v a l e n t Form:
CONTROLCpN, = ;

mmER = ;
CALL DATABANK (1,):

A.2.7

T a b l e Control

GOAL Statement:
.

ACTIVATE (TABLE A) ROW 1, ROW 3 ;

Purpose :

Activate t h e f u n c t i o n d e s i g n a t o r s assocjated w i t h
t h a i n d i c a t e d rows so t h a t f u t u r e 1/0 to this table w i l l

include the rows i n question.

HAL/S E q u i v a l e n t Form:
The HAL/S t r a n s l a t i o n of a GOAL table involves a
data a r r a y and an activation array of BOOLEANS. Assuming
t h a t "TABLE AA
i s TABLE A ' s a c t i v a t i o n array,.and that
"TRUE' mean?
corresponding row is active, then the
NAL/S e q u i v a l e n t is simply:

de

-

TABLE AA1 = ON:

-

s

Ti)

ROW 2 ,

TABLE AA- = C.;:

GOAL Statement:

INHIBIT (TABLE

ROW 3;

A030
INTERMETRICS INCORPORATED 701 CONCORD AVErJUE

CAMBRIDGE, MASSACHUSETTS 02138 (617) 661-18

Purpose :
Disable the function designators a s s o c i a t e d with the
izdicated rows,$so that future 1/0 to t h i s table w i l l
exclude the rews i n question.

HAL/S Equivalent Fora:

.

Analogous to the ACTIVATE case:

-

TABLE AA2 = OFF;

A-31
:\ITERMETF'C"

"

ORATED 701 COIKORD AVENUE
. ..
1

. --

CAMBRIDGE, MASSACHUSETTS
02138 e (617) 681-1840
-.---I-

-.ld...."IIY-.~-I^.-I..",-.

_yI_II

24.3

System Statements

The GOAL system statements serve primarily as inputs
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.
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. The Translator will generate an
error message.

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 :
T h i s statement begins a GOAL s u b r o u t i n e block, passintj

one formal parameter.
HAL/S Equivalent Form:

-

-

G FORCE TERM:

PROCEDURE (C) A S S I G N (PARAM'J!ER

-1D);

GOAL Statement:

BEGIN MACRO A2 (PARAMETER 1 ) ;
Purpose :
T h i s statement specifies the start of a GOAL source
language macro. Since macros o n l y refer to the source code
and are expanded w i t h i n the t r a n s l a t o r , there is no HAL/S
equivalent.
T h i s does n o t exclude u s e of a HAL/S macro form as
part of the generated HAL/S source code i f a GOAL-to-IiAL/S
t r a n s l a t i o n is done a t the source language level. But
such use is completely s e p a r a t e 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 p a r t i c u l a r 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.
the discussion of RLEAVE" above.

See comment in

A- 34
INTERMETRICS INCORPORATED 701 CONCORD AVENUE

CAMBRIDGE, MASSACHUSETTS 021%

(617) 661-1

System D i r e c t i v e S t a t e m e n t s

A.3.2

The GaAL system directive s t a t e m e n t s are USE, FREE, and
a l l of which refer t o the DATA BANK.

SPECIFY

-

These s t a t e m e n t s have no HAL/S e q u i v a l e n t (see S e c t i o n 3.0)
and are system-oriented i n p u t s t o t h e t r a n s l a t i o n process.
A l l data bank r e f e r e n c e s are resolved by the t r a n s l a t o r
the
data bank (as such) does n o t appear i n the o u t p u t of the
translator.

-

.

A. 3 3 S p e c i a l Aid S t a t e m e n t s
GOAL Comment Statement:
$ POWER TRANSFER SWITCH VERIFICATION:

Purpose :
Annotate l i s t i n g .

HAL/S E q u i v a l e n t Form:
a.

Embedded Comment

/*
b.

POWER TRANSFER SWITCH VERIPICATION

Comment L i n e
pos
C

Note:

*/

1
POWER TRANSFER SWITCH

VERIFICATION

Comments map d i r e c t l y i n t o comments w i t h i d e n t i c a l
t e x t and minor s y n t a x changes.

A935
NTERMETRICS INCORPORATED 701 CONCORD AVENUE

CAMBRIDGE, MASSACHUSETTS 02138 (617) 661-1840

GOAL Statement:
EXPAND MACRO ADJUST, ,
( 0 . SV) , 5340 ,;

Purpose :
Expand a GOAL s u b s t i t u t i o n macro p r i o to further
compilation

.

HAL/S Equivalent Form:

None. A l l macros involve expanding GOAL source statements,
so the macro itself and i t s expansion disappear in the translation process.

GOAL Statement:
REPIACE ;

Purpose :
Replace is a source level s u b s t i t u t i o n of characters
prior to compilation, a sort of "mini-macro" f a c i l i t y .
As with macros, it disappears following t r a n s l a t i o n because
it must be expanded i n order to translate.

A-36
INTERMETRICS INCORPORATED 701 CONCORO AVENUE

CXUIBRIDGE, MASSACHUSETTS E138 (617) 661-1

REFERENCE LIST

1)

Flanders, e t a l ; Final Report on S h u t t l e Avionics and
the GOAL Language, including the Impact of Error Detection
and Redundancy Management, Intermetrics, I n c . , Cambridge,
Mass., June 1973.

2)

Flanders, e t a l ; Final Report on G O A L - t 0 - W Translation
Study, Intermetrics, Inc., Cambridge, Mass., 1973.

NTERMETRICS “‘JCORPORATED 701 CONCORD AVENUE

CAMBRIDGE, MASSACHUSETTS 02133 (617) 661-1840



Source Exif Data:
File Type                       : PDF
File Type Extension             : pdf
MIME Type                       : application/pdf
PDF Version                     : 1.4
Linearized                      : Yes
Modify Date                     : 2007:02:23 11:23:52-05:00
Create Date                     : 2007:02:23 11:23:06-05:00
Creator                         : Acrobat Capture 3.0
Style                           : Searchable Image (Exact)
Page Count                      : 173
Mod Date                        : 2007:02:23 11:23:52-05:00
Creation Date                   : 2007:02:23 11:23:06-05:00
Producer                        : Adobe PDF Library 4.0
Metadata Date                   : 2007:02:23 11:23:52-05:00
EXIF Metadata provided by
EXIF.tools

Navigation menu