-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
towards proof obligations for functions
- Loading branch information
1 parent
224e5e0
commit a8e6dd6
Showing
11 changed files
with
181 additions
and
29 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
39 changes: 39 additions & 0 deletions
39
modules/core/src/edu/kit/iti/algover/symbex/FunctionObligationMaker.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,39 @@ | ||
/* | ||
* This file is part of AlgoVer. | ||
* | ||
* Copyright (C) 2015-2018 Karlsruhe Institute of Technology | ||
* | ||
*/ | ||
|
||
package edu.kit.iti.algover.symbex; | ||
|
||
import edu.kit.iti.algover.parser.DafnyParser; | ||
import edu.kit.iti.algover.parser.DafnyTree; | ||
import edu.kit.iti.algover.symbex.PathConditionElement.AssumptionType; | ||
|
||
import java.util.Deque; | ||
import java.util.LinkedList; | ||
import java.util.List; | ||
|
||
public class FunctionObligationMaker { | ||
|
||
SymbexExpressionValidator expressionValidator = | ||
new SymbexExpressionValidator(); | ||
|
||
public List<SymbexPath> visit(DafnyTree function) { | ||
|
||
assert function.getType() == DafnyParser.FUNCTION; | ||
|
||
LinkedList<SymbexPath> paths = new LinkedList<>(); | ||
|
||
SymbexPath path = new SymbexPath(function); | ||
|
||
for (DafnyTree req : function.getChildrenWithType(DafnyParser.REQUIRES)) { | ||
path.addPathCondition(req.getLastChild(), req, AssumptionType.PRE); | ||
} | ||
|
||
expressionValidator.handleExpression(paths, path, function.getLastChild()); | ||
|
||
return paths; | ||
} | ||
} |
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 |
---|---|---|
|
@@ -87,4 +87,4 @@ | |
(FUNCTION inImage | ||
(ARGS (VAR i (TYPE int))) | ||
(RETURNS bool) | ||
(BLOCK true))) | ||
true)) |
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