Commit 3ff2c9e2 authored by Amin Bandali's avatar Amin Bandali

Catalyst: change package name to org.shemshak.alloy.catalyst

As well as a few minor enhancements to SSR.java
parent 115a2b0a
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>org.aminb.alloy.catalyst.dist</name>
<name>org.shemshak.alloy.catalyst.dist</name>
<comment></comment>
<projects>
</projects>
......
Main-Class: org.aminb.alloy.catalyst.MainCLI
Main-Class: org.shemshak.alloy.catalyst.MainCLI
-buildpath: \
org.aminb.alloy.catalyst,\
org.shemshak.alloy.catalyst,\
org.alloytools.alloy.core,\
org.alloytools.kodkod.core;version=latest,\
org.alloytools.kodkod.nativesat.x86-windows;version=latest,\
......@@ -14,7 +14,7 @@ Main-Class: org.aminb.alloy.catalyst.MainCLI
-sources: false
-includeresource: \
@${repo;org.aminb.alloy.catalyst}, \
@${repo;org.shemshak.alloy.catalyst}, \
@${repo;org.alloytools.alloy.core}, \
@${repo;org.alloytools.kodkod.core}, \
@${repo;org.alloytools.kodkod.nativesat.util}, \
......
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>org.aminb.alloy.catalyst</name>
<name>org.shemshak.alloy.catalyst</name>
<comment></comment>
<projects>
</projects>
......
Main-Class: org.aminb.alloy.catalyst.MainCLI
Main-Class: org.shemshak.alloy.catalyst.MainCLI
-buildpath: \
org.alloytools.alloy.core;version=latest,\
......@@ -15,5 +15,5 @@ Main-Class: org.aminb.alloy.catalyst.MainCLI
com.google.gson
Private-Package: \
org.aminb.alloy.catalyst,\
org.shemshak.alloy.catalyst,\
kodkod.engine.satlab;-split-package:=merge-first
package org.aminb.alloy.catalyst;
package org.shemshak.alloy.catalyst;
import java.io.BufferedWriter;
import java.io.FileNotFoundException;
......
package org.aminb.alloy.catalyst;
package org.shemshak.alloy.catalyst;
import org.apache.commons.codec.digest.DigestUtils;
import org.kohsuke.github.GHRepository;
......
package org.aminb.alloy.catalyst;
package org.shemshak.alloy.catalyst;
import edu.mit.csail.sdg.ast.Expr;
import edu.mit.csail.sdg.ast.Func;
......
package org.aminb.alloy.catalyst;
package org.shemshak.alloy.catalyst;
import picocli.CommandLine;
import picocli.CommandLine.Command;
......@@ -13,7 +13,7 @@ import picocli.CommandLine.Command;
"Catalyst is free software: you are free to change and redistribute it.",
"There is NO WARRANTY, to the extent permitted by law.",
"",
"Written by Amin Bandali."
"Written by Amin Bandali <https://shemshak.org/~amin>."
},
description = "A framework for analysis/optimization of performance of Alloy models.",
customSynopsis = "@|bold catalyst|@ [OPTION] COMMAND",
......
package org.aminb.alloy.catalyst;
package org.shemshak.alloy.catalyst;
import java.io.IOException;
import java.io.Writer;
......
package org.aminb.alloy.catalyst;
package org.shemshak.alloy.catalyst;
import java.io.File;
import java.io.IOException;
......@@ -10,8 +10,6 @@ import java.time.Duration;
import java.time.Instant;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.stream.Collectors;
......@@ -71,9 +69,6 @@ public final class SSR extends CatalystCommand implements Runnable {
protected final CorpusResult analyzeCorpus(String corpus) {
CorpusResult cr = new CorpusResult();
cr.corpus_name = corpus;
cr.file_results = parallel ?
Collections.synchronizedList(new ArrayList<FileResult>()) :
new ArrayList<FileResult>();
pln();
......@@ -81,15 +76,17 @@ public final class SSR extends CatalystCommand implements Runnable {
try {
List<Path> files = Files.walk(Paths.get(modelsDir, corpus))
.filter(Files::isRegularFile)
.filter(p -> p.getFileName().toString().endsWith(".als"))
.filter(p -> !Arrays.asList(ignoredFiles).contains(p.getFileName().toString()))
.collect(Collectors.toList());
cr.file_count = files.size();
pln("number of " + corpus + " models: " + cr.file_count);
r.total_file_count += cr.file_count;
AtomicInteger i = new AtomicInteger(1);
Stream<Path> fs = parallel ? files.parallelStream() : files.stream();
fs.filter(p -> p.getFileName().toString().endsWith(".als"))
.filter(p -> !Arrays.asList(ignoredFiles).contains(p.getFileName().toString()))
.forEach(p -> cr.file_results.add(analyzeFile(corpus, p, i.getAndIncrement(), cr.file_count)));
cr.file_results =
fs.map(p -> analyzeFile(corpus, p, i.getAndIncrement(), cr.file_count))
.collect(Collectors.toList());
} catch (Exception e) {
String msg = "Failed while trying to iterate through and analyze " + corpus + " models.";
cr.error = String.format("%s%n%s", msg, Utils.toString(e));
......@@ -125,7 +122,6 @@ public final class SSR extends CatalystCommand implements Runnable {
protected final FileResult analyzeFile(String corpus, Path p, int index, int total) {
FileResult fr = new FileResult();
fr.file_name = p.toString();
fr.mutation_results = new ArrayList<MutationResult>();
fr.errors = new ArrayList<ParseOrTypeError>();
String progress = String.format("[%d/%d]: ", index, total);
......
package org.aminb.alloy.catalyst;
package org.shemshak.alloy.catalyst;
import java.util.Arrays;
import java.util.HashSet;
......
package org.aminb.alloy.catalyst;
package org.shemshak.alloy.catalyst;
import java.io.File;
import java.nio.file.Path;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment