Predicate abstraction of Java programs with collections

Pavel Parízek, OndYej Lhoták
2012 SIGPLAN notices  
Our goal is to develop precise and scalable verification techniques for Java programs that use collections and properties that depend on their content. We apply the popular approach of predicate abstraction to Java programs and collections. The main challenge in this context is precise and compact modeling of collections that enables practical verification. We define a predicate language for modeling the observable state of Java collections at the interface level. Changes of the state by API
more » ... hods are captured by weakest preconditions. We adapt existing techniques for construction of abstract programs. Most notably, we designed optimizations based on specific features of the predicate language. We evaluated our approach on Java programs that use collections in advanced ways. Our results show that interesting properties, such as consistency between multiple collections, can be verified using our approach. The properties are specified using logic formulas that involve predicates introduced by our language. Map id2thread = new HashMap(); Set active = new HashSet(); // initialize map with data for several threads id2thread.put(1, new ThreadInfo(1,5)); id2thread.put(2, new ThreadInfo(2,18)); id2thread.put(3, new ThreadInfo(3,10)); // some threads are put into the active state active.add (2) ; active.add(3); List schedule = new LinkedList(); Iterator actIt = active.iterator(); while (actIt.hasNext()) { int actID = actIt.next(); ThreadInfo actTh = id2thread.get(actID); for (int i = 0; i < schedule.size(); i++) { int schID = schedule.get(i); ThreadInfo schTh = id2thread.get(schID); if (actTh.priority > schTh.priority) { schedule.add(i, actID); break; } } }
doi:10.1145/2398857.2384623 fatcat:tgkobxy4engp7itpokr5e2xv7y