Experiments for Formal Methods and System Design 2017 
Title: Tightening the Contract Refinements of a System Architecture 
Authors: A. Cimatti, R. Demasi, and S. Tonetta
======

Folders:
========
README.txt This document

'single_tightening': contains the experiments for the 
single top-down tightening 

'parallel_tightening': contains the experiments for the 
parallel top-down tightening

'duplication': contains the experiments for the 
duplication of contracts for the problem of sharing 
subcontracts

'process_case_study': contains the results for 
the Example of Applying Tightening on a system architecture 
described in Section 6.4 of the article.

Experimental Evaluation
=======================

Scripts are provided to re-run the experimental evaluations. 
Benchmarks can be found within the directories described above
Python 2.6.6 is required to run the scripts.

Each benchmarks folder contains all 'cmd' script to run individually 
each contract refinement and there is a folder 'data' which contains 
the data collected of the run of the experiments.

For example to run the benchmarks for single top_down tightening:
- single_tightening/run_all_exps.sh
Similar for the others cases.

To plot the results (Requires gnuplots 5.0 and python 2.7)
run the script at ./plots/

It is possible to run each individual benckmark 
through script run_cmd.sh located on each benchmark folder.
For example, ./single_tightening/benchmarks/WBS_ARP/v1/run_cmd.sh
which runs all cmd files at single_tightening/benchmarks/WBS_ARP/v1/
and produce a file called all_results.csv at 
/single_tightening/benchmarks/WBS_ARP/v1/data/
where is copied each output of each cmd file executed.

----- 

Each cmd script has the following format name:

test_spec_name.oss_top_down_contract_name_at_component_name.cmd

For example:

test_WBS_ARP_v1.oss_top_down_cmd_at_BSCU.cmd located at 
single_tightening/benchmarks/WBS_ARP/v1/

which means that is the 'cmd' script to perform single top-down tightening 
in this case for the contract refinement 'cmd' defined in component 'BSCU' on 
the input oss specification WBS_ARP_v1. 

The contents of each cmd script contains the call to the new command
'ocra_tighten_contract_refinement' for a given contract refinement defined
in a given component, an options for the problem of sharion either 
parallel tightening or duplication.
Moreover, for validation purposes, we call 'ocra_check_refinement'  
after tightening and the command 'ocra_check_validation_prop' 
for checking the entailments properties defined in the output specification.

Running Example used in the article
====================

In the article a running example is presented along the paper, 
mainly in Subsection 3.2 'Need of Tightening' and 
Section 5 'Tightening the Whole System Architecture'.

It can be found as in a folder called 'RedundantSensors'
in 'exp'/benchmarks where 'exp' is either 
single_tightening, duplication, and parallel_tightening.
