From: ajreynol Date: Tue, 29 Apr 2014 13:39:11 +0000 (+0200) Subject: Significantly improve performance for producing datatypes models. X-Git-Tag: cvc5-1.0.0~6952 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=19cbae0d4ee81907c7b3d060b0dfc91e9e8469d6;p=cvc5.git Significantly improve performance for producing datatypes models. --- diff --git a/src/theory/datatypes/theory_datatypes.cpp b/src/theory/datatypes/theory_datatypes.cpp index 2715f8e75..d30c3639e 100644 --- a/src/theory/datatypes/theory_datatypes.cpp +++ b/src/theory/datatypes/theory_datatypes.cpp @@ -1149,27 +1149,38 @@ void TheoryDatatypes::collectModelInfo( TheoryModel* m, bool fullModel ){ ++eqccs_i; } - unsigned orig_size = nodes.size(); + //unsigned orig_size = nodes.size(); + std::map< TypeNode, int > typ_enum_map; + std::vector< TypeEnumerator > typ_enum; unsigned index = 0; while( index::iterator it = typ_enum_map.find( tn ); + int teIndex; + if( it==typ_enum_map.end() ){ + teIndex = (int)typ_enum.size(); + typ_enum_map[tn] = teIndex; + typ_enum.push_back( TypeEnumerator(tn) ); + }else{ + teIndex = it->second; + } + bool success; + do{ + success = true; + Assert( !typ_enum[teIndex].isFinished() ); + neqc = *typ_enum[teIndex]; + Trace("dt-cmi-debug") << "Try " << neqc << " ... " << std::endl; + ++typ_enum[teIndex]; for( unsigned i=0; iassertRepresentative( neqc ); - cons.push_back( neqc ); + if( addCons ){ + cons.push_back( neqc ); + } ++index; }