:-was_s_l('/pack/logicmoo_ec/ext/ec_sources/examples/Mueller2006/Chapter12/Device.e',72). % translate: unskipped File: /pack/logicmoo_ec/ext/ec_sources/examples/Mueller2006/Chapter12/ErraticDevice.e.lps :-include(library('ec_planner/ec_test_incl')). :-expects_dialect(lps). % translate: begining File: /pack/logicmoo_ec/ext/ec_sources/examples/Mueller2006/Chapter12/ErraticDevice.e.lps % Fri, 09 Oct 2020 15:13:57 GMT File: (0x5625a973c100)%; %; Copyright (c) 2005 IBM Corporation and others. %; All rights reserved. This program and the accompanying materials %; are made available under the terms of the Common Public License v1.0 %; which accompanies this distribution, and is available at %; http://www.eclipse.org/legal/cpl-v10.html %; %; Contributors: %; IBM - Initial implementation %; %; @book{Mueller:2006, %; author = "Erik T. Mueller", %; year = "2006", %; title = "Commonsense Reasoning", %; address = "San Francisco", %; publisher = "Morgan Kaufmann/Elsevier", %; } %; :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/examples/Mueller2006/Chapter12/ErraticDevice.e',20). % load foundations/Root.e :- if(is_e_toplevel). :- load_e_cond('foundations/Root.e', changed). % load('/pack/logicmoo_ec/ext/ec_sources/foundations/Root.e',changed). :- endif. % load foundations/EC.e :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/examples/Mueller2006/Chapter12/ErraticDevice.e',20). :- if(is_e_toplevel). :- load_e_cond('foundations/EC.e', changed). % load('/pack/logicmoo_ec/ext/ec_sources/foundations/EC.e',changed). :- endif. :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/examples/Mueller2006/Chapter12/ErraticDevice.e',23). % sort agent % From E: % % sort(agent). sort(agent). % sort device :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/examples/Mueller2006/Chapter12/ErraticDevice.e',23). % From E: % % sort(device). sort(device). :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/examples/Mueller2006/Chapter12/ErraticDevice.e',26). % agent Nathan % From E: % % t(agent,nathan). agent(nathan). % device Device1 :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/examples/Mueller2006/Chapter12/ErraticDevice.e',26). % From E: % % t(device,device1). device(device1). :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/examples/Mueller2006/Chapter12/ErraticDevice.e',29). % predicate Ab1(device,time) % From E: % % predicate( % ab1(device,time)). :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/examples/Mueller2006/Chapter12/ErraticDevice.e',29). predicates([ab1/2]). % From E: % % mpred_prop( % ab1(device,time), % predicate). :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/examples/Mueller2006/Chapter12/ErraticDevice.e',29). mpred_prop(ab1(device,time),predicate). :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/examples/Mueller2006/Chapter12/ErraticDevice.e',31). % fluent On(device) % From E: % % fluent( % on(device)). :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/examples/Mueller2006/Chapter12/ErraticDevice.e',31). fluents([on/1]). % From E: % % mpred_prop( % on(device), % fluent). :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/examples/Mueller2006/Chapter12/ErraticDevice.e',31). mpred_prop(on(device),fluent). % fluent PluggedIn(device) % From E: % % fluent( % pluggedIn(device)). :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/examples/Mueller2006/Chapter12/ErraticDevice.e',31). fluents([pluggedIn/1]). % From E: % % mpred_prop( % pluggedIn(device), % fluent). :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/examples/Mueller2006/Chapter12/ErraticDevice.e',31). mpred_prop(pluggedIn(device),fluent). :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/examples/Mueller2006/Chapter12/ErraticDevice.e',33). % fluent BrokenSwitch(device) % From E: % % fluent( % brokenSwitch(device)). :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/examples/Mueller2006/Chapter12/ErraticDevice.e',33). fluents([brokenSwitch/1]). % From E: % % mpred_prop( % brokenSwitch(device), % fluent). :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/examples/Mueller2006/Chapter12/ErraticDevice.e',33). mpred_prop(brokenSwitch(device),fluent). % fluent Erratic(device) % From E: % % fluent( % erratic(device)). :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/examples/Mueller2006/Chapter12/ErraticDevice.e',33). fluents([erratic/1]). % From E: % % mpred_prop( % erratic(device), % fluent). :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/examples/Mueller2006/Chapter12/ErraticDevice.e',33). mpred_prop(erratic(device),fluent). :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/examples/Mueller2006/Chapter12/ErraticDevice.e',36). % fluent DeterminingFluent(device) % From E: % % fluent( % determiningFluent(device)). :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/examples/Mueller2006/Chapter12/ErraticDevice.e',36). fluents([determiningFluent/1]). % From E: % % mpred_prop( % determiningFluent(device), % fluent). :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/examples/Mueller2006/Chapter12/ErraticDevice.e',36). mpred_prop(determiningFluent(device),fluent). % noninertial DeterminingFluent % From E: % % noninertial(determiningFluent). :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/examples/Mueller2006/Chapter12/ErraticDevice.e',36). noninertial(determiningFluent). :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/examples/Mueller2006/Chapter12/ErraticDevice.e',39). % event TurnOn(agent,device) % From E: % % event( % turnOn(agent,device)). :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/examples/Mueller2006/Chapter12/ErraticDevice.e',39). events([turnOn/2]). % From E: % % mpred_prop( % turnOn(agent,device), % event). :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/examples/Mueller2006/Chapter12/ErraticDevice.e',39). mpred_prop(turnOn(agent,device),event). :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/examples/Mueller2006/Chapter12/ErraticDevice.e',41). %; Sigma % [agent,device,time] % !Ab1(device,time) -> % Initiates(TurnOn(agent,device),On(device),time). :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/examples/Mueller2006/Chapter12/ErraticDevice.e',43). % From E: % % '->'( % not( % ab1(Device,Time)), % initiates( % turnOn(Agent,Device), % on(Device), % Time)). turnOn(Agent, Device)initiates on(Device)at Time if not ab1(Device, Time). :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/examples/Mueller2006/Chapter12/ErraticDevice.e',43). /* initiated(happens(turnOn(Agent,Device), Time_From, Time_Until), at(on(Device),Time), [not(ab1(Device,Time))]). */ % "% =================================". %; Delta :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/examples/Mueller2006/Chapter12/ErraticDevice.e',49). % Happens(TurnOn(Nathan,Device1),0). % From E: % % happens( % turnOn(nathan,device1), % t+0). observe turnOn(nathan, device1)at t+0. % observe([turnOn(nathan,device1)],t+0). % "% =================================". :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/examples/Mueller2006/Chapter12/ErraticDevice.e',51). %; Theta % Theta: % [device,time] % HoldsAt(BrokenSwitch(device),time) -> Ab1(device,time). :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/examples/Mueller2006/Chapter12/ErraticDevice.e',53). % From E: % % '->'( % axiom_uses(theta,Time), % '->'( % holds_at( % brokenSwitch(Device), % Time), % ab1(Device,Time))). if axiom_uses(theta, Time)then ab1(Device, Time)if brokenSwitch(Device)at Time. :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/examples/Mueller2006/Chapter12/ErraticDevice.e',53). /* reactive_rule([axiom_uses(theta,Time)], [ if(ab1(Device,Time), at(brokenSwitch(Device),Time)) ]). */ % "% =================================". :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/examples/Mueller2006/Chapter12/ErraticDevice.e',55). % Theta: % [device,time] % HoldsAt(Erratic(device),time) & HoldsAt(DeterminingFluent(device),time) -> % Ab1(device,time). :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/examples/Mueller2006/Chapter12/ErraticDevice.e',55). % From E: % % '->'( % axiom_uses(theta,Time), % '->'( % ','( % holds_at( % erratic(Device), % Time), % holds_at( % determiningFluent(Device), % Time)), % ab1(Device,Time))). if axiom_uses(theta, Time)then ab1(Device, Time)if erratic(Device)at Time, determiningFluent(Device)at Time. % reactive_rule([axiom_uses(theta, Time)], [if(ab1(Device, Time), (at(erratic(Device), Time), at(determiningFluent(Device), Time)))]). % "% =================================". % Theta: % [device,time] % !HoldsAt(PluggedIn(device),time) -> Ab1(device,time). :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/examples/Mueller2006/Chapter12/ErraticDevice.e',58). % From E: % % '->'( % axiom_uses(theta,Time), % '->'( % holds_at( % not( % pluggedIn(Device)), % Time), % ab1(Device,Time))). if axiom_uses(theta, Time)then ab1(Device, Time)if not pluggedIn(Device)at Time. :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/examples/Mueller2006/Chapter12/ErraticDevice.e',58). /* reactive_rule([axiom_uses(theta,Time)], [ if(ab1(Device,Time), at(not(pluggedIn(Device)),Time)) ]). */ % "% =================================". %; Gamma :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/examples/Mueller2006/Chapter12/ErraticDevice.e',63). % !HoldsAt(On(Device1),0). % From E: % % initially( % neg( % on(device1))). initially not on(device1). % initial_state([not(on(device1))]). % "% =================================". % !HoldsAt(BrokenSwitch(Device1),0). :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/examples/Mueller2006/Chapter12/ErraticDevice.e',63). % From E: % % initially( % neg( % brokenSwitch(device1))). initially not brokenSwitch(device1). % initial_state([not(brokenSwitch(device1))]). % "% =================================". :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/examples/Mueller2006/Chapter12/ErraticDevice.e',65). % HoldsAt(Erratic(Device1),0). % From E: % % initially( % erratic(device1)). initially erratic(device1). % initial_state([erratic(device1)]). % "% =================================". % HoldsAt(PluggedIn(Device1),0). :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/examples/Mueller2006/Chapter12/ErraticDevice.e',65). % From E: % % initially( % pluggedIn(device1)). initially pluggedIn(device1). % initial_state([pluggedIn(device1)]). % "% =================================". %; added: :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/examples/Mueller2006/Chapter12/ErraticDevice.e',69). % HoldsAt(DeterminingFluent(Device1),1). % From E: % % holds_at( % determiningFluent(device1), % start+1). determiningFluent(device1)at start+1. % l_int(holds(determiningFluent(device1),start+1),[]). % "% =================================". :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/examples/Mueller2006/Chapter12/ErraticDevice.e',71). % completion Theta Ab1 % From E: % % completion(theta). completion(theta). :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/examples/Mueller2006/Chapter12/ErraticDevice.e',71). % From E: % % completion(ab1). completion(ab1). % completion Happens :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/examples/Mueller2006/Chapter12/ErraticDevice.e',71). % From E: % % completion(happens). completion(happens). :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/examples/Mueller2006/Chapter12/ErraticDevice.e',74). % range time 0 1 % From E: % % range(time,0,1). range(time,0,1). % range offset 1 1 :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/examples/Mueller2006/Chapter12/ErraticDevice.e',74). % From E: % % range(offset,1,1). range(offset,1,1). %; End of file. % translate: ending File: /pack/logicmoo_ec/ext/ec_sources/examples/Mueller2006/Chapter12/ErraticDevice.e.lps