# <http://josd.github.io/eye/reasoning#person5> thinking for 0.025 seconds
# <http://josd.github.io/eye/reasoning#person1> thinking for 0.1 seconds
# <http://josd.github.io/eye/reasoning#person5> eating for 0.1 seconds
# <http://josd.github.io/eye/reasoning#person2> thinking for 0.2 seconds
# <http://josd.github.io/eye/reasoning#person1> eating for 0.1 seconds
# <http://josd.github.io/eye/reasoning#person4> thinking for 0.25 seconds
# <http://josd.github.io/eye/reasoning#person3> thinking for 0.3 seconds
# <http://josd.github.io/eye/reasoning#person2> eating for 0.2 seconds
# <http://josd.github.io/eye/reasoning#person4> eating for 0.2 seconds
# <http://josd.github.io/eye/reasoning#person3> eating for 0.3 seconds
PREFIX e: <http://eulersharp.sourceforge.net/2003/03swap/log-rules#>
PREFIX : <http://josd.github.io/eye/reasoning#>
PREFIX r: <http://www.w3.org/2000/10/swap/reason#>

[] a r:Proof, r:Conjunction;
  r:component <#lemma1>;
  r:gives {
    :all :got :dinner.
  }.

<#lemma1> a r:Inference;
  r:gives {
    :all :got :dinner.
  };
  r:evidence (
    <#lemma2>
  );
  r:rule <#lemma3>.

<#lemma2> a r:Inference;
  r:gives {
    :all :got :dinner.
  };
  r:evidence (
    [ a r:Fact; r:gives {("thread_create" {:person1 :run (0.1 0.1)} _:t_0 ()) e:derive true}]
    [ a r:Fact; r:gives {("thread_create" {:person2 :run (0.2 0.2)} _:t_1 ()) e:derive true}]
    [ a r:Fact; r:gives {("thread_create" {:person3 :run (0.3 0.3)} _:t_2 ()) e:derive true}]
    [ a r:Fact; r:gives {("thread_create" {:person4 :run (0.25 0.2)} _:t_3 ()) e:derive true}]
    [ a r:Fact; r:gives {("thread_create" {:person5 :run (0.025 0.1)} _:t_4 ()) e:derive true}]
    [ a r:Fact; r:gives {("thread_join" _:t_0 true) e:derive true}]
    [ a r:Fact; r:gives {("thread_join" _:t_1 true) e:derive true}]
    [ a r:Fact; r:gives {("thread_join" _:t_2 true) e:derive true}]
    [ a r:Fact; r:gives {("thread_join" _:t_3 true) e:derive true}]
    [ a r:Fact; r:gives {("thread_join" _:t_4 true) e:derive true}]
  );
  r:rule <#lemma4>.

<#lemma3> a r:Extraction;
  r:gives {
    {:all :got :dinner} => {:all :got :dinner}.
  };
  r:because [ a r:Parsing; r:source <http://josd.github.io/eye/reasoning/dp/dpQ.n3>].

<#lemma4> a r:Extraction;
  r:gives {
    {("thread_create" {:person1 :run (0.1 0.1)} ?x_0_2 ()) e:derive true.
     ("thread_create" {:person2 :run (0.2 0.2)} ?x_1_2 ()) e:derive true.
     ("thread_create" {:person3 :run (0.3 0.3)} ?x_2_2 ()) e:derive true.
     ("thread_create" {:person4 :run (0.25 0.2)} ?x_3_2 ()) e:derive true.
     ("thread_create" {:person5 :run (0.025 0.1)} ?x_4_2 ()) e:derive true.
     ("thread_join" ?x_0_2 ?x_5_2) e:derive true.
     ("thread_join" ?x_1_2 ?x_6_2) e:derive true.
     ("thread_join" ?x_2_2 ?x_7_2) e:derive true.
     ("thread_join" ?x_3_2 ?x_8_2) e:derive true.
     ("thread_join" ?x_4_2 ?x_9_2) e:derive true} => {:all :got :dinner}.
  };
  r:because [ a r:Parsing; r:source <http://josd.github.io/eye/reasoning/dp/dp.n3>].

