以下是一个基于Python的有限状态自动机程序:

```python
    class FiniteStateMachine:
    def __init__(self):
        self.states = []
        self.transitions = []
        self.current_state = None
        
    def add_state(self, name):
        self.states.append(State(name))
        
    def set_start(self, name):
        self.current_state = self.get_state(name)

    def get_state(self, name):
        for state in self.states:
            if state.name == name:
                return state
        
    def add_transition(self, from_state, to_state, input_symbol):
        self.transitions.append(Transition(self.get_state(from_state), 
                                          self.get_state(to_state), 
                                          input_symbol))
        
    def read_input(self, input_string):
        for symbol in input_string:
            transition = self.get_transition(self.current_state, symbol)
            if transition:
                self.current_state = transition.to_state
            else:
                print("Invalid input!")
                return 
                
        print("Accepted input!")
        
    def get_transition(self, state, input_symbol):
        for transition in self.transitions:
            if transition.from_state == state and transition.input_symbol == input_symbol:
                return transition
                
        return None

    class State:
    def __init__(self, name):
        self.name = name
   
    class Transition:
    def __init__(self, from_state, to_state, input_symbol):
        self.from_state = from_state
        self.to_state = to_state
        self.input_symbol = input_symbol
```
希望能够帮到您，如果有必要，我们可以进一步探讨其该如何使用。
spam fails_task lang_mismatch pii not_appropriate hate_speech sexual_content quality toxicity humor helpfulness creativity violence