test extension, types moved to ocanren_inject

This commit is contained in:
ProgramSnail 2026-01-29 15:31:54 +03:00
parent e2dcf6c2a1
commit bea18df70e
2 changed files with 133 additions and 98 deletions

View file

@ -6,7 +6,6 @@ module Tag = struct
ocanren type tag = Ref | Value
module Test = struct
@type answer = logic GT.list with show
let _ =
@ -14,3 +13,17 @@ module Tag = struct
(fun q -> q#reify reify)))
end
end
module Stmt = struct
ocanren type ('d, 'dl) stmt = Call of 'd * 'dl | Read of 'd | Write of 'd
module Test = struct
@type answer1 = Nat.ground List.ground GT.list with show
@type answer = (Nat.ground, Nat.ground List.ground) ground GT.list with show
let _ = Printf.printf "%s\n" @@ show(answer1) (Stream.take (run q (fun q -> ocanren {Call (1, [2]) === Call (1, q)})
(fun q -> q#reify (List.prj_exn Nat.prj_exn))))
let _ = Printf.printf "%s\n" @@ show(answer) (Stream.take (run q (fun q -> ocanren {Call (1, [2]) === q})
(fun q -> q#reify (prj_exn Nat.prj_exn (List.prj_exn Nat.prj_exn)))))
end
end