• No results found

Verificatie van een stuk wiskundige taal

N/A
N/A
Protected

Academic year: 2021

Share "Verificatie van een stuk wiskundige taal"

Copied!
10
0
0

Bezig met laden.... (Bekijk nu de volledige tekst)

Hele tekst

(1)

Verificatie van een stuk wiskundige taal

Citation for published version (APA):

de Bruijn, N. G. (1967). Verificatie van een stuk wiskundige taal. Technische Hogeschool Eindhoven.

Document status and date: Gepubliceerd: 01/01/1967

Document Version:

Uitgevers PDF, ook bekend als Version of Record

Please check the document version of this publication:

• A submitted manuscript is the version of the article upon submission and before peer-review. There can be important differences between the submitted version and the official published version of record. People interested in the research are advised to contact the author for the final version of the publication, or visit the DOI to the publisher's website.

• The final author version and the galley proof are versions of the publication after peer review.

• The final published version features the final layout of the paper including the volume, issue and page numbers.

Link to publication

General rights

Copyright and moral rights for the publications made accessible in the public portal are retained by the authors and/or other copyright owners and it is a condition of accessing publications that users recognise and abide by the legal requirements associated with these rights. • Users may download and print one copy of any publication from the public portal for the purpose of private study or research. • You may not further distribute the material or use it for any profit-making activity or commercial gain

• You may freely distribute the URL identifying the publication in the public portal.

If the publication is distributed under the terms of Article 25fa of the Dutch Copyright Act, indicated by the “Taverne” license above, please follow below link for the End User Agreement:

www.tue.nl/taverne Take down policy

If you believe that this document breaches copyright please contact us at: openaccess@tue.nl

providing details and we will investigate your claim.

(2)

N,G. de Bruijn

-

6 juni 1967

Verifioatie van een stuk wiskundi~e ta a l .

H e t stuk taal. bestaat u i t enkele arrays :

l e v e l [ 0 r

M]

(elementen z i jn i n t e g e r s ) middle

[I

t

M]

(elernenten zi jnexpressions)

right [ 1 t

M]

(elementen zi jn categories).

L I

n3

-

7

c

t n ) . .

Een expression i s 'bf een eymbool genaamd "empty bloukopener" of een aymbool genaamd "primitive notiontt o f een echte erpressie.

Een echte expreseie ie bf een positive integer, bf een r i j aymbolen v.d.

positive integer(echte erpreraie,.

. .

,echte expressie).

I n dit l a a t a t e geval worden dese oomponenten aangeduid met " h a d " e

van E, 1 subexpmeaie van E, enr,, a l s E een a f k o r t i n g vo'or do expreae-to irr.

b o l , t r u t h , axiom, e l t , aet. ' l i d , . .

t :.A "- '

$#;-&%:., ;:' < ,

' t,*?q- '

We r i l l e n de in onze taal opgeachrevm xinnen verifiBren door 3@4$&$:.

. r * S b ' 3

' voor bBn t s onderwerpen aan do prooedure aoceptable, nl. a m

/'

4

/-7

\ ,-

9

, , 1 '

Op het ogenblik d a t de mde sin onderllrocht wordt dienen a l l e v o w

y"/'

reeds geaaaepteerd t e sijn. l e v e l

[o]

die@ de raarde 0 te hebben. Voorbeelden van eoht e expreseiee r

(3)

* .

i n t e ~ e r prooedure numberof subexpreesions ( E ) ; expression E; i n t w e r number of eubexpresaions;

begin

...

comment De s t i p p e l t j e e e v e n aan numberofsubexpressions a l e waarde het aantal subexpressions van E

b i t

aantal kan ook nu1 z i j n ) , b l l e e n

am t e roepen a l e E een echte erpressie i s ;

end;

e x ~ r e e e i o n pmoedure eubexpreesion (E, i ) ; express ion E, subexpreasion;

$it eger i ;

begin

...*...

oommat D e s t i p p e l t j e e germ aan eubexpreseion als m a d e de i-do eubexpreseion prul E. Alleen aan te roepen d s E een eohte expr&sie

i e en h > 0, 1 4 i h, waarbij h het aantal subexpreseiee mn E i a ;

a;

integer procedm head (E) ; emreeeion E; i n t w e r head;

besrlll * * * . * , e . . ~ e . * * . * * e . * ~ * * * *

oomueat D e ~ t i p p a l t j e e gwm asn head als raarde de head *an

E.

Alleen aan t e roepen a l e

E

een echte e r p r e s e i e ia;

ssil)

exxrurion

~ r o a . 8 ~ 1 ~ build (p, t,

z);

i n t e m r p, t ;

ex~re8rig1a X [l a t ]t

emmesaion

build;

lm0Kl-n

*...*....**...*...*

o s m n t De

a t i p p d t 3 e r &wen urn build a l a m a d e de q r e r t a i e

P(Z[I]

,,..,

~ [ t ] ) . Ulesn aan t e roepen ale p 1, t

a

1 en e l 8 Z[1

I,.

..

, Z i t ] eohte expreeaiee a i jn;

(4)

Intemr array prooedure greoedingl eadere (n, m) ; f n t e ~ e r n,m;

integer army precedingleaders

[I

1 m];

oomment Zoekt de m d i r e a t aan pleat8 n voorafgaande plaatsm raar een bij n geldig blok nordt geopend. Als er bi j n zelf een blok wordt geopend is

de m - d e plaats n zelf. Dus precedingleaders [k] i s , als 1 d k

<

rn, het

g r o o t s t e get& q 6 n met level [q]

s

level [n]

+

k

-

m.. Alleen aan t e

roepen a l e 1 6 m < l e v e l [n]. Werkt a l l e e n goed als indenlaad voor alle

x

geldt l e v e l [ x

+

1 1 c 1

+

level [x]; be& integer t , ~ ; t I = n; a I- level [n];

for k 11 rn s t e ~ -1 until 1

&

-

p r e a e d b l e a d e r r [k] t - t

+

1; B 1- B

-

1

boolean procedure oategorgimpl iaat ion (p, q) ; o a t e m q p, q;

.-

eat egoryhpl ica% ion;

k r i g

. 0 * * . * . . * . * * . * o....,..

aaraaent

D e s t i p p e l t j e ~ bererkstelligen dat categorgimplioatioa

true

rordt in de rolgende gerallen

- - - bod truth axim truth axiom eet met e l t b o d truth boor boo1 bool truth t r u t h 8 e t e l t elt axiom axiom

(5)

' r'-"

,g:

,&'

prooedure oompatible ( l , n , ~ , p ) ; integer n,l'; expression E, catemry p;

comment Ondenoekt o f de regel met l e v e l 1, i n d e n t i f i e r n, middle E,

a a t e p r y p geschrwen zou mogen wozden. Alleen a m te roepen als E een

echte expressie is;

if s

3

n 1

+

m < revel

[

s] then goto f out 8

-

,

f o r

N

,t- n-1

at*

-1 until B

9

-

if l e v e l

[a]

+

m

<

l e v e l

[

a] then u o t o fout ;

-

*ssvT ,,

c - -

if'~'\'oategoryimplication (right [a], p)

-

f a l s e then m t o f o u t ;

-

@-- - if m = 0 t h e n g o t o end;

-

-

for h 8 - 1 - 1 until

me

, middle [u] emptyblockopener then

BE&

emremion a r r q ~ r V[1 : h

-

1

1;

.$&mE

31

for j I- 1 ~ t e p 1 u n t i l h

L

-1

&

~ [ j ] r-

-

m b e x p n h i o n (E, j ) 1

&=

build (a[h],h-1

,w);

oheakidentity ( H , subsxpreeeion (E, h))

(6)

o m e n t beoordeelt aanvaardbaarheid ran regel n met nireau 1 , midden E, categorie

p

p;

+ s p a ~ c . t i u - 3 . J

5-f

1 > level [n-1

1.

+

1 then m t o fout ;

\

be& if

E

-

_

primitivenotion then

-_

- - mto OK3

,

- . /

if p = true then- CK elae goto fout;

-

OZCl print

4

aaaepted ; goto end;

prerriqn

~moaduxle

applydefinition

(E);

sxpreeeion

E,

applydefinition;

ooanat&

Als E

een euhte expraooie is, mrdt een nieuwe erpressie bepaald

doer

E

met

gebruikmnkir.rg van de bij head(^) t e vinden expreeeie uit te

mrkeab

t f m a u m b e r o f e ~ b ~ ~ e i o x u (E); q t - b a d (E);

~ t - O $ w n

beprin if middle [q

]

-

empfybloakopener middle [q

]

= prtmitivenot ion thea

-

(7)

b 1

-

preaedingl eadere (q, t

)

; 1 :I l e v e l b

[I

1;

if middle [q

1

-

primitivenotion

then

-

begin applydef i n i t i o n 1- E g o t o end

2

s

;

if middle [q] 8 - emptyblockopener then

-

begin applydefinition r = subexpreeaion (~,t); a o t o end

endl

for j t- 1

etep

1 u n t i l t ~ [ j

]

t - eubexpreasion

(E,J);

-

(8)

erpreeeian pmoedura e u b s t i t u t e ( ~ , t , ~ , l ) 1 expreesi.on M, i n t e ~ e r t , l ;

emreeeion a n q H[I 1 t];

oomment Laat M sen op plaats k g d d i g e ecb@ .,. expressie z i j n , l a a t t

a

1,

en last n,

,

.. .

,n de t b i j plaata k hehoremle precedingleader~~ voorstell en. t

Het level van n, . heet 1 . Laat HI

,.

. .

,H

achte exprcssies zijn. D e prooedure

t

subetitute beechri j f t het e f f e c t op M van s u b s t i t u t i e van

HI,.

.

.,,Ht op plaate

-- -

bwin intwes a , r , h , i , e ; ,'

<U-.L+-

-

a-

-s t - head

(M)

; ,

/rd

f l =

ep&

k<w4?.x

.

-

&..+

-

h 8- munberofsubexpreesiona

(M);

If a

-

0 then

-

be&i(aubetitute r-

M $

g o t o end

- - - --

.

bwin examweion array Z

[I

r a];

-

-

fee-

-

-

(9)

procedure oheckidentity (E,F); expreesian E,F,G;

bwin if head(^) < head(^) then

begin G r - F; F t - E; E r- G

end;

h & ( ~ ) >

head(^)

then begin G r- spplydef Inition ( E ) 8

checkidentity (G

,F

)

; got0 end

*3

head E

-

head F then begin integer k,l,h, j;

k I- numberof eubexpreeeions

(E)

I

1 t - numberofmbexpreaaianm

(F)

;

If

k > 1

then

-

b w k 1- It 1 t r k; k t r

h;

Q

8 -

Ft F

8 -

E,

E t r G a t i f k < l t h . n

-

.

-

emmwioq

-

Q[I t

I

i n t e m r

amw

a l l t

11;

o a m e n a D i t deel van het programma zorgt erooor dat E e r

man de voorkant l - k aubexpreesies b i j k r i j g t , elk ait e m identifier bertaande,

nl.

a[l],..

.

,a[l-k];

a

t - pre06dia&eadera

head(^)

,1) ;

&

3

1- 1 etm 1

g&&

la&

~ [ j ] 8- r [ j l ;

(10)

far j eteep 1 until k

&

-

be- emreasion P,Q; I? r- eubexpreasion (E, j); Q r- suberpreeeion (F, j); oheokidenti* (P,Q)

Referenties

GERELATEERDE DOCUMENTEN

Copyright and moral rights for the publications made accessible in the public portal are retained by the authors and/or other copyright owners and it is a condition of

Copyright and moral rights for the publications made accessible in the public portal are retained by the authors and/or other copyright owners and it is a condition of

Copyright and moral rights for the publications made accessible in the public portal are retained by the authors and/or other copyright owners and it is a condition of

Copyright and moral rights for the publications made accessible in the public portal are retained by the authors and/or other copyright owners and it is a condition of

Copyright and moral rights for the publications made accessible in the public portal are retained by the authors and/or other copyright owners and it is a condition of

Copyright and moral rights for the publications made accessible in the public portal are retained by the authors and/or other copyright owners and it is a condition of

Copyright and moral rights for the publications made accessible in the public portal are retained by the authors and/or other copyright owners and it is a condition of

Copyright and moral rights for the publications made accessible in the public portal are retained by the authors and/or other copyright owners and it is a condition of