Пример #1
0
/* virtual */ OP_STATUS
ES_RemoteDebugFrontend::Connected()
{
	TRAPD(status, SendHelloL());
	if (OpStatus::IsSuccess(status))
		return AttachToAll();
	else
		return status;
}
Пример #2
0
bool
LDemonstrator::Inference(vector<string>* __param){
// cout<<"\nLDemonstrator::Inference(vector<string>* __param){ ....\n";
// 
if(GetStack()->size() == 0)
   return this;
bool end=false;

LDemonstrator* affine=POPAffines();
// Print();
int nb_repeats=GetStack()->size();
nb_repeats*=nb_repeats;
bool some_affine_constraints=false;
if(GetStack()->size() ==0)
   end=true;

while(!end){
//    cout<<"\nLDemonstrator::Inference==========STACK\n";
//    Print();
   AttachedClauses* header=POP();
/*   cout<<"\nLDemonstrator::Inference==========HEADER\n";
   header->Print();*/
   int __nb_unified;
   if(header->GetKnowledge()->GetVariables()->size()==0){
      PUSHBACK(header->GetKnowledge());
      __nb_unified=0;
      
      }
   else{

      AttachToAll(header->GetKnowledge());
      Try2UnifyAll(__param);
      vector<LogicalClause*>* unified=new vector<LogicalClause*>();
      *unified=RecoverUnified();
      __nb_unified=unified->size();
      DetachAll();
      Inject(unified);
      
      PUSHBACK(header->GetKnowledge());
      LDemonstrator* traduced_affine=POPAffines();
   
      if(traduced_affine->GetStack()->size() != 0){
         affine->Merge(traduced_affine);
//          cout<<"\nInference ........ ohhh pas mal fin anticipée ...!\n";
//          traduced_affine->Print();
//          cout<<"\naffine ....\n";
//          affine->Print();
//          cout<<"\nInference ........ ohhh pas mal fin anticipée ...FIN\n";
         some_affine_constraints=true;
         end=true;
         }
      
      }
   
   nb_repeats--;
      
   if(nb_repeats==0) end=true;
//    cout<<"\n nb repeats = "<<nb_repeats<<"  taille pile d'inferences ="<<GetStack()->size()<<"  nb unified == "<<__nb_unified;
//    Print();

   }


// CLEAR();
Merge(affine);

// cout<<"\nLDemonstrator::Inference=================FIN DE DEMO \n";
// Print();
// cout<<"\nLDemonstrator::Inference(vector<string>* __param){ ....END\n";
// cout<<"\n================================================================\n";
return some_affine_constraints;
}