%% Lasttime=3
%% Diagnosis: has_leak(ffm1) (others possible)
#const lasttime=3.
hpd(flip(fha,open),0).
hpd(flip(fi12,open),1).
hpd(flip(fm1,open),2).
obs(neg(pressurized_by(ff12j,ffh)),3).
%:- has_leak(ffi12).
%:- has_leak(ffm1).
%:- stuck(fha).
%obs(in_state(fha,open),1).
%obs(in_state(fi12,open),2).
%obs(in_state(fm1,open),3).


pb(N,TK,T) :-  node(N), tank(TK), time(T), h(pressurized_by(N,TK),T).

lk(N,T) :- node(N), time(T), h(leaking(N),T).
nlk(N,T) :- node(N), time(T), nh(leaking(N),T).

%hst(Sw,S,T) :- time(T), of_type(Sw,v_switch), state_of(S,v_switch),
%	       h(in_state(Sw,S),T).

d_has_leak(V) :- of_type(V,valve), has_leak(V).

d_stuck(Sw) :- of_type(Sw,v_switch), stuck(Sw).
d_stuck(V) :- of_type(V,valve), stuck(V), not dummy_valve(V).

d_bad_circuitry(V) :- of_type(V,valve), bad_circuitry(V).

hide.
show d_has_leak(X).
show d_bad_circuitry(X).
show d_stuck(X).
