Exemplo n.º 1
0
const V3NetId
V3NtkElaborate::elaborateLTLFormula(V3LTLFormula* const ltlFormula, const uint32_t& rootIndex) {
   assert (ltlFormula); assert (ltlFormula->isValid(rootIndex)); assert (isMutable());
   assert (_ntk); assert (this == ltlFormula->getHandler());
   if (ltlFormula->isLeaf(rootIndex)) {
      V3Formula* const formula = ltlFormula->getFormula(rootIndex); assert (formula);
      assert (ltlFormula->getHandler() == formula->getHandler());
      return dynamic_cast<V3BvNtk*>(ltlFormula->getHandler()->getNtk()) ? 
             elaborateBvFormula(formula, formula->getRoot(), _netHash) : 
             elaborateAigFormula(formula, formula->getRoot(), _netHash);
   }
   switch (ltlFormula->getOpType(rootIndex)) {
      case V3_LTL_T_G :  // Currently Support Single Layered LTL
         assert (1 == ltlFormula->getBranchSize(rootIndex));
         assert (ltlFormula->isLeaf(ltlFormula->getBranchIndex(rootIndex, 0)));
         return elaborateLTLFormula(ltlFormula, ltlFormula->getBranchIndex(rootIndex, 0));
      case V3_LTL_T_F :  // Currently Support Single Layered LTL
         assert (1 == ltlFormula->getBranchSize(rootIndex));
         assert (ltlFormula->isLeaf(ltlFormula->getBranchIndex(rootIndex, 0)));
         return elaborateLTLFormula(ltlFormula, ltlFormula->getBranchIndex(rootIndex, 0));
      default      : 
         Msg(MSG_WAR) << "Verification of General LTL Formula Has NOT Been Supported Yet !!" << endl;
   }
   return V3NetUD;
}
Exemplo n.º 2
0
// Elaboration Functions
const uint32_t
V3NtkElaborate::elaborateProperty(V3Property* const p, V3NetVec& constrList, const bool& l2s) {
   assert (p);
   V3LTLFormula* const ltlFormula = p->getLTLFormula(); assert (ltlFormula);
   const uint32_t pIndex = elaborateLTLFormula(ltlFormula, l2s);
   V3NetVec invList; invList.clear(); constrList.clear();
   // Elaborate Invariants
   for (uint32_t i = 0; i < p->getInvariantSize(); ++i) {
      const V3NetId id = elaborateInvariants(p->getInvariant(i));
      if (V3NetUD != id) invList.push_back(id);
   }
   // Elaborate Invariant Constraints
   V3NetVec invConstrList;
   for (uint32_t i = 0; i < p->getInvConstrSize(); ++i) {
      invConstrList.clear(); elaborateConstraints(p->getInvConstr(i), invConstrList);
      if (invConstrList.size()) constrList.push_back(combineConstraints(invConstrList));
   }
   // Elaborate Fairness Constraints
   if (l2s && p->getFairConstrSize()) {
      V3NetVec fairList;
      for (uint32_t i = 0; i < p->getFairConstrSize(); ++i) {
         fairList.clear(); elaborateFairnessL2S(p->getFairConstr(i), fairList);
         if (!fairList.size()) continue; fairList.push_back(_ntk->getOutput(pIndex));
         _ntk->replaceOutput(pIndex, combineConstraints(fairList));
      }
   }
   // Combine Invariants to Property Outpins
   if (invList.size()) combineInvariantToOutputs(pIndex, invList);
   assert ((1 + pIndex) == _ntk->getOutputSize()); return pIndex;
}
Exemplo n.º 3
0
// Elaboration Functions
const uint32_t
V3NtkElaborate::elaborateProperty(V3Property* const p, const bool& l2s) {
   assert (p);
   V3LTLFormula* const ltlFormula = p->getLTLFormula(); assert (ltlFormula);
   const uint32_t pIndex = elaborateLTLFormula(ltlFormula, l2s);
   assert ((1 + pIndex) == _ntk->getOutputSize()); return pIndex;
}
Exemplo n.º 4
0
const uint32_t
V3NtkElaborate::elaborateLTLFormula(V3LTLFormula* const ltlFormula, const bool& l2s) {
   // Make Sure Mapping Tables are Maintained, or NO properties can be proliferated
   if (!isMutable() || (_ntk && (!_p2cMap.size()))) return V3NtkUD;
   // Elaborate LTL Formula into Ntk
   assert (ltlFormula); assert (_handler == ltlFormula->getHandler()); elaborate(ltlFormula);
   // Create Formula for this Ntk, and Perform LTL Formula Rewriting if Enabled
   V3LTLFormula* const formula = ltlFormula->createSuccessor(this);
   // Currently Support ONLY AG(p) and AF(p)
   const uint32_t rootIndex = formula->getRoot(); assert (!formula->isLeaf(rootIndex));
   V3NetId id = elaborateLTLFormula(formula, rootIndex); if (V3NetUD == id) return V3NtkUD;
   id = (l2s && V3_LTL_T_F == formula->getOpType(rootIndex)) ? elaborateL2S(id) : ~id;
   // Record LTL Formula and Set to Output
   _pOutput.push_back(formula); _ntk->createOutput(id); assert (_pOutput.size() == _ntk->getOutputSize());
   return _ntk->getOutputSize() - 1;
}