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

{
    (?IN ?IV) ccd:model (?ON ?C ?N).
} <= {
    (?IN ?IV) ccd: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.
}.
