Main Page   Class Hierarchy   Compound List   File List   Compound Members   File Members  

/magnus/back_end/KB/include/KBMachine.h

Go to the documentation of this file.
00001 /*
00002  *   $Id: KBMachine.h,v 1.2 1996/08/15 18:55:46 bormotov Exp $
00003  */
00004 
00005 // Copyright (C) 1994 The New York Group Theory Cooperative
00006 // See magnus/doc/COPYRIGHT for the full notice.
00007 
00008 // Contents: The deterministic finite state automaton class
00009 //
00010 // Principal Author: Sarah Rees
00011 //
00012 // Status: in progress
00013 //
00014 // Revision History:
00015 //
00016 
00017 #ifndef _KBMachine_H_
00018 #define _KBMachine_H_
00019 
00020 #include <Integer.h>
00021 #include "Vector.h"
00022 #include "FSA.h"
00023 #include "DFSA.h"
00024 #include "KBMachineRep.h"
00025 
00026 class RKBPackage;
00027 class KBMachine : public FSA {
00028 // this should surely be derived from GroupDFSA but I can't get the
00029 // constructor to work except by doing this
00030   friend class RKBPackage;
00031 public:
00032   KBMachine( ) : FSA( new KBMachineRep() ) { }
00033 
00034   KBMachine( const VectorOf<Chars> & genNames ) : 
00035     FSA( new KBMachineRep( genNames ) ) { }
00036 
00037   KBMachine( const VectorOf<Chars> & genNames,const WordOrder & word_order ) : 
00038     FSA( new KBMachineRep( genNames,word_order) ) { }
00039 
00040   KBMachine( const VectorOf<Chars> & genNames,const WordOrder & word_order,
00041           int numOfRules) :
00042     FSA( new KBMachineRep( genNames,word_order,numOfRules) ) { }
00043 
00044   KBMachine( const VectorOf<Chars> & genNames,const WordOrder & word_order,
00045         int numOfRules, int numOfStates) :
00046     FSA( new KBMachineRep( genNames,numOfRules,numOfStates) ) { }
00047 
00048   void oldFormatPrintOn(ostream & str=cout) const {  look()->oldFormatPrintOn(str); }
00049   // for use with old code, which should one day be updated.
00050 
00051   Bool rewrite(Word & w) const { return look()->rewrite(w); }
00052 
00053   //Bool finiteLanguage() const { return look()->finiteLanguage(); }
00054 
00055   //Integer sizeLanguage() const { return look()->sizeLanguage(); }
00056 
00057 protected:
00058   KBMachine( KBMachineRep * rep ) : FSA((FSARep *)rep) { }
00059   // Need to shadow inherited look() and change(), to get right ptr types.
00060   const KBMachineRep *look() const { 
00061     return (KBMachineRep*)FSA::look(); }
00062   KBMachineRep *change() { 
00063     return (KBMachineRep*)FSA::change(); }
00064 };
00065 #endif

Generated at Tue Jun 19 09:49:36 2001 for Magnus Classes by doxygen1.2.6 written by Dimitri van Heesch, © 1997-2001