From: AAAI-86 Proceedings. Copyright ©1986, AAAI (www.aaai.org). All rights reserved. CIS: ,4 MASSIVELY CONCURRENT RULE-BASED Guy E. Blelloch Massachusetts Institute AI Lab, Rm. Net Mail: guyb@mit-ai Because Recently researchers have suggested in which, one programs several by specifying simple devices. Such models are interesting the roots of concurrency - the circuit level. computational large networks of because they go to A problem with the models is that it is unclear how to program large systems and expensive to implement many features that are taken for granted m symbolic programming This paper describes languages. the Concurrent and its implementation of computation. systems within such time, of very inference engine the rules simple devices. are no longer 1 into static concurrent real time user system rules. interaction processor On the with SIMD current is possible with The Concurrent Inference System (CIS) based system similar to Mycin ;Davis77]. arbitrary number of instances of an object. that many practical rule sets do not require the rule sets of Mycin out them. Section meta-rules of the sort described with uncertainty, 2 discusses system and implementationally and furthermore that relatively cheap concurrent model programming the system straightforward. The model 119821 and Rumelhart 119861. CIS does much of its work a static more complex such networks the Connection network much used 771, Rl paper argues features. For [McDermott the AFN model. cleanly Section 3 gives 801 witha brief 2 Activity In the past concurrent Flow Machine. Section 7 discusses some Networks decade, researchers processing many have of which proposed may many models be described of as net- of the time, 1 shows a taxonomy Network Models of Concurrent Computation T Static Networks /- 7 Dvnamic Networks \ Unbounded Message Node Limited MessageState Networks State Networks Non-Consing Finite Message State Networks to function- with leaving Value Passing Networks a simple of computation, in the model is the activity devices Figure A change Lbgic Simulators With’Global Communication f-- THlifLE I BOLTZMANN MACHINES Token’Passing Networks \ f---l is flow Activity flow networks are of Hinton [1981], Feldman at compile of computational of Zadeh’s implementation two seconds. for a single can be implemented network (AFN) model [Blelloch86]. similar to the connectionist networks time [Davis This these 821 can be implemented of AFNs on the Connection issues of concurrency. by Davis using a variation global inference step is the time needed percolate through all the rules. CIS was implemented to show that of a rule-based [Gaschnig is a interactive ruleIt asks the user ques- [1965] rules. With 100,000 rules on the current of CIS, a global inference step takes less than ality numbers, outline of AFL-l, the language CIS is programmed with. Sections 4 and 5 discuss CIS. Section 6 discusses the implementation tions and makes inferences according to the answers. The current version is capable of forward and backward chaining, which j1980]; and reasoning to use high-precision the messages sent among the nodes. of models categorized in this way. using and use very sim- works of nodes and links. As Fahlman 119821 noted, a useful way to categorize these models is by the cbmplkxity and content of Introduction run concurrently; static expensive to implement the general languages such as Prolog. For ex- CIS it is expensive model In this network the rules and distinct. The Thinking Machines Machine - a 65,536 to run the network. ample, and Prospector of cur- are completely hard to dynamically bind arbitrary values to a parameter, and not possible to execute general-purpose unification or create an example, in a straightforward a large the networks ple devices, it is hard and power of logic programming (CIS), implementations of rule-based systems engine and rule sets are clearly divided at Corporation, Connection computer - is then used implementation, up to 100,000 network of the functionality can be implemented CIS compiles network concurrent how much System models. Unlike conventional in which the inference run Inference on a massively It shows rent rule-based manner Square MA 02139 Abstract models of Technology 739. 545 Technology Cambridge, SYSTEM Witho;lt Global Communication NkL Activity Flow Networks at run not significantly than logic gates. It is easy and efficient to run on massively concurrent SIMD computers such as Figure 1: Hierarchy of Network Models of Concurrent Compu- Machine. AI LANGUAGES AND ARCHITECTURES / 735 The taxonomy divides network tation into two sub-classes: static static network nodes, choose each node communicates while in a dynamic which other nodes are further models of concurrent compuand dynamic networks. In a categorized nite message state network it wants with - Saturntion a fixed set of other Slope each node can dynamically to talk to. Static networks OUTPUT by the complexity of their messages. Finetworks are static networks that only Rise (FMS) send messages containing one of a fixed finite set of states. Because the messages of an FMS are typically short and simple, F.MS networks FMS networks usually consist are categorized : of a large number of simple nodes. by the content of their messages. (EXCITATORYINPUT Value passing networks (VPKs) are FMS networks that only send messages containing a finite approximation of the real numbers. VPNs nications. are categorized by whether they Any path that allows a central the nodes and make a decision sidered global communications. Fahlman example: and then links. nodes to the results is cona V’PN suggested by 3 AFL-l consists of functions that add nodes and links to the and the defgroup form which allows the user to hierar- chically To add define structures nodes and links signal flow networks The only (AFNs) do not include global control in AFNs allows the network from the nodes Some categories to take a step. by Ackley messages ‘19851 or Touretzky This clock of Feldman In summary, of real numbers, is a static network finite approximations of simple is an extension can only by a global communicate set of nodes and over its clock; with designated the external world through a and outputs. 4 of links an arbitrary number and of inputs - a threshold, parameters which - inhibitory are set at compile excitatory. and outputs. Nodes can have Each node A node combines its inputs The next objects represent The propositions. specification Each parameter of possible The used following gets multiplied by this weight. The clock - using after each node sends its activity and receives a new activity. 736 / ENGINEERING two a link it is used to synchronize all the nodes through languages [Batali how to assign [Steele 801. parameters triplets set in CIS consists its output to to of a list of by a list of rule definitions. followed contains a parameter name and a Each rule contains a list of if-parts, pair, and a list of then-parts, each a a certainty set of parameter as an example throughout factor. and rule definitions the de$cription of CIS. (make-parameter ‘covering (make-parameter 'animal-class '(mammal bird reptile)) 'eating-class '(ungulate carnivore)) 'ped-type '(claws hoofs)) (make-rule between is sent through describes each a parameter-value parameter-value pair with nodes. connection As an activity languages definition values. (make-parameter a directional in constraint design of a rule definitions 1981: name. makes and links. a NG by so as to use object-parameter-value AFL-l. in contrast to the distributed view used by Hinton and Touretzky :1985:, the nodes are each assigned a single link has a weight. found section specific (make-parameter A link The CIS maximum: minimum or sum (according to the nodes type) and applies the function shown in Figure 2 to compute its output. In Each which can then be simulated. has four a slope, a rise and a saturation time. envi- high level This section introduces the Concurrent Inference System. In this section we will use parameter-value pairs to represent proposi- set The particular AFN model used by AFL-l consists of five types of nodes - input, output, max, min and sum; and two types is to translate (node groups) out of nodes to the AFN, one instantiates 801 and circuit parameter as its inputs into AFNs to the mechanisms tions. is controlled 3600 programming of the language not such nodes of real numbers of tasks 80, Sussman that: only passes links; of the Symbolics The purpose description similar [1982’. an AFN AFL-l appending “make-” to the group name and passing the instance name and any arguments. This structure defining mechanism is in other as those ‘19851. or because are finite representations as in the model any is a back to the controller connectionist models are AFNs. Many fall either because they use global control, such discussed all their l &ode. language network a path l of an AFL-I The system might then take a global OR of the brown to see if the network knows of any brown-haired humans. that l Fuiictinn ronment. does not provide links, 2: The Output allow global commucontroller to inspect ‘19831, global communications are used heavily. For the host might put a value on all the human nodes have those nodes send the value over their hair-color In contrast. activity global communications. clock according In Thistle, Figure - INHIBITORYINPUT) ’(feathers 'animal-rule-l '(if (covering hair)) '(then (animal-class mammal (make-rule hair)) .95))) 'animal-rule-2 '(if (animal-class mammal) (ped-type hoofs)) '(then (eating-class ungulate .Q))) will be The active node of each rule SG instance takes the AND of that rule’s if-parts. Since the if parts are activity values: not binary, they are combined with MIN and thresholded. This method for taking the AND of uncertain propositions is the same as the methods used by Mycin’s rules and Prospector’s relations. The asserted node of the value SG instances the OR of its inputs. propositions. The rule Maximum implementer. sets the weights asserted nodes. 4.2 Backward A backward is used for the OR of uncertain using of a rule, logical takes the weight then-part in each the active and on the link‘s between Chaining chaining inference or consequent reasoning satisfy a goal parameter. systems (also called goal directed systems) looks for parameters that can By backward chaining, a rule-based sys- tem will only ask the user questions is looking for. CIS backward chains relevant by using to what the system the want-to-know nodes. The “want-to-know” activity flows in the opposite tion than the “truth” activity ~ i.e. from the then-parts directo the if-parts. The backward chaining done by CIS has two advantages over many current rule-based systems. Firstly, since the “want-toknow” and tecedent sider “true” and a medical X, and activity flow consequent diagnosis meanwhile program stumbles haps much more serious ignore this, and perhaps across reasoning which across by recursion Figure 3: Part of the Network In the above of node groups defined Each of the make-rule an instance that by the Animal rule and parameter example, (NGs) Created by CIS using or make-parameter of one of these NGs. each top level call in AFL-l The reader adds nodes are both the defgroup statements should 3 shows part of the network that l names form. for disease for a per- disease Y. Most current systems would not come to disease Y for a long time. to follow the the same inferences path are as the easier not control. to extend. Backward chaining links can easily be excluded rules; this allows a mixing of antecedent and from some consequent With few changes, meta-rules of the sort discussed by Davis [1980] can be implemented; such rules are discussed in section 4.5. creates keep in mind l It is easy to make these that occurs network. results anCon- rules. and links to the AFN at compile time. At run time, the only computation is the flow of activity values along the precompiled Figure Example. the is searching The backward chaining done by CIS is therefore Three examples of such extension are: l links, concurrently. all the symptoms CIS would find Y as it searched for X. Secondly, unlike Prolog and Mycin, restricted different happen rather than A potential from compil- “fuzzy” backward links as one of many heuristics chaining that links and use guide the search force it. problem backward is know and ask nodes have analog values and using heuristic rules to judge the current “interest” of a parameter and activate the instances are circumscribed by rectangles. The node group name is given in the lower left corner and the instance name is given in the upper 4.1 At run left corner. Forward time, value problem can want-to-know be solved nodes in CIS accordingly. by making These be unfocused. want-to- the rules are implemented using more network structure. The host will pick eter with the highest value on its ask node when the paramit selects a question to ask the user. The heuristic rules for activating the want-to-know nodes might include: a) asking related questions Chaining the activity This asks the user might chaining the type of node is specified weight of each link is shown name. The &ode group the system concurrent that below the node instance inside the link’s square. the questions with ing the above definitions. In this figure, the nodes of the AFK are shown as circles and the links as small squares. Within a node, of an asserted node gives the certainty that a parameter-value proposition is true. Inferences in CIS are made by forward flow of this activity through the active nodes of the rule NG instances. together (the rule set implementor can specify which questions are related), b) ask about the if-parts of almost active rules, and c) ask about parameters for implementing these that heuristics AI LANGUAGES lead to more are discussed goals. Methods in (Blelloch AND ARCHITECTURES 861. / 737 Input Input Nodes El ml): h,Whair?(yCS Illtcrthrl Node hctlviltcs Accord I ng to hllswcrs I- output Nodes Structures Ihu [ml User Activity Host Computer Figure 4: The Interface Between 0 Nodes z Flow Network the User and the AFN of CIS 4.3 Input and Output The only way an AFN Figure can communicate is through the input and output system uses a serial host computer nodes. sensor sible with the outside world nodes. At run time, the CIS to communicate with these activators. the l/O nodes Such direct connected connections directly to sensors will not be discussed and in this paper. Values 4.4 in those are shown. It is easy the network to add this required type signify of rule for the tetanus Figure This 5 shows network to tetanus relevant parameter “stepped is asserted. nail” - not all the nodes to CIS. rule. - hleta-Rule. that to ask all the questions on rusted - by the Tetanus groups the system causes when the Objects 5 can have several values, each of which creates an of the value NG (see Figure 3). The a-value-asserted Created the dashed Figure 4 pictures how the communications work. For based rule-based systems such as PDS [Fox 831 it is posto have 5: The Network In the diagram groups ’pnrdmctcr group L -_ - group mcta-rule Each parameter instance node of a parameter is used to recognize if any of its values are group is asserted above some threshold. A mutually-exclusive placed the asserted nodes around of the values (the one with of the values the highest so that input) only one is asserted at a time. The mutually-exclusive group can be left out if desired. Because there is a separate NG for each value, there can only be a moderate number of values rule sets do not require many specified values at compile time. and in many use of high-precision though most applications values ination other don’t only integers current rule- rule-based need them. for age, body for each value also precludes and floating systems allow For example temperature or immunization. point For these such Meta In practice, values, Mycin and dates parameters, are not needed; 100 or so values will suffice. Prospector and Rl also require no high-precision 4.5 numbers. object, such rules, attribute: to have task specific “meta-rules”, “contextual / ENGINEERING value The same sort triplet) of object creating a separate is done by defining which objects abstraction the stance about part such of the in the rules. allow a clean can be used As way to in CIS by network for each instance of an object. This a Node Group for an object and instantiating sub-networks. For example, two animals many systems (often are used objects it, at compile time, for each instance. computer assigns names of new instances we could i2t run time, the host to the precompiled in- if we wanted use the following CIS to reason definition. (defgroup animal (> uses integer (make-parameter 'covering '(feathers hair)) of last exam32 bit integers (make-rule 'animal-rule-l '(if (covering hair)) '(then (animal-class mammal The rule sets of numbers. rules that relations”. and Prospector (make-animal (make-animal control jGaschnig the .95))) 'first-animal) 'second-animal) To create the needed network at compile time, CIS must know maximum number of instances that might be needed. In most applications not vary enough 738 To allow for this, and KEE have generic well as allowing multiple instances, separate sets of rules into modules. Rules them OPS5 . 1 it is important [19801 names are valid for all instances. as Mycin, Al- the invocation of other rules [Davis 80, Gaschnig 821. An example of such a rule is: “if the patient has stepped on a rusty nail, then ask questions about tetanus (activate the tetanus rules).” Davis 821 names which Most based systems including Mycin, KEE and Prospector, one defines the possible values of each parameter at compile time. This helps prevent errors. The need for a NG instance When a rule set includes several instances of an object that all obey the same rules, it is convenient to create a single set of rules greatly this is not a problem from one use of a system to put an upper bound since this number to the next: on the number. does it is easy For example, in Mycin we know will usually there will only have at most three three organisms. The above method does not address different of creating the problem instances. be one patient cultures taken, multiple of creating Such rules might IF (and (father THEIi (zebra y)) x y> (zebra and the patient each with possibly instances 15 of an object rules that AFL-STEP cross between TIME include: (In msccs) 10 x)) 0 50 IF (= (number-of THEIJ (herd-of There zebras) 3) 0 0 zebras) are relatively simple ways to include I I I I I 1 2 4 8 16 such rules in CIS; VP RATIO (x 64.000 to get max numb of links) see [Blelloch86]. 6 Implementation Processor The network-processor network. is used to run a compiled cycle of the network A single activity processor an activities, l The Thinking Machines Corporation Connection Machine is currently used as the network-processor. At compile time, node links of a node is placed on a separate processor. All the output are placed in processors immediately following Processors are also used for each input of a the node processor. node and are placed immediately preceding the node processor. This means that for 1 links and n nodes, required (by overlapping input and output can be used). At run time, distribute After the a copy-prefix output value the copy-prefix, each operation of a node 21 + n processors are links, E+ n processors is used [Kruskal85] to all the link multiplies output its input value to The routing more links sor can simulate causes expensive step taken questions. whole 7 rules, as many depth than several a slightly processors, virtual greater number of virtual processors. by an afl-step as a function (VPs). linear assumptions require a network 2 million links an afl-step requires between 40 of them to be executed time for the answer to propagate the of the inferences. Concurrency Researchers have argued that stant speedup by implementing rather these than serial arguments gle processor of a rule-based machine based machines one can achieve at best a cona rule-based system on a parallel [Forgy In particular, is pictured 841. They developed a limited they consider make for sin- interpretation a model that a single channel so only one resolution” stage). This type in Figure 7a. Matching simu- with the Figure 6 shows the time required of the number of links when imple- mented on a 64K-processor Connection Machine. By making some assumptions about the rules ters and imposing between questions, systems and only consider system. forces the selection of rules through rule can fire at a time (the “conflict of concurrency 84, Oflazer on rule-based proces- Such slow-down as parameters by this each physical processors than rules the above links. With which allows This is enough Concurrent method. To include lation cycle is the most are five times For 100,000 links. and sum prefixes are used to compute the max, min and sum of the inputs for each node. The node processors then compute the node function. Because of the prefix operations, the time taken by this method is independent of the largest fan-in or fan- There of 2 million .05 seconds by its weight and sends the result, using the router, to the other end of the link - a processor preceding a node processor. Max, min out. CM). flow is called afl-step. It consists of all the nodes sending their receiving new ones and computing the node function. each Taken by an Afl-step as a Function of in the Activity Flow Network (On 64K Figure 6: The Time the Number of Links a)Typc and discussed by [Ofker841 Concurrent a limit on the time the user is willing to wait an upper bound on the number of rules that CIS may have can be given. With the following is possible to include 100,000 rules in CIS. l The maximum time a user is willing l The maximum depth l The average parts. rule has three l The average parameter of inferences to wait assumptions, Concurrent Matching I<tdc it is 2 seconds. in the system antecedent and [Fwgy84]. parame- is 20 rules, and two consequent b) Type used by CIS. has five values. Figure 7: Two Types of Forward AI LANGUAGES Chaining Concurrency. AND ARCHITECTURES / 739 The selection of a limited set of rules is necessary for some As mentioned applications, in particular problem-solving systems, but even for these applications the restriction to a single rule is unnecessary. restrictions expanding Usually precision only certain simultaneously. sets of rules must be prevented In CIS, one can prevent taneously by placing of concern. Because much a mutually rules exclusive of the work is done from firing from firing group around at compile simul- the rules time, Subrule and subparameter concurrency: Within the rules and parameters all the parts act concurrently. For example, at the same time that a value activates the rules it is connected to; it deactivates all the other values ter, activates the parameter-known its output node. a Concurrent matched matching: l a large make that fan-out between l by Forgy All the rules can propaThere can potentially be a single much change in just more could propagate a few afl-steps. concurrency 119841; Figure than 7 shows to backward rent AND/OR the difference ter to the parameters A completely is executed which concur- from the ‘(goal” parame- can affect it. Unlike the con- current implementations of logical inference systems discussed by Douglass [1985] and Murakami ;1984]: concurrent “AND” searching is does not present problems. is because the variables are compiled out. l l and Concurrent question rent happen Backward propagation in section 4.2. Forward mentioned question focusing search selection: mechanism: of a single With Again, together: the addition the system question I thank on various CIS allows all these this As of the Ackley, can do a concur- sorts of concurrency, how well is available. D.H., The initial study systems of CIS suggests using activity that to implement and more gener- level models. The AFL-l simple, no more complex the code used in other rule-based systems, and the running of CIS is very good. With expected advances in massively concurrent 740 it is possible flow networks, ally, with connectionist or other circuit code needed to implement CIS is quite than time hardware, / ENGINEERING Hinton, Batali, J., the times that create creates instances extra network W7altz for their helpful by the Defense ARPA Contract comments Advanced Re&0014-85-K- G.E., Blelloch, Sejnowski, Machines”, T.J., “A Learning Cognitive Science, Algo1985, 9. Hartheimer, A., “The Design Procedure Language 598, MIT AI Laboratory, September 1980. , Memo G.E., “AFL-l: A Programming Concurrent Computers”, gineering and Computer Davis, R., Buchanan, Representation Language for Massively MS Thesis, Dept. of Electrical Science, MIT, June 1986. B., Shortliffe, E., “Production for Knowledge-Based Intelligence, En- pert R.J., “A Qualitative Systems”, as a Program”, 1977, 8, 15-45. R., “Meta-Rules: Reasoning Intelligence, 1980, 15, 179-222. Douglass, Rules Consultation Davis, IEEE about Assessment Software, Control”, Artificial of Parallelism in Ex- May 1985, 70-81. Fahlman, S.E., ‘(Three Flavors of Parallelism”, Proc. National Conference of the Canadian Society for Computational Studies of Intelligence, May 1982, Saskatoon, Saskatchewan, 230235. Fahlman, S.E., Hinton G.E., Sejnowski, T.J., “Massively Parallel Architectures for AI: Neti, Thistle and Boltzmann Machines”: Proc. AAAI, J.A., August 1983, Washington Ballard, Properties”, Forgy, C.L., University, will greatly improve. D-H., Cognitive “The OPS5 Department C., A. Gupta, Architectures 1984, Austin, Conclusions practical Phil Agre and David parts of this work. rithm for Boltzmann 147-169. Forgy, 8 To dynamically D.C, 109-113. to ask the user. the system takes advantage of them depends on the rule set being used. Since no large rule sets have been implemented in CIS, no data flow networks. This research was supported search Projects Agency {DOD), 0124. Feldman, Although sc,rre Acknowledgements Artificial propagation: search imposec Note the model the two types. Concurrent flow and activity of an object. one could use a system structure as it is nceded. Manual” of changes offers considered of a rule are This is possible because out so the variable slots propagation: concurrently. so that thousands this parts bottlenecks. Concurrent forward gate their inferences rn.c?el and activates In fact it only takes a single afl-step to match every rule in the system. the variable references are compiled AFN References All the antecedent concurrently. do not become of its parame- node: the and be- cause of the concurrency of AFNs, CIS can take advantage of several sources of concurrency at run time. Among these are: l in the paper, on CIS. Some of these limitations can be . ,oided by the model slightly. For example, to manipulate highone could use a model that intermixes data numbers, R. Wedig, “Initial Systems”, Proc. P., “Techniques Proc. August in Michie New York, Assessment AAAI, S., Kleinosky, “Prospector: and Their User’s Manual”, TR, Carnegie-Mellon of Computer Science, 1981. A. Newell, Based Diagnostics” Germany, 1 S8-163. Systems, Models 1982, 6, 205-254. for Production TX., 116-120. Fox, M.S., Lowenfeld, Gaschnig, J., ploration”, “Connectionist Science, IJCAI, An Expert (Ed.), Gordon for Sensor- 1983, Karlsruhe System for Mineral Introdzlctory Readings and Breach, 1982. of August W. Ex- in Ezpert Hinton, G.E., “Implementing Semantic IVetworks in Parallel”, Hinton and J.A. Anderson (Ed.), Parallel Models Memory, Hillsdale, XJ: Erlbaum, 1981. Associative of in G.E. Kruskal: C.P., Rudolph, fix”: Proc. Int’l. 1985, 180-185. McDermott, main”, J., L., Snir. M., “The Power Conference “RI: Proc. on Parallel an Expert AAAI, of Parallel Processing, in the Computer August 1980, Stanford Pre- iZugust Systems University, Do269- 271. Murakami, K., Kakuta, ware Systems: Base Machine”, Systems; Oflazer: 1984, Tokyo, K.. Systems” 92-100. I: D.E., G.L. Jr., G.J., Touretzky, J.L., MIT Press: “The Definition Language 595: MIT AI Laboratory, Expressing telligence, Parallel Steele, Based “Symbols L.A., “Fuzzy Sets”, Mass., ProcessVolume 1986. of a Com- on Constraints”, “Constraints Among 1984, AI-TR 1980. - A Language Descriptions”, the Connectionist Inference Architecture”, 1985, Los Angeles, 238-243. Zadeh, Distributed and Implementation August G.L. Jr., August of Cognition, Cambridge Almost-Hierarchical 1980, 14: l-39. D.S., and HardKnowledge Computer of Production Processing. in the Microstructure Programming Sussman, Processing Parallel McClelland, Foundations, puter in Parallel Int’l Conf. Erplorations Steele, R.: “Architectures 18-36. “Partitioning : Proc. Rumelhart, ing: T.; Onai: Parallel Inference Machine and Proc. Int’l Conf. Fifth Generation Information h’eurons: Proc. and for Artificial In- Details of a IJCAI, Control, August 1965, 8, 338-353. AI LANGUAGES AND ARCHITECTURES / 74 I