Browse Source

Now working families + an added example related to it

master
julia 3 years ago
parent
commit
dcb987e188
  1. 2
      ocaml/Resolution.ml
  2. 6
      ocaml/main.ml

2
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 ) aux tl ((fam, j)::tokl) ([(ri, rj)]::prob_aux) ( (( star_filter const ((i, j),(ri,rj)) [] ))::star_aux )
else None else None
else 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*) 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 else

6
ocaml/main.ml

@ -27,8 +27,8 @@ let constellation = make_const_add 1 3 ;;
print_dgraph (dgraph constellation) ;; print_dgraph (dgraph constellation) ;;
(* determinist constellation test*) (* simple determinist constellation test*)
let test = [ [Func("c", Neg, [x]); x] ; [Func("c", Pos, [Func("f", Npol, [y])]) ; Func("c", Npol, [x]) ] ] ;; let test = [ [Func("e", Neg, [x]); x] ; [Func("e", Pos, [Func("d", Npol, [y])]) ; Func("e", Npol, [x]) ] ] ;;
print_dgraph (dgraph test);; print_dgraph (dgraph test);;
exec test ;; exec test ;;
@ -45,3 +45,5 @@ let exec_exmid_noprop = exec excl_mid_no_prop [0];;
let exec_exmid_prop = exec excl_mid_prop [0];; let exec_exmid_prop = exec excl_mid_prop [0];;
print_const exec_exmid_prop;; print_const exec_exmid_prop;;
let test_fam = excl_mid_prop@test
Loading…
Cancel
Save