PrimeCounter { static VarIndexing countPrimes(final Expr<?> expr) { return collectPrimes(expr, 0).build(); } private  PrimeCounter();   }
@Test public void test() { final ConstDecl<BoolType> a = Const("a", Bool()); final VarDecl<BoolType> x = Var("x", Bool()); final VarDecl<BoolType> y = Var("y", Bool()); final CoreDslManager manager = new CoreDslManager(); manager.declare(a); manager.declare(x); manager.declare(y); final Expr<?> expr = manager.parseExpr(exprString); final VarIndexing indexing = PathUtils.countPrimes(expr); assertEquals(nPrimesOnX, indexing.get(x)); assertEquals(nPrimesOnY, indexing.get(y)); }