(Context ctx, FuncDecl f)
| 154 | // construction. |
| 155 | // / </remarks> |
| 156 | private BoolExpr commAxiom(Context ctx, FuncDecl f) throws Exception |
| 157 | { |
| 158 | Sort t = f.getRange(); |
| 159 | Sort[] dom = f.getDomain(); |
| 160 | |
| 161 | if (dom.length != 2 || !t.equals(dom[0]) || !t.equals(dom[1])) |
| 162 | { |
| 163 | System.out.println(Integer.toString(dom.length) + " " |
| 164 | + dom[0].toString() + " " + dom[1].toString() + " " |
| 165 | + t.toString()); |
| 166 | throw new Exception( |
| 167 | "function must be binary, and argument types must be equal to return type"); |
| 168 | } |
| 169 | |
| 170 | String bench = "(assert (forall (x " + t.getName() |
| 171 | + ") (y " + t.getName() + ") (= (" + f.getName() + " x y) (" |
| 172 | + f.getName() + " y x))))"; |
| 173 | return ctx.parseSMTLIB2String(bench, new Symbol[] { t.getName() }, |
| 174 | new Sort[] { t }, new Symbol[] { f.getName() }, |
| 175 | new FuncDecl[] { f })[0]; |
| 176 | } |
| 177 | |
| 178 | // / "Hello world" example: create a Z3 logical context, and delete it. |
| 179 |
no test coverage detected