UltimateAutomizer程序验证工具总结

UltimateAutomizer

 

1. Introduction

UltimateAutomizer is a software verifier that implements an automata-based approach for the verification of safety and liveness properties. UltimateAutomizer is one toolchain of the Ultimate software analysis framework. Learn more inrfomation at the website.

 

UltimateAutomizer can verify the following program properties:

  • the correctness of the user-defined assertion,
  • error function unreachability,
  • valid memory deallocations, pointer dereferences and memory tracking (to search such errors as buffer over-reads and over-writes, null pointer dereferences, uses after free and memory leaks),
  • absence of integer overflows,
  • program termination.

 

2. Approach and Example

UltimateAutomizer verifies a C program by first executing several program transformations and then performing an interpolation based variant of trace abstraction. The workflow of UltimateAutomizer is shown in the following picture. In the first step, it translates the C program into a Boogie program. Next, the Boogie program is translated into an interprocedural control flow graph. As an optimization, it does not label the edges with single program statements but with loop-free code blocks of the program.

From the right of the following picture, we can see that the program is represented by an automaton that accepts all error traces of the program. An error trace is a labeling of an initial path in the control flow graph which leads to the error location. If all error traces are infeasible with respect to the semantics of the programming language, the program is correct. The CEGAR algorithm is depicted below.

 

The abstraction of Program P is a nested word automaton that accepts all error traces of the program. We iteratively construct a set of automata A1∪A2∪...∪An which accepts only infeasible traces. The algorithm terminates if the inclusion P ⊆ A1∪A2∪...∪An holds or a feasible error trace was found.

The following example illustrates how UltimateAutomizer uses automata-theoretic to prove program correctness.

 

Moreover, note that UltimateAutomizer has its own boogie dialect, which deviates from the original Boogie specification as follows.

 

Ultimate Automizer uses the following techniques:

 

 

3. Project and Architecture

UltimateAutomizer is one toolchain of the Ultimate software analysis framework, which is implemented in JAVA.

  • For parsing C programs, it use the C parser of the Eclipse CDT project.
  • Ultimate software analysis framework provides has own translators to transform C code to Boogie code, and own converters to convert boogie code to CFG.
  • UltimateAutomizer use several SMT solvers. For the unification of predicates, the simplification of formulas and the Hoare triple checks we use Z3, because this solver can handle several SMT theories in combination with quantifiers.
  • UltimateAutomizer use CVC4, MathSAT, SMTInterpol, and Z3, for the analysis of error traces. These solvers each provide interpolants or unsatisfiable cores, which both can be used by Ultimate to extract predicates from infeasible traces.
  • The termination analysis is performed by the ULTIMATE Büchi Automizer.
  • For the interprocedural analysis, it use nested word automata; The operations on nested word automata are implemented in the Ultimate Automata Library.
  • Ultimate also provides support for violation witnesses and correctness witnesses.

 

 

4. Installation and Usage

Automizer is developed on top of the open-source program analysis framework Ultimate. Ultimate is mainly developed at the University of Freiburg and received contributions from more than 50 people. The framework and Automizer are written in Java, licensed under LGPLv3, and their source code is available on Github.

UltimateAutomizer is highly automated and required little manual effort. The user only needs to provide a .prp file that contains program properties, and specifies whether the program is written for a 32bit or 64bit architecture.

Here I try to provide a regular installation step for UltimateAutomizer on the Linux system (If you use Mac, you can try it on a virtual machine). Note that if you don't want to install UltimateAutomizer on your system, you can try the web interface of UltimateAutomizer, in which you can verify C programs.

 

1. You require a working version of Python2.7. Its executable should be present in your PATH variable.

 

2. You need to install Java development environment 1.8. Note that Java JRE is not sufficient. Moreover, currently Java >= 1.8 will not work. You can use the following command to install JDK 1.8 and JRE 1.8.

sudo apt install openjdk-8-jre-headless 

sudo apt install openjdk-8-jdk-headless

3. Download the releases version of UltimateAutomizer from here: https://github.com/ultimate-pa/ultimate/releases

 

4. Extract the package and enter the directory of UAutomizer. For example, use the following instruction.

unzip ./UltimateAutomizer-linux.zip cd UAutomizer-linux

 

5. Add the UAutomizer-linux directory to the PATH environment variable.

export PATH=path_to/UAutomizer-linux/:$PATH

 

6. This Ultimate tool should be called by the Python wrapper script Ultimate.py. The script supports the input parameters should be invoked as follows.

./Ultimate.py --spec <propfile> --file <inputfile> --architecture <architecture>

where

  • <propfile> is a property file, usually with the ending *.prp,
  • <inputfile> is a C program,
  • <architecture> is either '32bit' or '64bit' (without quotes).

 

Additional information can be found by invoking

./Ultimate.py --help

 

The output of the Ultimate tool is written to the file "Ultimate.log" in the current working directory and the result is written to stdout.

If the property specified in the property file does not hold, a human readable counterexample is written to UltimateCounterExample.errorpath. Ultimate writes for many properties a violation or correctness witness to the file witness.graphml.

 

7. Choosing the right parameters (i.e., Property files and Architecture).

You can use property files as defined by the following. For example, you can creat a new file namely PropertyMemSafety.prp, then copy the following rules into that file.

  • PropertyMemSafety.prp: The result is 'TRUE' iff all pointer dereferences are valid, all deallocations are valid, and all allocated memory is eventually freed.
CHECK( init(main()), LTL(G valid-free) ) 
CHECK( init(main()), LTL(G valid-deref) ) 
CHECK( init(main()), LTL(G valid-memtrack) )
  • PropertyOverflow.prp: The result is 'TRUE' iff no operations on signed integers results in an overflow. (Operations on unsigned integers are not checked as their behaviour is always defined by the C standard.)
CHECK( init(main()), LTL(G ! overflow) )
  • PropertyTermination.prp: The result is 'TRUE' iff every program execution reaches the end of the program, i.e., iff all program executions are finite.
CHECK( init(main()), LTL(F end) )

For each of this property files (except Termination.prp) Ultimate also checks if all ACSL specifications (e.g., "//@ assert x > 0") are valid.

The architecture parameter specifies whether the program is written for an ILP32 (32bit) or an LP64 (64bit) architecture.

 

8. Now, Let's run an example. For example, I have a file namely test.c in the folder ~/UAutomizer-linux/test. This example is not MemorySafety as a pointer to a variable is only valid as long as the variable is in scope.

//$ vim test.c

#include<stdio.h>

void foo(int **a)
{
	int b = 1;
	*a = &b;
}

int main()
{
	int *c;
	foo(&c);
	printf("%d\n",*c);
}

Use the following command to verify these code, I use can use property files namely PropertyMemSafety.prp and the architecture parameter specifies whether the program is written for 64bit architecture.

../Ultimate.py --spec PropertyMemSafety.prp --architecture 64bit --file test.c

 

9. Check the result. The wrapper script provides output to stdout that indicates whether the checked property is violated or not. The output can be one of the following:

  • TRUE: The property holds.
  • FALSE(P): Generally means that the property is violated. P specifies which property is violated.
  • UNKNOWN: Ultimate is not able to decide whether the property is satisfied or not.
  • ERROR: MSG: Indicates an abnormal termination of Ultimate due to some error. MSG usually describes the error.

For this example, UltimateAutomizer give the result FALSE (valid-deref)

 

Add the parameter --full-output if you require more detail.

../Ultimate.py --spec PropertyMemSafety.prp --architecture 64bit --file test.c --full-output

 

 

5. Related Publication and Slides

 

Ultimate Automizer won the overall ranking at the SV-COMP 2017, 2016. Moreover, Ultimate Automizer was second in the overall ranking at the SV-COMP 2020, 2018, 2015, and third in the at the SV-COMP 2019. Its publication of Competition Contribution are shown as follows.

[1] Heizmann M , Chen Y F , Dietsch D , et al. Ultimate Automizer and the Search for Perfect Interpolants[M]// Tools and Algorithms for the Construction and Analysis of Systems. Springer, Cham, 2018.

[2] Heizmann M , Chen Y W , Dietsch D , et al. Ultimate Automizer with an On-Demand Construction of Floyd-Hoare Automata[C]// International Conference on Tools and Algorithms for the Construction and Analysis of Systems. Springer, Berlin, Heidelberg, 2017.

[3] Heizmann M , Dietsch D , Greitschus M , et al. Ultimate Automizer with Two-track Proofs[C]// International Conference on Tools & Algorithms for the Construction & Analysis of Systems. Springer Berlin Heidelberg, 2016.

[4] Heizmann M , Dietsch D , Leike J , et al. Ultimate Automizer with Array Interpolation[C]// International Conference on Tools & Algorithms for the Construction & Analysis of Systems. Springer, Berlin, Heidelberg, 2015.

[5] Heizmann, Matthias et al. “Ultimate Automizer with Unsatisfiable Cores - (Competition Contribution).” TACAS 2014.

[6] Heizmann M , Jürgen Christ, Dietsch D , et al. Ultimate Automizer with SMTInterpol[J]. lecture notes in computer science, 2013, 7795:641-643.

 

UltimateAutomizer is a software model checker that implements an approach based on automata, as shown in the following.

[7] Matthias Heizmann, Jochen Hoenicke, Andreas Podelski: Software Model Checking for People Who Love Automata. CAV 2013:36-52

[8] Matthias Heizmann, Jürgen Christ, Daniel Dietsch, Evren Ermis, Jochen Hoenicke, Markus Lindenmann, Alexander Nutz, Christian Schilling, Andreas Podelski: Ultimate Automizer with SMTInterpol - (Competition Contribution). TACAS 2013:641-643

[9] Matthias Heizmann, Jochen Hoenicke, Andreas Podelski: Nested interpolants. POPL 2010:471-482

[10] Matthias Heizmann, Jochen Hoenicke, Andreas Podelski: Refinement of Trace Abstraction. SAS 2009:69-85

 

Some related Slides are shown as follows.

 

  • 2
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
SQLAlchemy 是一个 SQL 工具包和对象关系映射(ORM)库,用于 Python 编程语言。它提供了一个高级的 SQL 工具和对象关系映射工具,允许开发者以 Python 类和对象的形式操作数据库,而无需编写大量的 SQL 语句。SQLAlchemy 建立在 DBAPI 之上,支持多种数据库后端,如 SQLite, MySQL, PostgreSQL 等。 SQLAlchemy 的核心功能: 对象关系映射(ORM): SQLAlchemy 允许开发者使用 Python 类来表示数据库表,使用类的实例表示表中的行。 开发者可以定义类之间的关系(如一对多、多对多),SQLAlchemy 会自动处理这些关系在数据库中的映射。 通过 ORM,开发者可以像操作 Python 对象一样操作数据库,这大大简化了数据库操作的复杂性。 表达式语言: SQLAlchemy 提供了一个丰富的 SQL 表达式语言,允许开发者以 Python 表达式的方式编写复杂的 SQL 查询。 表达式语言提供了对 SQL 语句的灵活控制,同时保持了代码的可读性和可维护性。 数据库引擎和连接池: SQLAlchemy 支持多种数据库后端,并且为每种后端提供了对应的数据库引擎。 它还提供了连接池管理功能,以优化数据库连接的创建、使用和释放。 会话管理: SQLAlchemy 使用会话(Session)来管理对象的持久化状态。 会话提供了一个工作单元(unit of work)和身份映射(identity map)的概念,使得对象的状态管理和查询更加高效。 事件系统: SQLAlchemy 提供了一个事件系统,允许开发者在 ORM 的各个生命周期阶段插入自定义的钩子函数。 这使得开发者可以在对象加载、修改、删除等操作时执行额外的逻辑。
SQLAlchemy 是一个 SQL 工具包和对象关系映射(ORM)库,用于 Python 编程语言。它提供了一个高级的 SQL 工具和对象关系映射工具,允许开发者以 Python 类和对象的形式操作数据库,而无需编写大量的 SQL 语句。SQLAlchemy 建立在 DBAPI 之上,支持多种数据库后端,如 SQLite, MySQL, PostgreSQL 等。 SQLAlchemy 的核心功能: 对象关系映射(ORM): SQLAlchemy 允许开发者使用 Python 类来表示数据库表,使用类的实例表示表中的行。 开发者可以定义类之间的关系(如一对多、多对多),SQLAlchemy 会自动处理这些关系在数据库中的映射。 通过 ORM,开发者可以像操作 Python 对象一样操作数据库,这大大简化了数据库操作的复杂性。 表达式语言: SQLAlchemy 提供了一个丰富的 SQL 表达式语言,允许开发者以 Python 表达式的方式编写复杂的 SQL 查询。 表达式语言提供了对 SQL 语句的灵活控制,同时保持了代码的可读性和可维护性。 数据库引擎和连接池: SQLAlchemy 支持多种数据库后端,并且为每种后端提供了对应的数据库引擎。 它还提供了连接池管理功能,以优化数据库连接的创建、使用和释放。 会话管理: SQLAlchemy 使用会话(Session)来管理对象的持久化状态。 会话提供了一个工作单元(unit of work)和身份映射(identity map)的概念,使得对象的状态管理和查询更加高效。 事件系统: SQLAlchemy 提供了一个事件系统,允许开发者在 ORM 的各个生命周期阶段插入自定义的钩子函数。 这使得开发者可以在对象加载、修改、删除等操作时执行额外的逻辑。
GeoPandas是一个开源的Python库,旨在简化地理空间数据的处理和分析。它结合了Pandas和Shapely的能力,为Python用户提供了一个强大而灵活的工具来处理地理空间数据。以下是关于GeoPandas的详细介绍: 一、GeoPandas的基本概念 1. 定义 GeoPandas是建立在Pandas和Shapely之上的一个Python库,用于处理和分析地理空间数据。 它扩展了Pandas的DataFrame和Series数据结构,允许在其中存储和操作地理空间几何图形。 2. 核心数据结构 GeoDataFrame:GeoPandas的核心数据结构,是Pandas DataFrame的扩展。它包含一个或多个列,其中至少一列是几何列(geometry column),用于存储地理空间几何图形(如点、线、多边形等)。 GeoSeries:GeoPandas中的另一个重要数据结构,类似于Pandas的Series,但用于存储几何图形序列。 二、GeoPandas的功能特性 1. 读取和写入多种地理空间数据格式 GeoPandas支持读取和写入多种常见的地理空间数据格式,包括Shapefile、GeoJSON、PostGIS、KML等。这使得用户可以轻松地从各种数据源中加载地理空间数据,并将处理后的数据保存为所需的格式。 2. 地理空间几何图形的创建、编辑和分析 GeoPandas允许用户创建、编辑和分析地理空间几何图形,包括点、线、多边形等。它提供了丰富的空间操作函数,如缓冲区分析、交集、并集、差集等,使得用户可以方便地进行地理空间数据分析。 3. 数据可视化 GeoPandas内置了数据可视化功能,可以绘制地理空间数据的地图。用户可以使用matplotlib等库来进一步定制地图的样式和布局。 4. 空间连接和空间索引 GeoPandas支持空间连接操作,可以将两个GeoDataFrame按照空间关系(如相交、包含等)进行连接。此外,它还支持空间索引,可以提高地理空间数据查询的效率。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值