Subject: Fragments
Keywords: ::policies
Title: fragment policies
--------------------------------------------------
OnVar : var -> (int -> tactic) -> tactic
  - allows hyp spec by name rather than number.
  - find hyp num and just use int -> tactic 
      * names meaningless once alpha normalized.
  - Could use when instantiating an hypnum -> tactic fragment
Cost/Benefit matrix
  - compute effort (GC, CPUTIME, RuleCount)
      * smaller better
  - primitive tree size
      * smaller better
  - tactic tree size : 
      * conciseness vs explication
      * other measures being equal then concise preferred.
          - smaller is better
              * easier maintenance, if Auto only uniformly gets better. 
  no direct correlations 
    Eg, faster may result in bigger or smaller primitive tree
  smaller tactic tree
    * uniformly better compute and primtree -> Good.
    * mixed : how bad is the worse measure 
    * uniformly worse : accept a small penalty
        ConcisnessPenaltyPercentage      
FTTB not considering primitive tree size
 while dekreitzing not tracking subgoals, 
 but probably easily could. 
Examples
T1 THEN T2 THEN Auto becomes
T1 THEN Auto but dyngc goes from 0 to 6
T1 leaves two subgoals becomes
T1 THEN Auto leaving one subgoal but dyngc 0 -> 8
  - info about cost of tree that finished other subgoal is not available
((T1 THEN T2 THEN T3 THEN T4) THEN AutoA) THEN (T5 THEN Auto)
(T1 THEN T2 THEN T3 THEN (T4 THENW Complete Auto)
 THENL [(T5 THEN Try (Complete Auto)) THEN Auto;
        (T5 THEN Try (Complete Auto)) THEN Auto']
Total Cost goes from 14 -> 24 probably because 
 of duplicate Auto effort on subgoal that does not complete in each THENL clause
 MinMax effects the outcome here
  if effort is total effor of T THEN TCA is less then minmax or Conciesness then do the TCA
  else don't and apply Auto individually to subgoals.
(T1 THENA Auto) THEN (T2 THENA Auto) THEN (T2 THEN Auto) THEN (T4 THEN Auto)
  leaving 1 subgoal
T1 THENW Auto THEN T2 THEN Auto
  leaving no subgoals but cost goes from 13 -> 46
 thus, cost exceeds acceptable penalty so would not accept
  do not have cost to finish subgoal available thus would need
  to judge cost relative to some completeing subgoal acceptable penalty
  which would need to be pretty agressive to accept this. 
   
 becomes one of :
  (T1 THENx Auto) THEN (T2 THEN Auto)
  T1 THEN (T2 THEN Auto)
  T1 THEN Auto
 Pick best wrt cost except prefer last option if small penalty
 Locally optimize, may not be globally optimal
  - bottom up within source subtrees (ie checked only at dekreitz)
  - but should accept bigger penalty if fewer (while covering soruce) subgoals
    than source tree  
 Must cover subgoals, but may finish some.
  T1 THEN Auto
    - penalty wrt effort or primitive tree size
  
    - finishes one or more subgoals.
        cost of tree - relative to 
    -
Broaden
T THENA Auto
  T THEN Try (Complete Auto)
Try Complete - 
  - Might add signifcant cost on subgoals not completed
      * THEN<x> where x one of A,W, or M to filter out problem subgoals
      * Dont do THENx Try Complete Auto and maybe apply Auto to some individual subgoals.
 
dups :
 avoids adding new records if a re-rank lessor dup exists
 expensive to search for dups at each update.
 how many dups are there? like 1-2%  
   - if any completion of fragment for a stm is not from that stm
       ie hie not same for dekreitz/thin if thin dup or thin/alpha for alpha dup.
     then is a dup (and rest of completion would implicitly be too).
 dekreitz not checked for dups 
 rather than detect dups at insert, just insert then
 have background job to remove dups rather than doing it as we go
   - foreach thin fragment dseq bucket
       - find equivalent step
         delete fragment with greater hrank
         update orig of deleted fragment to point remaing fragment. 
Dekreitz is aggressive about using Auto to complete subgoals.
However, this can, at times, be quite a bit more expensive.
Thus need to limit Auto in cases when it is too expensive:
  ? what is too expensive
      ? need sum of cost of subtree
      ! have cost of entire tree 
  
fragments currently record extract_by_obid, computationStep and rule 
dependencies, should be extended to include updates but must 
re-examine update dependencies to be sure accurate.
Could be done via a dependency fragment which minimizes dependencies
by building explicit re's from the dependencies
 
When replaying, if rule_count is less than 33% greater than saved value
 the percentage value is now specified as prop on ccobid.
 then update value and call it good,
 othewise fail replay step.
When inserting genned record in index table
 expect bucket to be sorted by re_rank
 if dup and rank of new record is greater or equal then found record is better than old.
 if dup and rank of new record is less then new record is better than old
   - overwrite, ie use key of found record and write new content.
 if no dup then insert new record
 
 ⋅
--------------------------------------------------
Authors: 
Contributors: RICH:t
              NUPRL:t
⋅
Home