Commit db44f34a authored by alexander.weigl's avatar alexander.weigl 🐼

Merge branch 'masterToMerge' into 'master'

Master to merge

See merge request !8
parents a4d6ca6e a7a05d05
Pipeline #17466 failed with stages
......@@ -31,12 +31,12 @@ import lombok.Setter;
import org.antlr.v4.runtime.ParserRuleContext;
import javax.annotation.Nullable;
import java.util.Objects;
/**
* @author Alexander Weigl
* @version 1 (27.04.17)
*/
@EqualsAndHashCode
public abstract class ASTNode<T extends ParserRuleContext>
implements Visitable, Copyable<ASTNode<T>> {
/**
......@@ -139,4 +139,17 @@ public abstract class ASTNode<T extends ParserRuleContext>
} while (n != null);
return depth;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
ASTNode<?> astNode = (ASTNode<?>) o;
return Objects.equals(getRuleContext(), astNode.getRuleContext());
}
@Override
public int hashCode() {
return Objects.hash(getRuleContext());
}
}
......@@ -25,16 +25,16 @@ package edu.kit.iti.formal.psdbg.parser.ast;
import edu.kit.iti.formal.psdbg.parser.ScriptLanguageParser;
import edu.kit.iti.formal.psdbg.parser.Visitor;
import lombok.Data;
import lombok.Getter;
import lombok.NonNull;
import lombok.Setter;
import lombok.*;
import java.util.Objects;
/**
* @author Alexander Weigl
* @version 1 (27.04.17)
*/
@Data
@EqualsAndHashCode(callSuper = false)
public class ProofScript extends ASTNode<ScriptLanguageParser.ScriptContext> {
@NonNull
@Getter
......@@ -73,4 +73,19 @@ public class ProofScript extends ASTNode<ScriptLanguageParser.ScriptContext> {
return getBody() != null ? getBody().eq(that.getBody()) : that.getBody() == null;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
if (!super.equals(o)) return false;
ProofScript that = (ProofScript) o;
return Objects.equals(getName(), that.getName()) &&
Objects.equals(getSignature(), that.getSignature()) &&
Objects.equals(getBody(), that.getBody());
}
@Override
public int hashCode() {
return Objects.hash(super.hashCode(), getName(), getSignature(), getBody());
}
}
package edu.kit.iti.formal.psdbg;
import de.uka.ilkd.key.java.Services;
import de.uka.ilkd.key.logic.Name;
import de.uka.ilkd.key.logic.PosInOccurrence;
import de.uka.ilkd.key.logic.PosInTerm;
import de.uka.ilkd.key.logic.SequentFormula;
import de.uka.ilkd.key.macros.scripts.RuleCommand;
import de.uka.ilkd.key.proof.Goal;
import de.uka.ilkd.key.proof.Proof;
import de.uka.ilkd.key.proof.RuleAppIndex;
import de.uka.ilkd.key.proof.rulefilter.TacletFilter;
import de.uka.ilkd.key.rule.*;
import org.key_project.util.collection.ImmutableList;
import org.key_project.util.collection.ImmutableSLList;
import java.util.ArrayList;
import java.util.List;
public class RuleCommandHelper {
private final Proof proof;
private final Services services;
private final Goal g;
private final RuleCommand.Parameters parameters;
public RuleCommandHelper(Goal g, RuleCommand.Parameters parameters) {
this.proof = g.proof();
this.services = proof.getServices();
this.g = g;
this.parameters = parameters;
}
public int getOccurence(TacletApp app) {
List<TacletApp> apps = getTacletApps();
if (apps.isEmpty()) {
return -1;
}
if(apps.size()==1) {
return 0;
}
return 0;
//return apps.indexOf(app);
}
private List<TacletApp> getTacletApps() {
ImmutableList<TacletApp> allApps = findAllTacletApps();
return filterList(allApps);
}
public ImmutableList<TacletApp> findAllTacletApps() {
TacletFilter filter = new TacletNameFilter(parameters.rulename);
RuleAppIndex index = g.ruleAppIndex();
index.autoModeStopped();
ImmutableList<TacletApp> allApps = ImmutableSLList.nil();
for (SequentFormula sf : g.node().sequent().antecedent()) {
if (parameters.formula != null && !sf.formula().equalsModRenaming(parameters.formula)) {
continue;
}
allApps = allApps.append(index.getTacletAppAtAndBelow(filter,
new PosInOccurrence(sf, PosInTerm.getTopLevel(), true),
services));
}
for (SequentFormula sf : g.node().sequent().succedent()) {
if (parameters.formula != null && !sf.formula().equalsModRenaming(parameters.formula)) {
continue;
}
allApps = allApps.append(index.getTacletAppAtAndBelow(filter,
new PosInOccurrence(sf, PosInTerm.getTopLevel(), false),
services));
}
return allApps;
}
/*
* Filter those apps from a list that are according to the parameters.
*/
private List<TacletApp> filterList(ImmutableList<TacletApp> list) {
List<TacletApp> matchingApps = new ArrayList<TacletApp>();
for (TacletApp tacletApp : list) {
if (tacletApp instanceof PosTacletApp) {
PosTacletApp pta = (PosTacletApp) tacletApp;
if (parameters.on == null || pta.posInOccurrence().subTerm()
.equalsModRenaming(parameters.on)) {
matchingApps.add(pta);
}
}
}
return matchingApps;
}
private static class TacletNameFilter extends TacletFilter {
private final Name rulename;
public TacletNameFilter(String rulename) {
this.rulename = new Name(rulename);
}
@Override
protected boolean filter(Taclet taclet) {
return taclet.name().equals(rulename);
}
}
}
......@@ -156,7 +156,7 @@ public class KeYMatcher implements MatcherApi<KeyData> {
}
assignments.forEach(variableAssignment -> System.out.println(variableAssignment));
// assignments.forEach(variableAssignment -> System.out.println(variableAssignment));
return assignments.isEmpty()? null: assignments;
}
......@@ -198,11 +198,11 @@ public class KeYMatcher implements MatcherApi<KeyData> {
Value<String> value = toValueTerm(currentState.getData(), matched);
va.declare(s, value.getType());
va.assign(s, value);
LOGGER.error("Variables to match " + s + " : " + value);
//LOGGER.info("Variables to match " + s + " : " + value);
}
}
List<VariableAssignment> retList = new LinkedList();
LOGGER.error("Matched Variables " + va.toString());
LOGGER.info("Matched Variables " + va.toString());
retList.add(va);
return retList;
}
......
......@@ -21,7 +21,6 @@ import org.key_project.util.collection.ImmutableList;
import java.io.File;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.stream.Collectors;
......@@ -201,6 +200,9 @@ public class KeYProofFacade {
public void setEnvironment(KeYEnvironment environment) {
this.environment.set(environment);
if (environment != null) {
getEnvironment().getUi().getProofControl().setMinimizeInteraction(true);
}
}
public SimpleObjectProperty<KeYEnvironment> environmentProperty() {
......@@ -233,7 +235,7 @@ public class KeYProofFacade {
ImmutableList<Goal> openGoals = p.getSubtreeGoals(p.root());
List<GoalNode<KeyData>> goals = openGoals.stream().map(g ->
new GoalNode<>(null, new KeyData(g, env, p), false))
.collect(Collectors.toList());
.collect(Collectors.toList());
return goals;
}
......
<!DOCTYPE html>
<html lang="en">
<head>
<body>
This command is currently not supported by PSDBG.
</body>
</html>
\ No newline at end of file
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>smt</title>
</head>
<body>
<h2 id="smt">smt</h2>
<blockquote>
<p>Synopsis: <code>cut TERM</code></p>
</blockquote>
<p></strong>Description:</strong>
Performs a cut and thus splits the sequent into two goals. The unnamed
argument is the formula to cut with
</p>
<p><strong>Arguments:</strong></p>
<ul>
<li><em>TERM</em> formula to cut with</li>
</ul>
Examples:
<code>cut `value1 = value2`;</code>
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<body>
This command is currently not supported by PSDBG.
</body>
</html>
\ No newline at end of file
<!DOCTYPE html>
<html lang="en">
<head>
<body>
This command is currently not supported by PSDBG.
</body>
</html>
\ No newline at end of file
......@@ -11,10 +11,10 @@
</blockquote>
<p><strong>Arguments:</strong></p>
<ul>
<li><code>formula</code> : <em>TERM</em> (<em>R</em>)null</li>
<li><code>var</code> : <em>STRING</em> (<em>R</em>)null</li>
<li><code>occ</code> : <em>INT</em> (<em>R</em>)null</li>
<li><code>with</code> : <em>TERM</em> (<em>R</em>)null</li>
<li><code>formula</code> : <em>TERM</em> top-level formula where variables should be instantiated</li>
<li><code>var</code> : <em>STRING</em> the variable name that shoudl be instantiated</li>
<li><code>occ</code> : <em>INT</em> occurence of the top-level formula</li>
<li><code>with</code> : <em>TERM</em> the term with which variables should be instantiated</li>
</ul>
</body>
</html>
\ No newline at end of file
<!DOCTYPE html>
<html lang="en">
<head>
<body>
This command is currently not supported by PSDBG.
</body>
</html>
\ No newline at end of file
<html lang="en">
<head>
<body>
This command is currently not supported by PSDBG.
</body>
</html>
\ No newline at end of file
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
</body>
</html>
\ No newline at end of file
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>macro</title>
</head>
<body>
<h2 id="macro">macro</h2>
<blockquote>
<p>Synopsis: <code>macro macroname </code></p>
</blockquote>
<p></strong>Description:</strong>
The macro command applies the macro specified as argument
</p>
<code>macro</code> keyword can be ommited
<p><strong>Arguments:</strong></p>
<ul>
<li>macroname : <em>STRING</em> name of macro to apply</li>
</ul>
</body>
</html>
\ No newline at end of file
<!DOCTYPE html>
<html lang="en">
<head>
<body>
This command is currently not supported by PSDBG.
</body>
</html>
\ No newline at end of file
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Call to subscripts</title>
</head>
<body>
<h2 id="script">Call to subscripts</h2>
<blockquote>
<p>Synopsis: <code>scriptname; </code></p>
</blockquote>
Call of a subscript.
<p><strong>Arguments:</strong></p>
Arguments according to the subscript's declaration.
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<body>
This command is currently not supported by PSDBG.
</body>
</html>
\ No newline at end of file
<!DOCTYPE html>
<html lang="en">
<head>
<body>
This command is currently not supported by PSDBG.
</body>
</html>
\ No newline at end of file
<!DOCTYPE html>
<html lang="en">
<head>
<body>
This command is currently not supported by PSDBG.
</body>
</html>
\ No newline at end of file
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>smt</title>
</head>
<body>
<h2 id="smt">smt</h2>
<blockquote>
<p>Synopsis: <code>smt solver=&lt;STRING&gt;</code></p>
</blockquote>
<p></strong>Description:</strong>
Invoke an external SMT solver. That solver must be adequately
configured outside the script mechanism. By default, Z3 is invoked,
but that can be chosen.
</p>
<p><strong>Arguments:</strong></p>
<ul>
<li>solver : <em>STRING</em> comma separated list of SMT solvers (currently supported: "z3", "yices")</li>
</ul>
</body>
</html>
\ No newline at end of file
......@@ -2,12 +2,12 @@
<html lang="en">
<head>
<meta charset="UTF-8">
<title>autopilot-prep</title>
<title>autopilot_prep</title>
</head>
<body>
<h2 id="autopilot-prep">autopilot-prep</h2>
<h2 id="autopilot-prep">autopilot_prep</h2>
<blockquote>
<p>Synopsis: <code>autopilot-prep;</code></p>
<p>Synopsis: <code>autopilot_prep;</code></p>
</blockquote>
<p><strong></strong>Description:</strong></strong></p>
This macro performs the following steps:
......
......@@ -2,12 +2,12 @@
<html lang="en">
<head>
<meta charset="UTF-8">
<title>infflow-autopilot</title>
<title>infflow_autopilot</title>
</head>
<body>
<h2 id="infflow-autopilot">infflow-autopilot</h2>
<h2 id="infflow-autopilot">infflow_autopilot</h2>
<blockquote>
<p>Synopsis: <code>infflow-autopilot;</code></p>
<p>Synopsis: <code>infflow_autopilot;</code></p>
</blockquote>
<p><strong></strong>Description:</strong></strong></p>
This macro is tailored to information flow problems.
......
......@@ -2,12 +2,12 @@
<html lang="en">
<head>
<meta charset="UTF-8">
<title>nosplit-prop</title>
<title>nosplit_prop</title>
</head>
<body>
<h2 id="symbex">nosplit-prop</h2>
<h2 id="symbex">nosplit_prop</h2>
<blockquote>
<p>Synopsis: <code>nosplit-prop;</code></p>
<p>Synopsis: <code>nosplit_prop;</code></p>
</blockquote>
<p><strong></strong>Description:</strong></strong></p>
This macros applies rules to decompose propositional toplevel formulas without applying splitting rules.
......
......@@ -2,12 +2,12 @@
<html lang="en">
<head>
<meta charset="UTF-8">
<title>simp-heap</title>
<title>simp_heap</title>
</head>
<body>
<h2 id="symbex">simp-heap</h2>
<h2 id="symbex">simp_heap</h2>
<blockquote>
<p>Synopsis: <code>simp-heap;</code></p>
<p>Synopsis: <code>simp_heap;</code></p>
</blockquote>
<p><strong></strong>Description:</strong></strong></p>
This macro performs simplification of Heap and LocSet terms.
......
......@@ -2,12 +2,12 @@
<html lang="en">
<head>
<meta charset="UTF-8">
<title>simp-int</title>
<title>simp_int</title>
</head>
<body>
<h2 id="symbex">simp-int</h2>
<h2 id="symbex">simp_int</h2>
<blockquote>
<p>Synopsis: <code>simp-int;</code></p>
<p>Synopsis: <code>simp_int;</code></p>
</blockquote>
<p><strong></strong>Description:</strong></strong></p>
This macro performs simplification of integers and terms with integers.
......
......@@ -2,12 +2,12 @@
<html lang="en">
<head>
<meta charset="UTF-8">
<title>simp-upd</title>
<title>simp_upd</title>
</head>
<body>
<h2 id="simp-upd">simp-upd</h2>
<h2 id="simp-upd">simp_upd</h2>
<blockquote>
<p>Synopsis: <code>simp-upd;</code></p>
<p>Synopsis: <code>simp_upd;</code></p>
</blockquote>
<p><strong></strong>Description:</strong></strong></p>
This macro applies only update simplification rules, i.e., that simplify the update term.
......
......@@ -5,9 +5,9 @@
<title>split-prop</title>
</head>
<body>
<h2 id="symbex">split-prop</h2>
<h2 id="symbex">split_prop</h2>
<blockquote>
<p>Synopsis: <code>split-prop;</code></p>
<p>Synopsis: <code>split_prop;</code></p>
</blockquote>
<p><strong></strong>Description:</strong></strong></p>
This macros applies rules to decompose propositional toplevel formulas and also applies splitting rules.
......
......@@ -72,6 +72,31 @@
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
<archive>
<manifest>
<mainClass>edu.kit.iti.formal.psdbg.gui.ProofScriptDebugger</mainClass>
</manifest>
</archive>
</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
<!--HIER EVTL. PLUGIN HIN-->
<plugin>
<groupId>org.lesscss</groupId>
<artifactId>lesscss-maven-plugin</artifactId>
......@@ -92,12 +117,12 @@
</plugin>
<!--
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>2.4.3</version>
<configuration>
<!-- put your configurations here -->
</configuration>
<executions>
<execution>
......@@ -120,6 +145,7 @@
</execution>
</executions>
</plugin>
-->
<plugin>
<groupId>org.antlr</groupId>
<artifactId>antlr4-maven-plugin</artifactId>
......@@ -149,10 +175,10 @@
<name>bintray</name>
<url>http://dl.bintray.com/jerady/maven</url>
</repository>
<repository>
<id>sonatype</id>
<url>https://oss.sonatype.org/content/repositories/snapshots/</url>
</repository>
<repository>
<id>sonatype</id>
<url>https://oss.sonatype.org/content/repositories/snapshots/</url>
</repository>
</repositories>
......
......@@ -15,9 +15,12 @@ import java.nio.charset.Charset;
public class JavaExample extends Example {
private URL projectFile;
public void setJavaFile(URL javaFile) {
this.javaFile = javaFile;
}
//public void setProjectFile(URL projectFile){this.projectFile = projectFile;}
protected URL javaFile;
......
......@@ -9,7 +9,7 @@ public class QuickSort extends JavaExample {
setName("Quicksort example");
setHelpText(null);
setHelpText(getClass().getResource("help.html"));
setJavaFile(getClass().
......
......@@ -6,7 +6,7 @@ public class JavaSimpleExample extends JavaExample {
public JavaSimpleExample() {
setName("Simple Java Example");
setJavaFile(this.getClass().getResource("Test.java"));
setJavaFile(this.getClass().getResource("Simple.java"));
defaultInit(getClass());
}
}
package edu.kit.iti.formal.psdbg.examples.lulu.bigIntProof;
import edu.kit.iti.formal.psdbg.examples.JavaExample;
public class BigIntExample extends JavaExample {
public BigIntExample() {
}
}
......@@ -29,7 +29,7 @@ import java.util.Locale;
public class ProofScriptDebugger extends Application {
public static final String NAME = "Proof Script Debugger";
public static final String VERSION = "0.1";
public static final String VERSION = "1.0-FM";