c laus b rabrand & j acob a ndersen © s emantics (q1,’07) aug 30, 2007 adapted version for...

12
CLAUS BRABRAND & JACOB ANDERSEN © SEMANTICS (Q1,’07) Aug 30, 2007 Adapted version for dSem 2007 Original story by: CLAUS BRABRAND © 2005–2006 , University of Aarhus [ [email protected] ] [ http://www.daimi.au.dk/~brabrand/ ] SEMANTICS (Q1,’07) Hand-in Exercise 1

Post on 21-Dec-2015

215 views

Category:

Documents


1 download

TRANSCRIPT

CLAUS BRABRAND & JACOB ANDERSEN © SEMANTICS (Q1,’07) Aug 30, 2007

Adapted version for dSem 2007Original story by:CLAUS BRABRAND

© 2005–2006 , University of Aarhus[ [email protected] ]

[ http://www.daimi.au.dk/~brabrand/ ]

SEMANTICS (Q1,’07)

Hand-in Exercise 1

CLAUS BRABRAND & JACOB ANDERSEN SEMANTICS (Q1,’07)[ 2 ]

Aug 30, 2007

Purpose

Purpose: to describe structure inductively (and recursively)

via inference systems to describe relations formally

via inference systems and transition systems

On: relations inference systems transition systems

CLAUS BRABRAND & JACOB ANDERSEN SEMANTICS (Q1,’07)[ 3 ]

Aug 30, 2007

11.000 BC

It is the year 11,000 BC.

The ice age is over and the homo sapiens are rapidly multiplying across the plains of Europe.

CLAUS BRABRAND & JACOB ANDERSEN SEMANTICS (Q1,’07)[ 4 ]

Aug 30, 2007

The Situation

However, over-hunting and intense inter-tribal resource competition has left your tribe starving. You have to find new hunting grounds...

The island in the horizon off the main land presents itself with a possibility:

Scouts from your tribe went there a few seasons ago, but deemed it unfit to sustain a human population.

The scouts did however release two rabbits; one old, one young(one male, one female).

CLAUS BRABRAND & JACOB ANDERSEN SEMANTICS (Q1,’07)[ 5 ]

Aug 30, 2007

The Problem

Your problem is to figure out whether by nowthere are enough rabbits on the island to sustain your tribe(?)

Being dependent on local wildlife,you have the following knowledgeon the reproductive cycle of rabbits:

A) a population of rabbits a given season may be divided into two categories: the old and the young

B) each passing of a season: kills off the old; ages the young to old; and makes a number of new young ones equal to that of the total size of the

population (i.e. the sum of the old and young).

CLAUS BRABRAND & JACOB ANDERSEN SEMANTICS (Q1,’07)[ 6 ]

Aug 30, 2007

The Problem (cont'd)

Hence, a population of rabbits may be described by a pair of "numbers":

...and the evolution of a rabbit population over time may be described by a sequence of pairs of "numbers":

, r , r , r ...

, number of old rabbits number of young rabbits

CLAUS BRABRAND & JACOB ANDERSEN SEMANTICS (Q1,’07)[ 7 ]

Aug 30, 2007

Restrictions

However, being the year 11,000 BC, you do not yet have any mathematics at your disposal beyond thecapacity to follow simple procedures.

i.e. those that can be written down by an inference system or a transition system

Also, the tribe will not understand anything beyond stone-age numbers (a structural unary representation of numbers) in which:

'0' (zero) is represented as "zero" '1' (one) is represented as "(succ zero)"

"...the successor of zero". '2' (two) is repr. as "(succ (succ zero))"

"...the successor of the successor of zero". ...

()( ())

( ( ()))

+ – /

CLAUS BRABRAND & JACOB ANDERSEN SEMANTICS (Q1,’07)[ 8 ]

Aug 30, 2007

Your Tasks

Thus, you have three tasks: define... "|-san" ...stone-age numbers

define... "|-add" ...addition on stone-age numbers

define... "r" ...evolution of rabbits in a season

You may do this either: INDUCTIVELY:

first, "|-san"; then "|-add"; and finally "r"

...or...: DEDUCTIVELY:

first "r"; then "|-add"; and finally "|-san"

(your choice)

CLAUS BRABRAND & JACOB ANDERSEN SEMANTICS (Q1,’07)[ 9 ]

Aug 30, 2007

Task "|-san"

Represent stone-age numbers: i.e., define an inference system "|-san"

that describes all legal stone-age numbers, such thate.g.:

Let the relation "|-san" induce the set of all stone-age numbes, S:

S := { n | |_san n }

|_san { "(" , ")" , "succ" , "zero" }*

|_san zero |_san (succ zero) |_san succ zero

|_san wgjkewkl |_san (succ (succ zero))...

CLAUS BRABRAND & JACOB ANDERSEN SEMANTICS (Q1,’07)[ 10 ]

Aug 30, 2007

Task "|-add"

Define stone-age number addition: i.e., define a relation "|-add" adding stone-age numbers:

that describes stone-age number addition, such thate.g.:

|_add S S S

|_add zero , zero , zero

|_add (succ zero) , (succ zero) , (succ (succ zero))

|_add zero , (succ zero) , (succ (succ zero))

CLAUS BRABRAND & JACOB ANDERSEN SEMANTICS (Q1,’07)[ 11 ]

Aug 30, 2007

Task "r"

Define the evolution of the rabbit population: i.e., a transition system r,r describing the evolution of rabbits:

such that, e.g.:

Using only your newly invented “stone-age arithmetic” calculate how many rabbits are on the island after two seasons. The answer should be a single stone-age number providing the total of young and old rabbits.

(succ zero) , (succ zero)

(succ zero) , (succ (succ zero))

r

r , r

CLAUS BRABRAND & JACOB ANDERSEN SEMANTICS (Q1,’07)[ 12 ]

Aug 30, 2007

Final Rules

You have to define and prove everything formally, including:

all arities, signatures, configurations, ... without using any abbreviations (cf. [slide #14])

...and include a reference to either a presentation slide number or a page in the [SOS] note every time you use something introduced in the course.

Of course, these strict rules are only for the first-week...

Finally, be sure to explain everything you do carefully. Note: This is an “exam training exercise” – use this chance to train

(and demonstrate) your skills according to the Aim & Goal section on the webpage !