What is R++ ?
R++ is ``rules in C++''.
R++ is an extension to C++ that bridges the gap
between object-oriented programming and data-driven
(rule-based) programming.
Programs written in R++ have all the facilities of C++
plus a new programming construct: a rule.
A rule is like an ``IF-THEN'' statement,
but it sits apart from the procedural code
and is triggered automatically upon changes to
the data that it monitors.
In effect, rules monitor object memory and react
when their ``IF'' clause becomes true.
The sample rule shown below expresses a company's policy
that employees must retire upon reaching age 65.
This rule is defined as a member of class Employee
and is triggered whenever an employee's age or status changes.
rule Employee::retirement_policy {
age >= 65 &&
status != retired
=>
cout << name << " must retire...";
}
What are rules useful for?
- Applications can use rules to help maintain model integrity
by enforcing invariants and detecting constraint violations
in the model.
- Applications that monitor a physical system
(such as a telephone switching system)
can use rules to detect and react to critical states.
- Applications that are primarily reactive
(such as an elevator controller)
can use rules to express state transitions.
- Applications that apply engineering guidelines
(such as in equipment configuration)
or business policies (such as in loan analysis)
can use rules to apply the guidelines/policies
when each situation arises.
- As a software engineering aid, rules can be used as a
kind of non-procedural exception mechanism for detecting
and handling illegal states.
What are the benefits of R++ ?
- Programs become clearer and more robust because many
auxiliary tasks (such as enforcing invariants and
detecting constraint violations) can be expressed more simply
in rules, thereby uncluttering an application's procedural logic
and eliminating some of the burden of
explicit procedural control.
- R++ expands the kinds and complexity of tractable applications
because it adds another programming paradigm to the
programmer's repertoire.
- R++ shortens the distance between requirements and design
since requirements in the form of invariants, constraints,
policies, and situation-action directives can be readily
expressed in rules.
How to Obtain R++
There are currently problems in obtaining R++.
Lucent has a patent on the technology in R++ but
AT&T owns the production version of the software.
However, it may be
possible for some software vendor to license the rights to R++. This
possibility has been investigated in the past, but the AT&T/Lucent breakup
and the resulting legal hassles caused problems and the effort was abandoned.
R++ Documents and Articles
- ``R++ User Manual'' (version 9-Jan-95)
D. Dvorak, editor.
This 100-page user manual is aimed at C++ programmers who
wish to add R++ rules to their repertoire.
-
Modeling Dynamic Collections of Interdependent
Objects Using Path-Based Rules. D. Litman, A. Mishra and
P. Patel-Schneider, Proceedings of the 1997 ACM-SIGPLAN
Conference on Object-Oriented Programming Systems, Languages and
Applications (OOPSLA-97), October 1997.
This paper presents the benefits of R++ in modeling dynamic
collections of objects, describes the R++ implementation and
provides a comparison with previous integrations of rules and objects.
-
R++: Adding Path-Based Rules to
C++. J. Crawford, D. Dvorak, D. Litman, A. Mishra, and
P. Patel-Schneider, unpublished manuscript, 1997.
This paper presents to the OO community the motivations, design
goals, rule syntax and semantics, and examples of R++ rules.
-
Path-Based Rules in Object-Oriented
Programming. J. Crawford, D. Dvorak, D. Litman, A. Mishra, and
P. Patel-Schneider, Proceedings of the Thirteenth National
Conference on Artificial Intelligence (AAAI-96),
August 1996.
This conference paper explains to the AI community how an AI result
(path-based rules) transfers to the larger computer science
community engaged in object-oriented techniques.
-
R++: Using Rules in Object-Oriented Designs. A. Mishra,
J. P. Ros, A. Singhal, G. Weiss, D. Litman, P. Patel-Schneider,
D. Dvorak, and J. Crawford, Proceedings of the 1996 ACM-SIGPLAN
Conference on Object-Oriented Programming Systems,
Languages and Applications, (OOPSLA-96), July 1996.
This experience report describes the use of R++ in a project in
AT&T and the lessons learned from its use.
-
R++: Rules in C++ (talk slides). Anil Mishra, AT&T,
June 1996.
Slides of a presentation on R++.
-
Device Representation and Reasoning with Affective Relations.
J. Crawford, D. Dvorak, D. Litman, A. Mishra, and
P. Patel-Schneider, Proceedings of the Fourteenth
International Joint Conference on Artificial Intellligence
(IJCAI-95), August 1995.
This paper describes a method for representing and reasoning about
complex devices and how R++ fits in with this method.
-
Path-Based Production Rules. J. Crawford, D. Dvorak, D. Litman,
A. Mishra, and P. Patel-Schneider, Proceedings of the OOPSLA
'94 workshop on Embedded Object-Oriented Production Systems
(EOOPS), F. Pachet, editor, October 1994.
This 6-page position paper explains why path-based rules fit better
in the object-oriented paradigm than conventional pattern-matching rules.
The R++ Team
R++ was a result of a collaboration between research and development
within AT&T Bell Laboratories, specifically,
the Artificial Intelligence Principles Research Department of the
Software and Systems Research Center
and the Advanced Software Engineering and
Information Management Development Department of the
Operations Technology Center.
Members of the R++ design and development team (in alphabetical order):
For more information
write to
Peter F. Patel-Schneider
(pfps@research.bell-labs.com)
Updated 22 November 2002 by
Peter F. Patel-Schneider