Copyright © 2002 Cycorp
Writing Efficient CycL
Part 1
•Part One
–Simpler is Better
–Use Rule Macro Predicates
–Create Simplifying Vocabulary
•Part Two
–Factor out Commonality
–Existence is Expensive
–Exceptions are Exceptional
–State Negations Explicitly
–Generalize -- Don’t List
–Use #$different
This section will give you some specific suggestions on how to write CycL that can be more efficiently handled by our Inference Engine. The lessons will give you a set of heuristics, some of which are mutually contradictory, so you’ll have to trade off between them (all good heuristics are mutually contradictory, otherwise you could set up a decision tree, right?).

If you have completed all of the lessons in order, then you’ve been exposed to a lot of suggestions on doing OE that make representational sense, so they are suggestions from the representational side. This section, however, is focusing on stuff from the implementation and algorithmic side that treats CycL as more than just a notational exercise in predicate calculus calligraphy. You’re writing something that is meant to be used by an automaton efficiently to do useful things. So you’ll see some suggestions which might seem a little bit inelegant; actually, many of them have analogs to software engineering principles which would be considered elegant by software engineers, so it’s worth keeping your mind open.

The slide shows an outline of the lessons in this section, going from most fundamental to least fundamental (and most idiosyncratic to our system). Many of the earlier lessons apply to any knowledge representation system and some of the later ones reflect the current CycL state.