@prefix math: <http://www.w3.org/2000/10/swap/math#>.
@prefix e: <http://eulersharp.sourceforge.net/2003/03swap/log-rules#>.
@prefix c2d: <http://josd.github.io/eye/reasoning/c2d#>.
@prefix : <http://josd.github.io/eye/reasoning#>.

{
    (?IN ?IV) c2d:model (?ON ?C ?N).
} <= {
    (?IN ?IV) c2d:output ?ON.
    ?SCOPE e:findall (1 {?CASE ?IN ?IV; ?ON 1} ?CL).
    ?SCOPE e:findall (1 {?CASE ?IN ?IV; ?ON 0} ?NL).
    ?CL math:sum ?C.
    ?NL math:sum ?N.
}.
