-
Notifications
You must be signed in to change notification settings - Fork 26
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
24 changed files
with
99 additions
and
22 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
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
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
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
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
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
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
32 changes: 32 additions & 0 deletions
32
key.ncore.calculus/src/main/java/org/key_project/ncore/rules/Rule.java
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,32 @@ | ||
package org.key_project.ncore.rules; | ||
|
||
import org.jspecify.annotations.NonNull; | ||
import org.key_project.logic.Name; | ||
import org.key_project.logic.Named; | ||
import org.key_project.ncore.proof.ProofGoal; | ||
import org.key_project.util.collection.ImmutableList; | ||
|
||
public interface Rule extends Named { | ||
/** | ||
* the rule is applied on the given goal using the information of rule application. | ||
* | ||
* @param goal the Goal on which to apply <tt>ruleApp</tt> | ||
* @param ruleApp the rule application to be executed | ||
* @return all open goals below \old(goal.node()), i.e. the goals resulting from the rule | ||
* application | ||
* @throws RuleAbortException when this rule was aborted | ||
*/ | ||
@NonNull | ||
<G extends ProofGoal> ImmutableList<G> apply(G goal, RuleApp ruleApp) | ||
throws RuleAbortException; | ||
|
||
/** | ||
* the name of the rule | ||
*/ | ||
Name name(); | ||
|
||
/** | ||
* returns the display name of the rule | ||
*/ | ||
String displayName(); | ||
} |
2 changes: 1 addition & 1 deletion
2
...uka/ilkd/key/rule/RuleAbortException.java → ...oject/ncore/rules/RuleAbortException.java
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
37 changes: 37 additions & 0 deletions
37
key.ncore.calculus/src/main/java/org/key_project/ncore/rules/RuleApp.java
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,37 @@ | ||
package org.key_project.ncore.rules; | ||
|
||
import org.jspecify.annotations.Nullable; | ||
import org.key_project.ncore.proof.ProofGoal; | ||
import org.key_project.util.collection.ImmutableList; | ||
|
||
public interface RuleApp { | ||
/** | ||
* returns the rule of this rule application | ||
*/ | ||
Rule rule(); | ||
|
||
/** | ||
* applies the specified rule at the specified position if all schema variables have been | ||
* instantiated | ||
* | ||
* @param goal the Goal where to apply the rule | ||
* @return list of new created goals | ||
*/ | ||
@Nullable | ||
<G extends ProofGoal> ImmutableList<G> execute(G goal); | ||
|
||
/** | ||
* returns true if all variables are instantiated | ||
* | ||
* @return true if all variables are instantiated | ||
*/ | ||
boolean complete(); | ||
|
||
/** | ||
* @return user-friendly name for this rule-application | ||
*/ | ||
default String displayName() { | ||
return rule().displayName(); | ||
} | ||
|
||
} |
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