Commit 57f39581 authored by yoogx's avatar yoogx

* Addition of the Alloy library

        For issue #68
parent d919a2f3
......@@ -419,6 +419,7 @@ AC_OUTPUT([
resources/behavioural_properties/Makefile
resources/runtime/Makefile
resources/runtime/aadl_xml/Makefile
resources/runtime/alloy/Makefile
resources/runtime/cheddar/Makefile
resources/runtime/python/Makefile
projects/ocarina.gpr
......
SUBDIRS = cheddar aadl_xml python
SUBDIRS = cheddar aadl_xml python alloy
@DEBUG_FALSE@DEBUG_FLAG = --disable-debug
@DEBUG_TRUE@DEBUG_FLAG = --enable-debug
......
AUTOMAKE_OPTIONS = no-dependencies
BASE_ALLOY_FILES = contract/analysis/example_scheduling_analysis.als \
contract/goal/example_scheduling_goal.als \
lib/data_structure.als lib/property.als main.als \
meta/contract.als
ALLOY_FILES = $(addprefix $(srcdir)/,$(BASE_ALLOY_FILES))
EXTRA_DIST = $(ALLOY_FILES)
alloy_files = ${shell $(CYGPATH_U) '$(includedir)/ocarina/runtime/alloy'}
install-data-local:
$(INSTALL) -d $(DESTDIR)$(alloy_files)
for f in $(BASE_ALLOY_FILES); do $(INSTALL) -m 444 -D $(srcdir)/$$f $(DESTDIR)$(alloy_files)/$$f; done
module contract/goal/example_scheduling_goal
open lib/data_structure
/*********************************************************
Generated from the objective(s) specification
*********************************************************/
/*
Declaration of the contract(s) representing the objective(s)
*/
one sig is_schedulable extends Contract{
}{
assumption= is_schedulable
input=none
guarantee= none
output=none
}
module lib/data_structure
open lib/property
/*
Library of Data Structures that can be analyzed
*/
//Components
one sig system, device,
process, thread, data,
bus, data_flow,
virtual_bus, virtual_processor,
processor, memory extends Data_Structure{
}
//Thread/Tasks properties
one sig dispatch_protocol,
period,
compute_execution_time,
offset,
priority,
deadline,
jitter,
policy,
//processing/scheduling properties
processor_properties__max_prio_first,
preemptive_scheduler,
scheduling_protocol,
//Dataflows properties
afdx_properties__afdx_bandwidth_allocation_gap, //period
afdx_properties__afdx_frame_size, //max_frame_size
// jitter,
//Networking properties
afdx_properties__afdx_tx_jitter, //TxJitterTime
afdx_properties__afdx_es_delay, //TxLatencyTime, RxLatencyTime,
afdx_properties__afdx_sw_delay, //SwLatencyTime,
bus_properties__bandwidth, //speed
bus_properties__available_bandwidth, //speed
bus_properties__channel_type
extends Data_Structure{
}
one sig
actual_connection_binding,
actual_memory_binding,
actual_processor_binding,
source_text,
//ARINC 653 properties
arinc653__access_type,
//Deployment properties
deployment__execution_platform
extends Data_Structure{
}
//satellite
one sig
source_data_size
extends Data_Structure{
}
//mars_pathinder
one sig
posix_scheduling_policy,
concurrency_control_protocol,
data_sheet__uuid
extends Data_Structure{
}
//ravenscar
one sig
deployment__process_id,
deployment__channel_address,
compute_entrypoint_source_text,
priority_range,
clock_period
extends Data_Structure{
}
//fms
one sig
arinc653__slots_allocation,
arinc653__partition_slots,
arinc653__module_major_frame
extends Data_Structure{
}
one sig response_time extends Data_Structure{}
module lib/property
open meta/contract
/*
Library of Properties that can be analyzed
*/
one sig uniprocessor_architectures extends Property{
}
one sig periodic_tasks,
periodic_tasks_with_jitter,
simultaneous_tasks,
tasks_with_implicit_deadlines,
tasks_with_arbitrary_deadlines,
tasks_with_fixed_priority,
independent_tasks,
tasks_with_bounded_execution_times,
preemtible_tasks extends Property{
}
one sig periodic_frames,
periodic_frames_with_jitter,
simultaneous_fames,
frames_with_fixed_priority,
point_to_point_physical_connections,
messages_with_bounded_size,
asynchronous_nodes,
full_duplex_links,
static_routing extends Property{
}
one sig is_schedulable extends Property{
}
one sig arinc653_context, can_context extends Property{}
module main
open contract/analysis/example_scheduling_analysis
open contract/goal/example_scheduling_goal
/*
open contract/model/ravenscar_aadl
open contract/model/dre_aadl
open contract/model/pathfinder_aadl
open contract/model/satellite_aadl
open contract/model/fms_aadl
*/
open con_model
/*
This is the main alloy file to execute with Alloy Analyzer
Default settings for the Alloy analyzer to be adjusted if necessary
*/
fact no_univ_signature{
Univ=none
}
//adjust resolution scope if necessary
run {} for 1
module meta/contract
/*********************************************************
Alloy module
*********************************************************/
/*Basic structures manipulated in the Alloy specification*/
/*Relationships with Data and Properties can be specified in a contract*/
abstract sig Data_Structure {}
abstract sig Component {
subcomponents: set Component,
type: lone Data_Structure,
properties: set Data_Structure
}
abstract sig Property {}
/*Definition of the structure of a contract*/
abstract sig Contract{
input: set Component, //required-provided data
output:set Component,
assumption: set Property, //required-provided properties
guarantee: set Property,
// inter-dependencies with other contracts
nextHoriz:set Contract, // output->input
nextVertical:set Contract // guarantee->assumption
}
/*
Constraints to be held by satisfiable instance(s)
*/
//Fact defining an horizontal precedence between two elements
fact HorizontalPrecedence{
all c_current:Contract |
c_current.nextHoriz={c_next:Contract|
(c_current.output & c_next.input != none) and
(all a :c_current.assumption| a in Contract.guarantee) and
(all a :c_next.assumption| a in Contract.guarantee) //and
// c_current.output != none
}
}
//Fact defining a vertical precedence between two elements
fact VerticalPrecedence{
all c_current:Contract |
c_current.nextVertical={c_next:Contract|
(c_current.guarantee & c_next.assumption != none)
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment