File: FSARep.h

package info (click to toggle)
magnus 20060324-5.1
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 19,436 kB
  • ctags: 20,462
  • sloc: cpp: 130,217; ansic: 37,090; tcl: 10,970; perl: 1,109; makefile: 966; sh: 403; yacc: 372; csh: 57; awk: 33; asm: 10
file content (62 lines) | stat: -rw-r--r-- 1,771 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
// Copyright (C) 1994 The New York Group Theory Cooperative
// See magnus/doc/COPYRIGHT for the full notice.

// Contents: Definition of FSARep class.
//
// Principal Author: Sarah Rees
//
// Status: in progress
//
// Revision History:
//
// * 08/96 Dmitry B. implemented IPC tools.
//

#ifndef _FSA_REP_H_
#define _FSA_REP_H_

#include <Integer.h>
#include "global.h"
#include "RefCounter.h"
#include "Word.h"

using std::cin;


class FSARep : public RefCounter {
public:
  virtual ~FSARep() {};
  virtual FSARep *clone() const = 0;
  virtual Bool operator == ( const FSARep& ) const = 0;

  virtual Bool accepts(Word w) const = 0;
  virtual Bool rejectsInState(Word w, int& state) const = 0;
  virtual Bool nextAcceptedWord(Word& w) const = 0;

//virtual Bool nextAcceptedWord(Word w, int*& history) const = 0; //@rn bad arg
  virtual void minimize() = 0;
  virtual Integer sizeLanguage() const = 0;
  virtual Bool finiteLanguage() const = 0;

  virtual void readFrom(istream &str = cin) = 0;
  virtual void printOn(ostream &str = cout) const = 0;
  virtual void setName(const Chars & name)=0;
  virtual int getNumStates() const =0;


  /////////////////////////////////////////////////////////////////////////
  //                                                                     //
  // IPC tools:                                                          //
  //                                                                     //
  /////////////////////////////////////////////////////////////////////////

  virtual void write( ostream& ostr ) const = 0;

  virtual void read( istream& istr ) = 0;

};

// FSARep *fsaUnion(FSA A1, FSA A2); //friend function
// FSARep *fsaIntersection(FSA A1, FSA A2); //friend function (or operator?)
// other boolean
#endif