summaryrefslogtreecommitdiff
path: root/files/practicum/StamBoom.dcl
blob: b8bf99e96c2ed2ef62df49775d1597b004348e18 (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
definition module StamBoom

import GenTree

::  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

instance <  DateOfBirth
instance == DateOfBirth
instance == Couple
instance == Person
instance == Gender

okFamilyTree	::               FamilyTree -> Bool
rootAncestor	::               FamilyTree -> Person
inFamilyTree	:: Person        FamilyTree -> Bool
marry			:: Person Person FamilyTree -> FamilyTree
addChild		:: Person Couple FamilyTree -> FamilyTree
children		:: Person        FamilyTree -> [Person]
offspring		:: Person        FamilyTree -> [Person]