@prefix math: <http://www.w3.org/2000/10/swap/math#>.
@prefix log: <http://www.w3.org/2000/10/swap/log#>.
@prefix var: <http://www.w3.org/2000/10/swap/var#>.
@prefix : <https://eyereasoner.github.io/eye/reasoning#>.

:s :p1 true.
#:s :p2 true.
:s :p3 true.
:s :p4 true.
#:s :p5 true.
:s :p6 true.
:s :p7 true.

# query
[ log:graph (
    [ log:triple (true log:callWithOptional [ log:graph (
        [ log:triple (:s :p1 true)]
        [ log:triple (var:C1 log:equalTo 1)]
    )])]
    [ log:triple (true log:callWithOptional [ log:graph (
        [ log:triple (var:C1 log:equalTo 0)]
    )])]
    [ log:triple (true log:callWithOptional [ log:graph (
        [ log:triple (:s :p2 true)]
        [ log:triple (var:C2 log:equalTo 1)]
    )])]
    [ log:triple (true log:callWithOptional [ log:graph (
        [ log:triple (var:C2 log:equalTo 0)]
    )])]
    [ log:triple (true log:callWithOptional [ log:graph (
        [ log:triple (:s :p3 true)]
        [ log:triple (var:C3 log:equalTo 1)]
    )])]
    [ log:triple (true log:callWithOptional [ log:graph (
        [ log:triple (var:C3 log:equalTo 0)]
    )])]
    [ log:triple (true log:callWithOptional [ log:graph (
        [ log:triple (:s :p4 true)]
        [ log:triple (var:C4 log:equalTo 1)]
    )])]
    [ log:triple (true log:callWithOptional [ log:graph (
        [ log:triple (var:C4 log:equalTo 0)]
    )])]
    [ log:triple (true log:callWithOptional [ log:graph (
        [ log:triple (:s :p5 true)]
        [ log:triple (var:C5 log:equalTo 1)]
    )])]
    [ log:triple (true log:callWithOptional [ log:graph (
        [ log:triple (var:C5 log:equalTo 0)]
    )])]
    [ log:triple ((var:C1 var:C2 var:C3 var:C4 var:C5) math:sum var:C)]
    [ log:triple (var:C math:notLessThan 3)]
)] log:impliesAnswer [ log:graph (
    [ log:triple (:s :is :3outof5)]
)].
