% AILog code for the electrical environment for consistency-based diagnosis. % This is the code discussed in Section 5.4.3 of Poole and Mackworth, Artificial % Intelligence: foundations of computational agents, Cambridge, 2010. % Copyright (c) David Poole and Alan Mackworth 2009. This program % is released under GPL, version 3 or later; see http://www.gnu.org/licenses/gpl.html % To run this in AILog, you should put it in the same directory as AILog and then call % load 'elect_cbd.ail'. % load 'ailog_code/ch05/elect_cbd.ail'. light_l1. light_l2. live_outside. live_l1 <- live_w0. live_w0 <- live_w1 & up_s2 & ok_s2. live_w0 <- live_w2 & down_s2 & ok_s2. live_w1 <- live_w3 & up_s1 & ok_s1. live_w2 <- live_w3 & down_s11 & ok_s1. live_l2 <- live_w4. live_w4 <- live_w3 & up_s3 & ok_s3. live_p_1 <- live_w3. live_w3 <- live_w5 & ok_cb1. live_p_2 <- live_w6. live_w6 <- live_w5 & ok_cb2. live_w5 <- live_outside. lit_l1 <- light_l1 & live_l1 & ok_l1. lit_l2 <- light_l2 & live_l2 & ok_l2. false <- dark_l1 & lit_l1. false <- dark_l2 & lit_l2. assumable ok_l1. assumable ok_l2. assumable ok_cb1. assumable ok_cb2. assumable ok_s1. assumable ok_s2. assumable ok_s3. askable up_s1. askable down_s1. askable up_s2. askable down_s2. askable up_s3. askable down_s3. askable dark_l1. askable dark_l2. % To use this, ask the query: % ailog: ask false.