Typestates are a notion of behavioral types that describe protocols for stateful objects, specifying the available methods for each state, in terms of a state machine. Usually, objects with protocol are either forced to be used in a linear way, which restricts what a programmer can do, or deductive verification is required to verify programs where these objects may be aliased. To evaluate the strengths and limitations of static verification tools for object-oriented languages in checking the correct use of shared objects with protocol, we present a survey on four tools for Java: VeriFast, VerCors, Plural, and KeY. We describe the implementation of a file reader and of a linked-list, check for each tool its ability to statically guarantee protocol compliance as well as protocol completion, even when objects are shared in collections, and evaluate the programmer's effort in making the code acceptable to these tools.
翻译:类型状态是一种行为类型的概念,描述有色物体的规程,具体说明每个州可用的方法,即国家机器。通常,有规程的物体要么被迫以线性方式使用,这限制了程序员能够做什么,要么需要从推论上核查程序,以核查可能用别名核查这些物件的程序。为了评估物体导向语言静态核查工具的长处和局限性,以检查是否正确使用有规程的共有物体,我们向Java展示了四种工具:VeriFast、VerCors、Ploral和Key。我们描述了文件阅读器和链接列表的执行情况,检查了每个工具是否有能力静态地保证遵守规程和完成协议,即便在收藏中共享了物件,我们也评估了程序员努力使代码为这些工具所接受的努力。