Overview

We provide a tool, PMCx86, that automatically translates programs written in a subset of the x86 assembly language to Cubicle-W, our extension of the Cubicle model checker that allows to check safety properties of parametrized transition systems under weak memory.

Publications

Compiling Parameterized x86-TSO Concurrent Programs to Cubicle-W
Sylvain Conchon, David Declerck and Fatiha Zaïdi
In 19th International Conference on Formal Engineering Methods, Xi'an, China, November 2017

Download

pmcx86 source code and examples
You should also download Cubicle-W

Compilation

The tool may be compiled using any recent version of the OCaml compiler by typing make in the source folder. It should not require any specific dependency.

Usage

To invoke the tool, simply run the following command:

pmcx86 prog.s

This produces a Cubicle-W file named prog.cub that can then be checked by executing:

cubiclew prog.cub

Experiments

The table below presents the results obtained on some classical x86-TSO programs. For each program, both the x86-TSO and Cubicle-W code is provided. We give some statistics about the program: number of non-weak arrays, number of weak variables and arrays, number of transitions. We then give the length of the counter-example found (if any), and Cubicle-W's running time.

Program Non-weak
Arrays
Weak
Variables
Weak
Arrays
Transitions Counter-Example
Length
Time
Naive Mutex w/ Deadlock
x86 Code / Cubicle-W Code
US 31112120,38s
Naive Mutex w/o Deadlock
x86 Code / Cubicle-W Code
US 31114120,85s
Mutex w/ xchg
x86 Code / Cubicle-W Code
US 4108100,07s
Mutex w/ xchg
x86 Code / Cubicle-W Code
S 3107-0,08s
Mutex w/ cmpxchg
x86 Code / Cubicle-W Code
US 41010100,12s
Mutex w/ cmpxchg
x86 Code / Cubicle-W Code
S 4108-0,47s
Linux Spinlock
x86 Code / Cubicle-W Code
US 4101060,06s
Linux Spinlock
x86 Code / Cubicle-W Code
S 4109-0,30s
Sense Reversing Barrier (single entry)
x86 Code / Cubicle-W Code
S 31115-0,27s
Sense Reversing Barrier (multiple entries)
x86 Code / Cubicle-W Code
S 31116-1m37s