Exemple #1
0
        public override Cmd VisitAssertCmd(AssertCmd node)
        {
            int phaseNum = QKeyValue.FindIntAttribute(node.Attributes, "phase", int.MaxValue);

            assertionPhaseNums.Add(phaseNum);
            if (phaseNum > enclosingProcPhaseNum)
            {
                Error(node, "The phase of assert cannot be greater than the phase of enclosing procedure");
            }
            return(node);
        }
Exemple #2
0
        public override Requires VisitRequires(Requires requires)
        {
            int phaseNum = QKeyValue.FindIntAttribute(requires.Attributes, "phase", int.MaxValue);

            assertionPhaseNums.Add(phaseNum);
            if (phaseNum > enclosingProcPhaseNum)
            {
                Error(requires, "The phase of requires clause cannot be greater than the phase of enclosing procedure");
            }
            return(requires);
        }
Exemple #3
0
        public override Ensures VisitEnsures(Ensures ensures)
        {
            if (ensures.IsAtomicSpecification)
            {
                inAtomicSpecification = true;
                Ensures ret = base.VisitEnsures(ensures);
                inAtomicSpecification = false;
                return(ret);
            }
            int phaseNum = QKeyValue.FindIntAttribute(ensures.Attributes, "phase", int.MaxValue);

            assertionPhaseNums.Add(phaseNum);
            if (phaseNum > enclosingProcPhaseNum)
            {
                Error(ensures, "The phase of ensures clause cannot be greater than the phase of enclosing procedure");
            }
            return(ensures);
        }
Exemple #4
0
 public static MoverType GetMoverType(Ensures e, out int phaseNum)
 {
     phaseNum = QKeyValue.FindIntAttribute(e.Attributes, "atomic", int.MaxValue);
     if (phaseNum != int.MaxValue)
     {
         return(MoverType.Atomic);
     }
     phaseNum = QKeyValue.FindIntAttribute(e.Attributes, "right", int.MaxValue);
     if (phaseNum != int.MaxValue)
     {
         return(MoverType.Right);
     }
     phaseNum = QKeyValue.FindIntAttribute(e.Attributes, "left", int.MaxValue);
     if (phaseNum != int.MaxValue)
     {
         return(MoverType.Left);
     }
     phaseNum = QKeyValue.FindIntAttribute(e.Attributes, "both", int.MaxValue);
     if (phaseNum != int.MaxValue)
     {
         return(MoverType.Both);
     }
     return(MoverType.Top);
 }
 public static IEnumerable <Implementation> NonInlinedImplementations(this Program prog)
 {
     return(prog.Implementations.
            Where(Item => QKeyValue.FindIntAttribute(Item.Proc.Attributes, "inline", -1) == -1));
 }
 public static IEnumerable <Procedure> NonInlinedProcedures(this Program prog)
 {
     return(prog.Procedures.
            Where(Item => QKeyValue.FindIntAttribute(Item.Attributes, "inline", -1) == -1));
 }
Exemple #7
0
 private IEnumerable <Implementation> NonInlinedImplementations()
 {
     return(prog.TopLevelDeclarations.OfType <Implementation>().
            Where(Item => QKeyValue.FindIntAttribute(Item.Proc.Attributes, "inline", -1) == -1));
 }
Exemple #8
0
 private IEnumerable <Procedure> NonInlinedProcedures()
 {
     return(prog.TopLevelDeclarations.OfType <Procedure>().
            Where(Item => QKeyValue.FindIntAttribute(Item.Attributes, "inline", -1) == -1));
 }