Commit a027d3f9 authored by Sarah Grebing's avatar Sarah Grebing
Browse files

ContinueCommand; Grammar for quantifiermatch

parent a64a5a0a
Pipeline #16864 failed with stages
in 109 minutes and 22 seconds
......@@ -22,7 +22,8 @@ sequentPattern : antec=semiSeqPattern? ARROW succ=semiSeqPattern? #sequentArrow
semiSeqPattern : termPattern (',' termPattern)*;
termPattern :
termPattern MUL termPattern #mult
'(' (EXISTS|FORALL) (SID|ID) termPattern ')' #quantForm
| termPattern MUL termPattern #mult
| <assoc=right> termPattern op=(DIV|MOD) termPattern #divMod
| termPattern op=(PLUS|MINUS) termPattern #plusMinus
| termPattern op=(LE|GE|LEQ|GEQ) termPattern #comparison
......@@ -53,12 +54,6 @@ bindClause : ('\\as' | ':') SID;
DONTCARE: '?' | '_' | '█';
DIGITS : DIGIT+ ;
fragment DIGIT : [0-9] ;
SID: '?' [_a-zA-Z0-9\\]+ ;
ID : [a-zA-Z\\_] ([_a-zA-Z0-9\\])*
| 'update-application'
| 'parallel-upd'
| 'elem-update'
;
ARROW : '⇒' | '==>';
STARDONTCARE: '...' | '…';
......@@ -78,8 +73,16 @@ OR: '|' ;
IMP: '->';
MOD:'%';
XOR:'^';
FORALL: '\forall' | '∀';
EXISTS: '\exists';
NOT :'!';
FORALL: '\\forall' | '∀';
EXISTS: '\\exists';
SID: '?' [_a-zA-Z0-9\\]+ ;
ID : [a-zA-Z\\_] ([_a-zA-Z0-9\\])*
| 'update-application'
| 'parallel-upd'
| 'elem-update'
;
COMMENT: '//' ~[\n\r]* -> channel(HIDDEN);
WS: [\n\f\r\t ] -> channel(HIDDEN);
......@@ -54,6 +54,7 @@ public class MatcherFacadeTest {
@Test
public void matches() throws Exception {
shouldMatchForm("\\exists int i; \\exists int j; (fint2(i, j) -> fint2(j, i))", "\\exists int i; \\exists int j; (fint2(i, j) -> fint2(j, i))");
shouldMatch("f(a)", "_");
shouldMatch("f(a)", "?X", "[{?X=f(a)}]");
shouldMatch("h(a,a)", "h(?X,?X)", "[{?X=a}]");
......
package edu.kit.iti.formal.psdbg.interpreter.dbg;
import edu.kit.iti.formal.psdbg.parser.ast.ASTNode;
import java.util.Arrays;
import java.util.function.Supplier;
public class ContinueCommand<T> extends DebuggerCommand<T> {
@Override
public void execute(DebuggerFramework<T> dbg) {
PTreeNode<T> statePointer = dbg.getStatePointer();
if (statePointer != null) {
PTreeNode<T> stepOverPointer = statePointer.getStepOver();
if (stepOverPointer != null) {
dbg.setStatePointer(stepOverPointer);
return;
}
ASTNode[] ctx = statePointer.getContext();
//statePointer stands on the main script, we add the script itself to the context
if (statePointer.getContext().length == 0) {
ctx = Arrays.copyOf(ctx, ctx.length + 1);
ctx[ctx.length - 1] = statePointer.getStatement();
}
Supplier<Integer> currenDepth = () -> dbg.getStatePointer().getContext().length;
//Blocker.BlockPredicate predicate = new Blocker.ParentInContext(ctx);
// Blocker.SmallerContext predicate = new Blocker.SmallerContext(
// currenDepth.get(), currenDepth);
//dbg.releaseUntil(predicate);
dbg.release();
} else {
}
}
}
package edu.kit.iti.formal.psdbg.interpreter.dbg;
import lombok.val;