From c752dccbed1f901d8527b2ff1f98f6a79f34d165 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Pecka?= <peckato1@fit.cvut.cz> Date: Thu, 1 May 2014 11:03:48 +0200 Subject: [PATCH] aconversion: elimination: fix converting automata without final states --- aconversions/src/fa2re/StateElimination.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/aconversions/src/fa2re/StateElimination.cpp b/aconversions/src/fa2re/StateElimination.cpp index 76cc3e41f0..177a3a0b7b 100644 --- a/aconversions/src/fa2re/StateElimination.cpp +++ b/aconversions/src/fa2re/StateElimination.cpp @@ -17,8 +17,7 @@ namespace conversions StateElimination::StateElimination( const FSM & automaton ) : m_automaton( automaton ) { - if( automaton.getFinalStates( ).size( ) <= 0 ) - throw AlibException( "aconversion: Automaton's final states set must not be empty." ); + } StateElimination::~StateElimination( void ) @@ -34,6 +33,13 @@ void StateElimination::deleteTransitions( void ) RegExp StateElimination::convert( void ) { + if( m_automaton.getFinalStates( ).size( ) <= 0 ) + { + RegExp ret; + ret.setRegExp( new RegExpEmpty( ) ); + return ret; + } + m_MR = ExtendedNFA( ); // steps 1 + 2 -- GitLab