コード例 #1
0
ファイル: success.cs プロジェクト: isse-augsburg/ssharp
		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;
		}
コード例 #2
0
		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);
		}
コード例 #3
0
		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);
		}
コード例 #4
0
		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);
		}
コード例 #5
0
		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);
		}
コード例 #6
0
		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);
		}
コード例 #7
0
		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);
		}
コード例 #8
0
ファイル: ModelTests.cs プロジェクト: isse-augsburg/ssharp
		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);
		}