:-was_s_l('/pack/logicmoo_ec/ext/ec_sources/examples/Mueller2006/Chapter9/RunningAndDriving.e',50). % translate: unskipped File: /pack/logicmoo_ec/ext/ec_sources/examples/Mueller2006/Exercises/Counter.e.lps :-include(library('ec_planner/ec_test_incl')). :-expects_dialect(lps). % translate: begining File: /pack/logicmoo_ec/ext/ec_sources/examples/Mueller2006/Exercises/Counter.e.lps % Fri, 09 Oct 2020 15:14:38 GMT File: (0x5625a9752300)%; %; 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{DeneckerDupreBelleghem:1998, %; author = "Marc Denecker and Daniele Theseider Dupr\'{e} and Kristof Van Belleghem", %; year = "1998", %; title = "An inductive definition approach to ramifications", %; journal = "Link{\"{o}}ping Electronic Articles in Computer and Information Science", %; volume = "3", %; number = "007", %; } %; %; @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/Exercises/Counter.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/Exercises/Counter.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/Exercises/Counter.e',32). % sort counter % From E: % % sort(counter). sort(counter). % counter Counter1 :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/examples/Mueller2006/Exercises/Counter.e',32). % From E: % % t(counter,counter1). counter(counter1). :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/examples/Mueller2006/Exercises/Counter.e',35). % event FalseToTrue(counter) % From E: % % event( % falseToTrue(counter)). :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/examples/Mueller2006/Exercises/Counter.e',35). events([falseToTrue/1]). % From E: % % mpred_prop( % falseToTrue(counter), % event). :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/examples/Mueller2006/Exercises/Counter.e',35). mpred_prop(falseToTrue(counter),event). % event TrueToFalse(counter) % From E: % % event( % trueToFalse(counter)). :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/examples/Mueller2006/Exercises/Counter.e',35). events([trueToFalse/1]). % From E: % % mpred_prop( % trueToFalse(counter), % event). :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/examples/Mueller2006/Exercises/Counter.e',35). mpred_prop(trueToFalse(counter),event). :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/examples/Mueller2006/Exercises/Counter.e',38). % fluent Count(counter,integer) % From E: % % fluent( % count(counter,integer)). :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/examples/Mueller2006/Exercises/Counter.e',38). fluents([count/2]). % From E: % % mpred_prop( % count(counter,integer), % fluent). :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/examples/Mueller2006/Exercises/Counter.e',38). mpred_prop(count(counter,integer),fluent). % fluent True(counter) % From E: % % fluent( % true(counter)). :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/examples/Mueller2006/Exercises/Counter.e',38). fluents([true/1]). % From E: % % mpred_prop( % true(counter), % fluent). :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/examples/Mueller2006/Exercises/Counter.e',38). mpred_prop(true(counter),fluent). :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/examples/Mueller2006/Exercises/Counter.e',40). % fluent InputLine(counter) % From E: % % fluent( % inputLine(counter)). :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/examples/Mueller2006/Exercises/Counter.e',40). fluents([inputLine/1]). % From E: % % mpred_prop( % inputLine(counter), % fluent). :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/examples/Mueller2006/Exercises/Counter.e',40). mpred_prop(inputLine(counter),fluent). % noninertial InputLine % From E: % % noninertial(inputLine). :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/examples/Mueller2006/Exercises/Counter.e',40). noninertial(inputLine). :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/examples/Mueller2006/Exercises/Counter.e',43). % Delta: % [counter,time] % !HoldsAt(True(counter),time) & % HoldsAt(InputLine(counter),time) -> % Happens(FalseToTrue(counter),time). :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/examples/Mueller2006/Exercises/Counter.e',43). % From E: % % '->'( % axiom_uses(delta,Time), % '->'( % ','( % holds_at( % not( % true(Counter)), % Time), % holds_at( % inputLine(Counter), % Time)), % falseToTrue(Counter))). if axiom_uses(delta, Time)then falseToTrue(Counter)if not true(Counter)at Time, inputLine(Counter)at Time. % reactive_rule([axiom_uses(delta, Time)], [if(falseToTrue(Counter), (at(not(true(Counter)), Time), at(inputLine(Counter), Time)))]). % "% =================================". % Delta: % [counter,time] % HoldsAt(True(counter),time) & % !HoldsAt(InputLine(counter),time) -> % Happens(TrueToFalse(counter),time). :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/examples/Mueller2006/Exercises/Counter.e',49). % From E: % % '->'( % axiom_uses(delta,Time), % '->'( % ','( % holds_at( % true(Counter), % Time), % holds_at( % not( % inputLine(Counter)), % Time)), % trueToFalse(Counter))). if axiom_uses(delta, Time)then trueToFalse(Counter)if true(Counter)at Time, not inputLine(Counter)at Time. % reactive_rule([axiom_uses(delta, Time)], [if(trueToFalse(Counter), (at(true(Counter), Time), at(not(inputLine(Counter)), Time)))]). % "% =================================". % [counter,time] % Initiates(FalseToTrue(counter),True(counter),time). :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/examples/Mueller2006/Exercises/Counter.e',52). % From E: % % initiates( % falseToTrue(Counter), % true(Counter), % Time). falseToTrue(Counter)initiates true(Counter). :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/examples/Mueller2006/Exercises/Counter.e',52). /* initiated(happens(falseToTrue(Counter), Time_From, Time_Until), true(Counter), []). */ % "% =================================". % [counter,time] % Terminates(TrueToFalse(counter),True(counter),time). :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/examples/Mueller2006/Exercises/Counter.e',54). % From E: % % terminates( % trueToFalse(Counter), % true(Counter), % Time). trueToFalse(Counter)terminates true(Counter). :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/examples/Mueller2006/Exercises/Counter.e',54). /* terminated(happens(trueToFalse(Counter), Time_From, Time_Until), true(Counter), []). */ % "% =================================". % [counter,integer1,integer2,time] % HoldsAt(Count(counter,integer1),time) & % (integer2 = (integer1 + 1)) -> % Initiates(FalseToTrue(counter),Count(counter,integer2),time). :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/examples/Mueller2006/Exercises/Counter.e',58). % From E: % % '->'( % ','( % holds_at( % count(Counter,Integer1), % Time), % '+Pred'(Integer1,1,Integer2)), % initiates( % falseToTrue(Counter), % count(Counter,Integer2), % Time)). falseToTrue(Counter)initiates count(Counter, Integer2)at Time if count(Counter, Integer1)at Time, '+Pred'(Integer1, 1, Integer2). :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/examples/Mueller2006/Exercises/Counter.e',58). /* initiated(happens(falseToTrue(Counter), Time_From, Time_Until), at(count(Counter,Integer2),Time), [ holds(count(Counter,Integer1),Time), '+Pred'(Integer1,1,Integer2) ]). */ % "% =================================". % [counter,integer,time] % HoldsAt(Count(counter,integer),time) -> % Terminates(FalseToTrue(counter),Count(counter,integer),time). :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/examples/Mueller2006/Exercises/Counter.e',63). % From E: % % '->'( % holds_at( % count(Counter,Integer), % Time), % terminates( % falseToTrue(Counter), % count(Counter,Integer), % Time)). falseToTrue(Counter)terminates count(Counter, Integer)at Time if count(Counter, Integer)at Time. /* terminated(happens(falseToTrue(Counter), Time, Time_Until), at(count(Counter,Integer),Time), [holds(count(Counter,Integer),Time)]). */ % "% =================================". % [counter,integer1,integer2,time] % HoldsAt(Count(counter,integer1),time) & % HoldsAt(Count(counter,integer2),time) -> % integer1 = integer2. :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/examples/Mueller2006/Exercises/Counter.e',67). % From E: % % '->'( % ','( % holds_at( % count(Counter,Integer1), % Time), % holds_at( % count(Counter,Integer2), % Time)), % equals(Integer1,Integer2)). if count(Counter, Integer1)at Time, count(Counter, Integer2)at Time then equals(Integer1, Integer2). :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/examples/Mueller2006/Exercises/Counter.e',67). /* reactive_rule([ holds(count(Counter,Integer1),Time), holds(count(Counter,Integer2),Time) ], [equals(Integer1,Integer2)]). */ % "% =================================". % !HoldsAt(True(Counter1),0). :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/examples/Mueller2006/Exercises/Counter.e',70). % From E: % % initially( % neg( % true(counter1))). initially not true(counter1). % initial_state([not(true(counter1))]). % "% =================================". :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/examples/Mueller2006/Exercises/Counter.e',72). % !HoldsAt(InputLine(Counter1),0). % From E: % % initially( % neg( % inputLine(counter1))). initially not inputLine(counter1). % initial_state([not(inputLine(counter1))]). % "% =================================". % HoldsAt(InputLine(Counter1),1). :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/examples/Mueller2006/Exercises/Counter.e',72). % From E: % % holds_at( % inputLine(counter1), % start+1). inputLine(counter1)at start+1. % l_int(holds(inputLine(counter1),start+1),[]). % "% =================================". :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/examples/Mueller2006/Exercises/Counter.e',74). % HoldsAt(InputLine(Counter1),2). % From E: % % holds_at( % inputLine(counter1), % start+2). inputLine(counter1)at start+2. % l_int(holds(inputLine(counter1),start+2),[]). % "% =================================". % HoldsAt(InputLine(Counter1),3). :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/examples/Mueller2006/Exercises/Counter.e',74). % From E: % % holds_at( % inputLine(counter1), % start+3). inputLine(counter1)at start+3. % l_int(holds(inputLine(counter1),start+3),[]). % "% =================================". :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/examples/Mueller2006/Exercises/Counter.e',76). % !HoldsAt(InputLine(Counter1),4). % From E: % % holds_at( % neg( % inputLine(counter1)), % start+4). not inputLine(counter1)at start+4. % l_int(holds(not(inputLine(counter1)),start+4),[]). % "% =================================". % !HoldsAt(InputLine(Counter1),5). :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/examples/Mueller2006/Exercises/Counter.e',76). % From E: % % holds_at( % neg( % inputLine(counter1)), % start+5). not inputLine(counter1)at start+5. % l_int(holds(not(inputLine(counter1)),start+5),[]). % "% =================================". :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/examples/Mueller2006/Exercises/Counter.e',78). % !HoldsAt(InputLine(Counter1),6). % From E: % % holds_at( % neg( % inputLine(counter1)), % start+6). not inputLine(counter1)at start+6. % l_int(holds(not(inputLine(counter1)),start+6),[]). % "% =================================". % HoldsAt(InputLine(Counter1),7). :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/examples/Mueller2006/Exercises/Counter.e',78). % From E: % % holds_at( % inputLine(counter1), % start+7). inputLine(counter1)at start+7. % l_int(holds(inputLine(counter1),start+7),[]). % "% =================================". :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/examples/Mueller2006/Exercises/Counter.e',80). % HoldsAt(InputLine(Counter1),8). % From E: % % holds_at( % inputLine(counter1), % start+8). inputLine(counter1)at start+8. % l_int(holds(inputLine(counter1),start+8),[]). % "% =================================". % HoldsAt(InputLine(Counter1),9). :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/examples/Mueller2006/Exercises/Counter.e',80). % From E: % % holds_at( % inputLine(counter1), % start+9). inputLine(counter1)at start+9. % l_int(holds(inputLine(counter1),start+9),[]). % "% =================================". % HoldsAt(Count(Counter1,0),0). :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/examples/Mueller2006/Exercises/Counter.e',82). % From E: % % initially( % count(counter1,0)). initially count(counter1, 0). % initial_state([count(counter1,0)]). % "% =================================". % completion Happens :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/examples/Mueller2006/Exercises/Counter.e',84). % From E: % % completion(happens). completion(happens). :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/examples/Mueller2006/Exercises/Counter.e',87). % range integer 0 6 % From E: % % range(integer,0,6). range(integer,0,6). % range time 0 10 :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/examples/Mueller2006/Exercises/Counter.e',87). % From E: % % range(time,0,10). range(time,0,10). :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/examples/Mueller2006/Exercises/Counter.e',89). % range offset 1 1 % From E: % % range(offset,1,1). range(offset,1,1). %; End of file. % translate: ending File: /pack/logicmoo_ec/ext/ec_sources/examples/Mueller2006/Exercises/Counter.e.lps