File tree Expand file tree Collapse file tree 4 files changed +443
-0
lines changed Expand file tree Collapse file tree 4 files changed +443
-0
lines changed Original file line number Diff line number Diff line change
1
+ (library
2
+ (name wp)
3
+ (libraries ast eval symbolic z3)
4
+ (preprocess (pps ppx_deriving.std)))
Original file line number Diff line number Diff line change
1
+ (* * Nõrgima eeltingimuse arvutamine ja sellega programmi korrektsuse kontrollimine. *)
2
+ open Z3
3
+ open Symbolic
4
+
5
+ (* * Arvutab lause nõrgima eeltingimuse antud järeltingimuse jaoks.
6
+ Üldist While lauset pole vaja toetada, ainult piisavalt, et testid läbi läheks.
7
+ Vihje: let open Syntax in ...
8
+ Vihje: eval_expr.
9
+ Vihje: Expr.substitute_one.
10
+ Vihje: bool_of_int. *)
11
+ let rec wp (stmt : Ast.stmt ) (post : Expr.expr ): Expr.expr =
12
+ failwith " TODO"
13
+
14
+
15
+ (* * Korrektsuse kontrolli tulemus. *)
16
+ type verdict =
17
+ | Correct (* * Korrektne ehk Error lauset ei täideta. *)
18
+ | Incorrect of Env .t (* * Vigane ehk Error lauset täidetakse. Andmetena kaasas keskkond, milles Error lauseni jõutakse. *)
19
+ | Unknown (* * Z3 ei oska lahendada. *)
20
+ [@@ deriving show ]
21
+
22
+ (* * Kontrollib, kas programm on korrektne.
23
+ Vt. Toyatp.Bool.check.
24
+ Vihje: wp.
25
+ Vihje: match-i Solver.check tulemust.
26
+ Vihje: env_of_model. *)
27
+ let check (stmt : Ast.stmt ): verdict =
28
+ failwith " TODO"
Original file line number Diff line number Diff line change
1
+ (test
2
+ (name wp_test)
3
+ (libraries ounit2 ounittodo ast eval symbolic wp))
You can’t perform that action at this time.
0 commit comments