// Define some basic things about mountains. // Note the use of quotes to introduce terms. theory "mountain" [ a mountain has a "peak". a mountain has a "height above sea level". if a mountain's "height above sea level" is X then the mountain's peak is X above "sea level". ] // A test case (an expected dialog) that the theories can be // automatically checked against. test "what is a mountain" [ on [a mountain is a big thing] say [[ok a mountain is a big thing] [i will remember that]] on [what is a mountain] say [a mountain is a big thing] on [name a mountain] say [i dont' know any mountains] on [everest is a mountain] say [[ok everest is a mountain] [i will remember that]] on [name a mountain] say [everest] on [is everest a mountain] say [yes] on [is everest a goat] say [i don't know] on [is georgia a mountain] say [i don't know] ] // Define the plural of many words (for writing answers) theory "simple plural" [ if [concat(Mountain,"s") = Mountains] then [the plural of Mountain is Mountains] ] // Some logic about mountains theory "mountains and peaks" [ if [M is a mountain] then [M has a "peak"] ] // An extremely general logic rule that should be present at all // times. theory "is a, has a" [ if [M is a X] and [a X has a Y] then [M has a Y] ]