private void printSummaryBox(Rule rule, List<ConstrainedTerm> proofResults, int successPaths, int step) { if (proofResults.isEmpty()) { System.err.format("\nSPEC PROVED: %s %s\n==================================\nExecution paths: %d\n", new File(rule.getSource().source()), rule.getLocation(), successPaths); } else { System.err.format("\nSPEC FAILED: %s %s\n==================================\n" + "Success execution paths: %d\nFailed execution paths: %d\n", new File(rule.getSource().source()), rule.getLocation(), successPaths, proofResults.size()); } System.err.format("Longest path: %d steps\n", step); global.profiler.printResult(); }
public static void appendRuleAndSource(Rule rule, Appendable out) { File source = rule.source().isPresent() ? new File(rule.getSource().source()) : null; Formatter formatter = new Formatter(out); if (sourceShortEnough(rule)) { formatter.format("%s\n", loadSource(rule)); } else if (rule.source().isPresent()) { formatter.format("rule too long...\n"); } else { formatter.format("Rule with no source. toString() format:\n%s\n", rule.toString()); } formatter.format("\tSource: %s %s\n\n", source, rule.getLocation()); } }
private static String loadSource(Rule rule) { if (!cache.containsKey(rule)) { if (rule.getSource() != null && rule.getLocation() != null) { cache.putIfAbsent(rule, FileUtil.loadFragment(new File(rule.getSource().source()), rule.getLocation())); } } return cache.get(rule); }
lookupDirectories, requiredFiles));; Set<File> allFiles = modules.stream().map(m -> new File(m.getSource().source())).collect(Collectors.toSet()); System.out.println(files.resolveWorkingDirectory(".").toURI().relativize(files.resolveKompiled("timestamp").toURI()).getPath() + " : \\"); for (File file : allFiles) {
public K gen(Rule r, K body) { if (!cover || !r.att().getOptional(Source.class).isPresent()) { return body; } K left = RewriteToTop.toLeft(body); K right = RewriteToTop.toRight(body); String file = r.att().get(Source.class).source(); if (file.startsWith(JarInfo.getKBase())) { return body; } int line = r.att().get(Location.class).startLine(); int col = r.att().get(Location.class).startColumn(); String loc = file + ":" + line + ":" + col; String id = r.att().get("UNIQUE_ID"); allRulesFile.print(id); allRulesFile.print(" "); allRulesFile.println(loc); if (r.att().contains("macro") || r.att().contains("alias")) { //handled by macro expander return body; } return KRewrite(left, KSequence(KApply(KLabel("#logToFile"), KToken(StringUtil.enquoteKString(files.resolveKompiled("coverage.txt").getAbsolutePath()), Sorts.String()), KToken(StringUtil.enquoteKString(id + '\n'), Sorts.String())), right)); }