Skip to content

Safety analysis fails to propagate fault behavior within faulty component #21

Description

@kfhoech

Safety analysis fails to propagate fault behavior within the component containing the fault. That is, where a component contains a fault we expect the behavior resulting from that fault to be present in other behavior within that component. Yet, nominal (non-faulty) behavior is what is observed.

A simple, self-contained example follows:

package Example
public
	with Base_Types;

	system Valve
		features
			command_open : in data port Base_Types::Boolean;
			indicate_open : out data port Base_Types::Boolean;
		annex agree {**
			eq true_valve_is_open : bool;
			guarantee Inner_O1 "Valve Open If Commanded" :
				true_valve_is_open = command_open;
			guarantee Inner_02 "Valve Indicates Open If True Open" :
				indicate_open = true_valve_is_open;
			node stuck_false (in1 : bool, trigger : bool) returns (out1 : bool);
			let
				out1 = if trigger then false else in1;
			tel;
		**};
		annex safety {**
			fault Valve_Stuck_Closed "Valve Stuck Closed" : stuck_false {
				inputs: in1 <- true_valve_is_open;
				outputs: true_valve_is_open <- out1;
				disable: false;
				probability: 1.0e-3;
				duration: permanent;
			}
		**};
	end Valve;

	system Top_Level
		features
			input1 : in data port Base_Types::Boolean;
			output1 : out data port Base_Types::Boolean;
		annex agree {**
			guarantee Top_Level_O1 "Output Follows Input" :
				output1 = input1;
		**};
	end Top_Level;

	system implementation Top_Level.impl
		subcomponents
			valve : system Valve;
		connections
			c_in1 : port input1 -> valve.command_open;
			c_out1 : port valve.indicate_open -> output1;
		annex agree {**
			lemma L_Top_Level_01 "Valve indicates open if open" :
				valve.true_valve_is_open = valve.indicate_open;
		**};
		annex safety {**
			analyze: max 1 fault 
		**};
	end Top_Level.impl;

end Example;

In the example above, the Valve system models an actuated valve that can be commanded to open, a local variable indicating the true position of the valve, and an output indicating the position of the valve. A fault models the valve getting physically stuck closed such that it cannot respond to the command to open.

At the top level a lemma is added to measure consistency between the true position of the valve and the indicated position. Running AGREE analysis indicates that the implementation at the top level meets its contract. However, running AMASE safety analysis in the presence of faults also shows that the top level is not affected by the fault with guarantee Top_Level_O1 "Output Follows Input" being satisfied. But, the valve is stuck closed while it is commanded open. The lemma helps indicate the nature of the bug: the indicated position is computed from the nominal position of the valve, not the true position.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions