[Toss-devel-svn] SF.net SVN: toss:[1384] trunk/Toss
Status: Beta
Brought to you by:
lukaszkaiser
From: <luk...@us...> - 2011-03-23 21:14:38
|
Revision: 1384 http://toss.svn.sourceforge.net/toss/?rev=1384&view=rev Author: lukstafi Date: 2011-03-23 21:14:31 +0000 (Wed, 23 Mar 2011) Log Message: ----------- Specification-level bug in monotonic heuristic generation. More encompassing monotonicity detection and more clean monotonic heuristic generation for approximately monotonic games. Modified Paths: -------------- trunk/Toss/Arena/DiscreteRule.ml trunk/Toss/Arena/DiscreteRule.mli trunk/Toss/Formula/Aux.ml trunk/Toss/Formula/Aux.mli trunk/Toss/Formula/FormulaOps.ml trunk/Toss/Formula/FormulaOps.mli trunk/Toss/Play/Heuristic.ml trunk/Toss/Play/HeuristicTest.ml Modified: trunk/Toss/Arena/DiscreteRule.ml =================================================================== --- trunk/Toss/Arena/DiscreteRule.ml 2011-03-23 17:47:00 UTC (rev 1383) +++ trunk/Toss/Arena/DiscreteRule.ml 2011-03-23 21:14:31 UTC (rev 1384) @@ -2,6 +2,9 @@ let debug_level = ref 0 +let approximate_monotonic = ref true +let prune_indef_vars = ref true + type matching = (int * int) list type matchings = Assignments.assignment_set @@ -55,7 +58,10 @@ preconditions, and negative fluents only negatively on RHSes (are only deleted) and only positively on LHSes and in preconditions. (Call the remaining fluents indefinite.) See - Heuristic.ml. *) + Heuristic.ml. + + In case [approximate_monotonic] is true, ignore what happens on + RHSes. *) let fluents_make ?(only_pos=false) f r = let fl_make (s, tp) = if tp = [] then None else @@ -72,8 +78,14 @@ let nega_cands = Aux.strings_of_list ( Aux.concat_map (fun r->map_rels r.rhs_neg_tuples) rules) in let fluents = Aux.Strings.union posi_cands nega_cands in - let posi = Aux.Strings.diff posi_cands nega_cands - and nega = Aux.Strings.diff nega_cands posi_cands in + let posi = + if !approximate_monotonic + then fluents + else Aux.Strings.diff posi_cands nega_cands + and nega = + if !approximate_monotonic + then fluents + else Aux.Strings.diff nega_cands posi_cands in let posi_lhs, nega_lhs = List.fold_left (fun (posi,nega) r -> let mp, mn = FormulaOps.rels_signs r.lhs_form in @@ -89,17 +101,42 @@ position. We are only interested in expanding preconditions of positive and negative fluents. + The fluent preconditions have closed subformulas eliminated, as + these do not differentiate between different actions (usually they + represent termination conditions). Also remove indefinite fluents + as these are heuristically assumed to be irrelevant in monotonic + games for long-term payoff behavior. + + Additional (optional but on by default) heuristic pruning removes + also other atoms that contain variables that were constrained by + indefinite fluents (prune_indef_vars). + TODO: currently, only a single absence/presence tuple is removed from the precondition: the one from which it "derived"; shouldn't all added and deleted tuples be removed? *) -let fluent_preconds rules signature posi_frels nega_frels = - let fluents = - Aux.Strings.elements posi_frels @ Aux.Strings.elements nega_frels in - let fluent_precond rel = +let fluent_preconds rules signature posi_frels nega_frels indef_frels = + let indef_vars_fold = + {FormulaOps.make_fold Aux.unique_append [] with + FormulaOps.fold_Rel = (fun rel args -> + if Aux.Strings.mem rel indef_frels + then Array.to_list args else [])} in + let collect_indef_vars phi = + FormulaOps.fold_formula indef_vars_fold phi in + let rem_closed indef_vars = function + | Formula.Eq (x, y) -> + List.mem x indef_vars || List.mem y indef_vars + | Formula.In (x, _) -> List.mem x indef_vars + | Formula.Rel (rel, args) -> + Aux.Strings.mem rel indef_frels || + ( !prune_indef_vars && + Aux.array_existsi (fun _ v -> List.mem v indef_vars) args) + | phi -> FormulaOps.free_vars phi = [] in + let fluent_precond is_posi rel = (* rules that produce a fluent, together with its args *) let rel_prods = Aux.map_some (fun r -> - let rhs_tuples = r.rhs_pos_tuples @ r.rhs_neg_tuples in + let rhs_tuples = + if is_posi then r.rhs_pos_tuples else r.rhs_neg_tuples in if List.mem_assoc rel rhs_tuples then let rel_tups = List.assoc rel rhs_tuples in if rel_tups <> [] then Some (r, rel_tups) @@ -121,6 +158,14 @@ args | Some rlmap -> Array.map (fun e->List.assoc e rlmap) args in + (* {{{ log entry *) + if !debug_level > 3 then ( + Printf.printf "compose_pre: rel=%s; args=%s; lhs_args=%s\n%!" + rel + (String.concat ", " (Array.to_list args)) + (String.concat ", " (Array.to_list lhs_args)) + ); + (* }}} *) (* remove potential condition for absence/presence of the fluent being just added / deleted *) let body = FormulaOps.map_formula @@ -135,6 +180,22 @@ if b && Aux.Strings.mem rel nega_frels then Formula.And [] else if b && Aux.Strings.mem rel posi_frels then Formula.Or [] else Formula.Rel (b_rel, b_args))} body in + (* {{{ log entry *) + if !debug_level > 2 then ( + Printf.printf "fluent_preconds: body before pruning:\n%s\n%!" + (Formula.sprint body) + ); + (* }}} *) + (* remove closed subformulas and indefinite fluents *) + let indef_vars = collect_indef_vars body in + let body = + FormulaOps.remove_subformulas (rem_closed indef_vars) body in + (* {{{ log entry *) + if !debug_level > 2 then ( + Printf.printf "fluent_preconds: body after pruning:\n%s\n%!" + (Formula.sprint body) + ); + (* }}} *) let args = Array.to_list args in let body, other_vars, numap_cstr = match r.rlmap with @@ -164,8 +225,17 @@ | [] -> failwith ("fluent_preconds: not a fluent: "^rel) | [phi] -> phi | _ -> Formula.Or disjs in + let precond = FormulaOps.prune_unused_quants precond in + (* {{{ log entry *) + if !debug_level > 2 then ( + Printf.printf "fluent_preconds: result -- rel=%s(%s), precond=\n%s\n%!" + rel (String.concat ", " nu_args) + (Formula.sprint precond) + ); + (* }}} *) rel, (nu_args, precond) in - List.map fluent_precond fluents + List.map (fluent_precond true) (Aux.Strings.elements posi_frels) @ + List.map (fluent_precond false) (Aux.Strings.elements nega_frels) (* {2 Embedding and rewriting.} *) Modified: trunk/Toss/Arena/DiscreteRule.mli =================================================================== --- trunk/Toss/Arena/DiscreteRule.mli 2011-03-23 17:47:00 UTC (rev 1383) +++ trunk/Toss/Arena/DiscreteRule.mli 2011-03-23 21:14:31 UTC (rev 1384) @@ -2,7 +2,13 @@ val debug_level : int ref -(* Single match of a rule, and a set of matches. *) +(** If [true], ignore what happens on RHSes of rules when assessing + if fluents are positive / negative (only check whether their + LHS+precondition occurrences are negative/positive). *) +val approximate_monotonic : bool ref +val prune_indef_vars : bool ref + +(** Single match of a rule, and a set of matches. *) type matching = (int * int) list type matchings = Assignments.assignment_set @@ -63,7 +69,8 @@ position. We are only interested in expanding preconditions of positive and negative fluents. *) val fluent_preconds : - rule_obj list -> (string -> int) -> Aux.Strings.t -> Aux.Strings.t -> + rule_obj list -> (string -> int) -> + Aux.Strings.t -> Aux.Strings.t -> Aux.Strings.t -> (string * (string list * Formula.formula)) list (* Helpers for special relations. *) Modified: trunk/Toss/Formula/Aux.ml =================================================================== --- trunk/Toss/Formula/Aux.ml 2011-03-23 17:47:00 UTC (rev 1383) +++ trunk/Toss/Formula/Aux.ml 2011-03-23 21:14:31 UTC (rev 1384) @@ -247,6 +247,10 @@ | [] -> [] in idemp (List.sort Pervasives.compare l) +let unique_append l1 l2 = + List.fold_left (fun l2 e -> + if List.mem e l2 then l2 else e::l2) l2 (List.rev l1) + (* TODO: that's quadratic, optimize? *) let rec unique eq = function | [] -> [] Modified: trunk/Toss/Formula/Aux.mli =================================================================== --- trunk/Toss/Formula/Aux.mli 2011-03-23 17:47:00 UTC (rev 1383) +++ trunk/Toss/Formula/Aux.mli 2011-03-23 21:14:31 UTC (rev 1384) @@ -155,6 +155,10 @@ by {!Pervasives.compare}. Not tail-recursive. *) val unique_sorted : 'a list -> 'a list +(** [unique_append l1 l2] appends elements not occurring in [l2] to + it, without repeating elements. *) +val unique_append : 'a list -> 'a list -> 'a list + (** Return the list of unique elements, under the given comparison (the input does not need to be sorted). (Currently uses a straightforward [n^2] algorithm. Currently not tail-recursive.) *) Modified: trunk/Toss/Formula/FormulaOps.ml =================================================================== --- trunk/Toss/Formula/FormulaOps.ml 2011-03-23 17:47:00 UTC (rev 1383) +++ trunk/Toss/Formula/FormulaOps.ml 2011-03-23 21:14:31 UTC (rev 1384) @@ -889,7 +889,10 @@ map_Or = (function | [disj] -> disj | disjs -> Or (Aux.concat_map flat_or disjs)); - map_Not = (function Not phi -> phi | phi -> Not phi)} + map_Not = (function + | Or [] -> And [] + | And [] -> Or [] + | Not phi -> phi | phi -> Not phi)} let rec flatten_or = function | Or disjs -> Aux.concat_map flatten_or disjs @@ -921,6 +924,30 @@ | Not (Not phi) -> flatten_ands phi | phi -> [phi] +(* Currently, does not go down real expressions. *) +let remove_subformulas psub phi = + let rec map_formula subf = + if psub subf then raise Not_found; + match subf with + | Rel _ | Eq _ | RealExpr _ | In _ -> subf + | Not phi -> Not (map_formula phi) + | And conjs -> And (Aux.map_try map_formula conjs) + | Or disjs -> Or (Aux.map_try map_formula disjs) + | Ex (vs, phi) -> Ex (vs, map_formula phi) + | All (vs, phi) -> All (vs, map_formula phi) in + try flatten_formula (map_formula phi) + with Not_found -> And [] + +let unused_quants_map = {identity_map with + map_Ex = (fun vs phi -> + if Aux.list_inter vs (free_vars phi) = [] then phi + else Ex (vs, phi)); + map_All = (fun vs phi -> + if Aux.list_inter vs (free_vars phi) = [] then phi + else All (vs, phi))} + +let prune_unused_quants = map_formula unused_quants_map + (* Simplify the formula by removing relational literals, depending on what literals they are conjoined with up the tree, whether they are in a disjunction and what literals they are disjoined with, keeping Modified: trunk/Toss/Formula/FormulaOps.mli =================================================================== --- trunk/Toss/Formula/FormulaOps.mli 2011-03-23 17:47:00 UTC (rev 1383) +++ trunk/Toss/Formula/FormulaOps.mli 2011-03-23 21:14:31 UTC (rev 1384) @@ -161,6 +161,13 @@ negation over disjunction and pushing quantifiers inside. *) val flatten_ands : formula -> formula list +(** "Erase" indicated subformulas from the formula. *) +val remove_subformulas : (formula -> bool) -> formula -> formula + +(** Remove quantifiers that bind only variables not occurring freely + in the body. *) +val prune_unused_quants : formula -> formula + (** Simplify the formula by removing relational literals, depending on what literals they are conjoined with up the tree, whether they are in a disjunction and what literals they are disjoined with, keeping Modified: trunk/Toss/Play/Heuristic.ml =================================================================== --- trunk/Toss/Play/Heuristic.ml 2011-03-23 17:47:00 UTC (rev 1383) +++ trunk/Toss/Play/Heuristic.ml 2011-03-23 21:14:31 UTC (rev 1384) @@ -51,11 +51,14 @@ module): H(Phi) = - Sum(V1, (F11\/...\/F1N_1) /\ Pre(F11/\.../\F1N_1) /\ Guard1, + Sum(V1, (F11\/...\/F1N_1) /\ + (F11\/Pre(F11)) /\ ... /\ (F1N_1\/Pre(F1N_1) /\ Guard1, CharSum(F11, ..., F1N_1)) + ... + - Sum(VM, (FM1\/...\/FMN_M) /\ Pre(FM1/\.../\FMN_M) /\ GuardM, + Sum(VM, (FM1\/...\/FMN_M) /\ + (FM1\/Pre(FM1)) /\ ... /\ (FMN_M\/Pre(FMN_M)) /\ GuardM, CharSum(FM1, ..., FMN_M)) + where: * CharSum(Fi1, ..., FiN_i) = f(Char(Fi1) + ... + Char(FiN_i), N_i) @@ -83,6 +86,15 @@ is equivalent to Phi with minimal application of distributivity (GuardI can contain disjunctions if they don't contain any of FIj) + The fluent preconditions Pre() have closed subformulas eliminated, + as these do not differentiate between different actions (usually + they represent termination conditions). Also remove indefinite + fluents as these are heuristically assumed to be irrelevant in + monotonic games for long-term payoff behavior. Additional + (optional but on by default) heuristic pruning removes also other + atoms that contain variables that were constrained by indefinite + fluents (parameter {!DiscreteRule.prune_indef_vars}}). + ********** Algorithm Alg(Ex(V,Phi), Guard0): @@ -888,7 +900,9 @@ let m = List.length literals in let pre_guard = And ( Or literals :: - List.map (FormulaOps.subst_once_rels preconds) atoms @ [guard]) in + List.map (fun atom -> + Or [atom; FormulaOps.subst_once_rels preconds atom]) + atoms @ [guard]) in Sum (avs, FormulaOps.simplify pre_guard, f_monot adv_ratio n m) ) guards in sum_exprs parts @@ -1075,7 +1089,7 @@ let fluent_preconds = if monotonic then Some (DiscreteRule.fluent_preconds drules signat - posi_frels nega_frels) + posi_frels nega_frels indef_frels) else None in Array.mapi (fun i node -> Array.map (fun payoff -> Modified: trunk/Toss/Play/HeuristicTest.ml =================================================================== --- trunk/Toss/Play/HeuristicTest.ml 2011-03-23 17:47:00 UTC (rev 1383) +++ trunk/Toss/Play/HeuristicTest.ml 2011-03-23 21:14:31 UTC (rev 1384) @@ -75,7 +75,8 @@ (Aux.Strings.inter all_poff_rels indef_frels) in let fluent_preconds = if monotonic then Some ( - DiscreteRule.fluent_preconds drules signat posi_frels nega_frels) + DiscreteRule.fluent_preconds drules signat + posi_frels nega_frels indef_frels) else None in Heuristic.of_payoff ?struc ?fluent_preconds advance_ratio ~posi_frels ~nega_frels frels payoff @@ -267,14 +268,14 @@ rule_of_str sigPQ "[a | P:1 {}; Q:1 {} | ] -> [ | Q:1 {}; P(a) | ] emb P, Q"; rule_of_str sigPQ "[a | P:1 {}; Q:1 {} | ] -> [ | P:1 {}; Q(a) | ] emb P, Q"] in assert_equal ~printer:(fun x->x) ~msg:"adv_ratio=1" - "(Sum (z, y, x | (((R(x, y) and R(y, z)) or (C(x, y) and C(y, z)) or ex u, v ((C(z, u) and C(y, v) and R(y, u) and R(x, v))) or ex u, v ((R(y, u) and R(x, v) and C(v, y) and C(u, z)))) and (P(z) or P(y) or P(x)) and (not Q(x)) and (not Q(y)) and (not Q(z))) : (((:(P(x)) + :(P(y))) + :(P(z))) * 0.33)) + (-1. * Sum (z, y, x | (((R(x, y) and R(y, z)) or (C(x, y) and C(y, z)) or ex u, v ((C(z, u) and C(y, v) and R(y, u) and R(x, v))) or ex u, v ((R(y, u) and R(x, v) and C(v, y) and C(u, z)))) and (Q(z) or Q(y) or Q(x)) and (not P(x)) and (not P(y)) and (not P(z))) : (((:(Q(x)) + :(Q(y))) + :(Q(z))) * 0.33))))" + "(Sum (z, y, x | (((R(x, y) and R(y, z)) or (C(x, y) and C(y, z)) or ex u, v ((C(z, u) and C(y, v) and R(y, u) and R(x, v))) or ex u, v ((R(y, u) and R(x, v) and C(v, y) and C(u, z)))) and (P(x) or P(y) or P(z)) and ((not Q(x)) or P(x)) and ((not Q(y)) or P(y)) and ((not Q(z)) or P(z))) : (((:(P(x)) + :(P(y))) + :(P(z))) * 0.33)) + (-1. * Sum (z, y, x | (((R(x, y) and R(y, z)) or (C(x, y) and C(y, z)) or ex u, v ((C(z, u) and C(y, v) and R(y, u) and R(x, v))) or ex u, v ((R(y, u) and R(x, v) and C(v, y) and C(u, z)))) and (Q(x) or Q(y) or Q(z)) and ((not P(x)) or Q(x)) and ((not P(y)) or Q(y)) and ((not P(z)) or Q(z))) : (((:(Q(x)) + :(Q(y))) + :(Q(z))) * 0.33))))" (Formula.real_str (Heuristic.map_constants (fun c->(floor (c*.100.))/.100.) (default_heuristic 1. rules (real_of_str (":("^winPxyz^") - :("^winQxyz^")"))))); assert_equal ~printer:(fun x->x) ~msg:"adv_ratio=2" - "(Sum (z, y, x | (((R(x, y) and R(y, z)) or (C(x, y) and C(y, z)) or ex u, v ((C(z, u) and C(y, v) and R(y, u) and R(x, v))) or ex u, v ((R(y, u) and R(x, v) and C(v, y) and C(u, z)))) and (P(z) or P(y) or P(x)) and (not Q(x)) and (not Q(y)) and (not Q(z))) : ((((:(P(x)) + :(P(y))) + :(P(z))) * ((:(P(x)) + :(P(y))) + :(P(z)))) * 0.11)) + (-1. * Sum (z, y, x | (((R(x, y) and R(y, z)) or (C(x, y) and C(y, z)) or ex u, v ((C(z, u) and C(y, v) and R(y, u) and R(x, v))) or ex u, v ((R(y, u) and R(x, v) and C(v, y) and C(u, z)))) and (Q(z) or Q(y) or Q(x)) and (not P(x)) and (not P(y)) and (not P(z))) : ((((:(Q(x)) + :(Q(y))) + :(Q(z))) * ((:(Q(x)) + :(Q(y))) + :(Q(z)))) * 0.11))))" + "(Sum (z, y, x | (((R(x, y) and R(y, z)) or (C(x, y) and C(y, z)) or ex u, v ((C(z, u) and C(y, v) and R(y, u) and R(x, v))) or ex u, v ((R(y, u) and R(x, v) and C(v, y) and C(u, z)))) and (P(x) or P(y) or P(z)) and ((not Q(x)) or P(x)) and ((not Q(y)) or P(y)) and ((not Q(z)) or P(z))) : ((((:(P(x)) + :(P(y))) + :(P(z))) * ((:(P(x)) + :(P(y))) + :(P(z)))) * 0.11)) + (-1. * Sum (z, y, x | (((R(x, y) and R(y, z)) or (C(x, y) and C(y, z)) or ex u, v ((C(z, u) and C(y, v) and R(y, u) and R(x, v))) or ex u, v ((R(y, u) and R(x, v) and C(v, y) and C(u, z)))) and (Q(x) or Q(y) or Q(z)) and ((not P(x)) or Q(x)) and ((not P(y)) or Q(y)) and ((not P(z)) or Q(z))) : ((((:(Q(x)) + :(Q(y))) + :(Q(z))) * ((:(Q(x)) + :(Q(y))) + :(Q(z)))) * 0.11))))" (Formula.real_str (Heuristic.map_constants (fun c->(floor (c*.100.))/.100.) (default_heuristic 2. rules @@ -287,14 +288,14 @@ rule_of_str sigPQ "[a | P:1 {}; Q:1 {} | ] -> [ | Q:1 {}; P(a) | ] emb P, Q"; rule_of_str sigPQ "[a | P:1 {}; Q:1 {} | ] -> [ | P:1 {}; Q(a) | ] emb P, Q"] in assert_equal ~printer:(fun x->x) ~msg:"adv_ratio=2" - "(Sum (z, y, x, w, v | (((R(v, w) and R(w, x) and R(x, y) and R(y, z)) or (C(v, w) and C(w, x) and C(x, y) and C(y, z)) or ex r, s, t, u ((C(z, u) and R(y, u) and C(y, t) and R(x, t) and C(x, s) and R(w, s) and C(w, r) and R(v, r))) or ex r, s, t, u ((R(y, u) and R(x, t) and R(w, s) and R(v, r) and C(u, z) and C(t, y) and C(s, x) and C(r, w)))) and (P(z) or P(y) or P(x) or P(w) or P(v)) and (not Q(v)) and (not Q(w)) and (not Q(x)) and (not Q(y)) and (not Q(z))) : ((((((:(P(v)) + :(P(w))) + :(P(x))) + :(P(y))) + :(P(z))) * ((((:(P(v)) + :(P(w))) + :(P(x))) + :(P(y))) + :(P(z)))) * 0.04)) + (-1. * Sum (z, y, x, w, v | (((R(v, w) and R(w, x) and R(x, y) and R(y, z)) or (C(v, w) and C(w, x) and C(x, y) and C(y, z)) or ex r, s, t, u ((C(z, u) and R(y, u) and C(y, t) and R(x, t) and C(x, s) and R(w, s) and C(w, r) and R(v, r))) or ex r, s, t, u ((R(y, u) and R(x, t) and R(w, s) and R(v, r) and C(u, z) and C(t, y) and C(s, x) and C(r, w)))) and (Q(z) or Q(y) or Q(x) or Q(w) or Q(v)) and (not P(v)) and (not P(w)) and (not P(x)) and (not P(y)) and (not P(z))) : ((((((:(Q(v)) + :(Q(w))) + :(Q(x))) + :(Q(y))) + :(Q(z))) * ((((:(Q(v)) + :(Q(w))) + :(Q(x))) + :(Q(y))) + :(Q(z)))) * 0.04))))" + "(Sum (z, y, x, w, v | (((R(v, w) and R(w, x) and R(x, y) and R(y, z)) or (C(v, w) and C(w, x) and C(x, y) and C(y, z)) or ex r, s, t, u ((C(z, u) and R(y, u) and C(y, t) and R(x, t) and C(x, s) and R(w, s) and C(w, r) and R(v, r))) or ex r, s, t, u ((R(y, u) and R(x, t) and R(w, s) and R(v, r) and C(u, z) and C(t, y) and C(s, x) and C(r, w)))) and (P(z) or P(y) or P(x) or P(w) or P(v)) and ((not Q(z)) or P(z)) and ((not Q(y)) or P(y)) and ((not Q(x)) or P(x)) and ((not Q(w)) or P(w)) and ((not Q(v)) or P(v))) : ((((((:(P(v)) + :(P(w))) + :(P(x))) + :(P(y))) + :(P(z))) * ((((:(P(v)) + :(P(w))) + :(P(x))) + :(P(y))) + :(P(z)))) * 0.04)) + (-1. * Sum (z, y, x, w, v | (((R(v, w) and R(w, x) and R(x, y) and R(y, z)) or (C(v, w) and C(w, x) and C(x, y) and C(y, z)) or ex r, s, t, u ((C(z, u) and R(y, u) and C(y, t) and R(x, t) and C(x, s) and R(w, s) and C(w, r) and R(v, r))) or ex r, s, t, u ((R(y, u) and R(x, t) and R(w, s) and R(v, r) and C(u, z) and C(t, y) and C(s, x) and C(r, w)))) and (Q(z) or Q(y) or Q(x) or Q(w) or Q(v)) and ((not P(z)) or Q(z)) and ((not P(y)) or Q(y)) and ((not P(x)) or Q(x)) and ((not P(w)) or Q(w)) and ((not P(v)) or Q(v))) : ((((((:(Q(v)) + :(Q(w))) + :(Q(x))) + :(Q(y))) + :(Q(z))) * ((((:(Q(v)) + :(Q(w))) + :(Q(x))) + :(Q(y))) + :(Q(z)))) * 0.04))))" (Formula.real_str ((* Heuristic.map_constants (fun c->(floor (c*.100.))/.100.) *) (default_heuristic 2. rules (real_of_str (":("^winPvwxyz^") - :("^winQvwxyz^")"))))); assert_equal ~printer:(fun x->x) ~msg:"adv_ratio=3" - "(Sum (z, y, x, w, v | (((R(v, w) and R(w, x) and R(x, y) and R(y, z)) or (C(v, w) and C(w, x) and C(x, y) and C(y, z)) or ex r, s, t, u ((C(z, u) and R(y, u) and C(y, t) and R(x, t) and C(x, s) and R(w, s) and C(w, r) and R(v, r))) or ex r, s, t, u ((R(y, u) and R(x, t) and R(w, s) and R(v, r) and C(u, z) and C(t, y) and C(s, x) and C(r, w)))) and (P(z) or P(y) or P(x) or P(w) or P(v)) and (not Q(v)) and (not Q(w)) and (not Q(x)) and (not Q(y)) and (not Q(z))) : ((((((:(P(v)) + :(P(w))) + :(P(x))) + :(P(y))) + :(P(z))) * (((((:(P(v)) + :(P(w))) + :(P(x))) + :(P(y))) + :(P(z))) * ((((:(P(v)) + :(P(w))) + :(P(x))) + :(P(y))) + :(P(z))))) * 0.008)) + (-1. * Sum (z, y, x, w, v | (((R(v, w) and R(w, x) and R(x, y) and R(y, z)) or (C(v, w) and C(w, x) and C(x, y) and C(y, z)) or ex r, s, t, u ((C(z, u) and R(y, u) and C(y, t) and R(x, t) and C(x, s) and R(w, s) and C(w, r) and R(v, r))) or ex r, s, t, u ((R(y, u) and R(x, t) and R(w, s) and R(v, r) and C(u, z) and C(t, y) and C(s, x) and C(r, w)))) and (Q(z) or Q(y) or Q(x) or Q(w) or Q(v)) and (not P(v)) and (not P(w)) and (not P(x)) and (not P(y)) and (not P(z))) : ((((((:(Q(v)) + :(Q(w))) + :(Q(x))) + :(Q(y))) + :(Q(z))) * (((((:(Q(v)) + :(Q(w))) + :(Q(x))) + :(Q(y))) + :(Q(z))) * ((((:(Q(v)) + :(Q(w))) + :(Q(x))) + :(Q(y))) + :(Q(z))))) * 0.008))))" + "(Sum (z, y, x, w, v | (((R(v, w) and R(w, x) and R(x, y) and R(y, z)) or (C(v, w) and C(w, x) and C(x, y) and C(y, z)) or ex r, s, t, u ((C(z, u) and R(y, u) and C(y, t) and R(x, t) and C(x, s) and R(w, s) and C(w, r) and R(v, r))) or ex r, s, t, u ((R(y, u) and R(x, t) and R(w, s) and R(v, r) and C(u, z) and C(t, y) and C(s, x) and C(r, w)))) and (P(z) or P(y) or P(x) or P(w) or P(v)) and ((not Q(z)) or P(z)) and ((not Q(y)) or P(y)) and ((not Q(x)) or P(x)) and ((not Q(w)) or P(w)) and ((not Q(v)) or P(v))) : ((((((:(P(v)) + :(P(w))) + :(P(x))) + :(P(y))) + :(P(z))) * (((((:(P(v)) + :(P(w))) + :(P(x))) + :(P(y))) + :(P(z))) * ((((:(P(v)) + :(P(w))) + :(P(x))) + :(P(y))) + :(P(z))))) * 0.008)) + (-1. * Sum (z, y, x, w, v | (((R(v, w) and R(w, x) and R(x, y) and R(y, z)) or (C(v, w) and C(w, x) and C(x, y) and C(y, z)) or ex r, s, t, u ((C(z, u) and R(y, u) and C(y, t) and R(x, t) and C(x, s) and R(w, s) and C(w, r) and R(v, r))) or ex r, s, t, u ((R(y, u) and R(x, t) and R(w, s) and R(v, r) and C(u, z) and C(t, y) and C(s, x) and C(r, w)))) and (Q(z) or Q(y) or Q(x) or Q(w) or Q(v)) and ((not P(z)) or Q(z)) and ((not P(y)) or Q(y)) and ((not P(x)) or Q(x)) and ((not P(w)) or Q(w)) and ((not P(v)) or Q(v))) : ((((((:(Q(v)) + :(Q(w))) + :(Q(x))) + :(Q(y))) + :(Q(z))) * (((((:(Q(v)) + :(Q(w))) + :(Q(x))) + :(Q(y))) + :(Q(z))) * ((((:(Q(v)) + :(Q(w))) + :(Q(x))) + :(Q(y))) + :(Q(z))))) * 0.008))))" (Formula.real_str ((* Heuristic.map_constants (fun c->(floor (c*.1000.))/.1000.) *) (default_heuristic 3. rules @@ -328,15 +329,14 @@ "default_heuristic_old: connect5 of GDL translation" >:: (fun () -> - skip_if true "turns out connect5 is not monotonic"; let (game,state) = state_of_file "./GGP/tests/connect5-simpl.toss" in let loc_heurs = Heuristic.default_heuristic_old ~struc:state.Arena.struc ~advr:4.0 game in assert_equal ~printer:(fun x->x) - "SHOULD GENERATE AS FOR A MONOTONIC GAME" - (Formula.sprint_real loc_heurs.(0).(0)); + "((50. + (-50. * (((Sum (cell_x61_y61__blank_, cell_x60_y60__blank_, cell_x59_y59__blank_, cell_x58_y58__blank_, cell_x57_y57__blank_ | ((cell_x_y_o(cell_x61_y61__blank_) or cell_x_y_o(cell_x60_y60__blank_) or cell_x_y_o(cell_x59_y59__blank_) or cell_x_y_o(cell_x58_y58__blank_) or cell_x_y_o(cell_x57_y57__blank_)) and (cell_x_y_b(cell_x61_y61__blank_) or cell_x_y_o(cell_x61_y61__blank_)) and (cell_x_y_b(cell_x60_y60__blank_) or cell_x_y_o(cell_x60_y60__blank_)) and (cell_x_y_b(cell_x59_y59__blank_) or cell_x_y_o(cell_x59_y59__blank_)) and (cell_x_y_b(cell_x58_y58__blank_) or cell_x_y_o(cell_x58_y58__blank_)) and (cell_x_y_b(cell_x57_y57__blank_) or cell_x_y_o(cell_x57_y57__blank_)) and R2(cell_x61_y61__blank_, cell_x60_y60__blank_) and R2(cell_x60_y60__blank_, cell_x59_y59__blank_) and R2(cell_x59_y59__blank_, cell_x58_y58__blank_) and R2(cell_x58_y58__blank_, cell_x57_y57__blank_)) : ((((((:(cell_x_y_o(cell_x61_y61__blank_)) + :(cell_x_y_o(cell_x60_y60__blank_))) + :(cell_x_y_o(cell_x59_y59__blank_))) + :(cell_x_y_o(cell_x58_y58__blank_))) + :(cell_x_y_o(cell_x57_y57__blank_))) * (((((:(cell_x_y_o(cell_x61_y61__blank_)) + :(cell_x_y_o(cell_x60_y60__blank_))) + :(cell_x_y_o(cell_x59_y59__blank_))) + :(cell_x_y_o(cell_x58_y58__blank_))) + :(cell_x_y_o(cell_x57_y57__blank_))) * (((((:(cell_x_y_o(cell_x61_y61__blank_)) + :(cell_x_y_o(cell_x60_y60__blank_))) + :(cell_x_y_o(cell_x59_y59__blank_))) + :(cell_x_y_o(cell_x58_y58__blank_))) + :(cell_x_y_o(cell_x57_y57__blank_))) * ((((:(cell_x_y_o(cell_x61_y61__blank_)) + :(cell_x_y_o(cell_x60_y60__blank_))) + :(cell_x_y_o(cell_x59_y59__blank_))) + :(cell_x_y_o(cell_x58_y58__blank_))) + :(cell_x_y_o(cell_x57_y57__blank_)))))) * 0.0016)) + Sum (cell_x56_y56__blank_, cell_x55_y55__blank_, cell_x54_y54__blank_, cell_x53_y53__blank_, cell_x52_y52__blank_ | ((cell_x_y_o(cell_x56_y56__blank_) or cell_x_y_o(cell_x55_y55__blank_) or cell_x_y_o(cell_x54_y54__blank_) or cell_x_y_o(cell_x53_y53__blank_) or cell_x_y_o(cell_x52_y52__blank_)) and (cell_x_y_b(cell_x56_y56__blank_) or cell_x_y_o(cell_x56_y56__blank_)) and (cell_x_y_b(cell_x55_y55__blank_) or cell_x_y_o(cell_x55_y55__blank_)) and (cell_x_y_b(cell_x54_y54__blank_) or cell_x_y_o(cell_x54_y54__blank_)) and (cell_x_y_b(cell_x53_y53__blank_) or cell_x_y_o(cell_x53_y53__blank_)) and (cell_x_y_b(cell_x52_y52__blank_) or cell_x_y_o(cell_x52_y52__blank_)) and R1(cell_x56_y56__blank_, cell_x55_y55__blank_) and R1(cell_x55_y55__blank_, cell_x54_y54__blank_) and R1(cell_x54_y54__blank_, cell_x53_y53__blank_) and R1(cell_x53_y53__blank_, cell_x52_y52__blank_)) : ((((((:(cell_x_y_o(cell_x56_y56__blank_)) + :(cell_x_y_o(cell_x55_y55__blank_))) + :(cell_x_y_o(cell_x54_y54__blank_))) + :(cell_x_y_o(cell_x53_y53__blank_))) + :(cell_x_y_o(cell_x52_y52__blank_))) * (((((:(cell_x_y_o(cell_x56_y56__blank_)) + :(cell_x_y_o(cell_x55_y55__blank_))) + :(cell_x_y_o(cell_x54_y54__blank_))) + :(cell_x_y_o(cell_x53_y53__blank_))) + :(cell_x_y_o(cell_x52_y52__blank_))) * (((((:(cell_x_y_o(cell_x56_y56__blank_)) + :(cell_x_y_o(cell_x55_y55__blank_))) + :(cell_x_y_o(cell_x54_y54__blank_))) + :(cell_x_y_o(cell_x53_y53__blank_))) + :(cell_x_y_o(cell_x52_y52__blank_))) * ((((:(cell_x_y_o(cell_x56_y56__blank_)) + :(cell_x_y_o(cell_x55_y55__blank_))) + :(cell_x_y_o(cell_x54_y54__blank_))) + :(cell_x_y_o(cell_x53_y53__blank_))) + :(cell_x_y_o(cell_x52_y52__blank_)))))) * 0.0016))) + Sum (cell_e8_y51__blank_, cell_d8_y51__blank_, cell_c8_y51__blank_, cell_b8_y51__blank_, cell_a8_y51__blank_ | ((cell_x_y_o(cell_a8_y51__blank_) or cell_x_y_o(cell_b8_y51__blank_) or cell_x_y_o(cell_c8_y51__blank_) or cell_x_y_o(cell_d8_y51__blank_) or cell_x_y_o(cell_e8_y51__blank_)) and (cell_x_y_b(cell_a8_y51__blank_) or cell_x_y_o(cell_a8_y51__blank_)) and (cell_x_y_b(cell_b8_y51__blank_) or cell_x_y_o(cell_b8_y51__blank_)) and (cell_x_y_b(cell_c8_y51__blank_) or cell_x_y_o(cell_c8_y51__blank_)) and (cell_x_y_b(cell_d8_y51__blank_) or cell_x_y_o(cell_d8_y51__blank_)) and (cell_x_y_b(cell_e8_y51__blank_) or cell_x_y_o(cell_e8_y51__blank_)) and R0(cell_d8_y51__blank_, cell_e8_y51__blank_) and R0(cell_c8_y51__blank_, cell_d8_y51__blank_) and R0(cell_b8_y51__blank_, cell_c8_y51__blank_) and R0(cell_a8_y51__blank_, cell_b8_y51__blank_)) : ((((((:(cell_x_y_o(cell_a8_y51__blank_)) + :(cell_x_y_o(cell_b8_y51__blank_))) + :(cell_x_y_o(cell_c8_y51__blank_))) + :(cell_x_y_o(cell_d8_y51__blank_))) + :(cell_x_y_o(cell_e8_y51__blank_))) * (((((:(cell_x_y_o(cell_a8_y51__blank_)) + :(cell_x_y_o(cell_b8_y51__blank_))) + :(cell_x_y_o(cell_c8_y51__blank_))) + :(cell_x_y_o(cell_d8_y51__blank_))) + :(cell_x_y_o(cell_e8_y51__blank_))) * (((((:(cell_x_y_o(cell_a8_y51__blank_)) + :(cell_x_y_o(cell_b8_y51__blank_))) + :(cell_x_y_o(cell_c8_y51__blank_))) + :(cell_x_y_o(cell_d8_y51__blank_))) + :(cell_x_y_o(cell_e8_y51__blank_))) * ((((:(cell_x_y_o(cell_a8_y51__blank_)) + :(cell_x_y_o(cell_b8_y51__blank_))) + :(cell_x_y_o(cell_c8_y51__blank_))) + :(cell_x_y_o(cell_d8_y51__blank_))) + :(cell_x_y_o(cell_e8_y51__blank_)))))) * 0.0016))) + Sum (cell_x51_e7__blank_, cell_x51_d7__blank_, cell_x51_c7__blank_, cell_x51_b7__blank_, cell_x51_a7__blank_ | ((cell_x_y_o(cell_x51_a7__blank_) or cell_x_y_o(cell_x51_b7__blank_) or cell_x_y_o(cell_x51_c7__blank_) or cell_x_y_o(cell_x51_d7__blank_) or cell_x_y_o(cell_x51_e7__blank_)) and (cell_x_y_b(cell_x51_a7__blank_) or cell_x_y_o(cell_x51_a7__blank_)) and (cell_x_y_b(cell_x51_b7__blank_) or cell_x_y_o(cell_x51_b7__blank_)) and (cell_x_y_b(cell_x51_c7__blank_) or cell_x_y_o(cell_x51_c7__blank_)) and (cell_x_y_b(cell_x51_d7__blank_) or cell_x_y_o(cell_x51_d7__blank_)) and (cell_x_y_b(cell_x51_e7__blank_) or cell_x_y_o(cell_x51_e7__blank_)) and R(cell_x51_d7__blank_, cell_x51_e7__blank_) and R(cell_x51_c7__blank_, cell_x51_d7__blank_) and R(cell_x51_b7__blank_, cell_x51_c7__blank_) and R(cell_x51_a7__blank_, cell_x51_b7__blank_)) : ((((((:(cell_x_y_o(cell_x51_a7__blank_)) + :(cell_x_y_o(cell_x51_b7__blank_))) + :(cell_x_y_o(cell_x51_c7__blank_))) + :(cell_x_y_o(cell_x51_d7__blank_))) + :(cell_x_y_o(cell_x51_e7__blank_))) * (((((:(cell_x_y_o(cell_x51_a7__blank_)) + :(cell_x_y_o(cell_x51_b7__blank_))) + :(cell_x_y_o(cell_x51_c7__blank_))) + :(cell_x_y_o(cell_x51_d7__blank_))) + :(cell_x_y_o(cell_x51_e7__blank_))) * (((((:(cell_x_y_o(cell_x51_a7__blank_)) + :(cell_x_y_o(cell_x51_b7__blank_))) + :(cell_x_y_o(cell_x51_c7__blank_))) + :(cell_x_y_o(cell_x51_d7__blank_))) + :(cell_x_y_o(cell_x51_e7__blank_))) * ((((:(cell_x_y_o(cell_x51_a7__blank_)) + :(cell_x_y_o(cell_x51_b7__blank_))) + :(cell_x_y_o(cell_x51_c7__blank_))) + :(cell_x_y_o(cell_x51_d7__blank_))) + :(cell_x_y_o(cell_x51_e7__blank_)))))) * 0.0016))))) + (50. * (((Sum (cell_x50_y50__blank_, cell_x49_y49__blank_, cell_x48_y48__blank_, cell_x47_y47__blank_, cell_x46_y46__blank_ | ((cell_x_y_x(cell_x50_y50__blank_) or cell_x_y_x(cell_x49_y49__blank_) or cell_x_y_x(cell_x48_y48__blank_) or cell_x_y_x(cell_x47_y47__blank_) or cell_x_y_x(cell_x46_y46__blank_)) and (cell_x_y_b(cell_x50_y50__blank_) or cell_x_y_x(cell_x50_y50__blank_)) and (cell_x_y_b(cell_x49_y49__blank_) or cell_x_y_x(cell_x49_y49__blank_)) and (cell_x_y_b(cell_x48_y48__blank_) or cell_x_y_x(cell_x48_y48__blank_)) and (cell_x_y_b(cell_x47_y47__blank_) or cell_x_y_x(cell_x47_y47__blank_)) and (cell_x_y_b(cell_x46_y46__blank_) or cell_x_y_x(cell_x46_y46__blank_)) and R2(cell_x50_y50__blank_, cell_x49_y49__blank_) and R2(cell_x49_y49__blank_, cell_x48_y48__blank_) and R2(cell_x48_y48__blank_, cell_x47_y47__blank_) and R2(cell_x47_y47__blank_, cell_x46_y46__blank_)) : ((((((:(cell_x_y_x(cell_x50_y50__blank_)) + :(cell_x_y_x(cell_x49_y49__blank_))) + :(cell_x_y_x(cell_x48_y48__blank_))) + :(cell_x_y_x(cell_x47_y47__blank_))) + :(cell_x_y_x(cell_x46_y46__blank_))) * (((((:(cell_x_y_x(cell_x50_y50__blank_)) + :(cell_x_y_x(cell_x49_y49__blank_))) + :(cell_x_y_x(cell_x48_y48__blank_))) + :(cell_x_y_x(cell_x47_y47__blank_))) + :(cell_x_y_x(cell_x46_y46__blank_))) * (((((:(cell_x_y_x(cell_x50_y50__blank_)) + :(cell_x_y_x(cell_x49_y49__blank_))) + :(cell_x_y_x(cell_x48_y48__blank_))) + :(cell_x_y_x(cell_x47_y47__blank_))) + :(cell_x_y_x(cell_x46_y46__blank_))) * ((((:(cell_x_y_x(cell_x50_y50__blank_)) + :(cell_x_y_x(cell_x49_y49__blank_))) + :(cell_x_y_x(cell_x48_y48__blank_))) + :(cell_x_y_x(cell_x47_y47__blank_))) + :(cell_x_y_x(cell_x46_y46__blank_)))))) * 0.0016)) + Sum (cell_x45_y45__blank_, cell_x44_y44__blank_, cell_x43_y43__blank_, cell_x42_y42__blank_, cell_x41_y41__blank_ | ((cell_x_y_x(cell_x45_y45__blank_) or cell_x_y_x(cell_x44_y44__blank_) or cell_x_y_x(cell_x43_y43__blank_) or cell_x_y_x(cell_x42_y42__blank_) or cell_x_y_x(cell_x41_y41__blank_)) and (cell_x_y_b(cell_x45_y45__blank_) or cell_x_y_x(cell_x45_y45__blank_)) and (cell_x_y_b(cell_x44_y44__blank_) or cell_x_y_x(cell_x44_y44__blank_)) and (cell_x_y_b(cell_x43_y43__blank_) or cell_x_y_x(cell_x43_y43__blank_)) and (cell_x_y_b(cell_x42_y42__blank_) or cell_x_y_x(cell_x42_y42__blank_)) and (cell_x_y_b(cell_x41_y41__blank_) or cell_x_y_x(cell_x41_y41__blank_)) and R1(cell_x45_y45__blank_, cell_x44_y44__blank_) and R1(cell_x44_y44__blank_, cell_x43_y43__blank_) and R1(cell_x43_y43__blank_, cell_x42_y42__blank_) and R1(cell_x42_y42__blank_, cell_x41_y41__blank_)) : ((((((:(cell_x_y_x(cell_x45_y45__blank_)) + :(cell_x_y_x(cell_x44_y44__blank_))) + :(cell_x_y_x(cell_x43_y43__blank_))) + :(cell_x_y_x(cell_x42_y42__blank_))) + :(cell_x_y_x(cell_x41_y41__blank_))) * (((((:(cell_x_y_x(cell_x45_y45__blank_)) + :(cell_x_y_x(cell_x44_y44__blank_))) + :(cell_x_y_x(cell_x43_y43__blank_))) + :(cell_x_y_x(cell_x42_y42__blank_))) + :(cell_x_y_x(cell_x41_y41__blank_))) * (((((:(cell_x_y_x(cell_x45_y45__blank_)) + :(cell_x_y_x(cell_x44_y44__blank_))) + :(cell_x_y_x(cell_x43_y43__blank_))) + :(cell_x_y_x(cell_x42_y42__blank_))) + :(cell_x_y_x(cell_x41_y41__blank_))) * ((((:(cell_x_y_x(cell_x45_y45__blank_)) + :(cell_x_y_x(cell_x44_y44__blank_))) + :(cell_x_y_x(cell_x43_y43__blank_))) + :(cell_x_y_x(cell_x42_y42__blank_))) + :(cell_x_y_x(cell_x41_y41__blank_)))))) * 0.0016))) + Sum (cell_e6_y40__blank_, cell_d6_y40__blank_, cell_c6_y40__blank_, cell_b6_y40__blank_, cell_a6_y40__blank_ | ((cell_x_y_x(cell_a6_y40__blank_) or cell_x_y_x(cell_b6_y40__blank_) or cell_x_y_x(cell_c6_y40__blank_) or cell_x_y_x(cell_d6_y40__blank_) or cell_x_y_x(cell_e6_y40__blank_)) and (cell_x_y_b(cell_a6_y40__blank_) or cell_x_y_x(cell_a6_y40__blank_)) and (cell_x_y_b(cell_b6_y40__blank_) or cell_x_y_x(cell_b6_y40__blank_)) and (cell_x_y_b(cell_c6_y40__blank_) or cell_x_y_x(cell_c6_y40__blank_)) and (cell_x_y_b(cell_d6_y40__blank_) or cell_x_y_x(cell_d6_y40__blank_)) and (cell_x_y_b(cell_e6_y40__blank_) or cell_x_y_x(cell_e6_y40__blank_)) and R0(cell_d6_y40__blank_, cell_e6_y40__blank_) and R0(cell_c6_y40__blank_, cell_d6_y40__blank_) and R0(cell_b6_y40__blank_, cell_c6_y40__blank_) and R0(cell_a6_y40__blank_, cell_b6_y40__blank_)) : ((((((:(cell_x_y_x(cell_a6_y40__blank_)) + :(cell_x_y_x(cell_b6_y40__blank_))) + :(cell_x_y_x(cell_c6_y40__blank_))) + :(cell_x_y_x(cell_d6_y40__blank_))) + :(cell_x_y_x(cell_e6_y40__blank_))) * (((((:(cell_x_y_x(cell_a6_y40__blank_)) + :(cell_x_y_x(cell_b6_y40__blank_))) + :(cell_x_y_x(cell_c6_y40__blank_))) + :(cell_x_y_x(cell_d6_y40__blank_))) + :(cell_x_y_x(cell_e6_y40__blank_))) * (((((:(cell_x_y_x(cell_a6_y40__blank_)) + :(cell_x_y_x(cell_b6_y40__blank_))) + :(cell_x_y_x(cell_c6_y40__blank_))) + :(cell_x_y_x(cell_d6_y40__blank_))) + :(cell_x_y_x(cell_e6_y40__blank_))) * ((((:(cell_x_y_x(cell_a6_y40__blank_)) + :(cell_x_y_x(cell_b6_y40__blank_))) + :(cell_x_y_x(cell_c6_y40__blank_))) + :(cell_x_y_x(cell_d6_y40__blank_))) + :(cell_x_y_x(cell_e6_y40__blank_)))))) * 0.0016))) + Sum (cell_x40_e5__blank_, cell_x40_d5__blank_, cell_x40_c5__blank_, cell_x40_b5__blank_, cell_x40_a5__blank_ | ((cell_x_y_x(cell_x40_a5__blank_) or cell_x_y_x(cell_x40_b5__blank_) or cell_x_y_x(cell_x40_c5__blank_) or cell_x_y_x(cell_x40_d5__blank_) or cell_x_y_x(cell_x40_e5__blank_)) and (cell_x_y_b(cell_x40_a5__blank_) or cell_x_y_x(cell_x40_a5__blank_)) and (cell_x_y_b(cell_x40_b5__blank_) or cell_x_y_x(cell_x40_b5__blank_)) and (cell_x_y_b(cell_x40_c5__blank_) or cell_x_y_x(cell_x40_c5__blank_)) and (cell_x_y_b(cell_x40_d5__blank_) or cell_x_y_x(cell_x40_d5__blank_)) and (cell_x_y_b(cell_x40_e5__blank_) or cell_x_y_x(cell_x40_e5__blank_)) and R(cell_x40_d5__blank_, cell_x40_e5__blank_) and R(cell_x40_c5__blank_, cell_x40_d5__blank_) and R(cell_x40_b5__blank_, cell_x40_c5__blank_) and R(cell_x40_a5__blank_, cell_x40_b5__blank_)) : ((((((:(cell_x_y_x(cell_x40_a5__blank_)) + :(cell_x_y_x(cell_x40_b5__blank_))) + :(cell_x_y_x(cell_x40_c5__blank_))) + :(cell_x_y_x(cell_x40_d5__blank_))) + :(cell_x_y_x(cell_x40_e5__blank_))) * (((((:(cell_x_y_x(cell_x40_a5__blank_)) + :(cell_x_y_x(cell_x40_b5__blank_))) + :(cell_x_y_x(cell_x40_c5__blank_))) + :(cell_x_y_x(cell_x40_d5__blank_))) + :(cell_x_y_x(cell_x40_e5__blank_))) * (((((:(cell_x_y_x(cell_x40_a5__blank_)) + :(cell_x_y_x(cell_x40_b5__blank_))) + :(cell_x_y_x(cell_x40_c5__blank_))) + :(cell_x_y_x(cell_x40_d5__blank_))) + :(cell_x_y_x(cell_x40_e5__blank_))) * ((((:(cell_x_y_x(cell_x40_a5__blank_)) + :(cell_x_y_x(cell_x40_b5__blank_))) + :(cell_x_y_x(cell_x40_c5__blank_))) + :(cell_x_y_x(cell_x40_d5__blank_))) + :(cell_x_y_x(cell_x40_e5__blank_)))))) * 0.0016)))))" + (Formula.real_str loc_heurs.(0).(0)); ); "default_heuristic_old: expansion breakthrough of GDL translation" >:: @@ -472,11 +472,11 @@ Aux.run_test_if_target "HeuristicTest" bigtests let a () = - DiscreteRule.debug_level := 0; + DiscreteRule.debug_level := 4; Heuristic.debug_level := 3 let a () = - match test_filter ["Heuristic:10:default_heuristic_old: Connect4"] + match test_filter ["Heuristic:11:default_heuristic_old: connect5 of GDL translation"] tests with | Some tests -> ignore (run_test_tt ~verbose:true tests) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |