From dcb987e188bf020ab284d8206c6ae710b90dcb57 Mon Sep 17 00:00:00 2001 From: julia Date: Mon, 29 Aug 2022 19:27:04 +0200 Subject: [PATCH] Now working families + an added example related to it --- ocaml/Resolution.ml | 2 +- ocaml/main.ml | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/ocaml/Resolution.ml b/ocaml/Resolution.ml index 1e5ff1b..a62d6ca 100644 --- a/ocaml/Resolution.ml +++ b/ocaml/Resolution.ml @@ -216,7 +216,7 @@ let divide_token (fam, n_star) toklist graph const prob fstar = aux tl ((fam, j)::tokl) ([(ri, rj)]::prob_aux) ( (( star_filter const ((i, j),(ri,rj)) [] ))::star_aux ) else None else - if Option.is_some (solve (link_to_eq ((ri, rj)::(List.nth prob_aux fam))) []) then (* We made sure prob_aux head would not be empty*) + if Option.is_some (solve (link_to_eq ((ri, rj)::(List.hd(*nth*) prob_aux (*fam*)))) []) then (* We made sure prob_aux head would not be empty*) aux tl ((fam, j)::tokl) (((ri, rj)::(List.hd prob_aux))::(List.tl prob_aux)) ( (( star_filter const ((i, j),(ri,rj)) (List.hd prob_aux) )@(List.hd star_aux))::(List.tl star_aux) ) (*We use List.hd because the current family we're working on should be the current first*) else diff --git a/ocaml/main.ml b/ocaml/main.ml index 2a79e96..d742ef5 100644 --- a/ocaml/main.ml +++ b/ocaml/main.ml @@ -27,8 +27,8 @@ let constellation = make_const_add 1 3 ;; print_dgraph (dgraph constellation) ;; -(* determinist constellation test*) -let test = [ [Func("c", Neg, [x]); x] ; [Func("c", Pos, [Func("f", Npol, [y])]) ; Func("c", Npol, [x]) ] ] ;; +(* simple determinist constellation test*) +let test = [ [Func("e", Neg, [x]); x] ; [Func("e", Pos, [Func("d", Npol, [y])]) ; Func("e", Npol, [x]) ] ] ;; print_dgraph (dgraph test);; exec test ;; @@ -44,4 +44,6 @@ let exec_exmid_noprop = exec excl_mid_no_prop [0];; (* should return 1*) let exec_exmid_prop = exec excl_mid_prop [0];; -print_const exec_exmid_prop;; \ No newline at end of file +print_const exec_exmid_prop;; + +let test_fam = excl_mid_prop@test \ No newline at end of file