- Main Page
- Namespaces
- Classes
- Files
- Related Pages

# /Users/fpy/titan-1-5-MBARI/Mers/Solvers/SAT/ISAT/ISATPropositionDB.h

    00001 //========================================================================================
    00002 //
    00003 // Copyright (c) 2001           Model-based Embedded and Robotic Systems Group
    00004 // All Rights Reserved          Massachusetts Institute of Technology
    00005 //
    00006 // This software is provided as is. Model-based Embedded and Robotic Systems (MERS) group
    00007 // does not assume any responsibility.
    00008 //
    00009 // Author:                      Seung H. Chung
    00010 //
    00011 // Organization:        Model-based Embedded and Robotic Systems Group
    00012 //                                      Massachusetts Institute of Technology
    00013 //
    00014 // File:                        ISATPropositionDB.h
    00015 //
    00016 // Description:         Circularly linked list of proposition pointers. It follows the C++
    00017 //                                      Standard Template Library specifications. It is in charge of
    00018 //                                      allocating and deallocating the propositions (i.e. this maintains
    00019 //                                      a data base of propositions that ISAT uses).
    00020 //
    00021 //========================================================================================
    00022
    00023 #if !defined (ISAT_PROPOSITION_DATABASE)
    00024 #define ISAT_PROPOSITION_DATABASE
    00025
    00026 #if defined _MSC_VER
    00027 #pragma warning(disable:4786)
    00028 #endif // #if defined _MSC_VER
    00029
    00030 #include <iostream>
    00031 #include <list>
    00032
    00033 namespace Mers {
    00034         namespace Solvers {
    00035                 namespace SAT {
    00036                         namespace ISAT {
    00037                                 class ISATPropositionDescription;
    00038                                 class ISATProposition;
    00039
    00040
    00050                                 class ISATPropositionDB : public std::list<ISATProposition *>
    00051                                 {
    00052                                         //------------------------------------------------------------------------------------
    00053                                         // Friends
    00054                                         //------------------------------------------------------------------------------------
    00055
    00056                                         friend std::ostream &                   operator <<	(std::ostream &stream,
    00057                                                                                                                         ISATPropositionDB const &proposition_DB);
    00058
    00059                                 public:
    00060                                         //------------------------------------------------------------------------------------
    00061                                         // Public Constructors, Copy Constructors, & Destructors
    00062                                         //------------------------------------------------------------------------------------
    00063
    00064                                         ISATPropositionDB();
    00065                                         ~ISATPropositionDB();
    00066
    00067                                         //------------------------------------------------------------------------------------
    00068                                         // Public Function Members
    00069                                         //------------------------------------------------------------------------------------
    00070
    00071                                         // Inserts the new proposition only if the duplicate does not exist in the database.
    00072                                         // If the new proposition was inserted, it return the pointer to the inserted
    00073                                         // proposition. Else, if the new proposition was not inserted because there was a
    00074                                         // duplicate, it returns the pointer to the same proposition in the database.
    00075                                         // Node: two propositions are the same if the descriptions of the two propositions are
    00076                                         // the same.
    00077                                 //      ISATProposition *       insert_proposition(ISATProposition *new_proposition_p);
    00078
    00079                                         ISATProposition const * get_proposition_p(
    00080                                                                                                 ISATPropositionDescription const *description_p);
    00081                                 //      ISATProposition *       get_proposition_p(ISATProposition *proposition_p);
    00082
    00083                                 /*      iterator                        find(isatProposition::descriptionType const
    00084                                                                                         _isatProposition_description);
    00085                                         const_iterator          find(isatProposition::descriptionType const
    00086                                                                                         _isatProposition_description) const;
    00087                                 */
    00088                                         // Resets the truth value of all propositions in the database to UNKNOWNVAL.
    00089                                         void                            reset();
    00090
    00091                                         //------------------------------------------------------------------------------------
    00092                                         // Public Operators
    00093                                         //------------------------------------------------------------------------------------
    00094
    00095                                 //      bool                                            operator ==     (ISATPropositionDB const &other) const;
    00096                                 //      bool                                            operator !=     (ISATPropositionDB const &other) const;
    00097                                 //      ISATPropositionDB const &       operator =      (ISATPropositionDB const &other);
    00098                                 //      ISATPropositionDB const &       operator +=     (ISATPropositionDB const &other);
    00099
    00100                                 protected:
    00101                                         //------------------------------------------------------------------------------------
    00102                                         // Private Function Members
    00103                                         //------------------------------------------------------------------------------------
    00104
    00105                                         ISATProposition *               find_proposition_p(
    00106                                                                                                 ISATPropositionDescription const *description_p) const;
    00107
    00108                                         void                                    remove_proposition(ISATProposition *proposition_p);
    00109
    00110                                         void                                    unmark_all_propositions();
    00111
    00112                                 };
    00113                         }
    00114                 }
    00115         }
    00116 }
    00117
    00118 #endif // !defined (ISAT_PROPOSITION_DATABASE)