Skip to content

Commit 06f4e04

Browse files
committed
Lisa wp
1 parent 955727a commit 06f4e04

File tree

4 files changed

+443
-0
lines changed

4 files changed

+443
-0
lines changed

src/wp/dune

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
(library
2+
(name wp)
3+
(libraries ast eval symbolic z3)
4+
(preprocess (pps ppx_deriving.std)))

src/wp/wp.ml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
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"

test/wp/dune

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
(test
2+
(name wp_test)
3+
(libraries ounit2 ounittodo ast eval symbolic wp))

0 commit comments

Comments
 (0)