-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implemented a realizes relation between justification diagram and pattern. Still one issue that must be addressed where diagrams are overlapping on each other.
- Loading branch information
1 parent
ff18fbb
commit 144f697
Showing
9 changed files
with
136 additions
and
36 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
51 changes: 51 additions & 0 deletions
51
src/main/java/ca/mcscert/jpipe/compiler/builders/ImplementJustificationBuilder.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,51 @@ | ||
package ca.mcscert.jpipe.compiler.builders; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
import ca.mcscert.jpipe.model.*; | ||
import ca.mcscert.jpipe.model.justification.*; | ||
import ca.mcscert.jpipe.model.justification.Conclusion; | ||
import ca.mcscert.jpipe.model.justification.JustificationElement; | ||
|
||
|
||
public class ImplementJustificationBuilder extends ConcreteJustificationBuilder{ | ||
|
||
private final JustificationPattern template; | ||
|
||
public ImplementJustificationBuilder(String name, JustificationPattern template){ | ||
super(name); | ||
this.template=template; | ||
extract(); | ||
} | ||
|
||
private void extract(){ | ||
this.elements=template.elements(); | ||
this.dependencies=template.dependencies(); | ||
this.conclusion=template.conclusion(); | ||
} | ||
|
||
@Override | ||
public void addElement(JustificationElement elem) { | ||
String identifier = elem.getIdentifier(); | ||
this.elements.put(identifier,elem); | ||
} | ||
|
||
@Override | ||
public void addDependency(String from, String to) { | ||
List<String> sources = this.dependencies.getOrDefault(to, new ArrayList<>()); | ||
sources.add(from); | ||
this.dependencies.put(to, sources); | ||
} | ||
|
||
@Override | ||
public void setConclusion(Conclusion conclusion) { | ||
this.conclusion = conclusion; | ||
} | ||
|
||
|
||
|
||
|
||
|
||
|
||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
pattern prover_pattern { | ||
|
||
@support Su1 is "Model is ready" | ||
@support Su2 is "Prover is available" | ||
evidence Su3 is "Scenario are available" | ||
|
||
strategy St1 is "Prove model" | ||
Su1 supports St1 | ||
Su2 supports St1 | ||
Su3 supports St1 | ||
|
||
conclusion C is "Model is correct" | ||
St1 supports C | ||
|
||
} |
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