Action Rules for Programming Constraint Propagators and Interactive User Interfaces

Neng-Fa Zhou

CUNY Brooklyn College & Graduate Center

http://www.sci.brooklyn.cuny.edu/~zhou/

zhou@sci.brooklyn.cuny.edu

@

In this tutorial, we present a new language construct, called Action Rules, and describe its application to the implementation of various constraint propagators and a graphics library. An action rule specifies a pattern for agents, an event pattern for events that can activate the agents, and an action that the agents carry out when activated. The extended language combines the goal-oriented execution model of logic programming with the event-driven execution model. This hybrid execution model facilitates programming interactions in applications such as constraint propagators and interactive user interfaces. A propagator for a constraint is an agent that maintains the consistency of the constraint and is activated by updates of the domain variables in the constraint. As graphics programming is concerned, an agent is an event handler that handles stimuli from the users. B-Prolog has been extended to accommodate action rules. We will also demonstrate the effectiveness of the extended language and system through several applications ranging from optimization, drawing, visualization, interactive user interface design, and games.