@prefix skolem: <https://eyereasoner.github.io/.well-known/genid/8b98b360-9a70-4845-b52c-c675af60ad01#>.
@prefix r: <http://www.w3.org/2000/10/swap/reason#>.
@prefix seq: <https://eyereasoner.github.io/eye/reasoning/seq#>.
@prefix list: <http://www.w3.org/2000/10/swap/list#>.
@prefix string: <http://www.w3.org/2000/10/swap/string#>.
@prefix n3: <http://www.w3.org/2004/06/rei#>.
@prefix e: <http://eulersharp.sourceforge.net/2003/03swap/log-rules#>.
@prefix func: <http://www.w3.org/2007/rif-builtin-function#>.
@prefix log: <http://www.w3.org/2000/10/swap/log#>.
@prefix var: <http://www.w3.org/2000/10/swap/var#>.
@prefix math: <http://www.w3.org/2000/10/swap/math#>.

skolem:proof a r:Proof, r:Conjunction;
    r:component skolem:lemma1;
    r:gives {
        (1 2 3 4 6 9 10 11 13) seq:answer "1-4, 6, 9-11, 13".
    }.

skolem: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 (
        skolem: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://www.w3.org/2000/10/swap/var#x_0"]; r:boundTo ((1 "-" 4 ", ") (6 ", ") (9 "-" 11 ", ") (13 ", "))];
    r:binding [ r:variable [ n3:uri "http://www.w3.org/2000/10/swap/var#x_1"]; r:boundTo (1 "-" 4 ", " 6 ", " 9 "-" 11 ", " 13 ", ")];
    r:binding [ r:variable [ n3:uri "http://www.w3.org/2000/10/swap/var#x_2"]; r:boundTo (1 "-" 4 ", " 6 ", " 9 "-" 11 ", " 13)];
    r:binding [ r:variable [ n3:uri "http://www.w3.org/2000/10/swap/var#x_3"]; r:boundTo "1-4, 6, 9-11, 13"];
    r:rule skolem:lemma3.

skolem: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)}]
        skolem:lemma4
        [ a r:Fact; r:gives {true log:callWithCut true}]
        skolem:lemma5
        [ a r:Fact; r:gives {((13 11 10 9 6)) func:reverse (6 9 10 11 13)}]
        skolem:lemma6
    );
    r:binding [ r:variable [ n3:uri "http://www.w3.org/2000/10/swap/var#x_0"]; r:boundTo ((1 "-" 4 ", ") (6 ", ") (9 "-" 11 ", ") (13 ", "))];
    r:binding [ r:variable [ n3:uri "http://www.w3.org/2000/10/swap/var#x_1"]; r:boundTo (1 "-" 4 ", ")];
    r:binding [ r:variable [ n3:uri "http://www.w3.org/2000/10/swap/var#x_2"]; r:boundTo ((6 ", ") (9 "-" 11 ", ") (13 ", "))];
    r:binding [ r:variable [ n3:uri "http://www.w3.org/2000/10/swap/var#x_4"]; r:boundTo (13 11 10 9 6 4 3 2 1)];
    r:binding [ r:variable [ n3:uri "http://www.w3.org/2000/10/swap/var#x_3"]; r:boundTo (1 2 3 4 6 9 10 11 13)];
    r:binding [ r:variable [ n3:uri "http://www.w3.org/2000/10/swap/var#x_5"]; r:boundTo (13 11 10 9 6)];
    r:binding [ r:variable [ n3:uri "http://www.w3.org/2000/10/swap/var#x_6"]; r:boundTo (4 3 2 1)];
    r:binding [ r:variable [ n3:uri "http://www.w3.org/2000/10/swap/var#x_7"]; r:boundTo (6 9 10 11 13)];
    r:rule skolem:lemma7.

skolem: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 <https://eyereasoner.github.io/eye/reasoning/seq/seq_query.n3>].

skolem: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}]
        skolem:lemma8
    );
    r:binding [ r:variable [ n3:uri "http://www.w3.org/2000/10/swap/var#x_0"]; r:boundTo (4 3 2 1)];
    r:binding [ r:variable [ n3:uri "http://www.w3.org/2000/10/swap/var#x_1"]; r:boundTo 4];
    r:binding [ r:variable [ n3:uri "http://www.w3.org/2000/10/swap/var#x_2"]; r:boundTo (3 2 1)];
    r:binding [ r:variable [ n3:uri "http://www.w3.org/2000/10/swap/var#x_3"]; r:boundTo 3];
    r:binding [ r:variable [ n3:uri "http://www.w3.org/2000/10/swap/var#x_4"]; r:boundTo (2 1)];
    r:rule skolem:lemma9.

skolem: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://www.w3.org/2000/10/swap/var#x_0"]; r:boundTo (4 3 2 1)];
    r:binding [ r:variable [ n3:uri "http://www.w3.org/2000/10/swap/var#x_1"]; r:boundTo 4];
    r:binding [ r:variable [ n3:uri "http://www.w3.org/2000/10/swap/var#x_2"]; r:boundTo (3 2 1)];
    r:binding [ r:variable [ n3:uri "http://www.w3.org/2000/10/swap/var#x_3"]; r:boundTo 1];
    r:rule skolem:lemma10.

skolem: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)}]
        skolem:lemma11
        [ a r:Fact; r:gives {true log:callWithCut true}]
        skolem:lemma12
        [ a r:Fact; r:gives {((13 11 10 9)) func:reverse (9 10 11 13)}]
        skolem:lemma13
    );
    r:binding [ r:variable [ n3:uri "http://www.w3.org/2000/10/swap/var#x_0"]; r:boundTo ((6 ", ") (9 "-" 11 ", ") (13 ", "))];
    r:binding [ r:variable [ n3:uri "http://www.w3.org/2000/10/swap/var#x_1"]; r:boundTo (6 ", ")];
    r:binding [ r:variable [ n3:uri "http://www.w3.org/2000/10/swap/var#x_2"]; r:boundTo ((9 "-" 11 ", ") (13 ", "))];
    r:binding [ r:variable [ n3:uri "http://www.w3.org/2000/10/swap/var#x_4"]; r:boundTo (13 11 10 9 6)];
    r:binding [ r:variable [ n3:uri "http://www.w3.org/2000/10/swap/var#x_3"]; r:boundTo (6 9 10 11 13)];
    r:binding [ r:variable [ n3:uri "http://www.w3.org/2000/10/swap/var#x_5"]; r:boundTo (13 11 10 9)];
    r:binding [ r:variable [ n3:uri "http://www.w3.org/2000/10/swap/var#x_6"]; r:boundTo (6)];
    r:binding [ r:variable [ n3:uri "http://www.w3.org/2000/10/swap/var#x_7"]; r:boundTo (9 10 11 13)];
    r:rule skolem:lemma7.

skolem: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.
            true log:callWithCut 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 <https://eyereasoner.github.io/eye/reasoning/seq/seq_components.n3>].

skolem: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}]
        skolem:lemma14
    );
    r:binding [ r:variable [ n3:uri "http://www.w3.org/2000/10/swap/var#x_0"]; r:boundTo (3 2 1)];
    r:binding [ r:variable [ n3:uri "http://www.w3.org/2000/10/swap/var#x_1"]; r:boundTo 3];
    r:binding [ r:variable [ n3:uri "http://www.w3.org/2000/10/swap/var#x_2"]; r:boundTo (2 1)];
    r:binding [ r:variable [ n3:uri "http://www.w3.org/2000/10/swap/var#x_3"]; r:boundTo 2];
    r:binding [ r:variable [ n3:uri "http://www.w3.org/2000/10/swap/var#x_4"]; r:boundTo (1)];
    r:rule skolem:lemma9.

skolem: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 <https://eyereasoner.github.io/eye/reasoning/seq/seq_components.n3>].

skolem: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 <https://eyereasoner.github.io/eye/reasoning/seq/seq_components.n3>].

skolem: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://www.w3.org/2000/10/swap/var#x_0"]; r:boundTo 6];
    r:rule skolem:lemma15.

skolem: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://www.w3.org/2000/10/swap/var#x_0"]; r:boundTo 6];
    r:rule skolem:lemma16.

skolem: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)}]
        skolem:lemma17
        [ a r:Fact; r:gives {true log:callWithCut true}]
        skolem:lemma18
        [ a r:Fact; r:gives {((13)) func:reverse (13)}]
        skolem:lemma19
    );
    r:binding [ r:variable [ n3:uri "http://www.w3.org/2000/10/swap/var#x_0"]; r:boundTo ((9 "-" 11 ", ") (13 ", "))];
    r:binding [ r:variable [ n3:uri "http://www.w3.org/2000/10/swap/var#x_1"]; r:boundTo (9 "-" 11 ", ")];
    r:binding [ r:variable [ n3:uri "http://www.w3.org/2000/10/swap/var#x_2"]; r:boundTo ((13 ", "))];
    r:binding [ r:variable [ n3:uri "http://www.w3.org/2000/10/swap/var#x_4"]; r:boundTo (13 11 10 9)];
    r:binding [ r:variable [ n3:uri "http://www.w3.org/2000/10/swap/var#x_3"]; r:boundTo (9 10 11 13)];
    r:binding [ r:variable [ n3:uri "http://www.w3.org/2000/10/swap/var#x_5"]; r:boundTo (13)];
    r:binding [ r:variable [ n3:uri "http://www.w3.org/2000/10/swap/var#x_6"]; r:boundTo (11 10 9)];
    r:binding [ r:variable [ n3:uri "http://www.w3.org/2000/10/swap/var#x_7"]; r:boundTo (13)];
    r:rule skolem:lemma7.

skolem: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}]
        skolem:lemma20
    );
    r:binding [ r:variable [ n3:uri "http://www.w3.org/2000/10/swap/var#x_0"]; r:boundTo (2 1)];
    r:binding [ r:variable [ n3:uri "http://www.w3.org/2000/10/swap/var#x_1"]; r:boundTo 2];
    r:binding [ r:variable [ n3:uri "http://www.w3.org/2000/10/swap/var#x_2"]; r:boundTo (1)];
    r:binding [ r:variable [ n3:uri "http://www.w3.org/2000/10/swap/var#x_3"]; r:boundTo 1];
    r:binding [ r:variable [ n3:uri "http://www.w3.org/2000/10/swap/var#x_4"]; r:boundTo ()];
    r:rule skolem:lemma9.

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

skolem: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 <https://eyereasoner.github.io/eye/reasoning/seq/seq_components.n3>].

skolem: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}]
        skolem:lemma21
    );
    r:binding [ r:variable [ n3:uri "http://www.w3.org/2000/10/swap/var#x_0"]; r:boundTo (11 10 9)];
    r:binding [ r:variable [ n3:uri "http://www.w3.org/2000/10/swap/var#x_1"]; r:boundTo 11];
    r:binding [ r:variable [ n3:uri "http://www.w3.org/2000/10/swap/var#x_2"]; r:boundTo (10 9)];
    r:binding [ r:variable [ n3:uri "http://www.w3.org/2000/10/swap/var#x_3"]; r:boundTo 10];
    r:binding [ r:variable [ n3:uri "http://www.w3.org/2000/10/swap/var#x_4"]; r:boundTo (9)];
    r:rule skolem:lemma9.

skolem: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://www.w3.org/2000/10/swap/var#x_0"]; r:boundTo (11 10 9)];
    r:binding [ r:variable [ n3:uri "http://www.w3.org/2000/10/swap/var#x_1"]; r:boundTo 11];
    r:binding [ r:variable [ n3:uri "http://www.w3.org/2000/10/swap/var#x_2"]; r:boundTo (10 9)];
    r:binding [ r:variable [ n3:uri "http://www.w3.org/2000/10/swap/var#x_3"]; r:boundTo 9];
    r:rule skolem:lemma10.

skolem: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)}]
        skolem:lemma22
        [ a r:Fact; r:gives {true log:callWithCut true}]
        skolem:lemma23
        [ a r:Fact; r:gives {(()) func:reverse ()}]
        skolem:lemma24
    );
    r:binding [ r:variable [ n3:uri "http://www.w3.org/2000/10/swap/var#x_0"]; r:boundTo ((13 ", "))];
    r:binding [ r:variable [ n3:uri "http://www.w3.org/2000/10/swap/var#x_1"]; r:boundTo (13 ", ")];
    r:binding [ r:variable [ n3:uri "http://www.w3.org/2000/10/swap/var#x_2"]; r:boundTo ()];
    r:binding [ r:variable [ n3:uri "http://www.w3.org/2000/10/swap/var#x_4"]; r:boundTo (13)];
    r:binding [ r:variable [ n3:uri "http://www.w3.org/2000/10/swap/var#x_3"]; r:boundTo (13)];
    r:binding [ r:variable [ n3:uri "http://www.w3.org/2000/10/swap/var#x_5"]; r:boundTo ()];
    r:binding [ r:variable [ n3:uri "http://www.w3.org/2000/10/swap/var#x_6"]; r:boundTo (13)];
    r:binding [ r:variable [ n3:uri "http://www.w3.org/2000/10/swap/var#x_7"]; r:boundTo ()];
    r:rule skolem:lemma7.

skolem: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://www.w3.org/2000/10/swap/var#x_0"]; r:boundTo 1];
    r:rule skolem:lemma15.

skolem: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}]
        skolem:lemma25
    );
    r:binding [ r:variable [ n3:uri "http://www.w3.org/2000/10/swap/var#x_0"]; r:boundTo (10 9)];
    r:binding [ r:variable [ n3:uri "http://www.w3.org/2000/10/swap/var#x_1"]; r:boundTo 10];
    r:binding [ r:variable [ n3:uri "http://www.w3.org/2000/10/swap/var#x_2"]; r:boundTo (9)];
    r:binding [ r:variable [ n3:uri "http://www.w3.org/2000/10/swap/var#x_3"]; r:boundTo 9];
    r:binding [ r:variable [ n3:uri "http://www.w3.org/2000/10/swap/var#x_4"]; r:boundTo ()];
    r:rule skolem:lemma9.

skolem: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://www.w3.org/2000/10/swap/var#x_0"]; r:boundTo 13];
    r:rule skolem:lemma15.

skolem: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://www.w3.org/2000/10/swap/var#x_0"]; r:boundTo 13];
    r:rule skolem:lemma16.

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

skolem: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://www.w3.org/2000/10/swap/var#x_0"]; r:boundTo 9];
    r:rule skolem:lemma15.

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

