# fc_findall.krb

collect_siblings
    foreach
        family.child_of($child, $father, $mother)
        python siblings = []
        forall
            family.child_of($sibling, $father, $mother)
            check $sibling != $child
            python siblings.append($sibling)
        $siblings = tuple(siblings)
    assert
        family.siblings_of($child, $siblings)
        
collect_cousins
    foreach
        family.child_of($child, $father, $mother)

        python cousins = []
        forall
            family.siblings_of($father, $father_siblings)            
            forall
                $father_sibling in $father_siblings
                family.child_of($cousin, $father_sibling, $_)
                python cousins.append($cousin)

            forall
                $father_sibling in $father_siblings
                family.child_of($cousin, $_, $father_sibling)
                python cousins.append($cousin)
        
        forall
            family.siblings_of($mother, $mother_siblings)
            forall
                $mother_sibling in $mother_siblings
                family.child_of($cousin, $_, $mother_sibling)
                python cousins.append($cousin)
            
            forall
                $mother_sibling in $mother_siblings
                family.child_of($cousin, $mother_sibling, $_)
                python cousins.append($cousin)
        
        $cousins = tuple(cousins)
    assert
        python print "%s has %s as cousins" % ($child, $cousins)
