This paper focuses an the problem of determining a priori the maximal respo
nse time of rule-based programs. The response time analysis problem is an i
mportant problem, especially for real-time systems. We study this problem i
n the context of OPS5 production systems. Two aspects of the response time
of a program are investigated, the maximal number of rule firings and the m
aximal number of basic comparisons made by the Rete network during the exec
ution of the program. The response time analysis problem is in general unde
cidable. However, a program terminates in a finite time if the rule trigger
ing pattern of this program Satisfies certain conditions. In this paper, we
present four such termination conditions for OPS5 production systems. An a
lgorithm for computing an upper bound on the number of rule firings is then
given. To have a better idea of the time required during execution, we pre
sent an algorithm that computes the maximal time required during the match
phase in terms of the number of comparisons made by the Rete network. This
measurement is sufficient since the match phase consumes about 90 percent o
f the execution time.