#Processed by EYE v20.0218.2044 josd
#eye --no-genid http://josd.github.io/brain/pptbank/bankSW.n3 http://josd.github.io/brain/pptbank/checking.n3 --query http://josd.github.io/brain/pptbank/query.n3

@prefix my: <http://josd.github.io/brain/ppt-bank/acct3#>.
@prefix ck: <http://josd.github.io/brain/ppt-bank/checking#>.
@prefix bk: <http://josd.github.io/brain/ppt-bank/banking#>.
@prefix math: <http://www.w3.org/2000/10/swap/math#>.
@prefix log: <http://www.w3.org/2000/10/swap/log#>.
@prefix list: <http://www.w3.org/2000/10/swap/list#>.
@prefix e: <http://eulersharp.sourceforge.net/2003/03swap/log-rules#>.
@prefix r: <http://www.w3.org/2000/10/swap/reason#>.
@prefix var: <http://josd.github.io/var#>.
@prefix n3: <http://www.w3.org/2004/06/rei#>.

[] a r:Proof, r:Conjunction;
  r:component <#lemma1>;
  r:gives {
    my:account ck:balance 2.0 .
  }.

<#lemma1> a r:Inference;
  r:gives {
    my:account ck:balance 2.0 .
  };
  r:evidence (
    <#lemma2>
  );
  r:binding [ r:variable [ n3:uri "http://josd.github.io/var#x_0"]; r:boundTo [ n3:uri "http://josd.github.io/brain/ppt-bank/acct3#account"]];
  r:binding [ r:variable [ n3:uri "http://josd.github.io/var#x_1"]; r:boundTo 2.0];
  r:rule <#lemma3>.

<#lemma2> a r:Inference;
  r:gives {
    my:account ck:balance 2.0 .
  };
  r:evidence (
    <#lemma4>
    [ a r:Fact; r:gives {<http://josd.github.io/brain/pptbank/acct3start.n3> log:semantics {my:account a ck:Account.
     my:account ck:balance 10.0}}]
    [ a r:Fact; r:gives {{my:account a ck:Account.
     my:account ck:balance 10.0} log:includes {my:account ck:balance 10.0}}]
    <#lemma5>
    [ a r:Fact; r:gives {((<http://josd.github.io/brain/pptbank/bankSW.n3> <http://josd.github.io/brain/pptbank/checking.n3>) 1) e:findall (_:sk_0 {(<http://josd.github.io/brain/pptbank/acct3check1.n3> <http://josd.github.io/brain/pptbank/acct3check2.n3>) list:member _:sk_1.
     _:sk_1 log:semantics _:sk_2.
     _:sk_2 log:includes {_:sk_1 a ck:Check.
      _:sk_1 ck:amount _:sk_0.
      _:sk_1 ck:account my:account}} (5.0 3.0))}]
    [ a r:Fact; r:gives {(5.0 3.0) math:sum 8.0}]
    [ a r:Fact; r:gives {(10.0 8.0) math:difference 2.0}]
  );
  r:binding [ r:variable [ n3:uri "http://josd.github.io/var#x_0"]; r:boundTo [ n3:uri "http://josd.github.io/brain/ppt-bank/acct3#account"]];
  r:binding [ r:variable [ n3:uri "http://josd.github.io/var#x_1"]; r:boundTo [ n3:uri "http://josd.github.io/brain/pptbank/acct3start.n3"]];
  r:binding [ r:variable [ n3:uri "http://josd.github.io/var#x_2"]; r:boundTo {my:account a ck:Account.
   my:account ck:balance 10.0}];
  r:binding [ r:variable [ n3:uri "http://josd.github.io/var#x_3"]; r:boundTo 10.0];
  r:binding [ r:variable [ n3:uri "http://josd.github.io/var#x_4"]; r:boundTo (<http://josd.github.io/brain/pptbank/acct3check1.n3> <http://josd.github.io/brain/pptbank/acct3check2.n3>)];
  r:binding [ r:variable [ n3:uri "http://josd.github.io/var#x_5"]; r:boundTo ((<http://josd.github.io/brain/pptbank/bankSW.n3> <http://josd.github.io/brain/pptbank/checking.n3>) 1)];
  r:binding [ r:variable [ n3:uri "http://josd.github.io/var#x_6"]; r:boundTo [ a r:Existential; n3:nodeId "_:sk_0"]];
  r:binding [ r:variable [ n3:uri "http://josd.github.io/var#x_7"]; r:boundTo [ a r:Existential; n3:nodeId "_:sk_1"]];
  r:binding [ r:variable [ n3:uri "http://josd.github.io/var#x_8"]; r:boundTo [ a r:Existential; n3:nodeId "_:sk_2"]];
  r:binding [ r:variable [ n3:uri "http://josd.github.io/var#x_9"]; r:boundTo (5.0 3.0)];
  r:binding [ r:variable [ n3:uri "http://josd.github.io/var#x_10"]; r:boundTo 8.0];
  r:binding [ r:variable [ n3:uri "http://josd.github.io/var#x_11"]; r:boundTo 2.0];
  r:rule <#lemma6>.

<#lemma3> a r:Extraction;
  r:gives {
    @forAll var:x_0, var:x_1. {var:x_0 ck:balance var:x_1} => {var:x_0 ck:balance var:x_1}.
  };
  r:because [ a r:Parsing; r:source <http://josd.github.io/brain/pptbank/query.n3>].

<#lemma4> a r:Extraction;
  r:gives {
    my:account bk:statements (<http://josd.github.io/brain/pptbank/acct3start.n3>).
  };
  r:because [ a r:Parsing; r:source <http://josd.github.io/brain/pptbank/bankSW.n3>].

<#lemma5> a r:Extraction;
  r:gives {
    my:account bk:transactions (<http://josd.github.io/brain/pptbank/acct3check1.n3> <http://josd.github.io/brain/pptbank/acct3check2.n3>).
  };
  r:because [ a r:Parsing; r:source <http://josd.github.io/brain/pptbank/bankSW.n3>].

<#lemma6> 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_8, var:x_9, var:x_10, var:x_11. {var:x_0 bk:statements (var:x_1).
     var:x_1 log:semantics var:x_2.
     var:x_2 log:includes {var:x_0 ck:balance var:x_3}.
     var:x_0 bk:transactions var:x_4.
     var:x_5 e:findall (var:x_6 {var:x_4 list:member var:x_7.
      var:x_7 log:semantics var:x_8.
      var:x_8 log:includes {var:x_7 a ck:Check.
       var:x_7 ck:amount var:x_6.
       var:x_7 ck:account var:x_0}} var:x_9).
     var:x_9 math:sum var:x_10.
     (var:x_3 var:x_10) math:difference var:x_11} => {var:x_0 ck:balance var:x_11}.
  };
  r:because [ a r:Parsing; r:source <http://josd.github.io/brain/pptbank/checking.n3>].

#2020-02-22T21:52:26.742Z in=17 out=1 ent=2 step=4 brake=4 inf=45252 sec=0.109 inf/sec=415156
#ENDS

