Slab sequencing problem is an NP-hard problem with complex side constraints. In this paper, slab sequencing problem is modeled as a constraint satisfaction problem. A constraint-based algorithm is proposed to solving this problem. During the solving procedure, domains of the variables are firstly preprocessed by using consistency technology to prune the search space; the solution is secondly constructed by the dynamic variable selection and value selection algorithm, when a variable is instantiated, the constraint propagation is triggered, domains of the unscheduled variables are filtered and the subtours are dynamically forbidden. Slab sequence is further adjusted by a modified 2-opt exchange to improve the solution quality. The validity of the proposed algorithm is demonstrated by the simulation experiment.