skip to main content
10.1145/1181195.1181209acmconferencesArticle/Chapter ViewAbstractPublication PagesfseConference Proceedingsconference-collections
Article

VC generation for functional behavior and non-interference of iterators

Published: 10 November 2006 Publication History

Abstract

We propose a formalism for the full functional specification of enumerator methods, which are C# methods that return objects of type IEnumerable<T> or IEnumerator<T>. We further propose a sound modular automatic verification approach for enumerator methods implemented using C# 2.0's iterator blocks (i.e., using yield return and yield break statements), and for client code that uses for-each loops. We require for-each loops to be annotated with special for-each loop invariants.The approach prevents interference between iterator implementations and client code. Specifically, an enumerator method may read a field o.f only if o is reflexively-transitively owned by an object listed in the enumerator method's reads clause, and the body of a for-each loop may not modify these objects. For example, we verify that a for-each loop iterating over an ArrayList does not modify the ArrayList. Note that one may break out of a for-each loop at any time to perform modifications before the iteration is complete. This in effect invalidates the iteration since the for-each loop cannot be resumed.We support specification of non-deterministic enumerations, infinite enumerations, and enumerations that terminate with a checked exception, but not enumerations with side-effects. We support verification of an enumerator method only if it is implemented using yield statements, and verification of client code only if it performs a for-each loop on an enumerator method call. That is, the present approach does not support explicit creation or manipulation of IEnumerator<T> objects.Our approach integrates easily with our concurrency approach (presented at ICFEM06), since both are based on read/write sets.This approach was initially presented at FTfJP05. Please refer to this paper for related work, references, and a soundness proof.

Cited By

View all

Recommendations

Comments

Information & Contributors

Information

Published In

cover image ACM Conferences
SAVCBS '06: Proceedings of the 2006 conference on Specification and verification of component-based systems
November 2006
87 pages
ISBN:159593586X
DOI:10.1145/1181195
Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

Sponsors

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 10 November 2006

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. boogie
  2. formal specification
  3. iterators
  4. verification

Qualifiers

  • Article

Conference

SIGSOFT06/FSE-14
Sponsor:

Acceptance Rates

SAVCBS '06 Paper Acceptance Rate 14 of 14 submissions, 100%;
Overall Acceptance Rate 37 of 46 submissions, 80%

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)1
  • Downloads (Last 6 weeks)0
Reflects downloads up to 07 Nov 2024

Other Metrics

Citations

Cited By

View all

View Options

Get Access

Login options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media