Project

General

Profile

Statistics
| Branch: | Revision:

cool / src / lib / GMLMIP-0.1 / rules / valuation.h @ 7c4d2eb4

History | View | Annotate | Download (711 Bytes)

1
#ifndef VALUATION_H
2
#define VALUATION_H
3

    
4
#include <cmath>
5
#include<iostream>
6

    
7
using namespace std;
8

    
9
/* This is a truth assignment */
10

    
11
class Valuation {
12
        private:
13
                int n;
14
                int* p;
15
        public:
16
                Valuation(){n=0; p=NULL;};
17
                Valuation(int i, int total); // Gives valuation corresponding to ith valuation.
18
                Valuation(int _n, int* p);
19
                Valuation(const Valuation& c);
20
                Valuation& operator=(const Valuation& c);
21
                ~Valuation();
22
                bool operator==(const Valuation& other) const;
23
                        
24
                
25
                int get_n(){ return n;};
26
                int get_p_i(int i);
27
};
28

    
29
typedef Valuation Clause;
30
// Since each valuation gives rise to a clause.
31
// Valuation is used by deprecated side condition first code.
32
typedef Valuation TruthAssignment;
33
#endif
34