public static int Main(string[] args) { var s = new S3(); var modelChecker = new SSharpChecker(); return modelChecker.CheckInvariant(s, s.C.X < 10).FormulaHolds ? 0 : -1; }
public void DepthFirstSearch() { var model = new Model(); model.InitializeDefaultInstance(); model.CreateObserverController<MiniZincObserverController>(); model.SetAnalysisMode(AnalysisMode.TolerableFaults); var modelChecker = new SSharpChecker { Configuration = { CpuCount = 1, StateCapacity = 1 << 20 } }; var result = modelChecker.CheckInvariant(model, true); Console.WriteLine(result); }
public void AllWorkpiecesCompleteEventually() { var model = new Model(); model.InitializeDefaultInstance(); model.CreateObserverController<FastObserverController>(); model.Faults.SuppressActivations(); var modelChecker = new SSharpChecker { Configuration = { StateCapacity = 1 << 22 } }; var result = modelChecker.CheckInvariant(model, !model.Workpieces.All(w => w.IsComplete)); Assert.IsFalse(result.FormulaHolds); }
public void NoDamagedWorkpieces() { var model = new Model(); model.InitializeDefaultInstance(); model.CreateObserverController<FastObserverController>(); model.Faults.SuppressActivations(); var modelChecker = new SSharpChecker { Configuration = { StateCapacity = 1 << 22 } }; var result = modelChecker.CheckInvariant(model, !model.Workpieces.Any(w => w.IsDamaged)); Assert.IsTrue(result.FormulaHolds); }
public void EnumerateStateSpace() { var model = new Model(); model.InitializeDefaultInstance(); model.CreateObserverController<FastObserverController>(); model.Faults.SuppressActivations(); var modelChecker = new SSharpChecker { Configuration = { StateCapacity = 1 << 22 } }; var result = modelChecker.CheckInvariant(model, true); Assert.IsTrue(result.FormulaHolds); }
public void EnumerateAllStates() { var model = new ModelSetupParser().Parse("Analysis/medium_setup.model"); model.Faults.SuppressActivations(); var checker = new SSharpChecker { Configuration = { StateCapacity = 1 << 18 } }; var result = checker.CheckInvariant(model, true); Console.WriteLine(result.StateVectorLayout); }
public void Test() { var specification = new Model(); var model = specification; var faults = model.Faults; for (var i = 0; i < faults.Length; ++i) faults[i].Activation = Activation.Nondeterministic; var checker = new SSharpChecker { Configuration = { StateCapacity = 1310720 } }; checker.CheckInvariant(model, true); }
public void HasResourceAndHasWorkpieceMatch() { var model = new Model(); model.InitializeDefaultInstance(); model.CreateObserverController<FastObserverController>(); model.Faults.SuppressActivations(); var modelChecker = new SSharpChecker { Configuration = { StateCapacity = 1 << 22 } }; var result = modelChecker.CheckInvariant(model, model.RobotAgents.All(a => a.HasResource == a.Robot.HasWorkpiece) && model.CartAgents.All(a => a.HasResource == a.Cart.HasWorkpiece)); Assert.IsTrue(result.FormulaHolds); }