:-was_s_l('/pack/logicmoo_ec/ext/ec_sources/examples/Mueller2006/Chapter6/ThielscherCircuit1.e',85). % translate: unskipped File: /pack/logicmoo_ec/ext/ec_sources/examples/Mueller2006/Chapter6/ThielscherCircuit2.e.lps :-include(library('ec_planner/ec_test_incl')). :-expects_dialect(lps). % translate: begining File: /pack/logicmoo_ec/ext/ec_sources/examples/Mueller2006/Chapter6/ThielscherCircuit2.e.lps % Fri, 09 Oct 2020 15:14:30 GMT File: (0x5625a978e400)%; %; 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 %; %; @article{Thielscher:1997, %; author = "Michael Thielscher", %; year = "1997", %; title = "Ramification and causality", %; journal = "Artificial Intelligence", %; volume = "89", %; pages = "317--364", %; } %; %; @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/Chapter6/ThielscherCircuit2.e',29). % 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/Chapter6/ThielscherCircuit2.e',29). :- 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/Chapter6/ThielscherCircuit2.e',32). % sort switch % From E: % % sort(switch). sort(switch). % sort relay :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/examples/Mueller2006/Chapter6/ThielscherCircuit2.e',32). % From E: % % sort(relay). sort(relay). :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/examples/Mueller2006/Chapter6/ThielscherCircuit2.e',34). % sort light % From E: % % sort(light). sort(light). :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/examples/Mueller2006/Chapter6/ThielscherCircuit2.e',36). % switch S1, S2, S3 % From E: % % t(switch,s1). switch(s1). :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/examples/Mueller2006/Chapter6/ThielscherCircuit2.e',36). % From E: % % t(switch,s2). switch(s2). % From E: % % t(switch,s3). :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/examples/Mueller2006/Chapter6/ThielscherCircuit2.e',36). switch(s3). % relay R % From E: % % t(relay,r). :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/examples/Mueller2006/Chapter6/ThielscherCircuit2.e',36). relay(r). :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/examples/Mueller2006/Chapter6/ThielscherCircuit2.e',38). % light L % From E: % % t(light,l). light(l). % l_events(happens(light(l),Time_From,Time_Until),[]). % "% =================================". :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/examples/Mueller2006/Chapter6/ThielscherCircuit2.e',40). % event Light(light) % From E: % % event( % light(light)). :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/examples/Mueller2006/Chapter6/ThielscherCircuit2.e',40). events([light/1]). % From E: % % mpred_prop( % light(light), % event). :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/examples/Mueller2006/Chapter6/ThielscherCircuit2.e',40). mpred_prop(light(light),event). % event Unlight(light) % From E: % % event( % unlight(light)). :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/examples/Mueller2006/Chapter6/ThielscherCircuit2.e',40). events([unlight/1]). % From E: % % mpred_prop( % unlight(light), % event). :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/examples/Mueller2006/Chapter6/ThielscherCircuit2.e',40). mpred_prop(unlight(light),event). :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/examples/Mueller2006/Chapter6/ThielscherCircuit2.e',42). % event Close(switch) % From E: % % event( % close(switch)). :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/examples/Mueller2006/Chapter6/ThielscherCircuit2.e',42). events([close/1]). % From E: % % mpred_prop( % close(switch), % event). :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/examples/Mueller2006/Chapter6/ThielscherCircuit2.e',42). mpred_prop(close(switch),event). % event Open(switch) % From E: % % event( % open(switch)). :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/examples/Mueller2006/Chapter6/ThielscherCircuit2.e',42). events([open/1]). % From E: % % mpred_prop( % open(switch), % event). :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/examples/Mueller2006/Chapter6/ThielscherCircuit2.e',42). mpred_prop(open(switch),event). :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/examples/Mueller2006/Chapter6/ThielscherCircuit2.e',44). % event Activate(relay) % From E: % % event( % activate(relay)). :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/examples/Mueller2006/Chapter6/ThielscherCircuit2.e',44). events([activate/1]). % From E: % % mpred_prop( % activate(relay), % event). :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/examples/Mueller2006/Chapter6/ThielscherCircuit2.e',44). mpred_prop(activate(relay),event). :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/examples/Mueller2006/Chapter6/ThielscherCircuit2.e',46). % fluent Lit(light) % From E: % % fluent( % lit(light)). :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/examples/Mueller2006/Chapter6/ThielscherCircuit2.e',46). fluents([lit/1]). % From E: % % mpred_prop( % lit(light), % fluent). :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/examples/Mueller2006/Chapter6/ThielscherCircuit2.e',46). mpred_prop(lit(light),fluent). % fluent Closed(switch) % From E: % % fluent( % closed(switch)). :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/examples/Mueller2006/Chapter6/ThielscherCircuit2.e',46). fluents([closed/1]). % From E: % % mpred_prop( % closed(switch), % fluent). :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/examples/Mueller2006/Chapter6/ThielscherCircuit2.e',46). mpred_prop(closed(switch),fluent). :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/examples/Mueller2006/Chapter6/ThielscherCircuit2.e',48). % fluent Activated(relay) % From E: % % fluent( % activated(relay)). :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/examples/Mueller2006/Chapter6/ThielscherCircuit2.e',48). fluents([activated/1]). % From E: % % mpred_prop( % activated(relay), % fluent). :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/examples/Mueller2006/Chapter6/ThielscherCircuit2.e',48). mpred_prop(activated(relay),fluent). :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/examples/Mueller2006/Chapter6/ThielscherCircuit2.e',50). % [time] % !HoldsAt(Lit(L),time) & % HoldsAt(Closed(S1),time) & % HoldsAt(Closed(S2),time) -> % Happens(Light(L),time). :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/examples/Mueller2006/Chapter6/ThielscherCircuit2.e',50). % From E: % % '->'( % ','( % holds_at( % not( % lit(l)), % Time), % ','( % holds_at( % closed(s1), % Time), % holds_at( % closed(s2), % Time))), % light(l)). light(l)if not lit(l)at Time, closed(s1)at Time, closed(s2)at Time. :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/examples/Mueller2006/Chapter6/ThielscherCircuit2.e',50). /* l_events(happens(light(l),Time,Time), [ holds(not(lit(l)),Time), holds(closed(s1),Time), holds(closed(s2),Time) ]). */ % "% =================================". % [time] % HoldsAt(Lit(L),time) & % (!HoldsAt(Closed(S1),time) | !HoldsAt(Closed(S2),time)) -> % Happens(Unlight(L),time). :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/examples/Mueller2006/Chapter6/ThielscherCircuit2.e',57). % From E: % % '->'( % ','( % holds_at( % lit(l), % Time), % ';'( % holds_at( % not( % closed(s1)), % Time), % holds_at( % not( % closed(s2)), % Time))), % unlight(l)). unlight(l)if lit(l)at Time, (not closed(s1)at Time;not closed(s2)at Time). :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/examples/Mueller2006/Chapter6/ThielscherCircuit2.e',57). /* l_events(happens(unlight(l), Time, Time_Until), [ holds(lit(l), Time), (at(not(closed(s1)), Time);at(not(closed(s2)), Time)) ]). */ % "% =================================". % [time] % HoldsAt(Closed(S2),time) & % HoldsAt(Activated(R),time) -> % Happens(Open(S2),time). :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/examples/Mueller2006/Chapter6/ThielscherCircuit2.e',62). % From E: % % '->'( % ','( % holds_at( % closed(s2), % Time), % holds_at( % activated(r), % Time)), % open(s2)). open(s2)if closed(s2)at Time, activated(r)at Time. :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/examples/Mueller2006/Chapter6/ThielscherCircuit2.e',62). /* l_events(happens(open(s2),Time,Time), [holds(closed(s2),Time),holds(activated(r),Time)]). */ % "% =================================". % [time] % !HoldsAt(Activated(R),time) & % HoldsAt(Closed(S1),time) & % HoldsAt(Closed(S3),time) -> % Happens(Activate(R),time). :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/examples/Mueller2006/Chapter6/ThielscherCircuit2.e',67). % From E: % % '->'( % ','( % holds_at( % not( % activated(r)), % Time), % ','( % holds_at( % closed(s1), % Time), % holds_at( % closed(s3), % Time))), % activate(r)). activate(r)if not activated(r)at Time, closed(s1)at Time, closed(s3)at Time. :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/examples/Mueller2006/Chapter6/ThielscherCircuit2.e',67). /* l_events(happens(activate(r),Time,Time), [ holds(not(activated(r)),Time), holds(closed(s1),Time), holds(closed(s3),Time) ]). */ % "% =================================". % [switch,time] % Initiates(Close(switch),Closed(switch),time). :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/examples/Mueller2006/Chapter6/ThielscherCircuit2.e',71). % From E: % % initiates( % close(Switch), % closed(Switch), % Time). close(Switch)initiates closed(Switch). :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/examples/Mueller2006/Chapter6/ThielscherCircuit2.e',71). /* initiated(happens(close(Switch),Time_From,Time_Until), closed(Switch), []). */ % "% =================================". :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/examples/Mueller2006/Chapter6/ThielscherCircuit2.e',73). % [switch,time] % Terminates(Open(switch),Closed(switch),time). % From E: % % terminates( % open(Switch), % closed(Switch), % Time). open(Switch)terminates closed(Switch). :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/examples/Mueller2006/Chapter6/ThielscherCircuit2.e',73). /* terminated(happens(open(Switch),Time_From,Time_Until), closed(Switch), []). */ % "% =================================". % [relay,time] % Initiates(Activate(relay),Activated(relay),time). :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/examples/Mueller2006/Chapter6/ThielscherCircuit2.e',73). % From E: % % initiates( % activate(Relay), % activated(Relay), % Time). activate(Relay)initiates activated(Relay). :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/examples/Mueller2006/Chapter6/ThielscherCircuit2.e',73). /* initiated(happens(activate(Relay), Time_From, Time_Until), activated(Relay), []). */ % "% =================================". :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/examples/Mueller2006/Chapter6/ThielscherCircuit2.e',75). % [light,time] % Initiates(Light(light),Lit(light),time). % From E: % % initiates( % light(Light), % lit(Light), % Time). light(Light)initiates lit(Light). :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/examples/Mueller2006/Chapter6/ThielscherCircuit2.e',75). /* initiated(happens(light(Light),Time_From,Time_Until), lit(Light), []). */ % "% =================================". % [light,time] % Terminates(Unlight(light),Lit(light),time). :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/examples/Mueller2006/Chapter6/ThielscherCircuit2.e',75). % From E: % % terminates( % unlight(Light), % lit(Light), % Time). unlight(Light)terminates lit(Light). :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/examples/Mueller2006/Chapter6/ThielscherCircuit2.e',75). /* terminated(happens(unlight(Light), Time_From, Time_Until), lit(Light), []). */ % "% =================================". % !HoldsAt(Closed(S1),0). :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/examples/Mueller2006/Chapter6/ThielscherCircuit2.e',77). % From E: % % initially( % neg( % closed(s1))). initially not closed(s1). % initial_state([not(closed(s1))]). % "% =================================". :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/examples/Mueller2006/Chapter6/ThielscherCircuit2.e',79). % HoldsAt(Closed(S2),0). % From E: % % initially( % closed(s2)). initially closed(s2). % initial_state([closed(s2)]). % "% =================================". % HoldsAt(Closed(S3),0). :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/examples/Mueller2006/Chapter6/ThielscherCircuit2.e',79). % From E: % % initially( % closed(s3)). initially closed(s3). % initial_state([closed(s3)]). % "% =================================". :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/examples/Mueller2006/Chapter6/ThielscherCircuit2.e',81). % !HoldsAt(Activated(R),0). % From E: % % initially( % neg( % activated(r))). initially not activated(r). % initial_state([not(activated(r))]). % "% =================================". % !HoldsAt(Lit(L),0). :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/examples/Mueller2006/Chapter6/ThielscherCircuit2.e',81). % From E: % % initially( % neg( % lit(l))). initially not lit(l). % initial_state([not(lit(l))]). % "% =================================". % Happens(Close(S1),0). :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/examples/Mueller2006/Chapter6/ThielscherCircuit2.e',83). % From E: % % happens( % close(s1), % t+0). observe close(s1)at t+0. % observe([close(s1)],t+0). % "% =================================". % completion Happens :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/examples/Mueller2006/Chapter6/ThielscherCircuit2.e',85). % From E: % % completion(happens). completion(happens). :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/examples/Mueller2006/Chapter6/ThielscherCircuit2.e',88). % range time 0 4 % From E: % % range(time,0,4). range(time,0,4). % range offset 1 1 :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/examples/Mueller2006/Chapter6/ThielscherCircuit2.e',88). % From E: % % range(offset,1,1). range(offset,1,1). %; End of file. % translate: ending File: /pack/logicmoo_ec/ext/ec_sources/examples/Mueller2006/Chapter6/ThielscherCircuit2.e.lps