1 package gov.nasa.jpf.search; 20 21 22 import gov.nasa.jpf.*; 23 import gov.nasa.jpf.util.Debug; 24 25 26 30 public class DFSearch extends AbstractSearch { 31 32 public DFSearch (Config config, VM vm) { 33 super(config,vm); 34 35 Debug.println(Debug.MESSAGE, "MC Search"); 36 } 37 38 public boolean requestBacktrack () { 39 doBacktrack = true; 40 41 return true; 42 } 43 44 66 67 public void search () { 68 int maxDepth = getMaxSearchDepth(); 69 70 depth = 0; 71 72 notifySearchStarted(); 73 74 while (!done) { 75 if ( !isNewState || isEndState) { 76 if (!backtrack()) { break; 78 } 79 80 depth--; 81 notifyStateBacktracked(); 82 } 83 84 if (forward()) { 85 notifyStateAdvanced(); 86 87 if (hasPropertyTermination()) { 88 break; 89 } 90 91 if (isNewState) { 92 depth++; 93 94 if (depth >= maxDepth) { 95 isEndState = true; 96 notifySearchConstraintHit(QUEUE_CONSTRAINT); 97 } 98 99 if (!checkStateSpaceLimit()) { 100 notifySearchConstraintHit(SIZE_CONSTRAINT); 101 break; 103 } 104 } 105 } else { notifyStateProcessed(); 107 } 108 } 109 110 notifySearchFinished(); 111 } 112 113 114 public boolean supportsBacktrack () { 115 return true; 116 } 117 } 118 | Popular Tags |