#Processed by EYE v20.1020.2137 josd
#eye --no-genid --wcache http://josd.github.io/eye/reasoning/seq . http://josd.github.io/eye/reasoning/seq/seq_components.n3 --query http://josd.github.io/eye/reasoning/seq/seq_query.n3

@prefix math: <http://www.w3.org/2000/10/swap/math#>.
@prefix list: <http://www.w3.org/2000/10/swap/list#>.
@prefix func: <http://www.w3.org/2007/rif-builtin-function#>.
@prefix e: <http://eulersharp.sourceforge.net/2003/03swap/log-rules#>.
@prefix seq: <http://josd.github.io/eye/reasoning/seq#>.
@prefix string: <http://www.w3.org/2000/10/swap/string#>.
@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 {
    (1 2 3 4 6 9 10 11 13) seq:answer "1-4, 6, 9-11, 13".
  }.

<#lemma1> a r:Inference;
  r:gives {
    (1 2 3 4 6 9 10 11 13) seq:answer "1-4, 6, 9-11, 13".
  };
  r:evidence (
    <#lemma2>
    [ a r:Fact; r:gives {((1 "-" 4 ", ") (6 ", ") (9 "-" 11 ", ") (13 ", ")) list:append (1 "-" 4 ", " 6 ", " 9 "-" 11 ", " 13 ", ")}]
    [ a r:Fact; r:gives {((1 "-" 4 ", " 6 ", " 9 "-" 11 ", " 13) (", ")) list:append (1 "-" 4 ", " 6 ", " 9 "-" 11 ", " 13 ", ")}]
    [ a r:Fact; r:gives {(1 "-" 4 ", " 6 ", " 9 "-" 11 ", " 13) string:concatenation "1-4, 6, 9-11, 13"}]
  );
  r:binding [ r:variable [ n3:uri "http://josd.github.io/var#x_0"]; r:boundTo ((1 "-" 4 ", ") (6 ", ") (9 "-" 11 ", ") (13 ", "))];
  r:binding [ r:variable [ n3:uri "http://josd.github.io/var#x_1"]; r:boundTo (1 "-" 4 ", " 6 ", " 9 "-" 11 ", " 13 ", ")];
  r:binding [ r:variable [ n3:uri "http://josd.github.io/var#x_2"]; r:boundTo (1 "-" 4 ", " 6 ", " 9 "-" 11 ", " 13)];
  r:binding [ r:variable [ n3:uri "http://josd.github.io/var#x_3"]; r:boundTo "1-4, 6, 9-11, 13"];
  r:rule <#lemma3>.

<#lemma2> a r:Inference;
  r:gives {
    (1 2 3 4 6 9 10 11 13) seq:punctuate ((1 "-" 4 ", ") (6 ", ") (9 "-" 11 ", ") (13 ", ")).
  };
  r:evidence (
    [ a r:Fact; r:gives {((1 "-" 4 ", ") (6 ", ") (9 "-" 11 ", ") (13 ", ")) e:firstRest ((1 "-" 4 ", ") ((6 ", ") (9 "-" 11 ", ") (13 ", ")))}]
    [ a r:Fact; r:gives {((1 2 3 4 6 9 10 11 13)) func:reverse (13 11 10 9 6 4 3 2 1)}]
    [ a r:Fact; r:gives {((13 11 10 9 6) (4 3 2 1)) list:append (13 11 10 9 6 4 3 2 1)}]
    <#lemma4>
    [ a r:Fact; r:gives {("!") e:derive true}]
    <#lemma5>
    [ a r:Fact; r:gives {((13 11 10 9 6)) func:reverse (6 9 10 11 13)}]
    <#lemma6>
  );
  r:binding [ r:variable [ n3:uri "http://josd.github.io/var#x_0"]; r:boundTo ((1 "-" 4 ", ") (6 ", ") (9 "-" 11 ", ") (13 ", "))];
  r:binding [ r:variable [ n3:uri "http://josd.github.io/var#x_1"]; r:boundTo (1 "-" 4 ", ")];
  r:binding [ r:variable [ n3:uri "http://josd.github.io/var#x_2"]; r:boundTo ((6 ", ") (9 "-" 11 ", ") (13 ", "))];
  r:binding [ r:variable [ n3:uri "http://josd.github.io/var#x_4"]; r:boundTo (13 11 10 9 6 4 3 2 1)];
  r:binding [ r:variable [ n3:uri "http://josd.github.io/var#x_3"]; r:boundTo (1 2 3 4 6 9 10 11 13)];
  r:binding [ r:variable [ n3:uri "http://josd.github.io/var#x_5"]; r:boundTo (13 11 10 9 6)];
  r:binding [ r:variable [ n3:uri "http://josd.github.io/var#x_6"]; r:boundTo (4 3 2 1)];
  r:binding [ r:variable [ n3:uri "http://josd.github.io/var#x_7"]; r:boundTo (6 9 10 11 13)];
  r:rule <#lemma7>.

<#lemma3> a r:Extraction;
  r:gives {
    @forAll var:x_0, var:x_1, var:x_2, var:x_3. {(1 2 3 4 6 9 10 11 13) seq:punctuate var:x_0.
     var:x_0 list:append var:x_1.
     (var:x_2 (", ")) list:append var:x_1.
     var:x_2 string:concatenation var:x_3} => {(1 2 3 4 6 9 10 11 13) seq:answer var:x_3}.
  };
  r:because [ a r:Parsing; r:source <http://josd.github.io/eye/reasoning/seq/seq_query.n3>].

<#lemma4> a r:Inference;
  r:gives {
    (4 3 2 1) seq:check true.
  };
  r:evidence (
    [ a r:Fact; r:gives {(4 3 2 1) e:firstRest (4 (3 2 1))}]
    [ a r:Fact; r:gives {(3 2 1) e:firstRest (3 (2 1))}]
    [ a r:Fact; r:gives {(3 1) math:sum 4}]
    <#lemma8>
  );
  r:binding [ r:variable [ n3:uri "http://josd.github.io/var#x_0"]; r:boundTo (4 3 2 1)];
  r:binding [ r:variable [ n3:uri "http://josd.github.io/var#x_1"]; r:boundTo 4];
  r:binding [ r:variable [ n3:uri "http://josd.github.io/var#x_2"]; r:boundTo (3 2 1)];
  r:binding [ r:variable [ n3:uri "http://josd.github.io/var#x_3"]; r:boundTo 3];
  r:binding [ r:variable [ n3:uri "http://josd.github.io/var#x_4"]; r:boundTo (2 1)];
  r:rule <#lemma9>.

<#lemma5> a r:Inference;
  r:gives {
    (4 3 2 1) seq:format (1 "-" 4 ", ").
  };
  r:evidence (
    [ a r:Fact; r:gives {(4 3 2 1) e:firstRest (4 (3 2 1))}]
    [ a r:Fact; r:gives {(3 2 1) list:last 1}]
  );
  r:binding [ r:variable [ n3:uri "http://josd.github.io/var#x_0"]; r:boundTo (4 3 2 1)];
  r:binding [ r:variable [ n3:uri "http://josd.github.io/var#x_1"]; r:boundTo 4];
  r:binding [ r:variable [ n3:uri "http://josd.github.io/var#x_2"]; r:boundTo (3 2 1)];
  r:binding [ r:variable [ n3:uri "http://josd.github.io/var#x_3"]; r:boundTo 1];
  r:rule <#lemma10>.

<#lemma6> a r:Inference;
  r:gives {
    (6 9 10 11 13) seq:punctuate ((6 ", ") (9 "-" 11 ", ") (13 ", ")).
  };
  r:evidence (
    [ a r:Fact; r:gives {((6 ", ") (9 "-" 11 ", ") (13 ", ")) e:firstRest ((6 ", ") ((9 "-" 11 ", ") (13 ", ")))}]
    [ a r:Fact; r:gives {((6 9 10 11 13)) func:reverse (13 11 10 9 6)}]
    [ a r:Fact; r:gives {((13 11 10 9) (6)) list:append (13 11 10 9 6)}]
    <#lemma11>
    [ a r:Fact; r:gives {("!") e:derive true}]
    <#lemma12>
    [ a r:Fact; r:gives {((13 11 10 9)) func:reverse (9 10 11 13)}]
    <#lemma13>
  );
  r:binding [ r:variable [ n3:uri "http://josd.github.io/var#x_0"]; r:boundTo ((6 ", ") (9 "-" 11 ", ") (13 ", "))];
  r:binding [ r:variable [ n3:uri "http://josd.github.io/var#x_1"]; r:boundTo (6 ", ")];
  r:binding [ r:variable [ n3:uri "http://josd.github.io/var#x_2"]; r:boundTo ((9 "-" 11 ", ") (13 ", "))];
  r:binding [ r:variable [ n3:uri "http://josd.github.io/var#x_4"]; r:boundTo (13 11 10 9 6)];
  r:binding [ r:variable [ n3:uri "http://josd.github.io/var#x_3"]; r:boundTo (6 9 10 11 13)];
  r:binding [ r:variable [ n3:uri "http://josd.github.io/var#x_5"]; r:boundTo (13 11 10 9)];
  r:binding [ r:variable [ n3:uri "http://josd.github.io/var#x_6"]; r:boundTo (6)];
  r:binding [ r:variable [ n3:uri "http://josd.github.io/var#x_7"]; r:boundTo (9 10 11 13)];
  r:rule <#lemma7>.

<#lemma7> 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_3 seq:punctuate var:x_0} <= {var:x_0 e:firstRest (var:x_1 var:x_2).
     (var:x_3) func:reverse var:x_4.
     (var:x_5 var:x_6) list:append var:x_4.
     var:x_6 seq:check true.
     ("!") e:derive true.
     var:x_6 seq:format var:x_1.
     (var:x_5) func:reverse var:x_7.
     var:x_7 seq:punctuate var:x_2}.
  };
  r:because [ a r:Parsing; r:source <http://josd.github.io/eye/reasoning/seq/seq_components.n3>].

<#lemma8> a r:Inference;
  r:gives {
    (3 2 1) seq:check true.
  };
  r:evidence (
    [ a r:Fact; r:gives {(3 2 1) e:firstRest (3 (2 1))}]
    [ a r:Fact; r:gives {(2 1) e:firstRest (2 (1))}]
    [ a r:Fact; r:gives {(2 1) math:sum 3}]
    <#lemma14>
  );
  r:binding [ r:variable [ n3:uri "http://josd.github.io/var#x_0"]; r:boundTo (3 2 1)];
  r:binding [ r:variable [ n3:uri "http://josd.github.io/var#x_1"]; r:boundTo 3];
  r:binding [ r:variable [ n3:uri "http://josd.github.io/var#x_2"]; r:boundTo (2 1)];
  r:binding [ r:variable [ n3:uri "http://josd.github.io/var#x_3"]; r:boundTo 2];
  r:binding [ r:variable [ n3:uri "http://josd.github.io/var#x_4"]; r:boundTo (1)];
  r:rule <#lemma9>.

<#lemma9> a r:Extraction;
  r:gives {
    @forAll var:x_0, var:x_1, var:x_2, var:x_3, var:x_4. {var:x_0 seq:check true} <= {var:x_0 e:firstRest (var:x_1 var:x_2).
     var:x_2 e:firstRest (var:x_3 var:x_4).
     (var:x_3 1) math:sum var:x_1.
     var:x_2 seq:check true}.
  };
  r:because [ a r:Parsing; r:source <http://josd.github.io/eye/reasoning/seq/seq_components.n3>].

<#lemma10> a r:Extraction;
  r:gives {
    @forAll var:x_0, var:x_1, var:x_2, var:x_3. {var:x_0 seq:format (var:x_3 "-" var:x_1 ", ")} <= {var:x_0 e:firstRest (var:x_1 var:x_2).
     var:x_2 list:last var:x_3}.
  };
  r:because [ a r:Parsing; r:source <http://josd.github.io/eye/reasoning/seq/seq_components.n3>].

<#lemma11> a r:Inference;
  r:gives {
    (6) seq:check true.
  };
  r:evidence (
    [ a r:Fact; r:gives true]
  );
  r:binding [ r:variable [ n3:uri "http://josd.github.io/var#x_0"]; r:boundTo 6];
  r:rule <#lemma15>.

<#lemma12> a r:Inference;
  r:gives {
    (6) seq:format (6 ", ").
  };
  r:evidence (
    [ a r:Fact; r:gives true]
  );
  r:binding [ r:variable [ n3:uri "http://josd.github.io/var#x_0"]; r:boundTo 6];
  r:rule <#lemma16>.

<#lemma13> a r:Inference;
  r:gives {
    (9 10 11 13) seq:punctuate ((9 "-" 11 ", ") (13 ", ")).
  };
  r:evidence (
    [ a r:Fact; r:gives {((9 "-" 11 ", ") (13 ", ")) e:firstRest ((9 "-" 11 ", ") ((13 ", ")))}]
    [ a r:Fact; r:gives {((9 10 11 13)) func:reverse (13 11 10 9)}]
    [ a r:Fact; r:gives {((13) (11 10 9)) list:append (13 11 10 9)}]
    <#lemma17>
    [ a r:Fact; r:gives {("!") e:derive true}]
    <#lemma18>
    [ a r:Fact; r:gives {((13)) func:reverse (13)}]
    <#lemma19>
  );
  r:binding [ r:variable [ n3:uri "http://josd.github.io/var#x_0"]; r:boundTo ((9 "-" 11 ", ") (13 ", "))];
  r:binding [ r:variable [ n3:uri "http://josd.github.io/var#x_1"]; r:boundTo (9 "-" 11 ", ")];
  r:binding [ r:variable [ n3:uri "http://josd.github.io/var#x_2"]; r:boundTo ((13 ", "))];
  r:binding [ r:variable [ n3:uri "http://josd.github.io/var#x_4"]; r:boundTo (13 11 10 9)];
  r:binding [ r:variable [ n3:uri "http://josd.github.io/var#x_3"]; r:boundTo (9 10 11 13)];
  r:binding [ r:variable [ n3:uri "http://josd.github.io/var#x_5"]; r:boundTo (13)];
  r:binding [ r:variable [ n3:uri "http://josd.github.io/var#x_6"]; r:boundTo (11 10 9)];
  r:binding [ r:variable [ n3:uri "http://josd.github.io/var#x_7"]; r:boundTo (13)];
  r:rule <#lemma7>.

<#lemma14> a r:Inference;
  r:gives {
    (2 1) seq:check true.
  };
  r:evidence (
    [ a r:Fact; r:gives {(2 1) e:firstRest (2 (1))}]
    [ a r:Fact; r:gives {(1) e:firstRest (1 ())}]
    [ a r:Fact; r:gives {(1 1) math:sum 2}]
    <#lemma20>
  );
  r:binding [ r:variable [ n3:uri "http://josd.github.io/var#x_0"]; r:boundTo (2 1)];
  r:binding [ r:variable [ n3:uri "http://josd.github.io/var#x_1"]; r:boundTo 2];
  r:binding [ r:variable [ n3:uri "http://josd.github.io/var#x_2"]; r:boundTo (1)];
  r:binding [ r:variable [ n3:uri "http://josd.github.io/var#x_3"]; r:boundTo 1];
  r:binding [ r:variable [ n3:uri "http://josd.github.io/var#x_4"]; r:boundTo ()];
  r:rule <#lemma9>.

<#lemma15> a r:Extraction;
  r:gives {
    @forSome var:x_0. {(var:x_0) seq:check true} <= true.
  };
  r:because [ a r:Parsing; r:source <http://josd.github.io/eye/reasoning/seq/seq_components.n3>].

<#lemma16> a r:Extraction;
  r:gives {
    @forSome var:x_0. {(var:x_0) seq:format (var:x_0 ", ")} <= true.
  };
  r:because [ a r:Parsing; r:source <http://josd.github.io/eye/reasoning/seq/seq_components.n3>].

<#lemma17> a r:Inference;
  r:gives {
    (11 10 9) seq:check true.
  };
  r:evidence (
    [ a r:Fact; r:gives {(11 10 9) e:firstRest (11 (10 9))}]
    [ a r:Fact; r:gives {(10 9) e:firstRest (10 (9))}]
    [ a r:Fact; r:gives {(10 1) math:sum 11}]
    <#lemma21>
  );
  r:binding [ r:variable [ n3:uri "http://josd.github.io/var#x_0"]; r:boundTo (11 10 9)];
  r:binding [ r:variable [ n3:uri "http://josd.github.io/var#x_1"]; r:boundTo 11];
  r:binding [ r:variable [ n3:uri "http://josd.github.io/var#x_2"]; r:boundTo (10 9)];
  r:binding [ r:variable [ n3:uri "http://josd.github.io/var#x_3"]; r:boundTo 10];
  r:binding [ r:variable [ n3:uri "http://josd.github.io/var#x_4"]; r:boundTo (9)];
  r:rule <#lemma9>.

<#lemma18> a r:Inference;
  r:gives {
    (11 10 9) seq:format (9 "-" 11 ", ").
  };
  r:evidence (
    [ a r:Fact; r:gives {(11 10 9) e:firstRest (11 (10 9))}]
    [ a r:Fact; r:gives {(10 9) list:last 9}]
  );
  r:binding [ r:variable [ n3:uri "http://josd.github.io/var#x_0"]; r:boundTo (11 10 9)];
  r:binding [ r:variable [ n3:uri "http://josd.github.io/var#x_1"]; r:boundTo 11];
  r:binding [ r:variable [ n3:uri "http://josd.github.io/var#x_2"]; r:boundTo (10 9)];
  r:binding [ r:variable [ n3:uri "http://josd.github.io/var#x_3"]; r:boundTo 9];
  r:rule <#lemma10>.

<#lemma19> a r:Inference;
  r:gives {
    (13) seq:punctuate ((13 ", ")).
  };
  r:evidence (
    [ a r:Fact; r:gives {((13 ", ")) e:firstRest ((13 ", ") ())}]
    [ a r:Fact; r:gives {((13)) func:reverse (13)}]
    [ a r:Fact; r:gives {(() (13)) list:append (13)}]
    <#lemma22>
    [ a r:Fact; r:gives {("!") e:derive true}]
    <#lemma23>
    [ a r:Fact; r:gives {(()) func:reverse ()}]
    <#lemma24>
  );
  r:binding [ r:variable [ n3:uri "http://josd.github.io/var#x_0"]; r:boundTo ((13 ", "))];
  r:binding [ r:variable [ n3:uri "http://josd.github.io/var#x_1"]; r:boundTo (13 ", ")];
  r:binding [ r:variable [ n3:uri "http://josd.github.io/var#x_2"]; r:boundTo ()];
  r:binding [ r:variable [ n3:uri "http://josd.github.io/var#x_4"]; r:boundTo (13)];
  r:binding [ r:variable [ n3:uri "http://josd.github.io/var#x_3"]; r:boundTo (13)];
  r:binding [ r:variable [ n3:uri "http://josd.github.io/var#x_5"]; r:boundTo ()];
  r:binding [ r:variable [ n3:uri "http://josd.github.io/var#x_6"]; r:boundTo (13)];
  r:binding [ r:variable [ n3:uri "http://josd.github.io/var#x_7"]; r:boundTo ()];
  r:rule <#lemma7>.

<#lemma20> a r:Inference;
  r:gives {
    (1) seq:check true.
  };
  r:evidence (
    [ a r:Fact; r:gives true]
  );
  r:binding [ r:variable [ n3:uri "http://josd.github.io/var#x_0"]; r:boundTo 1];
  r:rule <#lemma15>.

<#lemma21> a r:Inference;
  r:gives {
    (10 9) seq:check true.
  };
  r:evidence (
    [ a r:Fact; r:gives {(10 9) e:firstRest (10 (9))}]
    [ a r:Fact; r:gives {(9) e:firstRest (9 ())}]
    [ a r:Fact; r:gives {(9 1) math:sum 10}]
    <#lemma25>
  );
  r:binding [ r:variable [ n3:uri "http://josd.github.io/var#x_0"]; r:boundTo (10 9)];
  r:binding [ r:variable [ n3:uri "http://josd.github.io/var#x_1"]; r:boundTo 10];
  r:binding [ r:variable [ n3:uri "http://josd.github.io/var#x_2"]; r:boundTo (9)];
  r:binding [ r:variable [ n3:uri "http://josd.github.io/var#x_3"]; r:boundTo 9];
  r:binding [ r:variable [ n3:uri "http://josd.github.io/var#x_4"]; r:boundTo ()];
  r:rule <#lemma9>.

<#lemma22> a r:Inference;
  r:gives {
    (13) seq:check true.
  };
  r:evidence (
    [ a r:Fact; r:gives true]
  );
  r:binding [ r:variable [ n3:uri "http://josd.github.io/var#x_0"]; r:boundTo 13];
  r:rule <#lemma15>.

<#lemma23> a r:Inference;
  r:gives {
    (13) seq:format (13 ", ").
  };
  r:evidence (
    [ a r:Fact; r:gives true]
  );
  r:binding [ r:variable [ n3:uri "http://josd.github.io/var#x_0"]; r:boundTo 13];
  r:rule <#lemma16>.

<#lemma24> a r:Inference;
  r:gives {
    () seq:punctuate ().
  };
  r:evidence (
    [ a r:Fact; r:gives true]
  );
  r:rule <#lemma26>.

<#lemma25> a r:Inference;
  r:gives {
    (9) seq:check true.
  };
  r:evidence (
    [ a r:Fact; r:gives true]
  );
  r:binding [ r:variable [ n3:uri "http://josd.github.io/var#x_0"]; r:boundTo 9];
  r:rule <#lemma15>.

<#lemma26> a r:Extraction;
  r:gives {
    {() seq:punctuate ()} <= true.
  };
  r:because [ a r:Parsing; r:source <http://josd.github.io/eye/reasoning/seq/seq_components.n3>].

#2020-10-23T20:17:16.295Z in=7 out=1 ent=1 step=1 brake=1 inf=79702 sec=0.034 inf/sec=2344176
#ENDS

