Skip to content

Commit

Permalink
Add a reproduction case for issue #173. Discovered by @Lozov-Petr
Browse files Browse the repository at this point in the history
Signed-off-by: Dmitrii.Kosarev a.k.a. Kakadu <[email protected]>
  • Loading branch information
Dmitrii.Kosarev a.k.a. Kakadu authored and Dmitrii.Kosarev a.k.a. Kakadu committed Dec 17, 2024
1 parent 962312e commit 9def363
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 6 deletions.
37 changes: 31 additions & 6 deletions regression_ppx/dune
Original file line number Diff line number Diff line change
Expand Up @@ -148,13 +148,29 @@
(modules test013mutual)
(package OCanren)
(public_names -)
(flags
(:standard
;-dsource
;
))
(preprocess
(pps OCanren-ppx.ppx_distrib GT.ppx_all -- -new-typenames -pretty))
(pps
OCanren-ppx.ppx_distrib
GT.ppx_all
OCanren-ppx.ppx_fresh
--
-new-typenames
-pretty))
(libraries OCanren OCanren.tester))

(executables
(names test014diseq)
(modules test014diseq)
(package OCanren)
(public_names -)
(preprocess
(pps
GT.ppx_all
OCanren-ppx.ppx_fresh
OCanren-ppx.ppx_tester
OCanren-ppx.ppx_repr
--
-pretty))
(libraries OCanren OCanren.tester))

(cram
Expand Down Expand Up @@ -283,3 +299,12 @@
%{project_root}/ppx/pp_ocanren_all.exe
test013mutual.ml
test013mutual.exe))

(cram
(package OCanren)
(applies_to test014)
(deps
(package OCanren-ppx)
%{project_root}/ppx/pp_ocanren_all.exe
test014diseq.ml
test014diseq.exe))
4 changes: 4 additions & 0 deletions regression_ppx/test014.t
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
$ ./test014diseq.exe
rel, 1 answer {
Fatal error: exception File "src/core/Disequality.ml", line 177, characters 8-14: Assertion failed
[2]
18 changes: 18 additions & 0 deletions regression_ppx/test014diseq.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
open OCanren
open Tester

let rel list1 =
let open OCanren.Std in
fresh
(list2 hd1 tl1 hd2 tl2)
(list1 =/= list2)
(list1 === hd1 % tl1)
(list2 === hd2 % tl2)
(hd2 === !!1)
(tl2 === nil ())
(hd1 === !!1)
(tl1 === nil ())
;;

(* let () = [%tester run_r [%show GT.int GT.list] (Std.List.reify reify) 1 (fun q -> rel q)] *)
let () = run_r (Std.List.reify reify) ([%show: GT.int logic Std.List.logic] ()) 1 q qh (REPR rel)

0 comments on commit 9def363

Please sign in to comment.