lecture 9 - york university

16
LECTURE 9 MONDAY FEBRUARY 3

Upload: others

Post on 29-May-2022

0 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: LECTURE 9 - York University

LECTURE 9MONDAY FEBRUARY 3

Page 2: LECTURE 9 - York University

- Labtest 1: * Birthday Book * MATHMODELS * Iterator Patterns: Two Tutorial Series↳REL TYLER→

Page 3: LECTURE 9 - York University

i.÷÷÷÷÷÷÷:a:* ÷÷÷÷÷÷÷÷÷÷ii¥m÷÷way l"mark '

* key toexist

Page 4: LECTURE 9 - York University

Testing REL in MATHMODELS'" E -

Page 5: LECTURE 9 - York University

override ( s : SEK PAIR . - s)

overridden ( s : SET ether . - s) .- RELLGi-B

r . override ( s) → command- does not return

↳ not to be used

" overridden ( s) . domainin contract

Page 6: LECTURE 9 - York University

V. overridden (KL ''d's too] , [' 'E''shoo]Do - -

/ Lasko) (9,200)

relation d ,-7"

vs . ↳ v2

fmc→d, -74

Page 7: LECTURE 9 - York University

all_positive_values (a: ARRAY[INTEGER]): ARRAY[INTEGER] require no_duplicates: ?? ensure across Result is x all x > 0 end

°'÷¥¥÷÷÷¥¥⇐÷④÷¥t÷÷÷÷÷:÷.

Page 8: LECTURE 9 - York University

Writing Postcondition: Exercise

all_positive_values (a: ARRAY[INTEGER]): ARRAY[INTEGER] require no_duplicates: ?? ensure across Result is x all x > 0 end

'

÷!.. .real.nn⇒→:÷÷÷:÷

.

Page 9: LECTURE 9 - York University

all_positive_values (a: ARRAY[INTEGER]): ARRAY[INTEGER] require no_duplicates: ?? ensure across Result is x all x > 0 end

"

÷÷÷:÷÷÷÷÷÷÷÷i÷÷IahEEHhhaB⑦me

Page 10: LECTURE 9 - York University

all_positive_values (a: ARRAY[INTEGER]): ARRAY[INTEGER] require no_duplicates: ?? ensure across Result is x all x > 0 end

"

faena.is#.faT*.nascnD9.9"" µ÷¥.←

aRest

Page 11: LECTURE 9 - York University

⑤"

... .

= DET A TES

e:&:¥÷÷¥¥me

Tonalso in

a .

Pos .

Page 12: LECTURE 9 - York University

all_positive_values (a: ARRAY[INTEGER]): ARRAY[INTEGER] require no_duplicates: ?? ensure across Result is x all x > 0 end

tall- pos- in- a- in- result :

-

across a I n alt

adn >0 implies Result

.hash,

a"-

in

::":¥¥¥n::" an:÷. .

end.

resolution : FduphT¥f : ? ?

Page 13: LECTURE 9 - York University

HMMoccurred

Page 14: LECTURE 9 - York University

f-require require✓↳ attributes

locale¥::ii!ie )..↳ x old :

entire ensure

↳ attributes end↳ quires↳lxbcalva.to↳ V old -

Page 15: LECTURE 9 - York University

domain range

“Alan”

“Mark”

“Tom”August-11

October-15

Model of an Example Birthday Book

May-21

“Jim”

- → Hak , Tom

aunt"

÷÷n÷:D.it#IH-so-

Page 16: LECTURE 9 - York University

Birthday Book: Design→""

t.su#iEiiii;oSTEEG

.

¥

' '@

#

remind: -

jug,yq 1¥remind: ARRAY E -I