// Path: src/main/wcanalysis/heuristic/ContextManager.java
// public class ContextManager {
//   
//   static class CGContext {
//     final StackFrame stackFrame;
//     final StateBuilder stateBuilder;
//     
//     public CGContext(StackFrame sf, StateBuilder stateBuilder) {
//       this.stackFrame = sf;
//       this.stateBuilder = stateBuilder;
//     }
//   }
//   
//   private Map<Integer, CGContext> contextMap = new HashMap<>();
//   
//   public void addContext(ChoiceGenerator<?> cg, StackFrame caller, StateBuilder stateBuilder) {
//     if(contextMap.containsKey(cg.getStateId()))
//       throw new IllegalStateException("Attempt to override context map");
//     this.contextMap.put(cg.getStateId(), new CGContext(caller, stateBuilder));
//   }
//   
//   public CGContext getContext(ChoiceGenerator<?> cg) {
//     return this.contextMap.get(cg.getStateId());
//   }
// }
// 
// Path: src/main/wcanalysis/heuristic/Resolution.java
// public class Resolution implements Serializable {
//   public static enum ResolutionType implements Serializable {
//     PERFECT,
//     HISTORY, 
//     INVARIANT,
//     UNRESOLVED,
//     NEW_CHOICE;
//   }
//   
//   private static final long serialVersionUID = 2247935610676857227L;
//   public final ResolutionType type;
//   public final int choice;
//   public Resolution(int choice, ResolutionType type) {
//     this.choice = choice;
//     this.type = type;
//   }
// }


import java.util.Set;
import gov.nasa.jpf.vm.ChoiceGenerator;
import wcanalysis.heuristic.ContextManager;
import wcanalysis.heuristic.Resolution;
import java.io.IOException;
import java.io.InputStream;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.OutputStream;
import java.io.Serializable;
/*
 * MIT License
 *
 * Copyright (c) 2017 The ISSTAC Authors
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in all
 * copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 * SOFTWARE.
 */

package wcanalysis.heuristic.policy;



/**
 * @author Kasper Luckow
 *
 */
public abstract class Policy implements Serializable {
  
  private static final long serialVersionUID = -2247935610676857237L;
  
  private final Set<String> measuredMethods;
    
  public Policy(Set<String> measuredMethods) {
    this.measuredMethods = measuredMethods;
  }
  
  public Set<String> getMeasuredMethods() {
    return this.measuredMethods;
  }
  
// Path: src/main/wcanalysis/heuristic/ContextManager.java
// public class ContextManager {
//   
//   static class CGContext {
//     final StackFrame stackFrame;
//     final StateBuilder stateBuilder;
//     
//     public CGContext(StackFrame sf, StateBuilder stateBuilder) {
//       this.stackFrame = sf;
//       this.stateBuilder = stateBuilder;
//     }
//   }
//   
//   private Map<Integer, CGContext> contextMap = new HashMap<>();
//   
//   public void addContext(ChoiceGenerator<?> cg, StackFrame caller, StateBuilder stateBuilder) {
//     if(contextMap.containsKey(cg.getStateId()))
//       throw new IllegalStateException("Attempt to override context map");
//     this.contextMap.put(cg.getStateId(), new CGContext(caller, stateBuilder));
//   }
//   
//   public CGContext getContext(ChoiceGenerator<?> cg) {
//     return this.contextMap.get(cg.getStateId());
//   }
// }
// 
// Path: src/main/wcanalysis/heuristic/Resolution.java
// public class Resolution implements Serializable {
//   public static enum ResolutionType implements Serializable {
//     PERFECT,
//     HISTORY, 
//     INVARIANT,
//     UNRESOLVED,
//     NEW_CHOICE;
//   }
//   
//   private static final long serialVersionUID = 2247935610676857227L;
//   public final ResolutionType type;
//   public final int choice;
//   public Resolution(int choice, ResolutionType type) {
//     this.choice = choice;
//     this.type = type;
//   }
// }


// Path: src/main/wcanalysis/heuristic/policy/Policy.java
import java.util.Set;
import gov.nasa.jpf.vm.ChoiceGenerator;
import wcanalysis.heuristic.ContextManager;
import wcanalysis.heuristic.Resolution;
import java.io.IOException;
import java.io.InputStream;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.OutputStream;
import java.io.Serializable;

/*
 * MIT License
 *
 * Copyright (c) 2017 The ISSTAC Authors
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in all
 * copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 * SOFTWARE.
 */

package wcanalysis.heuristic.policy;



/**
 * @author Kasper Luckow
 *
 */
public abstract class Policy implements Serializable {
  
  private static final long serialVersionUID = -2247935610676857237L;
  
  private final Set<String> measuredMethods;
    
  public Policy(Set<String> measuredMethods) {
    this.measuredMethods = measuredMethods;
  }
  
  public Set<String> getMeasuredMethods() {
    return this.measuredMethods;
  }
  
  public abstract Resolution resolve(ChoiceGenerator<?> cg, ContextManager ctxManager);