Skip to content
This repository was archived by the owner on May 11, 2022. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
76026ba
remove useless files
May 29, 2017
279f2a5
remove deploy, install_eclipse
May 29, 2017
e7ed1df
remove unneeded invocation
May 29, 2017
563cc06
no longer needed
May 29, 2017
112a7af
ignore generated work folder
May 29, 2017
4c7320e
test model
May 29, 2017
0296bb7
starting subj
May 31, 2017
1bedd53
real version
May 31, 2017
fb16d8e
tst
Jun 1, 2017
5539f96
nthn
Jun 1, 2017
1b17d62
maj jeudi
Jun 1, 2017
13f6141
remove
Jun 1, 2017
a8341b5
first test
Jun 1, 2017
d9bd71f
maj thread
Jun 2, 2017
6a224d4
nthg
Jun 2, 2017
be998ce
Revert "first test"
Jun 2, 2017
58c3b17
add isolver and resultP
Jun 2, 2017
4f164f7
DON'T LOSE MODIF
Jun 2, 2017
ccc8c4d
reintroduce missing file
akheireddine Jun 2, 2017
c67003f
version friday w. obs/
akheireddine Jun 2, 2017
de77532
maj mardi 11
akheireddine Jun 6, 2017
2d1c930
almost done?
akheireddine Jun 6, 2017
86706dc
update interfaces
akheireddine Jun 7, 2017
e468def
maj obs et homogeneite avec les nouveaux runners
akheireddine Jun 7, 2017
f985568
adapter Cegar
akheireddine Jun 7, 2017
bf50ef5
fix application
akheireddine Jun 7, 2017
7bbc925
cast observer (ender to ISolverObservable)
akheireddine Jun 7, 2017
fc37b72
replace Observable to chiefrunner
akheireddine Jun 9, 2017
51db778
maj application w\ new struct using interface callable
akheireddine Jun 9, 2017
2c49d51
maj interfaces
akheireddine Jun 9, 2017
ffcfc80
maj solver, itssolver nd cleanup
akheireddine Jun 9, 2017
933bea7
adapter cegar lts
akheireddine Jun 9, 2017
5e5d970
last maj application
akheireddine Jun 9, 2017
ecf55cd
update listener appl
akheireddine Jun 12, 2017
87d7290
creation of concurrent package
akheireddine Jun 13, 2017
3786299
stuffs
akheireddine Jun 13, 2017
8861d38
update adaptors and first application with new packages adaptors
akheireddine Jun 13, 2017
439b0c0
mv irunner to package concurrent
akheireddine Jun 13, 2017
45d3079
dependence fixed between adaptors and application
akheireddine Jun 13, 2017
eda97a4
dependence pnmcc fixed
akheireddine Jun 13, 2017
c24c4cc
up final packages rearrange
akheireddine Jun 13, 2017
b70c5f5
nullpointeurexception fixed
akheireddine Jun 13, 2017
e8d339b
last maj befor adding problem to application
akheireddine Jun 14, 2017
35f66cd
last modif concurrent
akheireddine Jun 14, 2017
3439f6b
other algo for observable using wait
akheireddine Jun 14, 2017
ddaebe0
fixing termination of running threads
akheireddine Jun 15, 2017
dc5841b
before fixing its
akheireddine Jun 16, 2017
68019f8
new listener i/o
akheireddine Jun 19, 2017
d647f35
up
akheireddine Jun 19, 2017
7a54a04
set Listener and fixe minor errors
akheireddine Jun 20, 2017
7197313
fixe dependencies
akheireddine Jun 21, 2017
0f5c123
starting commenting and reorganize the project
akheireddine Jun 23, 2017
e8c0717
wrong impl listener I/O
akheireddine Jun 23, 2017
d4841e7
reorder the struct of interprete observable
akheireddine Jun 23, 2017
912dd3d
snc executors (solvers and interpreters
akheireddine Jun 26, 2017
c39c391
Final version with interpreters and sync between solvers/interp
akheireddine Jun 27, 2017
be98807
concurrence done but busy waiting method
akheireddine Jun 29, 2017
87a84e7
final maj interpreter/solver obs
akheireddine Jun 30, 2017
ec9444f
comments
akheireddine Jul 3, 2017
53cca0b
add runeclipse.sh
akheireddine Jul 3, 2017
7f0030d
bad parent path
akheireddine Jul 4, 2017
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 1 addition & 9 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,6 @@ script :
- zip -d fr.lip6.move.gal.itscl.product-macosx.cocoa.x86_64.zip '*its-*-win64' '*its-*-linux32' '*its-*-linux64'
- zip -d fr.lip6.move.gal.itscl.product-win32.win32.x86_64.zip '*its-*-linux64' '*its-*-linux32' '*its-*-Darwin'
- cd ..
- ./install_eclipse.sh
- cd eclipse/plugins/fr.lip6.move.gal.itstools.binaries_1.0.0.*/bin/
- \rm *Darwin* *linux32* *win64*
- cd -
- tar czf itscl_linux.tgz eclipse/ runeclipse.sh
- mv itscl_linux.tgz website/
- ls -lah website/

deploy:
Expand All @@ -34,6 +28,4 @@ deploy:
on:
branch: master

after_deploy:
- curl -s -X POST -H "Content-Type:application/json" -H "Accept:application/json" -H "Travis-API-Version:3" -H "Authorization:token $APITOKEN" -d '{"request":{"message":"Triggered by ITS Tools build.","branch":"master"}}' https://api.travis-ci.org/repo/yanntm%2FITS-Tools-pnmcc/requests


3 changes: 2 additions & 1 deletion fr.lip6.move.gal.itscl.application/.classpath
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src/"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="lib" path="/local/akheireddine/eclipses/eclipse/plugins/ch.qos.logback.classic_1.0.7.v20121108-1250.jar"/>
<classpathentry kind="output" path="target/classes"/>
</classpath>
2 changes: 1 addition & 1 deletion fr.lip6.move.gal.itscl.application/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ Require-Bundle: org.eclipse.core.runtime,
fr.lip6.move.gal,
fr.lip6.move.gal.itstools.binaries,
org.antlr.runtime;bundle-version="[3.2.0,3.3.0]",
fr.lip6.move.gal.application.pnmcc;bundle-version="1.0.0"
fr.lip6.move.gal.itscl.concurrent;bundle-version="1.0.0"
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Bundle-Vendor: UPMC/CNRS, LIP6
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
package fr.lip6.move.gal.itscl.application;


import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.FutureTask;

import org.eclipse.equinox.app.IApplication;
import org.eclipse.equinox.app.IApplicationContext;
Expand All @@ -15,9 +18,10 @@
import fr.lip6.move.gal.SafetyProp;
import fr.lip6.move.gal.Specification;
import fr.lip6.move.gal.instantiate.GALRewriter;
import fr.lip6.move.gal.itscl.interpreter.InterpreteObservable;
import fr.lip6.move.gal.itscl.modele.SolverObservable;
import fr.lip6.move.gal.itstools.CommandLine;
import fr.lip6.move.gal.itstools.CommandLineBuilder;
import fr.lip6.move.gal.itstools.Runner;
import fr.lip6.move.gal.itstools.BinaryToolsPlugin.Tool;
import fr.lip6.move.serialization.SerializationUtil;

Expand All @@ -28,28 +32,32 @@ public class Application implements IApplication {
private static final String REACH_EXAM = "-reach";
private static final String CTL_EXAM = "-ctl";
private static final String LTL_EXAM = "-ltl";

/* (non-Javadoc)
* @see org.eclipse.equinox.app.IApplication#start(org.eclipse.equinox.app.IApplicationContext)

private ExecutorService exec;

/*
* (non-Javadoc)
*
* @see org.eclipse.equinox.app.IApplication#start(org.eclipse.equinox.app.
* IApplicationContext)
*/
@Override
public Object start(IApplicationContext context) throws Exception {

String [] args = (String[]) context.getArguments().get(APPARGS);

if (Arrays.asList(args).contains("-pnfolder")) {
return new fr.lip6.move.gal.application.Application().start(context);
}

String[] args = (String[]) context.getArguments().get(APPARGS);

String inputff = null;
@SuppressWarnings("unused")
String inputType = null;

Tool tool = Tool.reach;
boolean doIts = false;
for (int i=0; i < args.length ; i++) {

for (int i = 0; i < args.length; i++) {
if (INPUT_FILE.equals(args[i])) {
inputff = args[++i];
} else if (INPUT_TYPE.equals(args[i])) {
inputType = args[++i];
inputType = args[++i];
} else if (REACH_EXAM.equals(args[i])) {
tool = Tool.reach;
doIts = true;
Expand All @@ -59,88 +67,141 @@ public Object start(IApplicationContext context) throws Exception {
} else if (LTL_EXAM.equals(args[i])) {
tool = Tool.ltl;
doIts = true;
// } else if (LTSMINPATH.equals(args[i])) {
// ltsminpath = args[++i];
// doLTSmin = true;
// } else if (ITS.equals(args[i])) {
// doITS = true;
// } else if (disablePOR.equals(args[i])) {
// doPOR = false;
// } else if (ONLYGAL.equals(args[i])) {
// onlyGal = true;
// } else if (LTSMINPATH.equals(args[i])) {
// ltsminpath = args[++i];
// doLTSmin = true;
// } else if (ITS.equals(args[i])) {
// doITS = true;
// } else if (disablePOR.equals(args[i])) {
// doPOR = false;
// } else if (ONLYGAL.equals(args[i])) {
// onlyGal = true;
}
}

if (inputff == null) {
System.err.println("Please provide input file with -i option");
return null;
}


if (!doIts) {
System.err.println("Please provide tool (ex: reach, ctl, ltl...)");
}

File ff = new File(inputff);
if (! ff.exists()) {
System.err.println("Input file "+inputff +" does not exist");
if (!ff.exists()) {
System.err.println("Input file " + inputff + " does not exist");
return null;
}

String pwd = ff.getParent();
String modelName = ff.getName().replace(".gal", "");
SerializationUtil.setStandalone(true);


// parse l'entrée
long time = System.currentTimeMillis();
Specification spec = SerializationUtil.fileToGalSystem(inputff);
System.out.println("Successfully read input file : " + inputff +" in " + (time - System.currentTimeMillis()) + " ms.");
Specification spec = SerializationUtil.fileToGalSystem(inputff);
System.out.println(
"Successfully read input file : " + inputff + " in " + (time - System.currentTimeMillis()) + " ms.");

time = System.currentTimeMillis();
ProblemSS p = loadModel(pwd, spec, tool);
System.out.println("Simplifications done in " + (time - System.currentTimeMillis()) + " ms.");

time = System.currentTimeMillis();
CommandLine cl = getCmdLine(spec, p.getFolder(), modelName, tool);
System.out.println("Built GAL and property files in " + (time - System.currentTimeMillis()) + " ms.");
SolverObservable superRunner = new SolverObservable();
exec = Executors.newSingleThreadExecutor();
InterpreteObservable interpRunner = new InterpreteObservable(superRunner);
SolverSeq s = new SolverSeq(p, cl);

superRunner.attach(s);
// run les solvers
FutureTask<Boolean> executeRunner = new FutureTask<>(superRunner);
Thread futureTh = new Thread(executeRunner);
FutureTask<Boolean> executeInterp = new FutureTask<>(interpRunner);
Thread futureTh2 = new Thread(executeInterp);

futureTh.start();
futureTh2.start();

Boolean result = executeRunner.get();
Boolean result2 = executeInterp.get();

if (futureTh != null)
futureTh.join();
if (futureTh2 != null)
futureTh2.join();
System.out.println("Operation reussi ? " + result + ". And Interpreter ? "+result2);
return IApplication.EXIT_OK;
}

// Traitement du problème : transformations + simplifications
public ProblemSS loadModel(String pwd, Specification spec, Tool tool) throws IOException {

String cwd = pwd + "/work";
File fcwd = new File(cwd);
if (! fcwd.exists()) {
if (! fcwd.mkdir()) {
System.err.println("Could not set up work folder in "+cwd);
if (!fcwd.exists()) {
if (!fcwd.mkdir()) {
System.err.println("Could not set up work folder in " + cwd);
}
}

time = System.currentTimeMillis();
}
GALRewriter.flatten(spec, true);
System.out.println("Simplifications done in " + (time - System.currentTimeMillis()) + " ms.");

time = System.currentTimeMillis();
String outpath = cwd+"/"+ modelName + ".gal";
ProblemSS p = new ProblemSS(tool, cwd);
p.configure(spec, 35000);

return p;
}

/**
* // On produit un fichier de modèle pour l'outil ligne de commande
* @param spec
* @param cwd
* @param modelName
* @param tool
* @return
* @throws IOException
*/
public CommandLine getCmdLine(Specification spec, String cwd, String modelName, Tool tool) throws IOException {

String outpath = cwd + "/" + modelName + ".gal";
outputGalFile(spec, outpath);

CommandLine cl = buildCommandLine(outpath, tool);

if (tool == Tool.reach) {
spec.getProperties().removeIf( (p) -> ! (p.getBody() instanceof SafetyProp) );
String proppath = cwd + "/" +modelName +".prop";
spec.getProperties().removeIf((p) -> !(p.getBody() instanceof SafetyProp));
String proppath = cwd + "/" + modelName + ".prop";
SerializationUtil.serializePropertiesForITSTools(outpath, spec.getProperties(), proppath);
cl.addArg("-reachable-file");
cl.addArg(proppath);
// cl.addArg("--stats");
} else if (tool == Tool.ctl) {
spec.getProperties().removeIf( (p) -> ! (p.getBody() instanceof CTLProp) );
String proppath = cwd + "/" +modelName +".ctl";
spec.getProperties().removeIf((p) -> !(p.getBody() instanceof CTLProp));
String proppath = cwd + "/" + modelName + ".ctl";
SerializationUtil.serializePropertiesForITSCTLTools(outpath, spec.getProperties(), proppath);
cl.addArg("-ctl");
cl.addArg(proppath);
} else if (tool == Tool.ltl) {
spec.getProperties().removeIf( (p) -> ! (p.getBody() instanceof LTLProp) );
String proppath = cwd + "/" +modelName +".ltl";
spec.getProperties().removeIf((p) -> !(p.getBody() instanceof LTLProp));
String proppath = cwd + "/" + modelName + ".ltl";
SerializationUtil.serializePropertiesForITSLTLTools(outpath, spec.getProperties(), proppath);
cl.addArg("-LTL");
cl.addArg(proppath);
cl.addArg(proppath);
cl.addArg("-c");
cl.addArg("-stutter-deadlock");
}
if (cl != null) {
cl.setWorkingDir(new File(cwd));
}
System.out.println("Built GAL and proeprty files in "+ (time - System.currentTimeMillis()) + " ms.");

Runner.runTool(3500, cl, System.out, true);

return IApplication.EXIT_OK;

return cl;

}

public void outputGalFile(Specification spec, String outpath) throws IOException {
if (! spec.getProperties().isEmpty()) {
if (!spec.getProperties().isEmpty()) {
List<Property> props = new ArrayList<Property>(spec.getProperties());
spec.getProperties().clear();
SerializationUtil.systemToFile(spec, outpath);
Expand All @@ -149,17 +210,18 @@ public void outputGalFile(Specification spec, String outpath) throws IOException
SerializationUtil.systemToFile(spec, outpath);
}
}

private CommandLine buildCommandLine(String modelff, Tool tool) throws IOException {
CommandLineBuilder cl = new CommandLineBuilder(tool);
cl.setModelFile(modelff);
cl.setModelType("CGAL");
return cl.getCommandLine();
}

/* (non-Javadoc)
* @see org.eclipse.equinox.app.IApplication#stop()
*/

public void stop() {
exec.shutdown();
if (!exec.isShutdown())
System.out.println("Problem to shutdown executor of runners");
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package fr.lip6.move.gal.itscl.application;


import fr.lip6.move.gal.itscl.interpreter.AbstractInterpreter;
import fr.lip6.move.gal.itscl.interpreter.InterpreteBytArray;

public class InterpreterApp extends AbstractInterpreter {

private InterpreteBytArray bufferWIO;
private SolverSeq sq;

public InterpreterApp(InterpreteBytArray buff, SolverSeq sq) {
this.bufferWIO = buff;
this.sq = sq;
}

public void run() {
String output = bufferWIO.getPout().toString();

if (output.contains("Error"))
sq.setResult();
else
System.out.println(" "+output);

releaseResult();
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package fr.lip6.move.gal.itscl.application;

import fr.lip6.move.gal.itscl.interpreter.IInterpreteObservable;
import fr.lip6.move.gal.itscl.modele.ISolverSeq;
import fr.lip6.move.gal.itstools.CommandLine;

public abstract class ItsSolver implements ISolverSeq {

private final CommandLine cl;
protected final ProblemSS p;
protected IInterpreteObservable inRunner;

public ItsSolver(ProblemSS p, CommandLine cl) {
this.cl = cl;
this.p = p;
}

public CommandLine getCmd() {
return cl;
}

public ProblemSS getProblem() {
return p;
}

public void configureInterpreter(IInterpreteObservable interp){
this.inRunner=interp;
}

}
Loading