1 //////////////////////////////////////////////////////////////////////////////
4 // ADLib, Prop and their related set of tools and documentation are in the
5 // public domain. The author(s) of this software reserve no copyrights on
6 // the source code and any code generated using the tools. You are encouraged
7 // to use ADLib and Prop to develop software, in both academic and commercial
8 // settings, and are welcomed to incorporate any part of ADLib and Prop into
11 // Although you are under no obligation to do so, we strongly recommend that
12 // you give away all software developed using our tools.
14 // We also ask that credit be given to us when ADLib and/or Prop are used in
15 // your programs, and that this notice be preserved intact in all the source
18 // This software is still under development and we welcome(read crave for)
19 // any suggestions and help from the users.
21 // Allen Leung (leunga@cs.nyu.edu)
23 //////////////////////////////////////////////////////////////////////////////
25 #ifndef CSP_solver_base_class_h
26 #define CSP_solver_base_class_h
28 #include <AD/generic/generic.h>
29 #include <AD/csp/trail.h>
33 CSP_Solver(const CSP_Solver
&); // no copy constructor
34 void operator = (const CSP_Solver
&); // no assignment
37 //////////////////////////////////////////////////////////////////////////
39 //////////////////////////////////////////////////////////////////////////
40 typedef int TimeStamp
; // time stamp
41 typedef void * Continuation
; // continuation is an address.
44 //////////////////////////////////////////////////////////////////////////
46 //////////////////////////////////////////////////////////////////////////
47 TimeStamp time_stamp
; // time stamp counter
48 CSP_Stack stack
; // stack
50 CSP_Heap heap
; // heap
53 //////////////////////////////////////////////////////////////////////////
54 // Constructor and destructor
55 //////////////////////////////////////////////////////////////////////////
57 virtual ~CSP_Solver();
59 //////////////////////////////////////////////////////////////////////////
60 // Ask/tell operations.
61 //////////////////////////////////////////////////////////////////////////
62 virtual Bool
ask (const Constraint
&) = 0;
63 virtual Bool
tell (const Constraint
&) = 0;
65 //////////////////////////////////////////////////////////////////////////
66 // Cut and trailing/backtracking operations.
67 //////////////////////////////////////////////////////////////////////////
69 virtual void create_choice();
70 virtual void backtrack();