(Context ctx, FuncDecl<R> f)
| 145 | // construction. |
| 146 | // / </remarks> |
| 147 | private <R extends Sort> BoolExpr commAxiom(Context ctx, FuncDecl<R> f) throws Exception |
| 148 | { |
| 149 | R t = f.getRange(); |
| 150 | Sort[] dom = f.getDomain(); |
| 151 | |
| 152 | if (dom.length != 2 || !t.equals(dom[0]) || !t.equals(dom[1])) |
| 153 | { |
| 154 | System.out.printf("%d %s %s %s%n", dom.length, dom[0], dom[1], t); |
| 155 | throw new Exception("function must be binary, and argument types must be equal to return type"); |
| 156 | } |
| 157 | |
| 158 | String bench = String.format("(assert (forall (x %s) (y %s) (= (%s x y) (%s y x))))", t.getName(), t.getName(), f.getName(), f.getName()); |
| 159 | return ctx.parseSMTLIB2String(bench, new Symbol[] { t.getName() }, |
| 160 | new Sort[] { t }, new Symbol[] { f.getName() }, |
| 161 | new FuncDecl[] { f })[0]; |
| 162 | } |
| 163 | |
| 164 | // / "Hello world" example: create a Z3 logical context, and delete it. |
| 165 |
no test coverage detected