summaryrefslogtreecommitdiff
path: root/files/practicum/StamBoom.icl
blob: d2ca2271b25c1c7e48246909555ff8c7b1387c48 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
implementation module StamBoom

import StdEnv, GenTree

Start							= 0

::  FamilyTree					:== GenTree Couple Single
::  Couple						  = Couple Person Person
::  Single						  = Single Person
::  Person						  = Person DateOfBirth Gender String
::  Gender						  = Male | Female
::  DateOfBirth					  = DoB Year Month Day
::  Year						:== Int
::  Month						:== Int
::  Day							:== Int


okFamilyTree					:: FamilyTree -> Bool
okFamilyTree ...

rootAncestor					:: FamilyTree -> Person
rootAncestor ...

inFamilyTree					:: Person FamilyTree -> Bool
inFamilyTree ...

marry							:: Person Person FamilyTree -> FamilyTree
marry ...

addChild						:: Person Couple FamilyTree -> FamilyTree
addChild ...

children						:: Person FamilyTree -> [Person]
children ...

offspring						:: Person FamilyTree -> [Person]
offspring ...