@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 : <http://example.org/#>.
@prefix n3: <http://www.w3.org/2004/06/rei#>.
@prefix var: <http://www.w3.org/2000/10/swap/var#>.
@prefix log: <http://www.w3.org/2000/10/swap/log#>.
@prefix list: <http://www.w3.org/2000/10/swap/list#>.

skolem:proof a r:Proof, r:Conjunction;
    r:component skolem:lemma1;
    r:gives {
        :test :for :PolicyX.
        :test :is true.
    }.

skolem:lemma1 a r:Inference;
    r:gives {
        :test :for :PolicyX.
        :test :is true.
    };
    r:evidence (
        skolem:lemma2
        skolem:lemma3
        skolem:lemma4
        skolem:lemma5
    );
    r:binding [ r:variable [ n3:uri "http://www.w3.org/2000/10/swap/var#x_0"]; r:boundTo [ n3:uri "http://example.org/#PolicyX"]];
    r:rule [ a r:Fact; r:gives {@forSome var:x_0. {
        var:x_0 a :Policy.
        var:x_0 :pass :allOfTest.
        var:x_0 :pass :anyOfTest.
        var:x_0 :pass :noneOfTest.
    } => {
        :test :for var:x_0.
        :test :is true.
    }}].

skolem:lemma2 a r:Extraction;
    r:gives {
        :PolicyX a :Policy.
    };
    r:because [ a r:Parsing; r:source <https://eyereasoner.github.io/eye/reasoning/acp/acp.n3>].

skolem:lemma3 a r:Inference;
    r:gives {
        :PolicyX :pass :allOfTest.
    };
    r:evidence (
        skolem:lemma6
        skolem:lemma2
        [ a r:Fact; r:gives {({
            :PolicyX :allOf _:sk_0.
        } {
            :test1 :has _:sk_0.
        }) log:forAllIn ((<https://eyereasoner.github.io/eye/reasoning/acp/acp.n3>) 1)}]
    );
    r:binding [ r:variable [ n3:uri "http://www.w3.org/2000/10/swap/var#x_0"]; r:boundTo [ n3:uri "http://example.org/#test1"]];
    r:binding [ r:variable [ n3:uri "http://www.w3.org/2000/10/swap/var#x_1"]; r:boundTo [ n3:uri "http://example.org/#PolicyX"]];
    r:binding [ r:variable [ n3:uri "http://www.w3.org/2000/10/swap/var#x_3"]; r:boundTo ((<https://eyereasoner.github.io/eye/reasoning/acp/acp.n3>) 1)];
    r:binding [ r:variable [ n3:uri "http://www.w3.org/2000/10/swap/var#x_2"]; r:boundTo [ a r:Existential; n3:nodeId "_:sk_0"]];
    r:rule skolem:lemma7.

skolem:lemma4 a r:Inference;
    r:gives {
        :PolicyX :pass :anyOfTest.
    };
    r:evidence (
        skolem:lemma6
        skolem:lemma2
        [ a r:Fact; r:gives {(_:sk_0 {
            :PolicyX :anyOf _:sk_0.
            :test1 :has _:sk_0.
        } (:C)) log:collectAllIn ((<https://eyereasoner.github.io/eye/reasoning/acp/acp.n3>) 1)}]
        [ a r:Fact; r:gives {(:C) list:length 1}]
        [ a r:Fact; r:gives {1 log:notEqualTo 0}]
    );
    r:binding [ r:variable [ n3:uri "http://www.w3.org/2000/10/swap/var#x_0"]; r:boundTo [ n3:uri "http://example.org/#test1"]];
    r:binding [ r:variable [ n3:uri "http://www.w3.org/2000/10/swap/var#x_1"]; r:boundTo [ n3:uri "http://example.org/#PolicyX"]];
    r:binding [ r:variable [ n3:uri "http://www.w3.org/2000/10/swap/var#x_4"]; r:boundTo ((<https://eyereasoner.github.io/eye/reasoning/acp/acp.n3>) 1)];
    r:binding [ r:variable [ n3:uri "http://www.w3.org/2000/10/swap/var#x_2"]; r:boundTo [ a r:Existential; n3:nodeId "_:sk_0"]];
    r:binding [ r:variable [ n3:uri "http://www.w3.org/2000/10/swap/var#x_3"]; r:boundTo (:C)];
    r:binding [ r:variable [ n3:uri "http://www.w3.org/2000/10/swap/var#x_5"]; r:boundTo 1];
    r:rule skolem:lemma8.

skolem:lemma5 a r:Inference;
    r:gives {
        :PolicyX :pass :noneOfTest.
    };
    r:evidence (
        skolem:lemma6
        skolem:lemma2
        [ a r:Fact; r:gives {(_:sk_0 {
            :PolicyX :noneOf _:sk_0.
            :test1 :has _:sk_0.
        } ()) log:collectAllIn ((<https://eyereasoner.github.io/eye/reasoning/acp/acp.n3>) 1)}]
        [ a r:Fact; r:gives {() list:length 0}]
        [ a r:Fact; r:gives {0 log:equalTo 0}]
    );
    r:binding [ r:variable [ n3:uri "http://www.w3.org/2000/10/swap/var#x_0"]; r:boundTo [ n3:uri "http://example.org/#test1"]];
    r:binding [ r:variable [ n3:uri "http://www.w3.org/2000/10/swap/var#x_1"]; r:boundTo [ n3:uri "http://example.org/#PolicyX"]];
    r:binding [ r:variable [ n3:uri "http://www.w3.org/2000/10/swap/var#x_4"]; r:boundTo ((<https://eyereasoner.github.io/eye/reasoning/acp/acp.n3>) 1)];
    r:binding [ r:variable [ n3:uri "http://www.w3.org/2000/10/swap/var#x_2"]; r:boundTo [ a r:Existential; n3:nodeId "_:sk_0"]];
    r:binding [ r:variable [ n3:uri "http://www.w3.org/2000/10/swap/var#x_3"]; r:boundTo ()];
    r:binding [ r:variable [ n3:uri "http://www.w3.org/2000/10/swap/var#x_5"]; r:boundTo 0];
    r:rule skolem:lemma9.

skolem:lemma6 a r:Extraction;
    r:gives {
        :test1 :policy :PolicyX.
    };
    r:because [ a r:Parsing; r:source <https://eyereasoner.github.io/eye/reasoning/acp/acp.n3>].

skolem:lemma7 a r:Extraction;
    r:gives {
        @forAll var:x_0, var:x_1, var:x_2, var:x_3. {
            var:x_1 :pass :allOfTest.
        } <= {
            var:x_0 :policy var:x_1.
            var:x_1 a :Policy.
            ({
                var:x_1 :allOf var:x_2.
            } {
                var:x_0 :has var:x_2.
            }) log:forAllIn var:x_3.
        }.
    };
    r:because [ a r:Parsing; r:source <https://eyereasoner.github.io/eye/reasoning/acp/acp.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_1 :pass :anyOfTest.
        } <= {
            var:x_0 :policy var:x_1.
            var:x_1 a :Policy.
            (var:x_2 {
                var:x_1 :anyOf var:x_2.
                var:x_0 :has var:x_2.
            } var:x_3) log:collectAllIn var:x_4.
            var:x_3 list:length var:x_5.
            var:x_5 log:notEqualTo 0.
        }.
    };
    r:because [ a r:Parsing; r:source <https://eyereasoner.github.io/eye/reasoning/acp/acp.n3>].

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_5. {
            var:x_1 :pass :noneOfTest.
        } <= {
            var:x_0 :policy var:x_1.
            var:x_1 a :Policy.
            (var:x_2 {
                var:x_1 :noneOf var:x_2.
                var:x_0 :has var:x_2.
            } var:x_3) log:collectAllIn var:x_4.
            var:x_3 list:length var:x_5.
            var:x_5 log:equalTo 0.
        }.
    };
    r:because [ a r:Parsing; r:source <https://eyereasoner.github.io/eye/reasoning/acp/acp.n3>].

