A Small Bit of Technique

I just discovered a minor bit of technique that improves performance of the engine. When searching for a particular event in the HistoryBook, a common problem is to get poisonings due to a mismatch between worksocket types. For example, suppose that I’m looking for any event in which Subject talks to DirObject about 4Actor. The search will encounter many events in which the verb doesn’t take a 4Actor. For example, the verb ‘give’ would take the form Subject give DirObject 4Prop. When the HistoryBook search encounters this event, it will poison the search because 4Prop is the wrong type for what it’s looking for (an Actor). 

The solution is to make the verb check the very first item in the list of factors searched for. Here’s an example:

CorrectScript

The logical operators in Sappho are all short-circuit operators: they abort the tests as soon as they have a definitive answer. Thus, the script on the left aborts the AND4 test as soon as it encounters a PastVerb that is not ‘relate feelings’. This insures that the subsequent tests, which look for wordsockets that exist only for events with verb ‘relate feelings’, will not be executed and so won’t screw up and poison the calculation.

I suppose that the fact that this fine point exists is an indicator of poor design of Sappho; you shouldn’t have to memorize little tips and tricks to use a computer. At the same time, I don’t think we could have done much better without a complete redesign of the system.