src/state.cpp
// States ensure their integrity:
// * All the transitions will need the same number of tapes
// * Only one transition can be chosen with a certain input
States ensure their integrity:
All the transitions will need the same number of tapes
Only one transition can be chosen with a certain input
States ensure their integrity : All the transitions will need the same number of tapes Only one transition can be chosen with a certain input
bool State::can_be_added(const Transition& new_transition) {
    if (transitions.empty()) {
        return true;
    }
    if (new_transition.get_actions().size() != transitions[0].get_actions().size()) {
        return false;
    }
    for (const Transition& transition : transitions) {
        if (new_transition.get_tokens_to_read() == transition.get_tokens_to_read()) {
            return false;
        }
    }
    return true;
}
bool State :: can_be_added ( const Transition & new_transition ) { if ( transitions . empty ( ) ) { return true ; } if ( new_transition . get_actions ( ) . size ( ) != transitions [ 0 ] . get_actions ( ) . size ( ) ) { return false ; } for ( const Transition & transition : transitions ) { if ( new_transition . get_tokens_to_read ( ) == transition . get_tokens_to_read ( ) ) { return false ; } } return true ; }
States ensure their integrity:
 All the transitions will need the same number of tapes
 Only one transition can be chosen with a certain input
States ensure their integrity : All the transitions will need the same number of tapes Only one transition can be chosen with a certain input