Created
June 29, 2011 07:44
-
-
Save mjambon/1053349 to your computer and use it in GitHub Desktop.
Complete example used in the atdgen tutorial. I am looking for a lighter example that allows me to illustrate the same features. Feel free to suggest one.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<doc text="Type definitions for family trees"> | |
type tree = { | |
members : person list; | |
filiations : filiation list; | |
} | |
type filiation = { | |
parent : person_id; | |
child : person_id; | |
filiation_type : filiation_type; | |
} | |
<doc text="Connection between parent or primary caretaker and child"> | |
type filiation_type = { | |
?genetic : bool option; | |
?pregnancy : bool option; | |
?raised_from_birth : bool option; | |
?raised : bool option; | |
?stepchild : bool option; | |
?adopted : bool option; | |
} | |
<doc text=" | |
Example of a father who raised his child from birth | |
but may not be the biological father: | |
{{{ | |
{ | |
genetic = None; | |
pregnancy = Some false; | |
raised_from_birth = Some true; | |
raised = Some true; | |
stepchild = Some false; | |
adopted = Some false; | |
} | |
}}} | |
"> | |
type person_id | |
<doc text="Two persons with the same {{person_id}} must be the same | |
person. Two persons with different {{person_id}}s | |
may be the same person if there is not enough evidence to | |
support it."> = int | |
type person = { | |
person_id : person_id; | |
name : string; | |
~gender : gender list; | |
?biological_gender | |
<doc text="Biological gender actually used for procreating"> : | |
gender option; | |
} | |
type gender = | |
[ | |
| F <doc text="female"> | |
| M <doc text="male"> | |
] | |
<doc text="Gender, definition depending on the context"> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment