@prefix math: <http://www.w3.org/2000/10/swap/math#>.
@prefix log: <http://www.w3.org/2000/10/swap/log#>.
@prefix e: <http://eulersharp.sourceforge.net/2003/03swap/log-rules#>.
@prefix fl: <http://eulersharp.sourceforge.net/2003/03swap/fl-rules#>.
@prefix : <http://eulersharp.sourceforge.net/2006/02swap/med#>.
@prefix r: <http://www.w3.org/2000/10/swap/reason#>.
@prefix var: <http://josd.github.io/var#>.
@prefix skolem: <http://josd.github.io/.well-known/genid/3917894951695475063#>.
@prefix n3: <http://www.w3.org/2004/06/rei#>.

skolem:proof a r:Proof, r:Conjunction;
  r:component skolem:lemma1;
  r:component skolem:lemma2;
  r:gives {
    :Joe :isPrescribed :aspirinLowDose.
    :Joe :isPrescribed :betaBlocker.
  }.

skolem:lemma1 a r:Inference;
  r:gives {
    :Joe :isPrescribed :aspirinLowDose.
  };
  r:evidence (
    skolem:lemma3
  );
  r:binding [ r:variable [ n3:uri "http://josd.github.io/var#x_0"]; r:boundTo [ n3:uri "http://eulersharp.sourceforge.net/2006/02swap/med#Joe"]];
  r:binding [ r:variable [ n3:uri "http://josd.github.io/var#x_1"]; r:boundTo [ n3:uri "http://eulersharp.sourceforge.net/2006/02swap/med#aspirinLowDose"]];
  r:rule skolem:lemma4.

skolem:lemma2 a r:Inference;
  r:gives {
    :Joe :isPrescribed :betaBlocker.
  };
  r:evidence (
    skolem:lemma5
  );
  r:binding [ r:variable [ n3:uri "http://josd.github.io/var#x_0"]; r:boundTo [ n3:uri "http://eulersharp.sourceforge.net/2006/02swap/med#Joe"]];
  r:binding [ r:variable [ n3:uri "http://josd.github.io/var#x_1"]; r:boundTo [ n3:uri "http://eulersharp.sourceforge.net/2006/02swap/med#betaBlocker"]];
  r:rule skolem:lemma4.

skolem:lemma3 a r:Inference;
  r:gives {
    :Joe :isPrescribed :aspirinLowDose.
  };
  r:evidence (
    skolem:lemma6
    skolem:lemma7
    [ a r:Fact; r:gives {0.9 math:greaterThan 0.7}]
    [ a r:Fact; r:gives {((<http://josd.github.io/eye/reasoning/medic/medic.n3>) 1) e:findall (_:sk_0 {:aspirinLowDose :excludedFor _:sk_0} (:ActivePepticUlcerDisease :AllergyForAspirin))}]
    [ a r:Fact; r:gives {((<http://josd.github.io/eye/reasoning/medic/medic.n3>) 1) e:findall (_:sk_0 {:aspirinLowDose :excludedFor _:sk_0.
     (:Joe _:sk_0) fl:mu _:sk_1.
     _:sk_1 math:notGreaterThan 0.01} (:ActivePepticUlcerDisease :AllergyForAspirin))}]
  );
  r:binding [ r:variable [ n3:uri "http://josd.github.io/var#x_0"]; r:boundTo [ n3:uri "http://eulersharp.sourceforge.net/2006/02swap/med#aspirinLowDose"]];
  r:binding [ r:variable [ n3:uri "http://josd.github.io/var#x_1"]; r:boundTo [ n3:uri "http://eulersharp.sourceforge.net/2006/02swap/med#AcuteMyocardialInfarction"]];
  r:binding [ r:variable [ n3:uri "http://josd.github.io/var#x_3"]; r:boundTo 0.9];
  r:binding [ r:variable [ n3:uri "http://josd.github.io/var#x_2"]; r:boundTo [ n3:uri "http://eulersharp.sourceforge.net/2006/02swap/med#Joe"]];
  r:binding [ r:variable [ n3:uri "http://josd.github.io/var#x_4"]; r:boundTo ((<http://josd.github.io/eye/reasoning/medic/medic.n3>) 1)];
  r:binding [ r:variable [ n3:uri "http://josd.github.io/var#x_5"]; r:boundTo [ a r:Existential; n3:nodeId "_:sk_0"]];
  r:binding [ r:variable [ n3:uri "http://josd.github.io/var#x_6"]; r:boundTo (:ActivePepticUlcerDisease :AllergyForAspirin)];
  r:binding [ r:variable [ n3:uri "http://josd.github.io/var#x_7"]; r:boundTo [ a r:Existential; n3:nodeId "_:sk_1"]];
  r:rule skolem:lemma8.

skolem:lemma4 a r:Extraction;
  r:gives {
    @forAll var:x_0, var:x_1. {var:x_0 :isPrescribed var:x_1} => {var:x_0 :isPrescribed var:x_1}.
  };
  r:because [ a r:Parsing; r:source <http://josd.github.io/eye/reasoning/medic/medicF.n3>].

skolem:lemma5 a r:Inference;
  r:gives {
    :Joe :isPrescribed :betaBlocker.
  };
  r:evidence (
    skolem:lemma9
    skolem:lemma7
    [ a r:Fact; r:gives {0.9 math:greaterThan 0.7}]
    [ a r:Fact; r:gives {((<http://josd.github.io/eye/reasoning/medic/medic.n3>) 1) e:findall (_:sk_2 {:betaBlocker :excludedFor _:sk_2} (:SevereAsthma :ChronicObstructivePumonaryDisease))}]
    [ a r:Fact; r:gives {((<http://josd.github.io/eye/reasoning/medic/medic.n3>) 1) e:findall (_:sk_2 {:betaBlocker :excludedFor _:sk_2.
     (:Joe _:sk_2) fl:mu _:sk_3.
     _:sk_3 math:notGreaterThan 0.01} (:SevereAsthma :ChronicObstructivePumonaryDisease))}]
  );
  r:binding [ r:variable [ n3:uri "http://josd.github.io/var#x_0"]; r:boundTo [ n3:uri "http://eulersharp.sourceforge.net/2006/02swap/med#betaBlocker"]];
  r:binding [ r:variable [ n3:uri "http://josd.github.io/var#x_1"]; r:boundTo [ n3:uri "http://eulersharp.sourceforge.net/2006/02swap/med#AcuteMyocardialInfarction"]];
  r:binding [ r:variable [ n3:uri "http://josd.github.io/var#x_3"]; r:boundTo 0.9];
  r:binding [ r:variable [ n3:uri "http://josd.github.io/var#x_2"]; r:boundTo [ n3:uri "http://eulersharp.sourceforge.net/2006/02swap/med#Joe"]];
  r:binding [ r:variable [ n3:uri "http://josd.github.io/var#x_4"]; r:boundTo ((<http://josd.github.io/eye/reasoning/medic/medic.n3>) 1)];
  r:binding [ r:variable [ n3:uri "http://josd.github.io/var#x_5"]; r:boundTo [ a r:Existential; n3:nodeId "_:sk_2"]];
  r:binding [ r:variable [ n3:uri "http://josd.github.io/var#x_6"]; r:boundTo (:SevereAsthma :ChronicObstructivePumonaryDisease)];
  r:binding [ r:variable [ n3:uri "http://josd.github.io/var#x_7"]; r:boundTo [ a r:Existential; n3:nodeId "_:sk_3"]];
  r:rule skolem:lemma8.

skolem:lemma6 a r:Extraction;
  r:gives {
    :aspirinLowDose :prescribedFor :AcuteMyocardialInfarction.
  };
  r:because [ a r:Parsing; r:source <http://josd.github.io/eye/reasoning/medic/medic.n3>].

skolem:lemma7 a r:Extraction;
  r:gives {
    (:Joe :AcuteMyocardialInfarction) fl:mu 0.9 .
  };
  r:because [ a r:Parsing; r:source <http://josd.github.io/eye/reasoning/medic/medic.n3>].

skolem:lemma8 a r:Extraction;
  r:gives {
    @forAll var:x_0, var:x_1, var:x_2, var:x_3, var:x_4, var:x_5, var:x_6, var:x_7. {var:x_0 :prescribedFor var:x_1.
     (var:x_2 var:x_1) fl:mu var:x_3.
     var:x_3 math:greaterThan 0.7 .
     var:x_4 e:findall (var:x_5 {var:x_0 :excludedFor var:x_5} var:x_6).
     var:x_4 e:findall (var:x_5 {var:x_0 :excludedFor var:x_5.
      (var:x_2 var:x_5) fl:mu var:x_7.
      var:x_7 math:notGreaterThan 0.01} var:x_6)} => {var:x_2 :isPrescribed var:x_0}.
  };
  r:because [ a r:Parsing; r:source <http://josd.github.io/eye/reasoning/medic/medic.n3>].

skolem:lemma9 a r:Extraction;
  r:gives {
    :betaBlocker :prescribedFor :AcuteMyocardialInfarction.
  };
  r:because [ a r:Parsing; r:source <http://josd.github.io/eye/reasoning/medic/medic.n3>].

