% -*- Example Program <ex_20> Diagnosis of 20-cascaded ripple-adder cercuit -*-  
%     Copyright (C) 1997      Shohei Kato  

facts. 
val(Node2,V)	:- conn(Node1,Node2),val(Node1,V).
val(out(D),V) :- dev(D,and),ok(D),val(in(1,D),A),val(in(2,D),B),and(A,B,V).
val(out(D),V) :- dev(D,or),ok(D),val(in(1,D),A),val(in(2,D),B),or(A,B,V).
val(out(D),V) :- dev(D,xor),ok(D),val(in(1,D),A),val(in(2,D),B),xor(A,B,V).
val(out(D),1) :- dev(D,Ano),stuck_on(D).
val(out(D),0) :- dev(D,Ano),stuck_off(D).
and(0,0,0) :- true.
and(0,1,0) :- true.
and(1,0,0) :- true.
and(1,1,1) :- true.
xor(0,0,0) :- true.
xor(0,1,1) :- true.
xor(1,0,1) :- true.
xor(1,1,0) :- true.
or(0,0,0)  :- true.
or(0,1,1)  :- true.
or(1,0,1)  :- true.
or(1,1,1)  :- true.
dev(g20x,xor) :- true.
dev(g20z,xor) :- true.
dev(g201,and) :- true.
dev(g202,and) :- true.
dev(g20c,or)  :- true.
conn(in(1,x20),in(1,g20x)) :- true.
conn(in(1,y20),in(2,g20x)) :- true.
conn(in(1,x20),in(1,g201)) :- true.
conn(in(1,y20),in(2,g201)) :- true.
conn(out(g19c),in(2,g202)) :- true.
conn(out(g19c),in(2,g20z)) :- true.
conn(out(g20x),in(1,g20z)) :- true.
conn(out(g20x),in(1,g202)) :- true.
conn(out(g201),in(2,g20c)) :- true.
conn(out(g202),in(1,g20c)) :- true.
dev(g19x,xor) :- true.
dev(g19z,xor) :- true.
dev(g191,and) :- true.
dev(g192,and) :- true.
dev(g19c,or)  :- true.
conn(in(1,x19),in(1,g19x)) :- true.
conn(in(1,y19),in(2,g19x)) :- true.
conn(in(1,x19),in(1,g191)) :- true.
conn(in(1,y19),in(2,g191)) :- true.
conn(out(g18c),in(2,g192)) :- true.
conn(out(g18c),in(2,g19z)) :- true.
conn(out(g19x),in(1,g19z)) :- true.
conn(out(g19x),in(1,g192)) :- true.
conn(out(g191),in(2,g19c)) :- true.
conn(out(g192),in(1,g19c)) :- true.
dev(g18x,xor) :- true.
dev(g18z,xor) :- true.
dev(g181,and) :- true.
dev(g182,and) :- true.
dev(g18c,or)  :- true.
conn(in(1,x18),in(1,g18x)) :- true.
conn(in(1,y18),in(2,g18x)) :- true.
conn(in(1,x18),in(1,g181)) :- true.
conn(in(1,y18),in(2,g181)) :- true.
conn(out(g17c),in(2,g182)) :- true.
conn(out(g17c),in(2,g18z)) :- true.
conn(out(g18x),in(1,g18z)) :- true.
conn(out(g18x),in(1,g182)) :- true.
conn(out(g181),in(2,g18c)) :- true.
conn(out(g182),in(1,g18c)) :- true.
dev(g17x,xor) :- true.
dev(g17z,xor) :- true.
dev(g171,and) :- true.
dev(g172,and) :- true.
dev(g17c,or)  :- true.
conn(in(1,x17),in(1,g17x)) :- true.
conn(in(1,y17),in(2,g17x)) :- true.
conn(in(1,x17),in(1,g171)) :- true.
conn(in(1,y17),in(2,g171)) :- true.
conn(out(g16c),in(2,g172)) :- true.
conn(out(g16c),in(2,g17z)) :- true.
conn(out(g17x),in(1,g17z)) :- true.
conn(out(g17x),in(1,g172)) :- true.
conn(out(g171),in(2,g17c)) :- true.
conn(out(g172),in(1,g17c)) :- true.
dev(g16x,xor) :- true.
dev(g16z,xor) :- true.
dev(g161,and) :- true.
dev(g162,and) :- true.
dev(g16c,or)  :- true.
conn(in(1,x16),in(1,g16x)) :- true.
conn(in(1,y16),in(2,g16x)) :- true.
conn(in(1,x16),in(1,g161)) :- true.
conn(in(1,y16),in(2,g161)) :- true.
conn(out(g15c),in(2,g162)) :- true.
conn(out(g15c),in(2,g16z)) :- true.
conn(out(g16x),in(1,g16z)) :- true.
conn(out(g16x),in(1,g162)) :- true.
conn(out(g161),in(2,g16c)) :- true.
conn(out(g162),in(1,g16c)) :- true.
dev(g15x,xor) :- true.
dev(g15z,xor) :- true.
dev(g151,and) :- true.
dev(g152,and) :- true.
dev(g15c,or)  :- true.
conn(in(1,x15),in(1,g15x)) :- true.
conn(in(1,y15),in(2,g15x)) :- true.
conn(in(1,x15),in(1,g151)) :- true.
conn(in(1,y15),in(2,g151)) :- true.
conn(out(g14c),in(2,g152)) :- true.
conn(out(g14c),in(2,g15z)) :- true.
conn(out(g15x),in(1,g15z)) :- true.
conn(out(g15x),in(1,g152)) :- true.
conn(out(g151),in(2,g15c)) :- true.
conn(out(g152),in(1,g15c)) :- true.
dev(g14x,xor) :- true.
dev(g14z,xor) :- true.
dev(g141,and) :- true.
dev(g142,and) :- true.
dev(g14c,or)  :- true.
conn(in(1,x14),in(1,g14x)) :- true.
conn(in(1,y14),in(2,g14x)) :- true.
conn(in(1,x14),in(1,g141)) :- true.
conn(in(1,y14),in(2,g141)) :- true.
conn(out(g13c),in(2,g142)) :- true.
conn(out(g13c),in(2,g14z)) :- true.
conn(out(g14x),in(1,g14z)) :- true.
conn(out(g14x),in(1,g142)) :- true.
conn(out(g141),in(2,g14c)) :- true.
conn(out(g142),in(1,g14c)) :- true.
dev(g13x,xor) :- true.
dev(g13z,xor) :- true.
dev(g131,and) :- true.
dev(g132,and) :- true.
dev(g13c,or)  :- true.
conn(in(1,x13),in(1,g13x)) :- true.
conn(in(1,y13),in(2,g13x)) :- true.
conn(in(1,x13),in(1,g131)) :- true.
conn(in(1,y13),in(2,g131)) :- true.
conn(out(g12c),in(2,g132)) :- true.
conn(out(g12c),in(2,g13z)) :- true.
conn(out(g13x),in(1,g13z)) :- true.
conn(out(g13x),in(1,g132)) :- true.
conn(out(g131),in(2,g13c)) :- true.
conn(out(g132),in(1,g13c)) :- true.
dev(g12x,xor) :- true.
dev(g12z,xor) :- true.
dev(g121,and) :- true.
dev(g122,and) :- true.
dev(g12c,or)  :- true.
conn(in(1,x12),in(1,g12x)) :- true.
conn(in(1,y12),in(2,g12x)) :- true.
conn(in(1,x12),in(1,g121)) :- true.
conn(in(1,y12),in(2,g121)) :- true.
conn(out(g11c),in(2,g122)) :- true.
conn(out(g11c),in(2,g12z)) :- true.
conn(out(g12x),in(1,g12z)) :- true.
conn(out(g12x),in(1,g122)) :- true.
conn(out(g121),in(2,g12c)) :- true.
conn(out(g122),in(1,g12c)) :- true.
dev(g11x,xor) :- true.
dev(g11z,xor) :- true.
dev(g111,and) :- true.
dev(g112,and) :- true.
dev(g11c,or)  :- true.
conn(in(1,x11),in(1,g11x)) :- true.
conn(in(1,y11),in(2,g11x)) :- true.
conn(in(1,x11),in(1,g111)) :- true.
conn(in(1,y11),in(2,g111)) :- true.
conn(out(g10c),in(2,g112)) :- true.
conn(out(g10c),in(2,g11z)) :- true.
conn(out(g11x),in(1,g11z)) :- true.
conn(out(g11x),in(1,g112)) :- true.
conn(out(g111),in(2,g11c)) :- true.
conn(out(g112),in(1,g11c)) :- true.
dev(g10x,xor) :- true.
dev(g10z,xor) :- true.
dev(g101,and) :- true.
dev(g102,and) :- true.
dev(g10c,or)  :- true.
conn(in(1,x10),in(1,g10x)) :- true.
conn(in(1,y10),in(2,g10x)) :- true.
conn(in(1,x10),in(1,g101)) :- true.
conn(in(1,y10),in(2,g101)) :- true.
conn(out(g9c),in(2,g102)) :- true.
conn(out(g9c),in(2,g10z)) :- true.
conn(out(g10x),in(1,g10z)) :- true.
conn(out(g10x),in(1,g102)) :- true.
conn(out(g101),in(2,g10c)) :- true.
conn(out(g102),in(1,g10c)) :- true.
dev(g9x,xor) :- true.
dev(g9z,xor) :- true.
dev(g91,and) :- true.
dev(g92,and) :- true.
dev(g9c,or)  :- true.
conn(in(1,x9),in(1,g9x)) :- true.
conn(in(1,y9),in(2,g9x)) :- true.
conn(in(1,x9),in(1,g91)) :- true.
conn(in(1,y9),in(2,g91)) :- true.
conn(out(g8c),in(2,g92)) :- true.
conn(out(g8c),in(2,g9z)) :- true.
conn(out(g9x),in(1,g9z)) :- true.
conn(out(g9x),in(1,g92)) :- true.
conn(out(g91),in(2,g9c)) :- true.
conn(out(g92),in(1,g9c)) :- true.
dev(g8x,xor) :- true.
dev(g8z,xor) :- true.
dev(g81,and) :- true.
dev(g82,and) :- true.
dev(g8c,or)  :- true.
conn(in(1,x8),in(1,g8x)) :- true.
conn(in(1,y8),in(2,g8x)) :- true.
conn(in(1,x8),in(1,g81)) :- true.
conn(in(1,y8),in(2,g81)) :- true.
conn(out(g7c),in(2,g82)) :- true.
conn(out(g7c),in(2,g8z)) :- true.
conn(out(g8x),in(1,g8z)) :- true.
conn(out(g8x),in(1,g82)) :- true.
conn(out(g81),in(2,g8c)) :- true.
conn(out(g82),in(1,g8c)) :- true.
dev(g7x,xor) :- true.
dev(g7z,xor) :- true.
dev(g71,and) :- true.
dev(g72,and) :- true.
dev(g7c,or)  :- true.
conn(in(1,x7),in(1,g7x)) :- true.
conn(in(1,y7),in(2,g7x)) :- true.
conn(in(1,x7),in(1,g71)) :- true.
conn(in(1,y7),in(2,g71)) :- true.
conn(out(g6c),in(2,g72)) :- true.
conn(out(g6c),in(2,g7z)) :- true.
conn(out(g7x),in(1,g7z)) :- true.
conn(out(g7x),in(1,g72)) :- true.
conn(out(g71),in(2,g7c)) :- true.
conn(out(g72),in(1,g7c)) :- true.
dev(g6x,xor) :- true.
dev(g6z,xor) :- true.
dev(g61,and) :- true.
dev(g62,and) :- true.
dev(g6c,or)  :- true.
conn(in(1,x6),in(1,g6x)) :- true.
conn(in(1,y6),in(2,g6x)) :- true.
conn(in(1,x6),in(1,g61)) :- true.
conn(in(1,y6),in(2,g61)) :- true.
conn(out(g5c),in(2,g62)) :- true.
conn(out(g5c),in(2,g6z)) :- true.
conn(out(g6x),in(1,g6z)) :- true.
conn(out(g6x),in(1,g62)) :- true.
conn(out(g61),in(2,g6c)) :- true.
conn(out(g62),in(1,g6c)) :- true.
dev(g5x,xor) :- true.
dev(g5z,xor) :- true.
dev(g51,and) :- true.
dev(g52,and) :- true.
dev(g5c,or)  :- true.
conn(in(1,x5),in(1,g5x)) :- true.
conn(in(1,y5),in(2,g5x)) :- true.
conn(in(1,x5),in(1,g51)) :- true.
conn(in(1,y5),in(2,g51)) :- true.
conn(out(g4c),in(2,g52)) :- true.
conn(out(g4c),in(2,g5z)) :- true.
conn(out(g5x),in(1,g5z)) :- true.
conn(out(g5x),in(1,g52)) :- true.
conn(out(g51),in(2,g5c)) :- true.
conn(out(g52),in(1,g5c)) :- true.
dev(g4x,xor) :- true.
dev(g4z,xor) :- true.
dev(g41,and) :- true.
dev(g42,and) :- true.
dev(g4c,or)  :- true.
conn(in(1,x4),in(1,g4x)) :- true.
conn(in(1,y4),in(2,g4x)) :- true.
conn(in(1,x4),in(1,g41)) :- true.
conn(in(1,y4),in(2,g41)) :- true.
conn(out(g3c),in(2,g42)) :- true.
conn(out(g3c),in(2,g4z)) :- true.
conn(out(g4x),in(1,g4z)) :- true.
conn(out(g4x),in(1,g42)) :- true.
conn(out(g41),in(2,g4c)) :- true.
conn(out(g42),in(1,g4c)) :- true.
dev(g3x,xor) :- true.
dev(g3z,xor) :- true.
dev(g31,and) :- true.
dev(g32,and) :- true.
dev(g3c,or)  :- true.
conn(in(1,x3),in(1,g3x)) :- true.
conn(in(1,y3),in(2,g3x)) :- true.
conn(in(1,x3),in(1,g31)) :- true.
conn(in(1,y3),in(2,g31)) :- true.
conn(out(g2c),in(2,g32)) :- true.
conn(out(g2c),in(2,g3z)) :- true.
conn(out(g3x),in(1,g3z)) :- true.
conn(out(g3x),in(1,g32)) :- true.
conn(out(g31),in(2,g3c)) :- true.
conn(out(g32),in(1,g3c)) :- true.
dev(g2x,xor) :- true.
dev(g2z,xor) :- true.
dev(g21,and) :- true.
dev(g22,and) :- true.
dev(g2c,or)  :- true.
conn(in(1,x2),in(1,g2x)) :- true.
conn(in(1,y2),in(2,g2x)) :- true.
conn(in(1,x2),in(1,g21)) :- true.
conn(in(1,y2),in(2,g21)) :- true.
conn(out(g1c),in(2,g22)) :- true.
conn(out(g1c),in(2,g2z)) :- true.
conn(out(g2x),in(1,g2z)) :- true.
conn(out(g2x),in(1,g22)) :- true.
conn(out(g21),in(2,g2c)) :- true.
conn(out(g22),in(1,g2c)) :- true.
dev(g1x,xor) :- true.
dev(g1z,xor) :- true.
dev(g11,and) :- true.
dev(g12,and) :- true.
dev(g1c,or)  :- true.
conn(in(1,x1),in(1,g1x)) :- true.
conn(in(1,y1),in(2,g1x)) :- true.
conn(in(1,x1),in(1,g11)) :- true.
conn(in(1,y1),in(2,g11)) :- true.
conn(out(g0c),in(2,g12)) :- true.
conn(out(g0c),in(2,g1z)) :- true.
conn(out(g1x),in(1,g1z)) :- true.
conn(out(g1x),in(1,g12)) :- true.
conn(out(g11),in(2,g1c)) :- true.
conn(out(g12),in(1,g1c)) :- true.
dev(g0c,or)  :- true.
val(in(1,x20),0) :- true.
val(in(1,y20),1) :- true.
val(in(1,x19),0) :- true.
val(in(1,y19),1) :- true.
val(in(1,x18),0) :- true.
val(in(1,y18),1) :- true.
val(in(1,x17),0) :- true.
val(in(1,y17),1) :- true.
val(in(1,x16),0) :- true.
val(in(1,y16),1) :- true.
val(in(1,x15),0) :- true.
val(in(1,y15),1) :- true.
val(in(1,x14),0) :- true.
val(in(1,y14),1) :- true.
val(in(1,x13),0) :- true.
val(in(1,y13),1) :- true.
val(in(1,x12),0) :- true.
val(in(1,y12),1) :- true.
val(in(1,x11),0) :- true.
val(in(1,y11),1) :- true.
val(in(1,x10),0) :- true.
val(in(1,y10),1) :- true.
val(in(1,x9),0) :- true.
val(in(1,y9),1) :- true.
val(in(1,x8),0) :- true.
val(in(1,y8),1) :- true.
val(in(1,x7),0) :- true.
val(in(1,y7),1) :- true.
val(in(1,x6),0) :- true.
val(in(1,y6),1) :- true.
val(in(1,x5),0) :- true.
val(in(1,y5),1) :- true.
val(in(1,x4),0) :- true.
val(in(1,y4),1) :- true.
val(in(1,x3),0) :- true.
val(in(1,y3),1) :- true.
val(in(1,x2),0) :- true.
val(in(1,y2),1) :- true.
val(in(1,x1),0) :- true.
val(in(1,y1),1) :- true.
val(out(g0c),0) :- true.
facts. 
hypotheses. 
ok(g20x) :- true.   0.500.
ok(g20z) :- true.   0.500.
ok(g201) :- true.   0.500.
ok(g202) :- true.   0.500.
ok(g20c) :- true.   0.500.
stuck_on(g20x) :- true.   0.100.
stuck_on(g20z) :- true.   0.100.
stuck_on(g201) :- true.   0.110.
stuck_on(g202) :- true.   0.110.
stuck_on(g20c) :- true.   0.130.
stuck_off(g20x) :- true.  0.400.
stuck_off(g20z) :- true.  0.400.
stuck_off(g201) :- true.  0.390.
stuck_off(g202) :- true.  0.390.
stuck_off(g20c) :- true.  0.370.
ok(g19x) :- true.   0.500.
ok(g19z) :- true.   0.500.
ok(g191) :- true.   0.500.
ok(g192) :- true.   0.500.
ok(g19c) :- true.   0.500.
stuck_on(g19x) :- true.   0.100.
stuck_on(g19z) :- true.   0.100.
stuck_on(g191) :- true.   0.130.
stuck_on(g192) :- true.   0.130.
stuck_on(g19c) :- true.   0.130.
stuck_off(g19x) :- true.  0.400.
stuck_off(g19z) :- true.  0.400.
stuck_off(g191) :- true.  0.370.
stuck_off(g192) :- true.  0.370.
stuck_off(g19c) :- true.  0.370.
ok(g18x) :- true.   0.500.
ok(g18z) :- true.   0.500.
ok(g181) :- true.   0.500.
ok(g182) :- true.   0.500.
ok(g18c) :- true.   0.500.
stuck_on(g18x) :- true.   0.140.
stuck_on(g18z) :- true.   0.140.
stuck_on(g181) :- true.   0.130.
stuck_on(g182) :- true.   0.130.
stuck_on(g18c) :- true.   0.120.
stuck_off(g18x) :- true.  0.360.
stuck_off(g18z) :- true.  0.360.
stuck_off(g181) :- true.  0.370.
stuck_off(g182) :- true.  0.370.
stuck_off(g18c) :- true.  0.380.
ok(g17x) :- true.   0.500.
ok(g17z) :- true.   0.500.
ok(g171) :- true.   0.500.
ok(g172) :- true.   0.500.
ok(g17c) :- true.   0.500.
stuck_on(g17x) :- true.   0.130.
stuck_on(g17z) :- true.   0.130.
stuck_on(g171) :- true.   0.150.
stuck_on(g172) :- true.   0.150.
stuck_on(g17c) :- true.   0.110.
stuck_off(g17x) :- true.  0.370.
stuck_off(g17z) :- true.  0.370.
stuck_off(g171) :- true.  0.350.
stuck_off(g172) :- true.  0.350.
stuck_off(g17c) :- true.  0.390.
ok(g16x) :- true.   0.500.
ok(g16z) :- true.   0.500.
ok(g161) :- true.   0.500.
ok(g162) :- true.   0.500.
ok(g16c) :- true.   0.500.
stuck_on(g16x) :- true.   0.130.
stuck_on(g16z) :- true.   0.130.
stuck_on(g161) :- true.   0.150.
stuck_on(g162) :- true.   0.150.
stuck_on(g16c) :- true.   0.100.
stuck_off(g16x) :- true.  0.370.
stuck_off(g16z) :- true.  0.370.
stuck_off(g161) :- true.  0.350.
stuck_off(g162) :- true.  0.350.
stuck_off(g16c) :- true.  0.400.
ok(g15x) :- true.   0.500.
ok(g15z) :- true.   0.500.
ok(g151) :- true.   0.500.
ok(g152) :- true.   0.500.
ok(g15c) :- true.   0.500.
stuck_on(g15x) :- true.   0.100.
stuck_on(g15z) :- true.   0.100.
stuck_on(g151) :- true.   0.160.
stuck_on(g152) :- true.   0.160.
stuck_on(g15c) :- true.   0.110.
stuck_off(g15x) :- true.  0.400.
stuck_off(g15z) :- true.  0.400.
stuck_off(g151) :- true.  0.340.
stuck_off(g152) :- true.  0.340.
stuck_off(g15c) :- true.  0.390.
ok(g14x) :- true.   0.500.
ok(g14z) :- true.   0.500.
ok(g141) :- true.   0.500.
ok(g142) :- true.   0.500.
ok(g14c) :- true.   0.500.
stuck_on(g14x) :- true.   0.110.
stuck_on(g14z) :- true.   0.110.
stuck_on(g141) :- true.   0.110.
stuck_on(g142) :- true.   0.110.
stuck_on(g14c) :- true.   0.150.
stuck_off(g14x) :- true.  0.390.
stuck_off(g14z) :- true.  0.390.
stuck_off(g141) :- true.  0.390.
stuck_off(g142) :- true.  0.390.
stuck_off(g14c) :- true.  0.350.
ok(g13x) :- true.   0.500.
ok(g13z) :- true.   0.500.
ok(g131) :- true.   0.500.
ok(g132) :- true.   0.500.
ok(g13c) :- true.   0.500.
stuck_on(g13x) :- true.   0.150.
stuck_on(g13z) :- true.   0.150.
stuck_on(g131) :- true.   0.110.
stuck_on(g132) :- true.   0.110.
stuck_on(g13c) :- true.   0.150.
stuck_off(g13x) :- true.  0.350.
stuck_off(g13z) :- true.  0.350.
stuck_off(g131) :- true.  0.390.
stuck_off(g132) :- true.  0.390.
stuck_off(g13c) :- true.  0.350.
ok(g12x) :- true.   0.500.
ok(g12z) :- true.   0.500.
ok(g121) :- true.   0.500.
ok(g122) :- true.   0.500.
ok(g12c) :- true.   0.500.
stuck_on(g12x) :- true.   0.170.
stuck_on(g12z) :- true.   0.170.
stuck_on(g121) :- true.   0.150.
stuck_on(g122) :- true.   0.150.
stuck_on(g12c) :- true.   0.110.
stuck_off(g12x) :- true.  0.330.
stuck_off(g12z) :- true.  0.330.
stuck_off(g121) :- true.  0.350.
stuck_off(g122) :- true.  0.350.
stuck_off(g12c) :- true.  0.390.
ok(g11x) :- true.   0.500.
ok(g11z) :- true.   0.500.
ok(g111) :- true.   0.500.
ok(g112) :- true.   0.500.
ok(g11c) :- true.   0.500.
stuck_on(g11x) :- true.   0.110.
stuck_on(g11z) :- true.   0.110.
stuck_on(g111) :- true.   0.150.
stuck_on(g112) :- true.   0.150.
stuck_on(g11c) :- true.   0.140.
stuck_off(g11x) :- true.  0.390.
stuck_off(g11z) :- true.  0.390.
stuck_off(g111) :- true.  0.350.
stuck_off(g112) :- true.  0.350.
stuck_off(g11c) :- true.  0.360.
ok(g10x) :- true.   0.500.
ok(g10z) :- true.   0.500.
ok(g101) :- true.   0.500.
ok(g102) :- true.   0.500.
ok(g10c) :- true.   0.500.
stuck_on(g10x) :- true.   0.120.
stuck_on(g10z) :- true.   0.120.
stuck_on(g101) :- true.   0.140.
stuck_on(g102) :- true.   0.140.
stuck_on(g10c) :- true.   0.160.
stuck_off(g10x) :- true.  0.380.
stuck_off(g10z) :- true.  0.380.
stuck_off(g101) :- true.  0.360.
stuck_off(g102) :- true.  0.360.
stuck_off(g10c) :- true.  0.340.
ok(g9x) :- true.   0.500.
ok(g9z) :- true.   0.500.
ok(g91) :- true.   0.500.
ok(g92) :- true.   0.500.
ok(g9c) :- true.   0.500.
stuck_on(g9x) :- true.   0.100.
stuck_on(g9z) :- true.   0.100.
stuck_on(g91) :- true.   0.110.
stuck_on(g92) :- true.   0.110.
stuck_on(g9c) :- true.   0.100.
stuck_off(g9x) :- true.  0.400.
stuck_off(g9z) :- true.  0.400.
stuck_off(g91) :- true.  0.390.
stuck_off(g92) :- true.  0.390.
stuck_off(g9c) :- true.  0.400.
ok(g8x) :- true.   0.500.
ok(g8z) :- true.   0.500.
ok(g81) :- true.   0.500.
ok(g82) :- true.   0.500.
ok(g8c) :- true.   0.500.
stuck_on(g8x) :- true.   0.130.
stuck_on(g8z) :- true.   0.130.
stuck_on(g81) :- true.   0.100.
stuck_on(g82) :- true.   0.100.
stuck_on(g8c) :- true.   0.120.
stuck_off(g8x) :- true.  0.370.
stuck_off(g8z) :- true.  0.370.
stuck_off(g81) :- true.  0.400.
stuck_off(g82) :- true.  0.400.
stuck_off(g8c) :- true.  0.380.
ok(g7x) :- true.   0.500.
ok(g7z) :- true.   0.500.
ok(g71) :- true.   0.500.
ok(g72) :- true.   0.500.
ok(g7c) :- true.   0.500.
stuck_on(g7x) :- true.   0.160.
stuck_on(g7z) :- true.   0.160.
stuck_on(g71) :- true.   0.110.
stuck_on(g72) :- true.   0.110.
stuck_on(g7c) :- true.   0.140.
stuck_off(g7x) :- true.  0.340.
stuck_off(g7z) :- true.  0.340.
stuck_off(g71) :- true.  0.390.
stuck_off(g72) :- true.  0.390.
stuck_off(g7c) :- true.  0.360.
ok(g6x) :- true.   0.500.
ok(g6z) :- true.   0.500.
ok(g61) :- true.   0.500.
ok(g62) :- true.   0.500.
ok(g6c) :- true.   0.500.
stuck_on(g6x) :- true.   0.170.
stuck_on(g6z) :- true.   0.170.
stuck_on(g61) :- true.   0.120.
stuck_on(g62) :- true.   0.120.
stuck_on(g6c) :- true.   0.110.
stuck_off(g6x) :- true.  0.330.
stuck_off(g6z) :- true.  0.330.
stuck_off(g61) :- true.  0.380.
stuck_off(g62) :- true.  0.380.
stuck_off(g6c) :- true.  0.390.
ok(g5x) :- true.   0.500.
ok(g5z) :- true.   0.500.
ok(g51) :- true.   0.500.
ok(g52) :- true.   0.500.
ok(g5c) :- true.   0.500.
stuck_on(g5x) :- true.   0.110.
stuck_on(g5z) :- true.   0.110.
stuck_on(g51) :- true.   0.100.
stuck_on(g52) :- true.   0.100.
stuck_on(g5c) :- true.   0.130.
stuck_off(g5x) :- true.  0.390.
stuck_off(g5z) :- true.  0.390.
stuck_off(g51) :- true.  0.400.
stuck_off(g52) :- true.  0.400.
stuck_off(g5c) :- true.  0.370.
ok(g4x) :- true.   0.500.
ok(g4z) :- true.   0.500.
ok(g41) :- true.   0.500.
ok(g42) :- true.   0.500.
ok(g4c) :- true.   0.500.
stuck_on(g4x) :- true.   0.170.
stuck_on(g4z) :- true.   0.170.
stuck_on(g41) :- true.   0.150.
stuck_on(g42) :- true.   0.150.
stuck_on(g4c) :- true.   0.120.
stuck_off(g4x) :- true.  0.330.
stuck_off(g4z) :- true.  0.330.
stuck_off(g41) :- true.  0.350.
stuck_off(g42) :- true.  0.350.
stuck_off(g4c) :- true.  0.380.
ok(g3x) :- true.   0.500.
ok(g3z) :- true.   0.500.
ok(g31) :- true.   0.500.
ok(g32) :- true.   0.500.
ok(g3c) :- true.   0.500.
stuck_on(g3x) :- true.   0.160.
stuck_on(g3z) :- true.   0.160.
stuck_on(g31) :- true.   0.130.
stuck_on(g32) :- true.   0.130.
stuck_on(g3c) :- true.   0.150.
stuck_off(g3x) :- true.  0.340.
stuck_off(g3z) :- true.  0.340.
stuck_off(g31) :- true.  0.370.
stuck_off(g32) :- true.  0.370.
stuck_off(g3c) :- true.  0.350.
ok(g2x) :- true.   0.500.
ok(g2z) :- true.   0.500.
ok(g21) :- true.   0.500.
ok(g22) :- true.   0.500.
ok(g2c) :- true.   0.500.
stuck_on(g2x) :- true.   0.100.
stuck_on(g2z) :- true.   0.100.
stuck_on(g21) :- true.   0.130.
stuck_on(g22) :- true.   0.130.
stuck_on(g2c) :- true.   0.120.
stuck_off(g2x) :- true.  0.400.
stuck_off(g2z) :- true.  0.400.
stuck_off(g21) :- true.  0.370.
stuck_off(g22) :- true.  0.370.
stuck_off(g2c) :- true.  0.380.
ok(g1x) :- true.   0.500.
ok(g1z) :- true.   0.500.
ok(g11) :- true.   0.500.
ok(g12) :- true.   0.500.
ok(g1c) :- true.   0.500.
stuck_on(g1x) :- true.   0.170.
stuck_on(g1z) :- true.   0.170.
stuck_on(g11) :- true.   0.230.
stuck_on(g12) :- true.   0.230.
stuck_on(g1c) :- true.   0.200.
stuck_off(g1x) :- true.  0.330.
stuck_off(g1z) :- true.  0.330.
stuck_off(g11) :- true.  0.270.
stuck_off(g12) :- true.  0.270.
stuck_off(g1c) :- true.  0.300.
ok(g0c) :- true.   0.500.
stuck_on(g0c) :- true.   0.130.
stuck_off(g0c) :- true.   0.370.
hypotheses. 
consistency_condition. 
false :- ok(D),on(D).
false :- ok(D),off(D).
false :- on(D),off(D).
consistency_condition. 
observations. 
false :- val(out(g20z),1),val(out(g19z),1),val(out(g18z),1),val(out(g17z),1),val(out(g16z),1),val(out(g15z),1),val(out(g14z),1),val(out(g13z),1),val(out(g12z),1),val(out(g11z),1),val(out(g10z),1),val(out(g9z),1),val(out(g8z),1),val(out(g7z),1),val(out(g6z),1),val(out(g5z),1),val(out(g4z),1),val(out(g3z),1),val(out(g2z),1),val(out(g1z),1),val(out(g0c),1).
observations. 
