终止性是主动规则所需的最重要的一个性质,但规则的终止性检查通常是不可判定的.已有的静态分析方法非常保守,SQL3标准也没有提供保证终止的机制,所以商业数据库限制规则级联触发的最大次数确保终止.由于规则可看成数据库状态转换器,而约束能够表示所有可能的数据库状态,基于约束表示的数据库状态及约束求解,模拟规则处理,可得到更精确的终止性结论.
Detecting termination of rules is in general undecidable. Existing static analysis techniques are very conservative, and the current SQL3 standard does not prescribe methods for ensuring termination, so most commercial database products impose a fixed upper limit on the number of cascading rule firings. The commercial solution has undesirable effects e.g. some correct rule firing sequences may prematurely be halted. Since a rule can be viewed as a database state transformer, in this paper, database states are expressed with linear and Boolean hybrid constraints, and processing of rules is simulated based on constraint expressions and constraint solving. This method can obtain more precise conclusion than the existing methods.