Laboratoire

de

l'Informatique

du

Parall?lisme

Ecole

Normale

Sup?rieure

de

Lyon

Unit

de

recherche

associ?e

au

CNRS

n

Escape

constructs

in

data-parallel

languages

semantics

and

proof

system

Luc

Boug?e

Gil

Utard

June

Research

Report

No

Ecole

Normale

Sup?rieure

de

Lyon

Adresse

lectronique

lip@lip.ens-lyon.fr

T?l?phone

-LRB-

-RRB-

T?l?copieur

-LRB-

-RRB-

All?e

d'Italie

Lyon

Cedex

France

Escape

constructs

in

data-parallel

languages

semantics

and

proof

system

Luc

Boug?e

Gil

Utard

June

Abstract

We

describe

a

simple

data-parallel

kernel

language

which

encapsulates

the

main

dataparallel

control

structures

found

in

high-level

languages

such

as

MasPar

's

MPL

or

the

recent

HyperC

In

particular

it

includes

the

concept

of

data-parallel

escape

which

extends

the

break

and

continue

constructs

of

the

scalar

C

language

We

give

this

language

a

natural

semantics

we

define

a

notion

of

assertion

and

describe

an

assertional

proof

system

We

demonstrate

its

use

by

proving

a

small

data-parallel

Mandelbrot-like

program

Citation

This

work

has

been

submitted

for

presentation

at

the

Conference

on

the

Foundations

of

Software

Technology

and

Theoretical

Computer

Science

December

-LCB-

Madras

India

R?esum?e

Nous

d?ecrivons

un

langage

minimal

qui

capture

la

s?emantique

des

structures

de

contr

ole

des

langages

data-parall

eles

tels

que

MPL

de

MasPar

ou

HyperC

En

particulier

il

etend

le

concept

d'

echappement

du

langage

C

scalaire

tel

que

le

break

ou

continue

au

cas

data-parall

ele

Nous

en

d?efinissons

une

s?emantique

naturelle

puis

nous

d?efinissons

une

notion

d'assertion

et

d?ecrivons

un

syst?eme

de

preuve

de

programmes

par

assertions

selon

la

m?ethode

axiomatique

de

Hoare

La

mise

en

oeuvre

du

syst?eme

est

illustr?ee

par

un

exemple

R?ef?erence

a

citer

Ce

travail

a

et?e

soumis

pour

une

pr?esentation

a

la

Conference

on

the

Foundations

of

Software

Technology

and

Theoretical

Computer

Science

December

-LCB-

Madras

India

Mots-cl

es

programmation

parall?ele

sp?ecification

et

validation

de

programmes

s?emantique

des

langages

de

programmation

langages

data-parall

eles

syst?eme

de

preuve

logique

de

Hoare

Escape

constructs

in

data-parallel

languages

semantics

and

proof

system

Luc

Boug?e?z

Gil

Utard

June

Abstract

We

describe

a

simple

data-parallel

kernel

language

which

encapsulates

the

main

data-parallel

control

structures

found

in

high-level

languages

such

as

MasPar

's

MPL

or

the

recent

HyperC

In

particular

it

includes

the

concept

of

data-parallel

escape

which

extends

the

break

and

continue

constructs

of

the

scalar

C

language

We

give

this

language

a

natural

semantics

we

define

a

notion

of

assertion

and

describe

an

assertional

proof

system

We

demonstrate

its

use

by

proving

a

small

data-parallel

Mandelbrot-like

program

Keywords

Concurrent

Programming

Specifying

and

Verifying

and

Reasoning

about

Programs

Semantics

of

Programming

Languages

Data-Parallel

Languages

Proof

System

Hoare

Logic

Citation

This

work

has

been

submitted

for

presentation

at

the

Conference

on

the

Foundations

of

Software

Technology

and

Theoretical

Computer

Science

December

-LCB-

Madras

India

LIP

ENS

Lyon

All?ee

d'Italie

Lyon

C?edex

France

zAuthors

contact

Luc

Boug?e

-LRB-

Luc.Bouge@lip.ens-lyon.fr

-RRB-

This

work

has

been

partly

supported

by

the

French

CNRS

Coordinated

Research

Program

on

Concurrency

Communication

and

Cooperation

and

Department

of

Defense

DRET

contract

Contents

Introduction

The

L

language

Informal

description

A

natural

semantics

for

L

Extending

L

with

non-local

control

transfer

commands

Informal

description

A

natural

semantics

for

Assertions

and

specifications

An

assertion

language

for

L

programs

Extending

assertions

to

programs

A

proof

system

for

programs

An

extended

example

Conclusion

Introduction

The

impressive

effort

put

in

the

design

and

the

implementation

of

the

High

Performance

Fortran

-LRB-

HPF

-RRB-

language

-LSB-

-RSB-

in

the

past

year

has

brought

data-parallelism

to

the

forefront

of

the

research

scene

Data-parallel

programming

appears

today

as

a

major

advance

in

the

long

quest

towards

a

portable

parallel

programming

environment

available

from

low

cost

workstation

clusters

to

massively

parallel

computers

We

are

now

witnessing

the

emergence

of

a

number

of

data-parallel

languages

most

of

them

derived

from

Fortran

or

C

and

mainly

designed

by

the

constructors

of

massively

parallel

machines

for

their

customers

Unfortunately

their

design

has

often

been

primarily

motivated

by

pragmatic

and

short-term

considerations

and

comparatively

few

studies

have

been

done

on

their

principles

on

their

semantic

expressivity

or

on

the

associated

program

validation

methods

This

results

in

poor

language

design

semantic

hand-waving

and

pitfalls

unmaintainable

programs

and

ultimately

a

waste

of

time

and

money

Current

data-parallel

languages

can

be

classified

into

two

categories

depending

on

the

diversity

of

their

data-parallel

control

structures

Low-level

languages

such

as

HPF

or

Thinking

Machine

's

C

offer

parallel

data-types

-LRB-

distributed

arrays

shapes

etc.

-RRB-

and

assignment

commands

between

parallel

objects

-LRB-

possibly

including

rearrangement

-RRB-

But

the

overall

control

structure

is

still

scalar

inherited

from

the

original

language

There

is

no

specific

data-parallel

control

besides

the

conditioning

where

construct

which

restricts

the

current

extent

of

parallelism

Such

languages

are

very

close

to

the

old

Actus

language

of

Perrot

-LSB-

-RSB-

probably

the

first

attempt

towards

a

semantic

approach

of

data-parallelism

High-level

languages

such

as

MasPar

's

MPL

or

the

recent

HyperC

-LSB-

-RSB-

define

besides

the

scalar

control

structure

inherited

from

the

original

language

a

rich

set

of

data-parallel

control

structures

They

include

the

data-parallel

extensions

of

usual

scalar

constructs

such

as

for

while

switch

and

their

associated

non-local

control-transfer

commands

break

and

continue

This

additional

semantic

facility

has

proved

to

be

appropriate

for

a

clean

description

of

many

data-parallel

algorithms

in

the

same

way

as

using

the

C

break

construct

often

leads

to

a

clearer

coding

In

this

respect

these

languages

can

be

called

fully

data-parallel

as

they

go

much

beyond

embedding

data-parallel

assignments

into

a

scalar

control

harness

Several

researchers

have

attempted

to

give

a

formal

semantics

to

such

data-parallel

languages

and

to

use

it

to

prove

programs

correct

Most

works

have

focused

on

the

data-parallel

assignment

-LRB-

see

for

instance

-LSB-

-RSB-

and

to

some

extent

-LSB-

-RSB-

-RRB-

that

is

a

low-level

approach

in

the

above

classification

An

early

attempt

for

the

Actus

language

can

be

found

in

-LSB-

-RSB-

there

the

entire

Actus

language

is

considered

at

the

price

of

considerable

technical

complexity

In

contrast

we

have

shown

in

our

previous

papers

that

it

is

possible

to

define

a

kernel

data-parallel

language

called

L

which

encapsulates

the

main

features

of

the

low-level

languages

-LSB-

-RSB-

We

have

described

a

natural

semantics

for

it

and

an

assertional

proof

system

-LSB-

-RSB-

Moreover

we

have

shown

the

possibility

of

defining

a

weakest

precondition

-LRB-

WP

-RRB-

calculus

for

L

-LSB-

-RSB-

It

can

be

used

as

a

basis

to

demonstrate

the

-LRB-

relative

-RRB-

completeness

of

this

proof

system

It

also

opens

the

way

to

a

computer-aided

validation

tool

for

L

programs

based

on

the

automatic

generation

of

verification

conditions

-LSB-

-RSB-

This

contribution

of

this

paper

is

to

extend

these

results

to

the

case

of

high-level

languages

First

we

describe

an

extended

version

of

the

L

kernel

language

called

which

captures

the

notion

of

data-parallel

non-local

control

transfer

We

give

it

a

natural

semantics

based

on

the

multi-context

approach

of

-LSB-

-RSB-

We

define

an

extended

notion

of

assertion

and

we

describe

the

associated

proof

rules

This

is

illustrated

by

the

proof

of

a

simple

data-parallel

factorial

program

The

L

language

An

extensive

presentation

of

the

L

language

can

be

found

in

-LSB-

-RSB-

For

the

sake

of

completeness

we

briefly

recall

its

natural

semantics

as

described

in

-LSB-

-RSB-

Informal

description

In

the

data-parallel

programming

model

the

basic

objects

are

arrays

with

parallel

access

Two

kinds

of

actions

can

be

applied

to

these

objects

componentwise

operations

and

global

rearrangements

A

program

is

a

sequential

composition

of

such

actions

Each

action

is

associated

with

the

set

of

array

indices

at

which

it

is

applied

An

index

at

which

an

action

is

applied

is

said

to

be

active

Other

indices

are

said

to

be

idle

The

set

of

active

indices

is

called

the

activity

context

or

the

extent

of

parallelism

It

can

be

seen

as

a

boolean

array

where

true

denotes

activity

and

false

idleness

The

L

language

is

designed

as

a

common

kernel

of

data-parallel

languages

like

C

-LSB-

-RSB-

HyperC

-LSB-

-RSB-

or

MPL

-LSB-

-RSB-

We

do

not

consider

the

scalar

part

of

these

languages

mainly

imported

from

the

C

language

For

the

sake

of

simplicity

we

consider

only

arrays

of

dimension

one

also

called

vectors

indexed

by

integers

It

follows

that

all

variables

of

L

are

parallel

and

all

the

objects

are

vectors

of

scalars

with

one

component

at

each

index

As

a

convention

the

parallel

objects

are

denoted

with

uppercase

letters

The

legal

expressions

are

pure

expressions

i.e.

without

side

effects

defined

like

the

pure

functions

of

HPF

The

value

of

a

pure

expression

at

index

u

only

depends

on

the

values

of

the

variables

at

index

u

The

expressions

are

evaluated

by

applying

operators

componentwise

to

parallel

values

We

do

not

further

specify

the

syntax

and

semantics

of

such

expressions

The

component

of

parallel

object

X

located

at

index

u

is

denoted

by

X

ju

We

introduce

a

special

vector

constant

called

This

The

value

of

its

component

at

each

index

u

is

the

value

u

itself

Thisju

u.

Note

that

This

is

a

pure

expression

and

that

all

constructs

defined

here

are

deterministic

Assignment

X

E

At

each

active

index

u

component

X

ju

is

updated

with

the

local

value

of

pure

expression

E.

Communication

get

X

from

A

into

Y

At

each

active

index

u

pure

expression

A

is

evaluated

to

an

index

v

then

component

Y

ju

is

updated

with

the

value

of

component

X

jv

We

always

assume

that

v

is

a

valid

index

-LRB-

Notice

that

the

remote

expression

X

is

restricted

to

be

a

variable

-RRB-

Sequencing

S

T

The

execution

of

the

actions

of

T

starts

on

the

termination

of

the

last

action

of

S.

Iteration

loop

B

do

S

end

The

actions

of

S

are

repeatedly

executed

with

the

current

extent

of

parallelism

until

pure

boolean

expression

B

evaluates

to

false

at

each

currently

active

index

Conditioning

where

B

do

S

end

The

body

S

of

a

conditioning

block

is

executed

in

a

new

activity

context

defined

as

follows

The

initially

idle

indices

remain

idle

during

the

execution

S

The

initially

active

indices

where

pure

boolean

expression

B

evaluates

to

false

are

turned

idle

M

N

R

N

loop

-LRB-

M

-RRB-

do

where

-LRB-

M

-RRB-

do

M

M

R

R?M

end

end

Figure

The

data-parallel

factorial

L

version

during

the

execution

of

S

they

are

called

deselected

The

remaining

ones

remain

active

during

the

execution

of

S

they

are

called

selected

The

initial

activity

context

is

restored

on

termination

of

S.

Note

that

the

MPL

data-parallel

while

construct

can

be

expressed

by

a

where

nested

in

a

loop

As

This

is

a

pure

L

expression

note

also

that

the

local

computations

may

depend

on

the

value

of

the

local

index

In

this

paper

we

will

consider

the

running

example

shown

in

Figure

Given

an

initial

integer

vector

N

with

all

components

N

ju

we

want

to

compute

an

integer

vector

R

such

that

at

each

index

u

Rju

factorial

-LRB-

N

ju

-RRB-

The

idea

is

to

build

the

decreasing

product

chain

at

each

index

until

is

reached

and

then

to

remain

in

active

wait

until

is

reached

at

all

indices

A

natural

semantics

for

L

We

describe

the

semantics

of

L

in

the

style

of

Kahn

and

Plotkin

's

natural

semantics

by

induction

on

the

syntax

of

L

An

environment

oe

is

a

function

from

identifiers

to

vector

values

The

set

of

environments

is

denoted

by

Env

For

convenience

we

extend

the

environment

functions

to

parallel

expressions

oe

-LRB-

E

-RRB-

denotes

the

value

obtained

by

evaluating

parallel

expression

E

in

environment

oe

We

do

not

specify

any

further

the

internals

of

expressions

Note

that

oe

-LRB-

This

-RRB-

ju

u

by

definition

Definition

-LRB-

Pure

expression

-RRB-

A

parallel

expression

E

is

pure

if

for

any

index

u

and

any

environments

oe

and

-LRB-

oe

-LRB-

X

-RRB-

ju

-LRB-

X

-RRB-

ju

-RRB-

-RRB-

-LRB-

oe

-LRB-

E

-RRB-

ju

-LRB-

E

-RRB-

ju

-RRB-

Let

oe

be

an

environment

X

a

vector

variable

and

V

a

vector

value

We

denote

by

oe

-LSB-

X

V

-RSB-

the

new

environment

where

-LRB-

X

-RRB-

V

and

-LRB-

Y

-RRB-

oe

-LRB-

Y

-RRB-

for

all

Y

X

A

context

c

is

a

boolean

vector

It

specifies

the

activity

at

each

index

cju

is

true

iff

index

u

is

active

The

set

of

contexts

is

denoted

by

Ctx

We

distinguish

a

particular

context

denoted

by

True

whose

components

all

have

value

true

For

the

sake

of

consistency

with

Section

we

introduce

the

notation

active

active

c

A

state

is

a

pair

made

of

an

environment

and

a

context

The

set

of

states

is

denoted

by

State

State

-LRB-

Env

Ctx

-RRB-

-LSB-

f?g

where

denotes

the

undefined

state

The

semantics

-LSB-

-LSB-

S

-RSB-

-RSB-

of

a

program

S

is

a

strict

function

from

State

to

State

-LSB-

-LSB-

S

-RSB-

-RSB-

-LRB-

-RRB-

and

-LSB-

-LSB-

S

-RSB-

-RSB-

is

extended

to

sets

of

states

as

usual

The

following

paragraphs

define

-LSB-

-LSB-

-RSB-

-RSB-

for

L

programs

Assignment

At

each

active

index

the

component

of

the

parallel

variable

is

updated

with

the

new

value

-LSB-

-LSB-

X

E

-RSB-

-RSB-

-LRB-

oe

c

-RRB-

-LRB-

c

-RRB-

with

oe

-LSB-

X

V

-RSB-

where

V

ju

oe

-LRB-

E

-RRB-

ju

if

active

ju

and

V

ju

oe

-LRB-

X

-RRB-

ju

otherwise

The

activity

context

is

preserved

Notice

that

since

E

is

pure

the

evaluation

of

oe

-LRB-

E

-RRB-

ju

requires

no

communications

it

is

local

Communication

It

acts

very

much

as

an

assignment

except

that

the

assigned

value

is

the

value

of

another

component

-LSB-

-LSB-

get

X

from

A

into

Y

-RSB-

-RSB-

-LRB-

oe

c

-RRB-

-LRB-

c

-RRB-

with

oe

-LSB-

Y

V

-RSB-

where

V

ju

oe

-LRB-

X

-RRB-

joe

-LRB-

A

-RRB-

ju

if

active

ju

and

V

ju

oe

-LRB-

Y

-RRB-

ju

otherwise

Again

the

evaluation

of

oe

-LRB-

A

-RRB-

ju

is

local

and

context

is

preserved

Sequencing

Sequential

composition

denotes

functional

composition

-LSB-

-LSB-

S

T

-RSB-

-RSB-

-LRB-

oe

c

-RRB-

-LSB-

-LSB-

T

-RSB-

-RSB-

-LRB-

-LSB-

-LSB-

S

-RSB-

-RSB-

-LRB-

oe

c

-RRB-

-RRB-

Iteration

Iteration

is

expressed

by

classical

loop

unfolding

It

terminates

when

the

pure

boolean

expression

B

evaluates

to

false

at

each

active

index

-LSB-

-LSB-

loop

B

do

S

end

-RSB-

-RSB-

-LRB-

oe

c

-RRB-

-LSB-

-LSB-

loop

B

do

S

end

-RSB-

-RSB-

-LRB-

-LSB-

-LSB-

S

-RSB-

-RSB-

-LRB-

oe

c

-RRB-

-RRB-

if

-LRB-

activeju

oe

-LRB-

B

-RRB-

ju

-RRB-

-LRB-

oe

c

-RRB-

otherwise

If

the

unfolding

does

not

terminates

then

we

take

the

usual

convention

-LSB-

-LSB-

loop

B

do

S

end

-RSB-

-RSB-

-LRB-

oe

c

-RRB-

Conditioning

The

denotation

of

a

where

construct

is

the

denotation

of

its

body

with

a

new

context

The

new

context

is

the

conjunction

of

the

previous

one

with

the

value

of

the

pure

conditioning

expression

B

If

-LSB-

-LSB-

S

-RSB-

-RSB-

-LRB-

oe

c

oe

-LRB-

B

-RRB-

-RRB-

-LRB-

-RRB-

then

we

have

-LSB-

-LSB-

where

B

do

S

end

-RSB-

-RSB-

-LRB-

oe

c

-RRB-

-LRB-

c

-RRB-

If

-LSB-

-LSB-

S

-RSB-

-RSB-

-LRB-

oe

c

oe

-LRB-

B

-RRB-

-RRB-

then

we

put

-LSB-

-LSB-

where

B

do

S

end

-RSB-

-RSB-

-LRB-

oe

c

-RRB-

Observe

that

the

value

of

is

ignored

here

i.e.

the

initial

context

is

restored

on

exit

from

the

where

block

The

evaluation

of

oe

-LRB-

B

-RRB-

is

local

Remark

In

the

L

language

the

activity

context

is

preserved

by

terminating

executions

for

any

program

S

such

that

-LSB-

-LSB-

S

-RSB-

-RSB-

-LRB-

oe

c

-RRB-

-LRB-

-RRB-

we

have

c

This

will

no

longer

be

the

case

for

the

extended

language

below

Extending

L

with

non-local

control

transfer

commands

The

MPL

or

HyperC

languages

include

the

data-parallel

extensions

of

the

for

while

switch

control

structures

with

their

associated

escape

commands

break

and

continue

Their

intended

meaning

is

the

following

When

an

escape

command

is

executed

at

a

currently

active

index

the

activity

at

this

index

is

turned

to

idle

until

the

end

of

the

corresponding

enclosing

block

We

say

it

is

then

asleep

On

the

other

hand

executing

an

escape

command

at

an

idle

index

has

no

effect

Once

the

control

has

reached

the

end

of

the

block

the

initial

awakeness

is

restored

at

all

indices

This

is

thus

the

straightforward

data-parallel

generalization

of

the

usual

scalar

behavior

which

is

to

jump

at

the

exit

label

of

the

block

the

jump

has

been

generalized

to

a

temporary

idleness

which

is

needed

because

of

the

global

nature

of

control

Informal

description

A

simple

way

to

give

account

of

this

behavior

in

the

L

language

is

to

extend

it

with

a

new

block

definition

structure

begin

S

end

together

with

a

escape

command

executable

in

the

scope

of

the

block

Such

a

block

will

be

called

an

escaping

block

Yet

this

is

not

sufficient

to

model

the

complex

interplay

between

the

break

and

continue

escape

commands

in

C

to

do

this

one

would

have

to

be

able

to

escape

from

more

than

one

enclosing

block

The

solution

is

thus

to

define

several

types

of

begini

S

end

escaping

blocks

with

their

respective

escape

escapei

commands

labelled

i

N

The

use

of

escaping

blocks

is

illustrated

by

the

program

below

We

consider

vectors

of

size

where

indices

range

between

and

The

comments

at

the

end

of

each

line

show

the

evolution

of

the

currently

active

index

list

Recall

that

expression

This

evaluates

to

the

local

index

value

Indices

are

active

where

-LRB-

This

-RRB-

do

where

-LRB-

This

-RRB-

do

end

end

end

end

For

usual

data-parallel

languages

derived

from

C

N

is

sufficient

type

defines

for

instance

the

scope

of

the

break

command

which

corresponds

to

type

defines

the

scope

of

the

continue

command

which

corresponds

to

-LRB-

Note

that

an

additional

type

could

be

defined

to

handle

the

data-parallel

extension

of

the

C

return

command

-RRB-

Thanks

to

these

data-parallel

non-local

transfer

commands

our

running

example

can

be

recast

as

in

Figure

On

executing

the

command

at

line

at

an

active

index

u

such

that

M

ju

this

index

falls

asleep

and

it

remains

idle

until

the

end

of

the

enclosing

type

block

at

line

The

loop

at

line

terminates

as

soon

as

all

indices

have

turned

idle

that

is

after

all

indices

have

'd

Once

the

global

control

reaches

line

all

asleep

indices

wake

up

The

reader

may

wish

to

compare

this

behavior

with

the

usual

C

code

M

N

R

N

-LRB-

-RRB-

-LRB-

-RRB-

loop

True

do

-LRB-

-RRB-

where

-LRB-

M

-RRB-

do

end

-LRB-

-RRB-

M

M

-LRB-

-RRB-

R

R?M

-LRB-

-RRB-

end

-LRB-

-RRB-

end

-LRB-

-RRB-

Figure

The

data-parallel

factorial

version

m

n

r

n

for

-LRB-

;-RRB-

-LCB-

if

-LRB-

m

-RRB-

break

m

r

m

-RCB-

Let

be

the

L

language

extended

with

N

block

definition

structures

begini

S

end

i

N

and

the

N

corresponding

escape

commands

escapei

A

natural

semantics

for

The

original

notion

of

activity

of

L

becomes

now

two-fold

in

Conditioning

context

It

is

defined

by

the

where

conditioning

blocks

An

index

is

said

to

be

selected

or

not

according

to

the

value

of

the

conditioning

expression

Escaping

context

It

is

defined

for

each

escaping

begini

block

An

index

can

be

awake

or

asleep

On

executing

an

escapek

command

all

currently

active

indices

fall

asleep

until

the

end

of

the

enclosing

escaping

block

of

type

k

An

index

is

active

in

if

it

is

both

selected

with

respect

to

the

enclosing

conditioning

block

and

awake

with

respect

to

the

enclosing

escaping

blocks

of

each

type

An

index

not

active

is

said

to

be

idle

The

original

notion

of

state

-LRB-

oe

c

-RRB-

in

L

can

then

be

similarly

extended

A

state

is

now

a

triple

-LRB-

oe

c

a

-RRB-

where

oe

is

the

environment

c

is

a

boolean

vector

and

a

aNi

is

a

list

of

boolean

vectors

Vector

c

denotes

the

conditioning

context

for

each

index

u

cju

is

true

if

u

is

selected

and

false

otherwise

Each

vector

ai

denotes

the

escaping

context

of

type

i

for

each

index

u

aiju

is

true

if

u

is

awake

in

block

i

and

it

is

false

if

it

is

asleep

It

is

convenient

to

extend

the

notation

defined

in

Section

active

c

-LRB-

i

N

i

ai

-RRB-

Thanks

to

this

convention

the

semantic

equations

of

for

assignment

communication

sequencing

and

iteration

are

obvious

extensions

of

the

corresponding

parts

of

L

's

semantics

We

only

list

below

the

remaining

cases

Conditioning

block

On

entering

a

conditioning

block

the

conditioning

context

is

saved

It

is

restored

on

exiting

the

block

The

new

conditioning

context

within

the

block

is

the

conjunction

of

the

initial

one

with

the

current

value

of

the

pure

expression

B.

-LSB-

-LSB-

where

B

do

S

end

-RSB-

-RSB-

-LRB-

oe

c

a

-RRB-

-LRB-

c

-RRB-

with

-LSB-

-LSB-

S

-RSB-

-RSB-

-LRB-

oe

c

oe

-LRB-

B

-RRB-

a

-RRB-

-LRB-

-RRB-

Observe

that

the

escaping

context

is

not

restored

If

-LSB-

-LSB-

S

-RSB-

-RSB-

-LRB-

oe

c

oe

-LRB-

B

-RRB-

a

-RRB-

then

we

simply

put

-LSB-

-LSB-

where

B

do

S

end

-RSB-

-RSB-

-LRB-

oe

c

a

-RRB-

Escaping

block

On

entering

an

escaping

block

of

type

k

the

escaping

context

of

type

k

is

saved

It

is

restored

on

exiting

the

block

-LSB-

-LSB-

begink

S

end

-RSB-

-RSB-

-LRB-

oe

c

a

-RRB-

-LRB-

-RRB-

with

-LSB-

-LSB-

S

-RSB-

-RSB-

-LRB-

oe

c

a

-RRB-

-LRB-

-RRB-

and

ak

i.

if

-LSB-

-LSB-

S

-RSB-

-RSB-

-LRB-

oe

c

a

-RRB-

then

we

put

-LSB-

-LSB-

begink

S

end

-RSB-

-RSB-

-LRB-

oe

c

a

-RRB-

Escape

On

executing

an

escapek

command

all

currently

active

indices

fall

asleep

with

respect

to

escaping

type

k

This

amounts

to

restricting

the

escaping

context

of

type

k

with

the

negation

of

the

current

activity

context

-LSB-

-LSB-

escapek

-RSB-

-RSB-

-LRB-

oe

c

a

-RRB-

-LRB-

oe

c

-RRB-

with

ak

ak

active

ak

aNi

Remark

In

the

L

language

we

have

stressed

that

the

activity

context

is

preserved

by

the

terminating

executions

Because

of

the

escapei

commands

of

this

invariant

is

no

longer

true

an

initially

active

index

may

be

idle

at

the

termination

Yet

it

can

be

proved

that

an

initially

idle

index

remains

idle

throughout

the

execution

Assertions

and

specifications

As

for

the

semantics

we

show

in

this

section

that

the

notion

of

assertion

defined

for

L

programs

can

be

conveniently

extended

to

programs

by

considering

multiple

activity

contexts

For

the

sake

of

completeness

we

briefly

recall

the

structure

of

L

assertions

as

described

in

-LSB-

-RSB-

An

assertion

language

for

L

programs

We

define

an

assertion

language

for

the

partial

correctness

of

L

programs

in

the

lines

of

-LSB-

-RSB-

Such

a

specification

is

denoted

by

a

formula

fPreg

S

fP

ostg

where

S

is

the

program

text

and

Pre

and

P

ost

are

logical

assertions

on

variables

of

S

This

formula

means

that

if

precondition

Pre

is

satisfied

in

the

initial

state

of

program

S

and

if

S

terminates

then

postcondition

P

ost

is

satisfied

in

the

final

state

A

proof

system

gives

a

formal

method

to

derive

such

specification

formulae

by

syntax-directed

induction

on

programs

Axioms

correspond

to

statements

and

inference

rules

to

control

structures

Then

proving

that

a

program

meets

its

specification

is

equivalent

to

deriving

the

specification

formula

fPreg

S

fP

ostg

in

the

proof

system

Such

a

proof

system

for

the

L

language

is

described

in

-LSB-

-RSB-

A

fundamental

property

of

this

axiomatic

semantics

in

the

usual

scalar

case

is

compositionality

To

achieve

this

goal

the

assertion

language

has

to

include

sufficient

information

on

variable

values

Similarly

our

assertion

language

has

to

include

some

information

about

the

current

activity

context

as

well

as

variable

values

We

therefore

define

two-part

assertions

fP

Cg

where

P

is

a

predicate

on

vector

program

variables

and

C

is

a

pure

boolean

vector

expression

which

evaluates

into

an

activity

context

Our

assertion

language

has

two

kinds

of

variables

scalar

variables

and

vector

variables

As

a

convention

scalar

variables

will

be

denoted

with

a

lowercase

initial

letter

and

vector

ones

with

an

uppercase

one

We

have

a

similar

distinction

for

arithmetic

and

logical

expressions

As

usual

scalar

-LRB-

resp

vector

-RRB-

expressions

are

inductively

defined

with

usual

arithmetic

and

logical

connectives

Basic

scalar

-LRB-

resp

vector

-RRB-

expressions

are

scalar

-LRB-

resp

vector

-RRB-

variables

and

constants

Vector

expression

can

be

subscripted

If

the

subscript

expression

is

a

scalar

expression

then

we

have

a

scalar

expression

the

meaning

of

X

ju

is

the

component

of

X

at

index

u.

Otherwise

if

the

subscript

expression

is

a

vector

expression

then

we

have

another

vector

expression

the

meaning

of

X

jA

is

a

vector

whose

component

at

index

u

is

the

value

of

component

of

X

at

index

Aju

The

meaning

of

a

vector

expression

is

obtained

by

componentwise

evaluation

We

introduce

a

scalar

conditional

expression

with

a

C-like

notation

c?e

f

Its

value

is

the

value

of

expression

e

if

c

is

true

and

f

otherwise

Similarly

the

value

of

a

conditional

vector

expression

denoted

by

C?E

F

is

a

vector

whose

component

at

index

u

is

Eju

if

Cju

is

true

and

F

ju

otherwise

Predicates

are

usual

first-order

formulae

They

are

inductively

defined

from

boolean

scalar

expressions

with

logical

connectives

and

existential

or

universal

quantifiers

binding

scalar

variables

It

turns

out

that

there

is

no

need

to

consider

quantification

on

vector

variables

We

introduce

a

substitution

mechanism

for

vector

variables

Let

P

be

a

predicate

or

any

vector

expression

X

a

vector

variable

and

E

a

vector

expression

P

-LSB-

E

X

-RSB-

denotes

the

predicate

or

expression

obtained

by

substituting

all

the

occurrences

of

X

in

P

with

E.

Note

that

all

vector

variables

are

free

by

definition

of

our

assertion

language

The

usual

Substitution

Lemma

-LSB-

-RSB-

extends

to

this

new

setting

Let

oe

be

an

environment

and

P

a

predicate

We

use

the

usual

notation

oe

j

P

to

denote

that

oe

is

a

model

of

predicate

P

that

is

P

evaluates

to

true

under

assignment

oe

Lemma

-LRB-

Substitution

lemma

-RRB-

For

every

predicate

on

vector

variables

P

vector

expression

E

and

environment

oe

oe

j

P

-LSB-

E

X

-RSB-

iff

oe

-LSB-

X

oe

-LRB-

E

-RRB-

-RSB-

j

P

Extending

assertions

to

programs

Going

from

L

to

semantics

amounts

to

replacing

the

single

activity

context

by

a

conditioning

context

and

a

list

of

escaping

contexts

We

thus

extend

the

context

part

of

L

assertions

in

a

similar

way

Assertions

are

of

the

form

fP

C

Ag

where

P

is

a

predicate

on

program

variables

C

is

a

pure

boolean

vector

expression

which

evaluates

into

the

current

conditioning

context

A

ANi

is

a

list

of

pure

boolean

vector

expressions

each

Ai

evaluates

into

the

current

escaping

context

of

type

i

The

activity

context

is

the

conjunction

of

these

contexts

It

is

the

value

of

C

Vi

N

i

Ai

For

convenience

we

denote

this

expression

by

C

A.

All

definitions

of

-LSB-

-RSB-

can

be

extended

to

this

new

setting

as

shown

below

We

extend

the

notion

of

satisfiability

-LRB-

denoted

by

j

=-RRB-

to

states

and

assertions

Definition

-LRB-

Satisfiability

-RRB-

Let

-LRB-

oe

c

a

-RRB-

be

a

state

fP

C

Ag

an

assertion

-LRB-

oe

c

a

-RRB-

j

fP

C

Ag

iff

oe

j

P

and

oe

-LRB-

C

-RRB-

c

and

oe

-LRB-

Ai

-RRB-

ai

By

convention

satisfies

any

assertion

The

set

of

states

satisfying

fP

C

Ag

is

denoted

by

-LSB-

-LSB-

fP

C

Ag

-RSB-

-RSB-

or

fP

C

Ag

when

no

confusion

may

arise

Definition

-LRB-

Assertion

implication

-RRB-

Let

fP

C

Ag

and

fQ

D

Bg

be

two

assertions

We

say

that

the

former

implies

the

latter

with

respect

to

context

fP

C

Ag

-RRB-

fQ

D

Bg

iff

P

-RRB-

Q

and

P

-RRB-

-LRB-

-LRB-

Cju

Dju

-RRB-

-LRB-

Aiju

Biju

-RRB-

-RRB-

Observe

that

this

definition

extends

the

usual

one

fP

C

Ag

-RRB-

fQ

D

Bg

iff

-LSB-

-LSB-

fP

C

Ag

-RSB-

-RSB-

-LSB-

-LSB-

fQ

D

Bg

-RSB-

-RSB-

A

proof

system

for

programs

We

may

now

define

the

validity

of

a

specification

of

a

program

with

respect

to

its

semantics

Because

satisfies

any

assertion

our

notion

validity

is

relative

to

termination

it

defines

partial

correctness

Definition

-LRB-

Specification

validity

-RRB-

Let

S

be

a

program

and

let

fP

C

Ag

and

fQ

D

Bg

be

two

assertions

We

say

that

the

specification

is

valid

denoted

by

j

fP

C

Ag

S

fQ

D

Bg

if

for

each

state

-LRB-

oe

c

a

-RRB-

such

that

-LRB-

oe

c

a

-RRB-

j

fP

C

Ag

-LSB-

-LSB-

S

-RSB-

-RSB-

-LRB-

oe

c

a

-RRB-

j

fQ

D

Bg

Following

the

notation

of

-LSB-

-RSB-

let

Change

-LRB-

S

-RRB-

be

the

set

of

variables

appearing

on

the

left

of

assignments

or

as

targets

of

get

instructions

Only

these

variables

can

have

their

values

changed

by

executing

S.

Let

Var

-LRB-

C

-RRB-

be

the

set

of

variables

which

appear

in

expression

C

The

value

of

C

depends

on

these

variables

only

We

describe

below

a

restricted

proof

system

where

we

assume

everywhere

that

context

expressions

are

not

modified

by

program

bodies

Change

-LRB-

S

-RRB-

Var

-LRB-

C

-RRB-

and

Change

-LRB-

S

-RRB-

-LRB-

-LSB-

i

N

i

Var

-LRB-

Ai

-RRB-

-RRB-

Assignment

X

E

We

extend

the

usual

backwards

axiom

by

taking

into

consideration

that

vector

variable

X

is

modified

only

at

the

active

indices

that

is

indices

where

C

A

evaluates

to

true

The

global

activity

is

preserved

by

assignments

the

initial

activity

is

the

same

as

the

final

one

As

the

conditioning

and

escaping

activities

are

described

by

boolean

vector

expressions

we

can

describe

the

respective

initial

activities

only

if

the

values

of

the

expressions

describing

the

final

ones

are

not

changed

by

the

assignment

An

easy

sufficient

condition

is

that

X

Var

-LRB-

C

-RRB-

and

X

Var

-LRB-

Ai

-RRB-

X

Var

-LRB-

C

-RRB-

and

X

Var

-LRB-

Ai

-RRB-

fP

-LSB-

-LRB-

-LRB-

C

A

-RRB-

E

X

-RRB-

X

-RSB-

C

Ag

X

E

fP

C

Ag

Communication

get

X

from

A

into

Y

As

noticed

before

a

get

is

an

assignment

of

a

remote

value

Y

Var

-LRB-

C

-RRB-

and

Y

Var

-LRB-

Ai

-RRB-

fP

-LSB-

-LRB-

-LRB-

C

A

-RRB-

X

jA

Y

-RRB-

Y

-RSB-

C

Ag

get

X

from

A

into

Y

fP

C

Ag

Sequencing

S

T

It

is

a

straightforward

generalization

of

the

usual

case

fP

C

Ag

S

fR

fR

T

fQ

D

Bg

fP

C

Ag

S

T

fQ

D

Bg

Iteration

loop

B

do

S

end

The

usual

loop

invariant

here

must

be

invariant

with

respect

to

both

the

variable

values

and

each

of

the

activity

types

fI

-LRB-

-LRB-

C

A

-RRB-

ju

Bju

-RRB-

C

Ag

S

fI

C

Ag

fI

C

Ag

loop

B

do

S

end

fI

-LRB-

-LRB-

C

A

-RRB-

ju

-RRB-

Bju

-RRB-

C

Ag

Conditioning

block

where

B

do

S

end

Following

the

semantics

the

initial

conditioning

context

is

saved

on

entering

the

block

and

restored

on

exiting

The

conditioning

context

within

the

block

is

the

conjunction

of

the

conditioning

context

expression

and

the

conditioning

expression

This

is

taken

into

account

by

and-ing

conditioning

context

expression

C

with

condition

expression

B

and

restoring

C

on

exiting

Yet

this

makes

sense

only

if

the

value

of

C

has

been

left

unchanged

The

restriction

Change

-LRB-

S

-RRB-

Var

-LRB-

C

-RRB-

is

an

easy

sufficient

condition

for

this

to

hold

fP

C

B

Ag

S

fQ

Change

-LRB-

S

-RRB-

Var

-LRB-

C

-RRB-

fP

C

Ag

where

B

do

S

end

fQ

C

Escaping

block

begink

S

end

Similarly

the

initial

escaping

context

of

type

k

is

saved

on

entering

an

escaping

block

and

restored

on

exiting

Again

the

restriction

Change

-LRB-

S

-RRB-

Var

-LRB-

Ak

-RRB-

is

sufficient

to

guarantee

that

the

value

of

Ak

has

been

left

unchanged

fP

C

Ag

S

fQ

Change

-LRB-

S

-RRB-

V

ar

-LRB-

Ak

-RRB-

fP

C

Ag

begink

S

end

fQ

with

Ak

i

Escape

escapek

All

currently

active

indices

fall

asleep

with

respect

to

escaping

type

k

The

new

escaping

context

expression

of

type

k

is

the

conjunction

of

the

previous

one

with

the

negation

of

the

global

activity

fP

C

Ag

escapek

fP

C

with

Ak

Ak

-LRB-

C

A

-RRB-

Ak

ANi

Consequence

rule

Following

Definition

we

can

state

the

consequence

rule

fP

C

Ag

-RRB-

fP

C

fP

S

-RRB-

fQ

D

Bg

fP

C

Ag

S

fQ

D

Bg

This

rule

allows

us

to

strengthen

preconditions

and

to

weaken

postconditions

of

specifications

Proposition

-LRB-

Soundness

-RRB-

This

proof

system

is

sound

if

fP

C

Ag

S

fQ

D

Bg

then

j

fP

C

Ag

S

fQ

D

Bg

Proof

The

proof

is

done

by

induction

on

the

structure

of

S

The

cases

of

the

assignment

and

communication

commands

are

simple

consequences

of

the

Substitution

Lemma

thanks

to

the

restriction

X

Var

-LRB-

C

-RRB-

and

X

Var

-LRB-

Ai

-RRB-

As

an

example

we

give

the

proof

of

the

case

of

escaping

block

Let

-LRB-

oe

c

a

-RRB-

be

a

state

satisfying

fP

C

Ag

By

definition

of

the

escaping

block

construct

assume

-LSB-

-LSB-

begink

S

end

-RSB-

-RSB-

-LRB-

oe

c

a

-RRB-

-LRB-

-RRB-

with

-LSB-

-LSB-

S

-RSB-

-RSB-

-LRB-

oe

c

a

-RRB-

-LRB-

-RRB-

and

ak

aNi

By

assumption

-LRB-

-RRB-

j

fQ

In

particular

-LRB-

-RRB-

As

Change

-LRB-

S

-RRB-

Var

-LRB-

Ak

-RRB-

we

have

oe

-LRB-

Ak

-RRB-

-LRB-

Ak

-RRB-

Thus

-LRB-

-RRB-

We

get

-LRB-

-RRB-

j

fQ

as

wanted

Remark

Two

additional

rules

will

be

introduced

in

the

next

section

to

deal

with

auxiliary

variables

in

preconditions

and

in

programs

An

extended

example

We

demonstrate

this

proof

system

by

giving

the

proof

annotation

of

our

running

example

with

assertions

in

the

manner

of

-LSB-

-RSB-

Let

P

be

our

original

program

in

Figure

Let

T

denote

the

constant

boolean

vector

whose

components

are

all

true

We

aim

at

proving

-LRB-

N

ju

-RRB-

T

hTig

P

-LRB-

Rju

N

ju

-RRB-

T

hTig

The

main

step

is

to

define

a

convenient

syntactic

loop

invariant

Observe

that

the

activity

context

decreases

as

iterations

go

It

is

thus

necessary

to

add

a

new

auxiliary

variable

A

which

is

meant

to

contain

the

value

of

the

activity

context

at

each

iteration

It

is

sufficient

to

set

it

to

true

initially

and

-LRB-

-RRB-

M

N

R

N

-LRB-

-RRB-

-LRB-

-RRB-

A

True

-LRB-

-RRB-

loop

True

do

-LRB-

-RRB-

where

-LRB-

M

-RRB-

do

A

False

end

-LRB-

-RRB-

M

M

-LRB-

-RRB-

R

R?M

-LRB-

-RRB-

end

-LRB-

-RRB-

end

Figure

The

data-parallel

factorial

version

with

the

auxiliary

variable

to

set

it

to

false

just

before

executing

the

command

this

assignment

will

then

be

completed

exactly

at

the

currently

active

indices

that

is

at

the

indices

bound

to

fall

asleep

immediately

This

new

program

P

is

displayed

on

Figure

According

to

this

intuition

variable

A

is

false

at

least

at

all

sleeping

indices

-LRB-

Aju

-RRB-

-LRB-

M

ju

-RRB-

-RRB-

and

the

role

of

line

-LRB-

-RRB-

where

-LRB-

M

-RRB-

do

A

False

end

is

to

tune

the

value

of

A

so

that

-LRB-

Aju

-LRB-

M

ju

-RRB-

-RRB-

Thus

at

each

iteration

the

'd

indices

are

exactly

those

indices

u

such

that

Aju

is

false

and

the

activity

of

type

is

described

by

expression

A

A

good

candidate

for

an

invariant

is

thus

fI

-LRB-

Aju

-RRB-

-LRB-

M

ju

-RRB-

-RRB-

T

hAig

with

I

-LRB-

-LRB-

Rju

N

ju

M

ju

-RRB-

-LRB-

M

ju

-RRB-

-RRB-

Assume

for

a

while

that

variable

A

acts

as

wanted

and

that

the

following

annotation

can

be

derived

fI

-LRB-

Aju

-RRB-

-LRB-

M

ju

-RRB-

-RRB-

T

hAig

where

-LRB-

M

-RRB-

do

A

False

end

fI

-LRB-

Aju

-LRB-

M

ju

-RRB-

-RRB-

T

hAig

Then

it

is

tedious

but

easy

to

check

that

the

annotation

for

the

entire

program

displayed

on

Figure

is

valid

It

remains

to

prove

that

the

annotation

of

line

-LRB-

-RRB-

is

indeed

correct

This

is

the

only

piece

of

program

where

the

escaping

context

is

explicitly

manipulated

Note

that

variable

A

appears

both

in

the

escaping

context

expression

and

in

the

left

part

of

an

assignment

The

assignment

rule

can

not

be

applied

as

explained

above

We

are

thus

bound

to

introduce

a

new

auxiliary

variable

in

the

initial

assertion

in

order

to

save

the

initial

value

of

the

escaping

context

First

we

show

fI

-LRB-

Aju

-RRB-

-LRB-

M

ju

-RRB-

-RRB-

-LRB-

Aju

-RRB-

T

where

-LRB-

M

-RRB-

do

A

False

end

fI

-LRB-

Aju

-LRB-

M

ju

-RRB-

-RRB-

T

hAig

The

annotation

is

displayed

on

Figure

The

crucial

step

is

to

show

that

-LRB-

d

-RRB-

-RRB-

-LRB-

e

-RRB-

that

is

boolean

We

use

the

following

definitions

I

-LRB-

-LRB-

Rju

N

ju

M

ju

-RRB-

-LRB-

M

ju

-RRB-

-RRB-

I

-LRB-

Aju

-RRB-

-LRB-

Rju

M

ju

N

ju

M

ju

-RRB-

Aju

-RRB-

-LRB-

Rju

N

ju

-RRB-

-LRB-

M

ju

-RRB-

-RRB-

I

-LRB-

Aju

-RRB-

-LRB-

Rju

-LRB-

M

ju

-RRB-

N

ju

-LRB-

M

ju

-RRB-

-RRB-

Aju

-RRB-

-LRB-

Rju

N

ju

-RRB-

-LRB-

M

ju

-RRB-

-RRB-

-LRB-

N

ju

-RRB-

T

hTig

-LRB-

a

-RRB-

-LRB-

-RRB-

M

N

R

N

fI

T

hTig

-LRB-

b

-RRB-

-LRB-

-RRB-

fI

T

hTig

-LRB-

c

-RRB-

-LRB-

-RRB-

A

True

fI

Aju

T

hTig

-LRB-

d

-RRB-

fI

Aju

T

hAig

-LRB-

e

-RRB-

fI

-LRB-

Aju

-RRB-

-LRB-

M

ju

-RRB-

-RRB-

Aju

T

hAig

-LRB-

f

-RRB-

-LRB-

-RRB-

loop

True

do

fI

-LRB-

Aju

-RRB-

-LRB-

M

ju

-RRB-

-RRB-

Aju

T

hAig

-LRB-

g

-RRB-

-LRB-

-RRB-

where

-LRB-

M

-RRB-

do

A

False

end

fI

-LRB-

Aju

-LRB-

M

ju

-RRB-

-RRB-

T

hAig

-LRB-

h

-RRB-

fI

-LRB-

Aju

-LRB-

M

ju

-RRB-

-RRB-

T

hAig

-LRB-

i

-RRB-

-LRB-

-RRB-

M

M

fI

-LRB-

Aju

-RRB-

-LRB-

M

ju

-RRB-

-RRB-

T

hAig

-LRB-

j

-RRB-

-LRB-

-RRB-

R

R?M

fI

-LRB-

Aju

-RRB-

-LRB-

M

ju

-RRB-

-RRB-

T

hAig

-LRB-

k

-RRB-

-LRB-

-RRB-

end

fI

-LRB-

Aju

-RRB-

-LRB-

M

ju

-RRB-

-RRB-

Aju

T

hAig

-LRB-

l

-RRB-

fI

-LRB-

M

ju

-RRB-

T

hAig

-LRB-

m

-RRB-

-LRB-

Rju

N

ju

-RRB-

T

hAig

-LRB-

n

-RRB-

-LRB-

-RRB-

end

-LRB-

Rju

N

ju

-RRB-

T

hTig

-LRB-

o

-RRB-

Figure

The

annotated

data-parallel

factorial

with

an

auxiliary

variable

We

use

the

same

definition

as

on

Figure

fI

-LRB-

-RRB-

-LRB-

M

ju

-RRB-

-RRB-

-LRB-

Aju

-RRB-

T

-LRB-

a

-RRB-

-LRB-

-RRB-

where

M

do

fI

-LRB-

Aju

-RRB-

-LRB-

M

ju

-RRB-

-RRB-

-LRB-

Aju

-RRB-

-LRB-

M

-RRB-

-LRB-

b

-RRB-

-LRB-

-RRB-

A

False

fI

-LRB-

Aju

-LRB-

M

ju

-RRB-

-RRB-

-LRB-

-RRB-

Aju

-RRB-

-LRB-

M

-RRB-

-LRB-

c

-RRB-

-LRB-

-RRB-

fI

-LRB-

Aju

-LRB-

M

ju

-RRB-

-RRB-

-LRB-

-RRB-

Aju

-RRB-

-LRB-

M

-RRB-

h

-LRB-

-LRB-

M

-RRB-

-RRB-

ig

-LRB-

d

-RRB-

fI

-LRB-

Aju

-LRB-

M

ju

-RRB-

-RRB-

-LRB-

-RRB-

Aju

-RRB-

-LRB-

M

-RRB-

hAig

-LRB-

e

-RRB-

fI

-LRB-

Aju

-LRB-

M

ju

-RRB-

-RRB-

-LRB-

M

-RRB-

hAig

-LRB-

f

-RRB-

-LRB-

-RRB-

end

fI

-LRB-

Aju

-LRB-

M

ju

-RRB-

-RRB-

T

hAig

-LRB-

g

-RRB-

Figure

The

annotated

inner

where

block

of

the

factorial

vector

expressions

-LRB-

M

-RRB-

and

A

have

the

same

value

as

soon

as

predicate

-LRB-

Aju

-LRB-

M

ju

-RRB-

-RRB-

-LRB-

-RRB-

Aju

-RRB-

is

satisfied

This

stems

from

a

simple

-LRB-

but

tedious

-RRB-

case

analysis

on

the

truth

value

of

Aju

If

Aju

is

true

then

both

-LRB-

M

ju

-RRB-

and

are

true

Thus

-LRB-

-LRB-

M

-RRB-

-RRB-

ju

is

true

If

Aju

is

false

then

-LRB-

M

ju

-RRB-

is

false

Thus

-LRB-

-LRB-

M

-RRB-

-RRB-

ju

is

false

as

well

Let

us

now

introduce

an

additional

rule

to

our

proof

system

to

get

rid

of

such

auxiliary

variables

Auxiliary

variable

elimination

in

preconditions

If

a

variable

Aux

appears

in

the

precondition

only

then

it

can

be

substituted

by

any

expression

E.

fP

C

Ag

S

fQ

D

Bg

Aux

Var

-LRB-

S

-RRB-

-LSB-

Var

-LRB-

Q

-RRB-

-LSB-

Var

-LRB-

D

-RRB-

-LSB-

Var

-LRB-

B

-RRB-

fP

-LSB-

E

Aux

-RSB-

C

-LSB-

E

Aux

-RSB-

A

-LSB-

E

Aux

-RSB-

g

S

fQ

D

Bg

It

can

be

shown

that

this

rule

is

sound

Substituting

A

-LRB-

E

-RRB-

for

-LRB-

Aux

-RRB-

in

the

initial

precondition

on

Figure

yields

the

wanted

formula

fI

-LRB-

Aju

-RRB-

-LRB-

M

ju

-RRB-

-RRB-

T

hAig

where

-LRB-

M

-RRB-

do

A

False

end

fI

-LRB-

Aju

-LRB-

M

ju

-RRB-

-RRB-

T

hAig

It

remains

to

get

rid

of

auxiliary

variable

A

in

the

factorial

program

P

We

can

again

add

a

new

rule

in

our

proof

system

which

enables

to

forget

everything

about

such

auxiliary

variables

in

the

lines

of

the

method

proposed

by

Gries

and

Owicki

-LSB-

-RSB-

Definition

-LRB-

Auxiliary

variables

-RRB-

Let

V

be

a

set

of

variables

We

say

that

variables

of

V

are

auxiliary

in

program

S

if

they

only

appear

in

assignment

commands

of

the

form

Z

E

or

communication

commands

of

the

form

get

X

from

A

into

Z

with

Z

V

It

is

clear

that

removing

all

commands

containing

variables

of

V

does

not

modify

the

overall

behavior

of

the

program

nor

the

final

values

of

the

variables

not

in

V

The

role

of

such

auxiliary

variables

is

limited

to

convey

information

from

the

control

flow

and

the

activity

context

to

the

environment

If

S

is

a

program

and

V

is

a

set

of

auxiliary

variables

for

S

then

S

n

V

denotes

the

program

obtained

by

stripping

S

from

all

commands

involving

variables

of

V

Elimination

of

auxiliary

variables

in

programs

If

something

which

does

not

depend

on

auxiliary

variables

has

been

proved

about

a

program

equipped

with

auxiliary

variables

then

it

is

true

of

the

program

without

them

fP

C

Ag

S

fQ

D

Bg

V

is

a

set

of

auxiliary

variables

for

S

V

-LRB-

Var

-LRB-

P

-RRB-

-LSB-

Var

-LRB-

C

-RRB-

-LSB-

Var

-LRB-

A

-RRB-

-LSB-

Var

-LRB-

Q

-RRB-

-LSB-

Var

-LRB-

D

-RRB-

-LSB-

Var

-LRB-

B

-RRB-

-RRB-

fP

C

Ag

S

n

V

fQ

D

Bg

It

can

be

shown

that

this

rule

is

sound

It

is

clear

that

fAg

is

a

set

of

auxiliary

variables

for

P

and

that

P

n

V

is

exactly

P

From

the

proved

formula

-LRB-

N

ju

-RRB-

T

hTig

P

-LRB-

Rju

N

ju

-RRB-

T

hTig

we

can

finally

infer

the

desired

formula

-LRB-

N

ju

-RRB-

T

hTig

P

-LRB-

Rju

N

ju

-RRB-

T

hTig

Conclusion

This

work

shows

that

the

classical

approach

towards

the

natural

semantics

and

assertional

proof

systems

for

scalar

languages

can

be

extended

to

modern

data-parallel

languages

It

can

even

be

tuned

to

handle

complex

escape

control

structures

as

found

in

high-level

data-parallel

languages

such

as

MasPar

's

MPL

or

the

recent

HyperC

Our

running

example

shows

that

the

proof

of

such

programs

can

be

built

according

to

the

usual

intuition

by

annotating

the

program

text

with

intermediate

assertions

This

is

a

major

result

as

the

amount

of

information

is

much

larger

than

in

the

scalar

case

and

yet

the

formal

manipulations

are

basically

of

the

same

complexity

To

our

understanding

this

is

a

strong

argument

in

favor

of

data-parallel

programming

as

opposed

to

-LRB-

control

-RRB-

parallel

Occam-like

programming

data-parallelism

allows

to

handle

the

validation

of

parallel

programs

for

free

which

is

in

striking

contrast

to

the

technical

complexity

of

the

validation

methods

for

Occam

programs

This

work

can

be

continued

in

several

directions

On

a

technical

level

it

would

be

interesting

to

study

the

completeness

of

the

proof

system

-LRB-

at

least

for

programs

without

iteration

-RRB-

is

it

always

possible

to

add

auxiliary

variables

to

convey

enough

information

from

the

control

flow

to

the

environment

Also

we

have

shown

in

-LSB-

-RSB-

that

any

program

S

can

be

transformed

into

an

equivalent

L

program

up

to

auxiliary

variables

In

-LSB-

-RSB-

we

have

presented

a

proof

system

for

L

programs

What

is

the

relationship

between

the

proof

of

S

in

and

the

proof

of

the

equivalent

program

in

L

Also

the

MPL

and

HyperC

languages

do

not

include

the

escape

mechanism

explicitly

but

rather

through

the

specialized

break

and

continue

commands

can

we

define

any

specialized

proof

rules

to

handle

these

constructs

directly

On

a

broader

level

the

extension

of

usual

proof

systems

to

complex

data-parallel

languages

such

as

MPL

or

HyperC

enables

to

reuse

in

this

new

setting

all

the

know-how

developed

for

the

validation

of

scalar

programs

methodologies

computer-aided

verification

environments

-LRB-

e.g.

-LSB-

-RSB-

-RRB-

heuristics

etc.

This

opportunity

opens

a

quite

exciting

research

direction

which

could

make

large-scale

parallel

programming

really

possible

We

are

currently

investigating

this

new

frontier

Acknowledgments

This

work

has

greatly

benefited

from

discussions

with

Yann

Le

Guyadec

and

Bernard

Virot

We

thank

Ga?etan

Hains

for

his

detailed

comments

and

suggestions

References

-LSB-

-RSB-

K.R.

Apt

and

E.R.

Olderog

Verification

of

Sequential

and

Concurrent

Programs

Text

and

Monographs

in

Computer

Science

Springer

Verlag

-LSB-

-RSB-

L.

Boug?e

Y.

Le

Guyadec

G.

Utard

and

B.

Virot

On

the

expressivity

of

a

waekest

precondition

calculus

for

a

simple

data-parallel

language

In

Parallel

Processing

ConPar

-LCB-

VAPP

VI

Lect

Notes

Comp

Science

Linz

Austria

September

-LSB-

-RSB-

L.

Boug?e

Y.

Le

Guyadec

G.

Utard

and

B.

Virot

A

proof

system

for

a

simple

data-parallel

programming

language

In

C.

Girault

editor

Proc

of

the

IFIP

Int

Conf

on

Application

in

Parallel

and

Distributed

Computing

Caracas

V?en?ezuela

April

Elsevier

-LSB-

-RSB-

L.

Boug?e

and

J.-L

Levaire

Control

structures

for

data-parallel

SIMD

languages

semantics

and

implementation

FGCS

-LCB-

-LSB-

-RSB-

M.

Clint

and

K.T.

Narayana

On

the

completeness

of

a

proof

system

for

a

synchronous

parallel

programming

langage

In

Third

Conf

Found

Softw

Techn

and

Theor

Comp

Science

Bangalore

India

December

-LSB-

-RSB-

High

Performance

Fortran

Forum

High

Performance

Fortran

language

specification

-LRB-

draft

version

-RRB-

CITI/CRPC

Rice

Univ.

Houston

January

Version

Draft

-LSB-

-RSB-

J.

Gabarr?o

and

R.

Gavald?a

An

approach

to

correctness

of

data

parallel

algorithms

Technical

Report

Univ.

Polit?ecnica

de

Catalunya

October

To

appear

in

Journ

of

Parallel

and

Distr

Computing

-LSB-

-RSB-

M.J.C.

Gordon

Programming

Language

Theory

and

its

Implementation

Int

Series

in

Comp

Sciences

Prentice

Hall

-LSB-

-RSB-

J.-L

Levaire

Using

the

Centaur

system

for

data-parallel

SIMD

programming

a

case

study

In

Proc

European

Symposium

on

Programming

ESOP

volume

of

Lect

Notes

Comp

Science

pages

-LCB-

Springer-Verlag

February

-LSB-

-RSB-

MasPar

Computer

Corporation

Sunnyvale

CA

Maspar

Parallel

Application

Language

Reference

Manual

-LSB-

-RSB-

S.

Owicki

and

D.

Gries

Verifying

Properties

of

Parallel

Programs

An

Axiomatic

Approach

Communication

of

the

ACM

-LRB-

-RRB-

-LCB-

May

-LSB-

-RSB-

N.

Paris

HyperC

specification

document

Technical

Report

HyperParallel

Technologie

-LSB-

-RSB-

R.H.

Perrot

A

language

for

array

and

vector

processors

ACM

Trans

on

Programming

languages

and

Systems

-LRB-

-RRB-

-LCB-

-LSB-

-RSB-

A.

Stewart

An

axiomatic

treatment

of

SIMD

assignment

Bit

-LCB-

-LSB-

-RSB-

Thinking

Machine

Corporation

Cambridge

MA

C

programming

guide

specifying and verifying and reasoning about programs


Chapter 16 Shape optimization by GA Jarmo T. Alander , Jouni Lampinen University of Vaasa Department of Information Technology and Production Economics , P. O. Box 700 , FIN-65101 Vaasa , Finland E-mail : Jarmo.Alander@uwasa.fi, Jouni.Lampinen@uwasa.fi Abstract . In this project we are studying feasibility of an automatized designing and optimizing system for constructing the cam shape of a diesel fuel injection equipment . The pump cam is an excentric and asymmetric lobe of its shape . The cam is mounted to a rotating camshaft , and used to control the movements of the fuel injection pump piston . What the injection cycle is like , mainly depends on the shape of the cam , which is a compromise between the target injection cycle and the restrictive design conditions . When a genetic algorithm is applied to cam shape design , the engineer starts by describing the target injection cycle . Then the evolution process tries to find a cam shape which is as close to the target cycle as possible and meets all the design constraints . As far as we know , this is the first time when evolutionary optimization is applied to the design of a cam shape of a diesel fuel injection equipment . Earlier only nonlinear mathematical programming methods has been applied to solve this problem . The complete title of this article : \ Shape optimization of diesel fuel injection cam by genetic algorithm '' . The article is available via anonymous ftp at site ftp.uwasa.fi directory cs/2NWGA as file Lampinen.ps.Z . 195 196 Proceedings of the 2NWGA , Vaasa , Finland , 19 - 23 August 1996 16.1 Introduction Here we describe the preliminary results of our research project , in which we are studying feasibility of an automatized designing method for the cam shape of diesel fuel injection equipment . The method is based on genetic algorithm . The study is a co-operation project of the University of Vaasa and W?artsil?a Diesel International Ltd , which is the largest manufacturer of medium speed diesel engines and a major manufacturer of high speed diesel engines in the World . Those engines are mainly used for power production in power plants and as marine diesels . The power output of these engines varies from 0.3 MW to 19 MW . In 1994 W?artsil?a delivered Worldwide engines , that were capable to produce total 2270 MW . The goal of the project is to create a computer aided design method for designing and optimizing the cam profiles of diesel fuel injection equipment and to automatize the design process as far as possible by creating and applying a tailored genetic algorithm in connection with a diesel fuel injection equipment simulator program . For this purpose we have constructed a program running in PC/Windows ? environment . With this program an engineer who is designing the shape of diesel fuel injection equipment cam , is able to input those design parameters which values are decided previously in engine design process and then leave the computer , for example overnight , to optimize the cam shape for his unique purpose and corresponding special functional demands . After that he gets a cam profile , which is optimized for the given conditions , in form of a table in which the cam lift from its base circle is given at one degree steps of cam angle . This table is further used as an input to an automatic CNC-cam grinding machine . 16.1.1 Diesel fuel injection equipment An example of a cam mechanism is shown in figure 16.1 . The movements of the cam follower depends on the shape of the cam profile . The disc type cam used in diesel fuel injection equipment is an excentric and asymmetric lobe of its shape . The cam is mounted to a rotating camshaft which is driven by the engines main power output shaft and it is used to control the movements of the fuel injection pump piston -LRB- pump plunger -RRB- . A good introduction to the basics of the fuel injection in diesel engines is provided , for example , in -LSB- 6 , 207 , 7 , 411 -RSB- . The layout of a diesel fuel injection equipment , operated by a diesel fuel injection cam , is shown in figure 16.2 . It is used to meter and to inject an accurately controlled quantity of fuel to the engines combustion chamber . Also the injection timing , relative to the operating cycle of the engine , is carefully adjusted in order to maintain a correct kind of combustion process , which is required for high thermodynamic efficiency of the engine and thus for low engine ? Windows is a registered trademark of Microsoft Corporation Alander & Lampinen : Shape optimization by GA. 197 Figure 16.1 : A typical cam mechanism used to operate diesel fuel injection equipment with disc type cam and roller type cam follower . fuel consumption , and also for high engine performance , low exhaust and noise emissions . 16.1.2 Cam design As previously said , the primary goal of diesel fuel injection equipment cam design is to achieve the best possible fuel injection cycle within restrictive design constraints . What the injection cycle is like , mainly depends on the shape of the cam . Also various mechanical and hydraulic properties of the diesel fuel injection equipment have their own effects . The cam shape is used to adjust properties of the injection cycle to meet specified requirements . In practise the theoretically optimal injection cycle can not be used as such because of the constraints like stiffness and strenghtness of the diesel fuel injection equipment components , geometrical conditions , and properties of the fuel . The cam shape is a compromise between the target injection cycle and the restrictive design conditions . Thus we should find an optimal compromise to this multiobjective problem . As a starting point the designing engineer defines the target fuel injection cycle -LRB- the injection rate history during injection cycle -RRB- , that he wants to put into practice , and then he designs equivalent cam shape . Usually the restrictive design conditions prevent him from using the original injection cycle and the corresponding cam shape . Therefore , the designer is forced to find the injection cycle and the cam shape , which is as close to the target injection cycle as possible and meets all the 198 Proceedings of the 2NWGA , Vaasa , Finland , 19 - 23 August 1996 Figure 16.2 : A diesel fuel injection equipment . restrictive design constraints -LRB- table 16.2 . -RRB- . A simulator program is used as a tool for evaluating different cam shapes and to calculate the equivalent fuel injection cycle . It is actually a mathematical model of the diesel fuel injection equipment , and known to give rather good correlation with experimental measurements . 16.1.3 Related work Dynamics of cam mechanisms have been studied intensively at least for the last 50 years , at first in order to cure the problem of false valve motion in cam driven valve mechanisms of high speed internal-combustion engines when the valvetrain is under high dynamic forces . One of the earliest works concerning the dynamics of cam mechanisms is -LSB- 547 -RSB- , which is done in 1939 . Since that there have been published a number of books -LSB- 494 , 347 , 311 -RSB- and articles about this topic . For further references see for example bibliographies in -LSB- 494 , 548 , 411 , 347 , 311 -RSB- . Computers have been used to calculate and to simulate cam operated mechanisms from early 50 's . One of the first studies about applying computer to calculate dynamics of cam mechanisms is -LSB- 112 -RSB- from year 1953 . By now using a computer model of cam driven system is considered essential for proper design of high speed cam mechanisms . There are also many studies applying GA in mechanical engineering related optimization of dynamic constructions and quite many studies , such as -LSB- 157 , 506 -RSB- , where GA is applied to shape optimization , but combination of those two seems to be rare . Shape optimization is one of the first optimization problems solved with evolutionary optimization techniques -LSB- 341 -RSB- . Despite that , it is still rare to ap - Alander & Lampinen : Shape optimization by GA. 199 ply evolutionary optimization methods to engineering oriented geometrical shape designing and optimization problems . There is only a dozen or so references to such research -LSB- 553 , 241 , 560 , 394 , 78 , 79 , 488 , 582 , 134 , 528 , 135 , 157 , 300 , 445 -RSB- among nearly 6000 references of Jarmo Alander 's bibliography -LSB- 26 , 47 -RSB- . In addition , there are some other articles , where genetic algorithm based geometrical shape optimization is discussed -LSB- 475 , 467 , 465 , 152 , 184 , 506 -RSB- . Genetic algorithm has been earlier applied to cam shape optimization by the authors -LSB- 78 , 79 -RSB- in connection with internal-combustion engine valvecams , but as far as we know , this is the first time when evolutionary optimization technique is applied to optimal design of a cam shape of a diesel fuel injection equipment . Earlier only non-linear mathematical programming methods has been applied to solve the optimal design problem of a diesel fuel injection equipment , as for example in -LSB- 330 -RSB- . Figure 16.3 : The basic steps of the genetic cam shape optimization . 16.2 Cam shape design using genetic algorithm In practise the main restriction for our system development is that we must be able to use the existing diesel fuel injection equipment simulator program . So , our genetic algorithm must be able to produce automatically cam shapes for this simulator program , run the simulator and finally evaluate its output data . Actually our cam shape optimization system is a program , which replaces the design engineer by using an existing diesel fuel injection equipment simulator program automatically in a logical and intelligent way trying to find the best possible cam shape for the purpose . In our solution genetic algorithm is responsible of that 200 Proceedings of the 2NWGA , Vaasa , Finland , 19 - 23 August 1996 fuel injection rate cam angle -LSB- deg -RSB- fuel injection rate -LSB- cmm/deg -RSB- 5 10 15 20 25 30 50 55 60 65 70 75 80 target achieved cumulative fuel injection rate cam angle -LSB- deg -RSB- injected quantity -LSB- cmm -RSB- 50 100 150 200 250 50 55 60 65 70 75 80 achieved target Figure 16.4 : A typical example of a design target fuel injection cycle and the final optimized fuel injection cycle achieved within design restrictions . Alander & Lampinen : Shape optimization by GA. 201 logic and artificial intelligence . 16.2.1 Evolutionary cam shape optimization process When a genetic algorithm is applied to the optimization of a cam shape , the design engineer still starts the process by describing the target fuel injection cycle . The population of the genetic algorithm is initialized with already well performing cam shapes . Each individual of the population describes one complete cam shape , which is represented piecewisely by 6th order polynomials , so called 6th order splines . The genes of the individuals are real values of the control points of these splines . Each individual cam shape is described with 28 pieces of the 6th order polynomials , controlled with a total number of 28 control points . The cam shapes are evaluated with a computer model of the mechanical-hydraulic diesel fuel injection equipment , which simulates the function of a cam operated injection pump mechanism . The fitness-value is calculated by evaluating the results of the simulation with an if-then structure , where each part of the structure represents one design target or one restrictive design condition . Each of them increases or decreases the fitness-value in relation with how well the cam shape meets the design target or constraints . 16.2.2 The genetic algorithm Table 16.1 provides a short description of our optimization problem and the genetic algorithm used . For a more detailed description see -LSB- 78 -RSB- . Basically the optimization method , the genetic algorithm and the cam shape parametrization method is the same that we have previously used for optimization of valvecams of internal combustion engine -LSB- 78 , 79 -RSB- . In table 16.2 is describe some of the optimization goals and some of the major design constraints . For example , the radius of the grinding stone used in manufacturing of the cams restricts the minimum concave radius of cam curvature , simply because the grinding stone can not produce smaller concave radius than its own radius . 16.3 Computing environment 16.3.1 Hardware At the moment we are using one i486DXy based PC -LRB- 100 MHz -RRB- for all processing . Typically optimization of one cam shape requires about 200 generations to be calculated , which takes about 12 hours in the above computer environment . In the future one of our objectives in the system development will be the distribution yi486DX is a registered trademark of Inter Corporation 202 Proceedings of the 2NWGA , Vaasa , Finland , 19 - 23 August 1996 problem parameters 28 control points of 6th order spline number of parameters 28 parameter type floating point parameter range non-fixed , typically -LSB- ? 0:85 ; :35 -RSB- optimization problem constrained multiobjective GA gene floating point number individual cam shape population size 40 number of genes 28 initial population 40 predefined individuals selection ranking elitism 24 best individuals crossover 1-point crossover rate 0.2 mutation by adding a random value 2 -LSB- ? 0:004 ; :004 -RSB- mutation rate 0.5 Table 16.1 : A short description of optimization problem and properties of the genetic algorithm used . Optimization goals distance from target cycle minimum distance from total target injection quantity minimum maximum camshaft torque minimum maximum cam/lifter contact force minimum fuel quantity after main injection cycle minimum Design constraints concave cam radius minimum convex cam radius minimum pumping pressure maximum total injected fuel quantity minimum total injected fuel quantity maximum cam shaft torque maximum cam/lifter contact force maximum pump plunger lift maximum cam lift maximum Table 16.2 : A short description of some of the optimization goals and design constraints . Alander & Lampinen : Shape optimization by GA. 203 of the processing on a mainframe computer environment . When the simulations and the calculating of fitness-values represents over 90 % of our program 's total demand of processing capacity , we can considerably speed up the evolution process for example by evaluating fitness in parallel in each generation . In this method , the master-process creates a new population and its individuals , and then it shares the evaluation of fitness-values between the slave-processes , and finally uses the fitness-values of each individual which the slave processes returns . 16.3.2 Software Our system runs on PC/Windows environment . The diesel fuel injection equipment cam designing system is added as a integrated module to our previously developed program called CamProfileDesign , which was developed to design and optimize the shapes of internal-combustion engine valvecams -LSB- 78 , 79 -RSB- . It is mainly written in VisualBasicz but the most time-critical parts , which consists a lot of calculation with floating-point numbers , are written in compilable programming languages . The diesel fuel injection equipment simulator program is written in FORTRAN and connected to the main program via temporary input and output files . 16.4 Preliminary results When this paper was written , the study was in its early stage , so we are not able to describe the possible improvements of the cam shape or either to compare cams designed by genetic algorithm to those designed with more conventional methods . By now the main result of our study is the outline of the genetic algorithm based solution , which we propose to solve the optimum cam shape design problem . One of the advantages of the proposed method , and the genetic algorithm approach in particular , is the possibility to automatize the cam shape designing process and still use both the existing human knowledge and existing diesel fuel injection equipment simulator program quite freely . 16.5 Conclusions Shape optimization , by genetic algorithm has been previously proven as a potential shape optimization method in connection with internal-combustion engine valve cam -LSB- 78 , 79 -RSB- . The shape design and optimization of diesel fuel injection cams may be even a more demanding and challenging problem . Preliminary results of our research project seems encouraging , and it seems very likely that it is zVisualBasic is a registered trademark of Microsoft Corporation 204 Proceedings of the 2NWGA , Vaasa , Finland , 19 - 23 August 1996 possible to successfully apply the described technique to diesel fuel injection cam shape designing and to optimize the cam shape to meet given objectives . Generally speaking , there is lot of computer programs which are used in various engineering areas to calculate functional properties of complex systems in order to optimize values of system parameters . Using an approach similar to that described in this paper an automatized program based on a genetic algorithm could be implemented for optimization of system parameters quite easily . Actually the genetic algorithm can be considered as an AI system which uses the simulator programs intelligently . As a general conclusion we can say that the results of our project showed us that genetic algorithm seems to be a potential method for applying artificial or computational intelligence in connection with existing engineering simulator programs . Acknowledgements The project is supported by TEKES , the Finnish Technology Development Centre . The authors also want to acknowledge Mr G?osta Liljenfeldt and Mr S?oren H?ostman from W?artsil?a Diesel International Ltd Oy Research and Calculation Department . Program NOCCZ used for cam shape parametrization , diesel fuel injection simulator program and some other portions of the CamProfileDesign program are programmed by Mr Liljenfeld . Both Mr Liljenfeld and Mr H?ostman are representatives of W?artsil?a Diesel International Ltd Oy in this research project . 16.6 Bibliography See chapter bibliography at the end of this proceedings .

O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O B O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O B O O O O O O O B O O O O O B O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O B O O O O O O O O O O O B O O O B O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O B O O O O O O O O O O O B O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O B B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B B I O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O B B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O B B I O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O B O O O O O O O O O O O O O O O B O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O B I O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O

cam
diesel engines
mechanical engineering
shape optimization