Efficient Algorithms for Functional Constraints * Yuanlin Zhang 1 , Roland H.C. Yap 2 , Chendong Li 1 , and Satyanarayana Marisetti 1 1 Texas Tech University, USA 2 National University of Singapore, Singapore Abstract. Functional constraints are an important constraint class in Constraint Programming (CP) systems, in particular for Constraint Logic Programming (CLP) systems. CP systems with finite domain constraints usually employ CSP-based solvers which use local consistency, e.g. arc consistency. We introduce a new approach which is based instead on vari- able substitution. We obtain efficient algorithms for reducing systems in- volving functional and bi-functional constraints together with other non- functional constraints. It also solves globally any CSP where there exists a variable such that any other variable is reachable from it through a sequence of functional constraints. Our experiments show that variable elimination can significantly improve the efficiency of solving problems with functional constraints. 1 Introduction Functional constraints are a common class of constraints occurring in Constraint Satisfaction Problem(s) (CSP) [10, 11, 7]. In Constraint Programming (CP) sys- tems such as Constraint Logic Programming (CLP), functional constraints also naturally arise as primitive constraints and from unification. Finite domain is a widely used and successful constraint domain for CLP. In this context, functional constraints (e.g., those in CHIP [11]), as primitive constraints, can facilitate the development of more efficient constraint solvers underlying CLP systems. In CLP, when reducing a goal, unification can also lead to functional constraints. For example, when matching p(Z 2 + 1) with a rule on p(X) where both X and Z are finite domain variables, a functional constraint X = Z 2 + 1 is produced. Most work on functional constraints follows the approach in CSP which is based on arc or path consistency [11, 3]. In this paper, we propose a new method — variable substitution — to process functional constraints. The idea is that if a constraint is functional on a variable, this variable in another constraint can be substituted using the functional constraint without losing any solution. Given a variable, the variable elimination method substitutes this variable in all constraints involving it such that it is effectively “eliminated” from the problem. This idea is applied to reduce any problem containing non-functional * Part of this work was supported by National Univ. of Singapore, grant 252-000- 303-112.