WGENEVB lets you load family trees, explore the relationships between people, add new people, and change existing people and relationships. The Prolog portion of the program does all the database manipulation, and ensures the integrity of the database, making sure that all the family members have relationships that make sense.
Adding / Changing Family Members
Application Architecture and Source Code
www.amzi.com - Additional demos, articles, freeware, evaluation copies and information about Amzi! Prolog + Logic Server.
We welcome any and all comments about this demo. Contact us at www.amzi.com
To build it:
To run it:
File / Save (As) This command saves the current family into a file.
.FAM Files The following is an excerpt from the sample family:
person('Elizabeth I', female, 'Anne Boleyn', 'Henry VIII', single). person('Edward VI', male, 'Jane Seymour', 'Henry VIII', single). person('Lady Frances Brandon', female, 'Mary', 'Charles Brandon', 'Henry Grey'). person('Mary Queen of Scots', female, 'Mary of Guise', 'James V', 'Henry Lord Darnley').Note, for each person we define their gender (male or female), their mother, their father, and their spouse or "single".
Change This allows you to modify an existing family member. The default is the currently highlighted person.
Delete This lets you delete a family member.
Represent each family member as relational-like record of the form: person(Name, Gender, Mother, Father, Spouse).
Add, save, delete and return information about family members. The add predicates call a set of rules that maintain the integretity of the database. For example, one rule makes sure a person is not their own ancestor or descendent.
Determining all the family members who have a specified relationship with a specified person. For example, sibling(Person, Sibling) can determine the siblings of the specified person.
The source code for WGENEVB is consists of these modules:
' Issue the Prolog command <relationship>(X, <person>)
tf = CallStrLS(Term, Relationship + "(X, '" + Person + "')")
' Loop getting all the people who have that relationship ' and add them to the related persons list
While (tf = True) GetArgLS(Term, 1, bSTR, StrVal) RelatedPersonsList.AddItem StrVal tf = RedoLS() WendFirst, a string containing the query is constructed. In this case we are asking Prolog to tell us everyone who has a specific relationship to a specific person. So for example, if to determine siblings of James IV, the query would be:
sibling(X, James IV)Next, we call Prolog using CallStrLS and RedoLS to get all the siblings, one at a time. As the siblings are returned in place of the X in the query, GetArgLS is used to get the value of the first argument to sibling. As the siblings are retrieved they are added to the RelatedPersonsLists.
Copyright ©1996-2000 Amzi! inc. All Rights Reserved.