A production system (or production rule system) is a computer program typically used to provide some form of artificial intelligence, which consists primarily of a set of rules about behavior, but also includes the mechanism necessary to follow those rules as the system responds to states of the world.[citation needed] Those rules, termed productions, are a basic knowledge representation found useful in automated planning and scheduling, expert systems, and action selection.
Productions consist of two parts: a sensory precondition (or "IF" statement) and an action ("THEN"). If a production's precondition matches the current state of the world, then the production is said to be triggered. If a production's action is executed, it has fired. A production system also contains a database, sometimes called working memory, which maintains data about the current state or knowledge, and a rule interpreter. The rule interpreter must provide a mechanism for prioritizing productions when more than one is triggered.[citation needed]