Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
sarah.grebing
ProofScriptParser
Commits
0430bb2f
Commit
0430bb2f
authored
Jan 23, 2018
by
Sarah Grebing
Browse files
FM Version
parent
a4d6ca6e
Pipeline
#17205
failed with stages
in 83 minutes and 57 seconds
Changes
8
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
ui/src/main/java/edu/kit/iti/formal/psdbg/gui/controller/DebuggerMain.java
View file @
0430bb2f
...
...
@@ -136,7 +136,7 @@ public class DebuggerMain implements Initializable {
//-----------------------------------------------------------------------------------------------------------------
private
ProofTree
proofTree
=
new
ProofTree
();
private
DockNode
proofTreeDock
=
new
DockNode
(
proofTree
,
"Proof Tree"
);
private
WelcomePane
welcomePane
=
new
WelcomePane
(
this
);
private
WelcomePane
FMEdition
welcomePane
=
new
WelcomePane
FMEdition
(
this
);
private
DockNode
welcomePaneDock
=
new
DockNode
(
welcomePane
,
"Welcome"
,
new
MaterialDesignIconView
(
MaterialDesignIcon
.
ACCOUNT
));
private
DockNode
activeInspectorDock
;
private
CommandHelp
commandHelp
=
new
CommandHelp
();
...
...
@@ -442,9 +442,8 @@ public class DebuggerMain implements Initializable {
// wait a second!
future
.
get
(
1
,
TimeUnit
.
SECONDS
);
// u
n
gently stop
// u
r
gently stop
model
.
getDebuggerFramework
().
hardStop
();
}
catch
(
InterruptedException
|
ExecutionException
|
TimeoutException
e
)
{
e
.
printStackTrace
();
}
finally
{
...
...
@@ -453,6 +452,7 @@ public class DebuggerMain implements Initializable {
}
else
{
LOGGER
.
info
(
"no interpreter running"
);
}
assert
model
.
getDebuggerFramework
()
==
null
;
}
@FXML
...
...
ui/src/main/java/edu/kit/iti/formal/psdbg/gui/controller/InteractiveModeController.java
View file @
0430bb2f
...
...
@@ -17,6 +17,7 @@ import edu.kit.iti.formal.psdbg.gui.controls.ScriptArea;
import
edu.kit.iti.formal.psdbg.gui.controls.ScriptController
;
import
edu.kit.iti.formal.psdbg.gui.controls.Utils
;
import
edu.kit.iti.formal.psdbg.gui.model.InspectionModel
;
import
edu.kit.iti.formal.psdbg.interpreter.Evaluator
;
import
edu.kit.iti.formal.psdbg.interpreter.data.GoalNode
;
import
edu.kit.iti.formal.psdbg.interpreter.data.KeyData
;
import
edu.kit.iti.formal.psdbg.interpreter.data.VariableAssignment
;
...
...
@@ -25,6 +26,7 @@ import edu.kit.iti.formal.psdbg.interpreter.dbg.PTreeNode;
import
edu.kit.iti.formal.psdbg.interpreter.exceptions.ScriptCommandNotApplicableException
;
import
edu.kit.iti.formal.psdbg.parser.PrettyPrinter
;
import
edu.kit.iti.formal.psdbg.parser.ast.*
;
import
edu.kit.iti.formal.psdbg.parser.data.Value
;
import
edu.kit.iti.formal.psdbg.termmatcher.MatcherFacade
;
import
edu.kit.iti.formal.psdbg.termmatcher.Matchings
;
import
javafx.beans.property.BooleanProperty
;
...
...
@@ -68,6 +70,8 @@ public class InteractiveModeController {
private
Proof
currentProof
;
private
Services
keYServices
;
private
boolean
moreThanOneMatch
=
false
;
public
void
start
(
Proof
currentProof
,
InspectionModel
model
)
{
Events
.
register
(
this
);
cases
.
clear
();
...
...
@@ -134,7 +138,9 @@ public class InteractiveModeController {
@Subscribe
public
void
handle
(
Events
.
TacletApplicationEvent
tap
)
{
LOGGER
.
debug
(
"Handling {}"
,
tap
);
moreThanOneMatch
=
false
;
String
tapName
=
tap
.
getApp
().
taclet
().
displayName
();
Goal
g
=
tap
.
getCurrentGoal
();
...
...
@@ -147,18 +153,16 @@ public class InteractiveModeController {
Parameters
params
=
new
Parameters
();
params
.
put
(
new
Variable
(
"formula"
),
new
TermLiteral
(
term
));
/* if(matches.size() > 1) {
System.out.println("matches = " + matches);
if
(
matches
.
size
()
>
1
)
{
moreThanOneMatch
=
true
;
params
.
put
(
new
Variable
(
"occ"
),
new
StringLiteral
(
"0"
));
Integer integ = new Integer(tap.getPio().sequentFormula().formula().serialNumber());
System.out.println("integ = " + integ);
params.put(new Variable("occ"), new IntegerLiteral(BigInteger.valueOf(integ)));
}*/
}
VariableAssignment
va
=
new
VariableAssignment
(
null
);
CallStatement
call
=
new
CallStatement
(
tapName
,
params
);
try
{
applyRule
(
call
,
g
);
// Insert into the right cases
Node
currentNode
=
g
.
node
();
...
...
@@ -182,6 +186,7 @@ public class InteractiveModeController {
}
private
Node
findRoot
(
Node
cur
)
{
while
(
cur
!=
null
)
{
if
(
cases
.
keySet
().
contains
(
cur
))
...
...
@@ -237,8 +242,16 @@ public class InteractiveModeController {
}
RuleCommand
c
=
new
RuleCommand
();
// KeyData kd = g.getData();
Evaluator
eval
=
new
Evaluator
(
expandedNode
.
getAssignments
(),
expandedNode
);
Map
<
String
,
String
>
map
=
new
HashMap
<>();
// call.getParameters().forEach((k, v) -> map.put(k.getIdentifier(), v.getData().toString()));
call
.
getParameters
().
forEach
((
variable
,
expression
)
->
{
Value
exp
=
eval
.
eval
(
expression
);
map
.
put
(
variable
.
getIdentifier
(),
exp
.
getData
().
toString
());
});
// call.getParameters().forEach((k, v) -> map.put(k.getIdentifier(),));
LOGGER
.
info
(
"Execute {} with {}"
,
call
,
map
);
try
{
KeyData
kd
=
expandedNode
.
getData
();
...
...
@@ -246,6 +259,7 @@ public class InteractiveModeController {
EngineState
estate
=
new
EngineState
(
g
.
proof
());
estate
.
setGoal
(
g
);
RuleCommand
.
Parameters
cc
=
c
.
evaluateArguments
(
estate
,
map
);
//reflection exception
AbstractUserInterfaceControl
uiControl
=
new
DefaultUserInterfaceControl
();
c
.
execute
(
uiControl
,
cc
,
estate
);
...
...
@@ -286,4 +300,6 @@ public class InteractiveModeController {
public
void
setKeYServices
(
Services
keYServices
)
{
this
.
keYServices
=
keYServices
;
}
}
ui/src/main/java/edu/kit/iti/formal/psdbg/gui/controls/WelcomePaneFMEdition.java
View file @
0430bb2f
...
...
@@ -45,13 +45,18 @@ public class WelcomePaneFMEdition extends AnchorPane {
* Load a test example
* @param event
*/
public
void
load
JavaTes
t
(
ActionEvent
event
)
{
public
void
load
Quicksor
t
(
ActionEvent
event
)
{
proofScriptDebugger
.
getWelcomePaneDock
().
close
();
proofScriptDebugger
.
showActiveInspector
(
null
);
Examples
.
loadExamples
().
forEach
(
example
->
{
if
(
example
.
getName
().
equals
(
"Quicksort example"
))
{
example
.
open
(
proofScriptDebugger
);
}
});
}
/**
* Load t
e
h help page documentation
* Load th
e
help page documentation
* @param event
*/
public
void
loadHelpPage
(
ActionEvent
event
)
{
...
...
ui/src/main/resources/META-INF/services/edu.kit.iti.formal.psdbg.examples.Example
View file @
0430bb2f
edu.kit.iti.formal.psdbg.examples.contraposition.ContrapositionExample
edu.kit.iti.formal.psdbg.examples.fol.FirstOrderLogicExample
edu.kit.iti.formal.psdbg.examples.java.simple.JavaSimpleExample
edu.kit.iti.formal.psdbg.examples.java.transitive.PaperExample
edu.kit.iti.formal.psdbg.examples.java.dpqs.DualPivotExample
edu.kit.iti.formal.psdbg.examples.java.quicksort.QuickSort
edu.kit.iti.formal.psdbg.examples.agatha.AgathaExample
edu.kit.iti.formal.psdbg.examples.java.bubbleSort.BubbleSortExample
edu.kit.iti.formal.psdbg.examples.java.sumAndMax.SumAndMaxExample
edu.kit.iti.formal.psdbg.examples.lulu.LuLuDoubleLinkedList
edu.kit.iti.formal.psdbg.examples.lulu.LuLuQuickSort
edu.kit.iti.formal.psdbg.examples.lulu.LuLuSumAndMax
edu.kit.iti.formal.psdbg.examples.java.simple.JavaSimpleExample
ui/src/main/resources/edu/kit/iti/formal/psdbg/examples/java/quicksort/script.kps
View file @
0430bb2f
...
...
@@ -14,8 +14,8 @@ script split_from_quicksort() {
case match `==> seqDef(_,_,_) = seqDef(_, _, _)`:
auto;
case match `==> (\exists ?X (\exists ?Y _))`:
instantiate var=
`?X`[?X \ X]
with=`i_0`;
instantiate var=
`?Y`[?Y \ Y]
with=`j_0`;
instantiate var=
X
with=`i_0`;
instantiate var=
Y
with=`j_0`;
auto;
}
}
...
...
ui/src/main/resources/edu/kit/iti/formal/psdbg/examples/java/simple/Test.java
View file @
0430bb2f
...
...
@@ -12,6 +12,6 @@ public class Test{
}
else
{
x
++;
}
return
x
++;
return
++
x
;
}
}
\ No newline at end of file
ui/src/main/resources/edu/kit/iti/formal/psdbg/examples/java/simple/script.kps
View file @
0430bb2f
script t1(){
symbex;
cases
{
case match `?X >= 0,?X > 0 ==>`:
cut `?X = 0`[?X \ X]
;
foreach{
auto
;
}
foreach
{
onestep;
andRight
;
foreach{
tryclose
;
}
}
// cases{
// case match `?X >= 0,?X > 0 ==>`:
// cut `?X = 0`[?X \ X];
// foreach{
// auto;
// }
// }
}
ui/src/main/resources/edu/kit/iti/formal/psdbg/gui/controls/WelcomePaneFMEdition.fxml
View file @
0430bb2f
...
...
@@ -7,18 +7,23 @@
<?import javafx.scene.text.Font?>
<fx:root
prefHeight=
"485.0"
prefWidth=
"716.0"
type=
"AnchorPane"
xmlns=
"http://javafx.com/javafx/8.0.121"
xmlns:fx=
"http://javafx.com/fxml/1"
>
<children>
<Label
layoutX=
"14.0"
layoutY=
"14.0"
text=
"Welcome to the ProofScriptDebugger"
>
<font>
<Font
size=
"24.0"
/>
</font>
</Label>
<Label
text=
"FM 2018 - Edition"
>
<font>
<Font
size=
"20.0"
/>
</font>
</Label>
<padding>
<Insets
top=
"25"
right=
"25"
bottom=
"25"
left=
"25"
/>
</padding>
<children>
<VBox>
<Label
layoutX=
"14.0"
layoutY=
"14.0"
text=
"Welcome to the ProofScriptDebugger"
>
<font>
<Font
size=
"24.0"
/>
</font>
</Label>
<Label
text=
"FM 2018 - Edition"
>
<font>
<Font
size=
"20.0"
/>
</font>
</Label>
</VBox>
<Label
alignment=
"TOP_LEFT"
layoutX=
"14.0"
layoutY=
"71.0"
prefHeight=
"129.0"
prefWidth=
"573.0"
text=
"This application is the Proof Script debugger for the KeY system. It allows to perform proofs using a proof scripting language on top of the KeY system."
wrapText=
"true"
/>
...
...
@@ -99,8 +104,10 @@
</Button>
<!-- <Button contentDisplay="TOP" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308"
onAction="#loadJavaTest" text="Java Test Example" GridPane.columnIndex="1" GridPane.rowIndex="1">
<Button
contentDisplay=
"TOP"
maxHeight=
"1.7976931348623157E308"
maxWidth=
"1.7976931348623157E308"
onAction=
"#loadQuicksort"
text=
"Quicksort Example"
GridPane.columnIndex=
"1"
GridPane.rowIndex=
"1"
>
<graphic>
<MaterialDesignIconView
glyphName=
"NEW_BOX"
size=
"24"
/>
</graphic>
...
...
@@ -113,7 +120,7 @@
<MaterialDesignIconView
glyphName=
"NEW_BOX"
size=
"24"
/>
</graphic>
</Button>
-->
</children>
<StackPane.margin>
<Insets
bottom=
"10.0"
left=
"10.0"
right=
"10.0"
top=
"10.0"
/>
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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