Have a look at Rule-Based Programming in Interactive Fiction. This is a slide presentation I gave at Penguicon 7, on May 3, 2009. I describe the programming model which Inform 7 is based on, and then go on to a more general rule model which I am still trying to figure out. (See also my earlier notes on rule-based programming.)