mirror of
https://github.com/ProgramSnail/pass_strategy_synthesis.git
synced 2026-06-11 03:38:15 +00:00
struct: synt. ref arg in call fix
This commit is contained in:
parent
68f2569922
commit
1bcf567839
4 changed files with 47 additions and 11 deletions
|
|
@ -10,6 +10,7 @@ open Decl
|
|||
open Type
|
||||
open Expr
|
||||
open Path
|
||||
open CopyCap
|
||||
open ReadCap
|
||||
open WriteCap
|
||||
open InCap
|
||||
|
|
@ -113,6 +114,36 @@ let prog_eval_t_simple_call_rd _ = show(answer) (Stream.take (run q
|
|||
})
|
||||
(fun q -> q#reify (StEnv.prj_exn))))
|
||||
|
||||
let prog_eval_t_simple_call_rd_ref _ = show(answer) (Stream.take (run q
|
||||
(fun q -> ocanren {
|
||||
fresh prog, xg, yg, fg, xd, yd, fd, st in
|
||||
globals_min_ido xg &
|
||||
yg == Nat.s xg &
|
||||
fg == Nat.s yg &
|
||||
xd == VarD (UnitT (Rd, AlwaysWr), UnitE) &
|
||||
yd == VarD (RefT (Rf, UnitT (Rd, AlwaysWr)), RefE xg) &
|
||||
fd == FunD ([(Mode (In, NOut), RefT (Cp, UnitT (Rd, AlwaysWr)))],
|
||||
ReadS (DerefP (VarP 0))) &
|
||||
prog == Prg ([xd; yd; fd], CallS (VarP fg, [PathE (VarP yg)])) &
|
||||
prog_evalo prog q
|
||||
})
|
||||
(fun q -> q#reify (StEnv.prj_exn))))
|
||||
|
||||
let prog_eval_t_simple_call_wr _ = show(answer) (Stream.take (run q
|
||||
(fun q -> ocanren {
|
||||
fresh prog, xg, yg, fg, xd, yd, fd, st in
|
||||
globals_min_ido xg &
|
||||
yg == Nat.s xg &
|
||||
fg == Nat.s yg &
|
||||
xd == VarD (UnitT (Rd, AlwaysWr), UnitE) &
|
||||
yd == VarD (RefT (Rf, UnitT (Rd, AlwaysWr)), RefE xg) &
|
||||
fd == FunD ([(Mode (In, NOut), RefT (Cp, UnitT (Rd, AlwaysWr)))],
|
||||
ReadS (DerefP (VarP 0))) &
|
||||
prog == Prg ([xd; yd; fd], CallS (VarP fg, [PathE (VarP yg)])) &
|
||||
prog_evalo prog q
|
||||
})
|
||||
(fun q -> q#reify (StEnv.prj_exn))))
|
||||
|
||||
(* @type answerArgs = (Arg.ground List.ground) GT.list with show *)
|
||||
(* @type answerValue = Value.ground GT.list with show *)
|
||||
(* @type answerNat = Nat.ground GT.list with show *)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue