go_dcg ?=> tests(Tests), foreach(Test in Tests) printf("%s: ", Test), if balanced(Test,[]) then println("OK") else println("NOT OK") end end, nl. go_dcg => true. balanced --> "". balanced --> "[", balanced, "]", balanced.