initial
[prop.git] / include / AD / csp / cspsolver.h
blob9a9f27c8ae042d08f1de629307aec7591255e30d
1 //////////////////////////////////////////////////////////////////////////////
2 // NOTICE:
3 //
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
9 // your programs.
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
16 // code.
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)
22 // 1994-1995
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>
31 class CSP_Solver {
33 CSP_Solver(const CSP_Solver&); // no copy constructor
34 void operator = (const CSP_Solver&); // no assignment
36 public:
37 //////////////////////////////////////////////////////////////////////////
38 // Type definitions.
39 //////////////////////////////////////////////////////////////////////////
40 typedef int TimeStamp; // time stamp
41 typedef void * Continuation; // continuation is an address.
43 protected:
44 //////////////////////////////////////////////////////////////////////////
45 // Internal timestamp
46 //////////////////////////////////////////////////////////////////////////
47 TimeStamp time_stamp; // time stamp counter
48 CSP_Stack stack; // stack
49 Trail trail; // trail
50 CSP_Heap heap; // heap
52 public:
53 //////////////////////////////////////////////////////////////////////////
54 // Constructor and destructor
55 //////////////////////////////////////////////////////////////////////////
56 CSP_Solver();
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 //////////////////////////////////////////////////////////////////////////
68 virtual void cut();
69 virtual void create_choice();
70 virtual void backtrack();
73 #endif