Esempio n. 1
0
        /// <summary>
        /// Finds unnecessary annotations throughout the whole dafny
        /// program and returns information on their locations
        /// </summary>
        /// <param name="program">The unresolved dafny program</param>
        /// <returns>A list of DareResult objects</returns>
        public List <DareResult> ProcessProgram(Program program)
        {
            Status = StatusEnum.Running;
            ApplyOptions();
            var DareController = new DareController(program);
            var results        = DareController.GetTokens(DareController.FastRemoveAllRemovables(_stopChecker));

            RestoreOptions();
            Status = StatusEnum.Idle;
            return(results);
        }
Esempio n. 2
0
        /// <summary>
        /// Finds unnecessary annotations throughout the specified members
        /// in the dafny program and returns information on their locations
        /// </summary>
        /// <param name="program">The unresolved dafny program</param>
        /// <param name="members">The members to be checked for dead annotations</param>
        /// <returns>A list of DareResult objects</returns>
        public List <DareResult> ProcessMembers(Program program, List <MemberDecl> members)
        {
            Status = StatusEnum.Running;
            ApplyOptions();
            List <DareResult> results;

            if (members.Count == 1)
            {
                var member        = members[0];
                var methodRemover = new MethodRemover(program);
                var removables    = methodRemover.FullSimplify(member);
                results = DareController.GetTokens(removables);
            }
            else
            {
                var DareController = new DareController(program);
                var removables     = DareController.FastRemoveAllInMethods(_stopChecker, members);
                results = DareController.GetTokens(removables);
            }
            RestoreOptions();
            Status = StatusEnum.Idle;
            return(results);
        }
Esempio n. 3
0
File: Dare.cs Progetto: ggrov/tacny
 /// <summary>
 /// Finds unnecessary annotations throughout the specified members
 /// in the dafny program and returns information on their locations
 /// </summary>
 /// <param name="program">The unresolved dafny program</param>
 /// <param name="members">The members to be checked for dead annotations</param>
 /// <returns>A list of DareResult objects</returns>
 public List<DareResult> ProcessMembers(Program program, List<MemberDecl> members)
 {
     Status = StatusEnum.Running;
     ApplyOptions();
     List<DareResult> results;
     if (members.Count == 1) {
         var member = members[0];
         var methodRemover = new MethodRemover(program);
         var removables = methodRemover.FullSimplify(member);
         results = DareController.GetTokens(removables);
     }
     else {
         var DareController = new DareController(program);
         var removables = DareController.FastRemoveAllInMethods(_stopChecker, members);
         results = DareController.GetTokens(removables);
     }
     RestoreOptions();
     Status = StatusEnum.Idle;
     return results;
 }
Esempio n. 4
0
File: Dare.cs Progetto: ggrov/tacny
 /// <summary>
 /// Finds unnecessary annotations throughout the whole dafny
 /// program and returns information on their locations
 /// </summary>
 /// <param name="program">The unresolved dafny program</param>
 /// <returns>A list of DareResult objects</returns>
 public List<DareResult> ProcessProgram(Program program)
 {
     Status = StatusEnum.Running;
     ApplyOptions();
     var DareController = new DareController(program);
     var results = DareController.GetTokens(DareController.FastRemoveAllRemovables(_stopChecker));
     RestoreOptions();
     Status = StatusEnum.Idle;
     return results;
 }