Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
ProofScriptParser
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
24
Issues
24
List
Boards
Labels
Service Desk
Milestones
Merge Requests
4
Merge Requests
4
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
sarah.grebing
ProofScriptParser
Commits
87f25c1a
Commit
87f25c1a
authored
Jan 19, 2018
by
Sarah Grebing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
NPE und Fehlerbehandlung
parent
c60feb1b
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
82 additions
and
37 deletions
+82
-37
rt-key/src/main/java/edu/kit/iti/formal/psdbg/interpreter/funchdl/ProofScriptCommandBuilder.java
.../psdbg/interpreter/funchdl/ProofScriptCommandBuilder.java
+8
-5
rt-key/src/main/java/edu/kit/iti/formal/psdbg/interpreter/funchdl/RuleCommandHandler.java
.../formal/psdbg/interpreter/funchdl/RuleCommandHandler.java
+9
-5
rt-key/src/main/resources/edu/kit/iti/formal/psdbg/commands/rule.html
...ain/resources/edu/kit/iti/formal/psdbg/commands/rule.html
+21
-0
ui/src/main/java/edu/kit/iti/formal/psdbg/gui/controller/DebuggerMain.java
...edu/kit/iti/formal/psdbg/gui/controller/DebuggerMain.java
+5
-5
ui/src/main/java/edu/kit/iti/formal/psdbg/gui/controls/ScriptController.java
...u/kit/iti/formal/psdbg/gui/controls/ScriptController.java
+1
-1
ui/src/main/java/edu/kit/iti/formal/psdbg/gui/graph/Graph.java
...c/main/java/edu/kit/iti/formal/psdbg/gui/graph/Graph.java
+24
-20
ui/src/main/resources/edu/kit/iti/formal/psdbg/examples/fol/script.kps
...esources/edu/kit/iti/formal/psdbg/examples/fol/script.kps
+14
-1
No files found.
rt-key/src/main/java/edu/kit/iti/formal/psdbg/interpreter/funchdl/ProofScriptCommandBuilder.java
View file @
87f25c1a
...
...
@@ -4,7 +4,6 @@ import de.uka.ilkd.key.control.AbstractUserInterfaceControl;
import
de.uka.ilkd.key.control.DefaultUserInterfaceControl
;
import
de.uka.ilkd.key.macros.scripts.EngineState
;
import
de.uka.ilkd.key.macros.scripts.ProofScriptCommand
;
import
de.uka.ilkd.key.macros.scripts.meta.ProofScriptArgument
;
import
de.uka.ilkd.key.proof.Goal
;
import
de.uka.ilkd.key.proof.Node
;
import
edu.kit.iti.formal.psdbg.interpreter.Interpreter
;
...
...
@@ -15,10 +14,14 @@ import edu.kit.iti.formal.psdbg.interpreter.data.VariableAssignment;
import
edu.kit.iti.formal.psdbg.parser.ast.CallStatement
;
import
lombok.Getter
;
import
lombok.RequiredArgsConstructor
;
import
org.apache.commons.io.IOUtils
;
import
org.apache.logging.log4j.LogManager
;
import
org.apache.logging.log4j.Logger
;
import
org.key_project.util.collection.ImmutableList
;
import
java.io.IOException
;
import
java.net.URISyntaxException
;
import
java.net.URL
;
import
java.util.Collection
;
import
java.util.HashMap
;
import
java.util.Iterator
;
...
...
@@ -104,17 +107,17 @@ public class ProofScriptCommandBuilder implements CommandHandler<KeyData> {
@Override
public
String
getHelp
(
CallStatement
call
)
{
ProofScriptCommand
c
=
commands
.
get
(
call
.
getCommand
());
/*
URL res = getClass().getResource("/edu/kit/iti/formal/psdbg/commands/" + call.getCommand() + ".html");
URL
res
=
getClass
().
getResource
(
"/edu/kit/iti/formal/psdbg/commands/"
+
call
.
getCommand
()
+
".html"
);
try
{
return
IOUtils
.
toString
(
res
.
toURI
(),
"utf-8"
);
}
catch
(
NullPointerException
|
IOException
|
URISyntaxException
e
)
{
return
"No Help found for "
+
call
.
getCommand
();
}
*/
}
StringBuilder
html
=
new
StringBuilder
();
/*
StringBuilder html = new StringBuilder();
html.append("<html><head><style>body {font-family: monospace;}</style></head><body>");
...
...
@@ -164,6 +167,6 @@ public class ProofScriptCommandBuilder implements CommandHandler<KeyData> {
html.append("</body></html>");
return html.toString();
*/
}
}
rt-key/src/main/java/edu/kit/iti/formal/psdbg/interpreter/funchdl/RuleCommandHandler.java
View file @
87f25c1a
...
...
@@ -41,6 +41,7 @@ import java.util.Set;
*/
@RequiredArgsConstructor
public
class
RuleCommandHandler
implements
CommandHandler
<
KeyData
>
{
private
static
final
Logger
LOGGER
=
LogManager
.
getLogger
(
RuleCommandHandler
.
class
);
@Getter
...
...
@@ -122,14 +123,17 @@ public class RuleCommandHandler implements CommandHandler<KeyData> {
KeyData
kdn
=
new
KeyData
(
kd
,
g
.
node
());
state
.
getGoals
().
add
(
new
GoalNode
<>(
expandedNode
,
kdn
,
kdn
.
getNode
().
isClosed
()));
}
}
catch
(
Exception
e
)
{
if
(
e
.
getClass
().
equals
(
ScriptException
.
class
))
{
System
.
out
.
println
(
"e.getMessage() = "
+
e
.
getMessage
());
}
catch
(
ScriptException
e
)
{
if
(
interpreter
.
isStrictMode
())
{
throw
new
ScriptCommandNotApplicableException
(
e
,
c
,
map
);
}
else
{
throw
new
RuntimeException
(
e
);
//Utils necessary oder schmeißen
LOGGER
.
error
(
"Command "
+
call
.
getCommand
()
+
" is not applicable in line "
+
call
.
getRuleContext
().
getStart
().
getLine
());
}
}
catch
(
InterruptedException
e
)
{
e
.
printStackTrace
();
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
}
...
...
rt-key/src/main/resources/edu/kit/iti/formal/psdbg/commands/rule.html
0 → 100644
View file @
87f25c1a
<!DOCTYPE html>
<html
lang=
"en"
>
<head>
<meta
charset=
"UTF-8"
>
<title>
rule
</title>
</head>
<body>
<h2
id=
"rule"
>
Rule Application
</h2>
<blockquote>
<p>
Synopsis:
<code>
rule tacletname on=
<
TERM
>
formula=
<
TERM
>
occ=
<
INT
>
</code></p>
</blockquote>
Rule keyword can be ommited
<p><strong>
Arguments:
</strong></p>
<ul>
<li>
rulename :
<em>
STRING
</em>
name of taclet to apply
</li>
<li><code>
on
</code>
:
<em>
TERM
</em>
(find term of the taclet)
</li>
<li><code>
formula
</code>
:
<em>
TERM
</em>
(top-level formula in which term appears)
</li>
<li><code>
occ
</code>
:
<em>
INT
</em>
(occurrence number of term formula in sequent)
</li>
</ul>
</body>
</html>
ui/src/main/java/edu/kit/iti/formal/psdbg/gui/controller/DebuggerMain.java
View file @
87f25c1a
...
...
@@ -282,17 +282,15 @@ public class DebuggerMain implements Initializable {
* @see {@link #handleStatePointer(PTreeNode)}
*/
private
void
handleStatePointerUI
(
PTreeNode
<
KeyData
>
node
)
{
if
(
node
!=
null
)
{
graph
.
addPartiallyAndMark
(
node
);
getInspectionViewsController
().
getActiveInspectionViewTab
().
activate
(
node
,
node
.
getStateBeforeStmt
());
scriptController
.
getDebugPositionHighlighter
().
highlight
(
node
.
getStatement
());
}
else
{
getInspectionViewsController
().
getActiveInspectionViewTab
().
getFrames
().
getItems
().
clear
();
scriptController
.
getDebugPositionHighlighter
().
remove
();
}
graph
.
addPartiallyAndMark
(
node
);
}
private
void
marriageJavaCode
()
{
...
...
@@ -514,6 +512,7 @@ public class DebuggerMain implements Initializable {
State
<
KeyData
>
lastState
=
statePointer
.
getStateAfterStmt
();
getInspectionViewsController
().
getActiveInspectionViewTab
().
activate
(
statePointer
,
lastState
);
});
}
...
...
@@ -1008,7 +1007,7 @@ public class DebuggerMain implements Initializable {
}
}
}
else
{
throw
new
RuntimeException
(
"Something went wrong when re
ading stop button
"
);
throw
new
RuntimeException
(
"Something went wrong when re
loading
"
);
}
}
...
...
@@ -1224,6 +1223,7 @@ public class DebuggerMain implements Initializable {
);
node
.
dock
(
dockStation
,
DockPos
.
CENTER
,
scriptController
.
getOpenScripts
().
get
(
getScriptController
().
getMainScript
().
getScriptArea
()));
node
.
requestFocus
();
}
}
...
...
ui/src/main/java/edu/kit/iti/formal/psdbg/gui/controls/ScriptController.java
View file @
87f25c1a
...
...
@@ -312,7 +312,7 @@ public class ScriptController {
getDockNode
(
area
).
focus
();
area
.
requestFocus
();
//area.scrollBy(new Point2D(0, scrollY));
area
.
selectRange
(
0
,
r
.
start
,
0
,
r
.
st
op
);
area
.
selectRange
(
0
,
r
.
start
,
0
,
r
.
st
art
);
lastScriptArea
=
area
;
lastRegion
=
r
;
...
...
ui/src/main/java/edu/kit/iti/formal/psdbg/gui/graph/Graph.java
View file @
87f25c1a
...
...
@@ -72,29 +72,33 @@ public class Graph<T> {
}
public
void
addPartiallyAndMark
(
PTreeNode
<
KeyData
>
node
)
{
Cell
cell
=
addCell
(
node
);
if
(
node
.
getStepOver
()
!=
null
)
{
addEdge
(
node
,
node
.
getStepOver
(),
"over"
);
}
if
(
node
.
getStepInto
()
!=
null
)
{
addEdge
(
node
,
node
.
getStepInto
(),
"into"
);
}
if
(
node
.
getStepInvOver
()
!=
null
)
{
addEdge
(
node
,
node
.
getStepInvOver
(),
"revo"
);
}
if
(
node
.
getStepInvInto
()
!=
null
)
{
addEdge
(
node
,
node
.
getStepInvInto
(),
"otni"
);
}
if
(
node
.
getStepReturn
()
!=
null
)
{
addEdge
(
node
,
node
.
getStepReturn
(),
"rtrn"
);
}
if
(
lastHighlightedCell
!=
null
)
{
lastHighlightedCell
.
getStyleClass
().
remove
(
"current-node"
);
}
cell
.
getStyleClass
().
add
(
"current-node"
);
lastHighlightedCell
=
cell
;
if
(
node
!=
null
)
{
Cell
cell
=
addCell
(
node
);
if
(
node
.
getStepOver
()
!=
null
)
{
addEdge
(
node
,
node
.
getStepOver
(),
"over"
);
}
if
(
node
.
getStepInto
()
!=
null
)
{
addEdge
(
node
,
node
.
getStepInto
(),
"into"
);
}
if
(
node
.
getStepInvOver
()
!=
null
)
{
addEdge
(
node
,
node
.
getStepInvOver
(),
"revo"
);
}
if
(
node
.
getStepInvInto
()
!=
null
)
{
addEdge
(
node
,
node
.
getStepInvInto
(),
"otni"
);
}
if
(
node
.
getStepReturn
()
!=
null
)
{
addEdge
(
node
,
node
.
getStepReturn
(),
"rtrn"
);
}
cell
.
getStyleClass
().
add
(
"current-node"
);
lastHighlightedCell
=
cell
;
}
}
}
}
ui/src/main/resources/edu/kit/iti/formal/psdbg/examples/fol/script.kps
View file @
87f25c1a
// This file is not written yet!!
script main() {
feqff : TERM := `f(c) = f(f(c))`;
ffeqf : TERM := `f(f(c)) = f(c)`;
feqfff: TERM := `f(c) = f(f(f(c)))`;
impRight;
instantiate var=`x` with=`c`;
applyEq on=`f(f(c))` formula=feqfff;
eqSymm on=feqff;
close;
}
script main1() {
impRight;
//instantiate var=`x` with=`c`;
//allLeft formula=`\forall` with=`a`;
allLeft on=`\forall s x; f(f(x)) = f(x)` inst_t=`c`;
//
allLeft on=`\forall s x; f(f(x)) = f(x)` inst_t=`c`;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment