-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
61 changed files
with
1,142 additions
and
578 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
grammar LTL; | ||
|
||
@header { | ||
package net.maswag; | ||
import net.maswag.LTLListener; | ||
import net.maswag.LTLVisitor; | ||
import net.maswag.LTLParser; | ||
} | ||
|
||
import AbstractTemporalLogic; | ||
|
||
expr | ||
: INPUT EQ ID | ||
| OUTPUT EQ ID | ||
| left=expr binaryOperator right=expr | ||
| unaryOperator expr | ||
| unaryTemporalOperator UNDER interval expr | ||
| left=expr binaryTemporalOperator UNDER interval right=expr | ||
| LPAREN expr RPAREN | ||
; | ||
|
||
INPUT : 'input'; | ||
OUTPUT : 'output'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
package net.maswag; | ||
|
||
import lombok.Getter; | ||
import net.automatalib.word.Word; | ||
|
||
import java.util.Set; | ||
|
||
/** | ||
* <p>Abstract TemporalLogic<I> class.</p> | ||
* | ||
* @author Masaki Waga {@literal <[email protected]>} | ||
*/ | ||
@Getter | ||
public abstract class AbstractTemporalLogic<I> implements TemporalLogic<I> { | ||
boolean nonTemporal; | ||
Set<String> atomicStrings; | ||
|
||
public String toLTLString() { | ||
return this.toAbstractString(); | ||
} | ||
|
||
/** | ||
* {@inheritDoc} | ||
*/ | ||
@Override | ||
public Double apply(IOSignal<I> signal) { | ||
return getRoSI(signal).getRobustness(); | ||
} | ||
|
||
@Override | ||
public boolean equals(Object o) { | ||
if (this == o) return true; | ||
if (o == null || getClass() != o.getClass()) return false; | ||
|
||
AbstractTemporalLogic<I> stlCost = (AbstractTemporalLogic<I>) o; | ||
|
||
return this.hashCode() == stlCost.hashCode(); | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
// Hash code is implemented based on the string representation. | ||
return this.toString().hashCode(); | ||
} | ||
} |
Oops, something went wrong.