├── .gitattributes
├── .gitignore
├── Common
└── version.cs
├── DelayingSchedulers
├── CustomDelayingScheduler
│ ├── CustomDelayingScheduler.cs
│ ├── CustomDelayingScheduler.csproj
│ ├── CustomDelayingScheduler.sln
│ └── Properties
│ │ └── AssemblyInfo.cs
├── RandomDelayingScheduler
│ ├── App.config
│ ├── Properties
│ │ └── AssemblyInfo.cs
│ ├── RandomDelayingScheduler.cs
│ └── RandomDelayingScheduler.csproj
├── RoundRobinDelayingScheduler
│ ├── Properties
│ │ └── AssemblyInfo.cs
│ ├── RoundRobinDelayingScheduler.cs
│ └── RoundRobinDelayingScheduler.csproj
├── RunToCompletionDelayingScheduler
│ ├── Properties
│ │ └── AssemblyInfo.cs
│ ├── RunToCompletionDelayingScheduler.cs
│ └── RunToCompletionDelayingScheduler.csproj
└── SealingScheduler
│ ├── Properties
│ └── AssemblyInfo.cs
│ ├── SealingScheduler.cs
│ └── SealingScheduler.csproj
├── Issues.txt
├── LICENSE.txt
├── LongRegressions
├── TMCompletionEventBug
│ ├── TMCompletionEventBug.zing
│ ├── golden.txt
│ └── param
├── n-bt
│ ├── compile_param
│ ├── golden.txt
│ ├── n-bt.zing
│ └── param
└── p-bt
│ ├── compile_param
│ ├── p-bt.zing
│ └── param
├── Microsoft.Zing.Runtime
├── AssemblyInfo.cs
├── Attributes.cs
├── Backtrace.cs
├── BaseClasses.cs
├── Events.cs
├── Exceptions.cs
├── Fingerprint.cs
├── FrontierTree.cs
├── HeapCanonicalizer.cs
├── HeapTraverser.cs
├── Microsoft.Zing.Runtime.csproj
├── Process.cs
├── ProgramCounterTuple.cs
├── State.cs
├── StateImpl.cs
├── StepByStepTraversal.cs
├── TraversalInfo.cs
├── Utils.cs
├── ZingDelayingSchedulerInterface.cs
├── ZingDronacharya.cs
├── ZingMethod.cs
├── ZingPluginInterface.cs
├── ZingPreemptionBounding.cs
├── ZingerConfiguration.cs
└── ZingerUtilities.cs
├── Microsoft.Zing
├── AssemblyInfo.cs
├── BBOptimizer.cs
├── BBSplitter.cs
├── Decompiler.cs
├── ErrorMessages.resx
├── Folders.bmp
├── Microsoft.Zing.csproj
├── ModuleSuppressions.cs
├── Partitioner.cs
├── Replacer.cs
├── Restorer.cs
├── Runtime.cs
├── Splicer.cs
├── Template.cs
├── TemplateExprs.cs
├── TemplateParts.cs
├── TemplateProps.cs
├── TemplateStmts.cs
├── TypeSystem.cs
├── ZChecker.cs
├── ZDeclarer.cs
├── ZDecompiler.cs
├── ZDuplicator.cs
├── ZLooker.cs
├── ZNodes.cs
├── ZNormalizer.cs
├── ZReplacer.cs
├── ZResolver.cs
├── ZScoper.cs
├── ZTemplateParser.cs
├── compiler.cs
├── debugger.cs
├── error.cs
├── languageservice.cs
├── parser.cs
└── scanner.cs
├── Plugins
├── MotionPlanning
│ ├── Complan.cs
│ ├── Complan.csproj
│ └── Properties
│ │ └── AssemblyInfo.cs
└── StateCoveragePlugin
│ ├── Properties
│ └── AssemblyInfo.cs
│ ├── StateCoveragePlugin.cs
│ └── StateCoveragePlugin.csproj
├── README.md
├── Regression
├── AllocObject
│ ├── AllocObject.zing
│ ├── compile_param
│ ├── golden_1.txt
│ ├── golden_2.txt
│ ├── golden_3.txt
│ ├── golden_4.txt
│ ├── golden_5.txt
│ └── param
├── AlternatingBit
│ ├── AlternatingBit.zing
│ ├── compile_param
│ ├── golden_1.txt
│ ├── golden_2.txt
│ ├── golden_3.txt
│ ├── golden_4.txt
│ ├── golden_5.txt
│ └── param
├── Array1
│ ├── Array1.zing
│ ├── compile_param
│ ├── golden_1.txt
│ ├── golden_2.txt
│ ├── golden_3.txt
│ ├── golden_4.txt
│ ├── golden_5.txt
│ └── param
├── Array2
│ ├── Array2.zing
│ ├── compile_param
│ ├── golden_1.txt
│ ├── golden_2.txt
│ ├── golden_3.txt
│ ├── golden_4.txt
│ ├── golden_5.txt
│ └── param
├── Array3
│ ├── Array3.zing
│ ├── compile_param
│ ├── golden_1.txt
│ ├── golden_2.txt
│ ├── golden_3.txt
│ ├── golden_4.txt
│ ├── golden_5.txt
│ └── param
├── Array4
│ ├── Array4.zing
│ ├── compile_param
│ ├── golden_1.txt
│ ├── golden_2.txt
│ ├── golden_3.txt
│ ├── golden_4.txt
│ ├── golden_5.txt
│ └── param
├── AuctionHouse
│ ├── AuctionHouse.zing
│ ├── compile_param
│ ├── golden_1.txt
│ ├── golden_2.txt
│ ├── golden_3.txt
│ ├── golden_4.txt
│ ├── golden_5.txt
│ └── param
├── BlueGlobal
│ ├── BlueGlobal.zing
│ ├── compile_param
│ ├── golden_1.txt
│ ├── golden_2.txt
│ ├── golden_3.txt
│ ├── golden_4.txt
│ ├── golden_5.txt
│ └── param
├── BlueGlobalFix2
│ ├── BlueGlobalFix2.zing
│ ├── compile_param
│ ├── golden_1.txt
│ ├── golden_2.txt
│ ├── golden_3.txt
│ ├── golden_4.txt
│ ├── golden_5.txt
│ └── param
├── Bluetooth
│ ├── Bluetooth.zing
│ ├── compile_param
│ ├── golden_1.txt
│ ├── golden_2.txt
│ ├── golden_3.txt
│ ├── golden_4.txt
│ ├── golden_5.txt
│ └── param
├── BluetoothFix
│ ├── BluetoothFix.zing
│ ├── compile_param
│ ├── golden_1.txt
│ ├── golden_2.txt
│ ├── golden_3.txt
│ ├── golden_4.txt
│ ├── golden_5.txt
│ └── param
├── BluetoothFix2
│ ├── BluetoothFix2.zing
│ ├── compile_param
│ ├── golden_1.txt
│ ├── golden_2.txt
│ ├── golden_3.txt
│ ├── golden_4.txt
│ ├── golden_5.txt
│ └── param
├── Casting
│ ├── Casting.zing
│ ├── compile_param
│ ├── golden_1.txt
│ ├── golden_2.txt
│ ├── golden_3.txt
│ ├── golden_4.txt
│ ├── golden_5.txt
│ └── param
├── Copy.bat
├── Ex1
│ ├── Ex1.zing
│ ├── compile_param
│ ├── golden_1.txt
│ ├── golden_2.txt
│ ├── golden_3.txt
│ ├── golden_4.txt
│ ├── golden_5.txt
│ └── param
├── Ex2
│ ├── Ex2.zing
│ ├── compile_param
│ ├── golden_1.txt
│ ├── golden_2.txt
│ ├── golden_3.txt
│ ├── golden_4.txt
│ ├── golden_5.txt
│ └── param
├── Ex3
│ ├── Ex3.zing
│ ├── compile_param
│ ├── golden_1.txt
│ ├── golden_2.txt
│ ├── golden_3.txt
│ ├── golden_4.txt
│ ├── golden_5.txt
│ └── param
├── Indigo
│ ├── Indigo.zing
│ ├── compile_param
│ ├── golden_1.txt
│ ├── golden_2.txt
│ ├── golden_3.txt
│ ├── golden_4.txt
│ ├── golden_5.txt
│ └── param
├── Objects
│ ├── Objects.zing
│ ├── compile_param
│ ├── golden_1.txt
│ ├── golden_2.txt
│ ├── golden_3.txt
│ ├── golden_4.txt
│ ├── golden_5.txt
│ └── param
├── ParPort
│ ├── compile_param
│ ├── golden_1.txt
│ ├── golden_2.txt
│ ├── golden_3.txt
│ ├── golden_4.txt
│ ├── golden_5.txt
│ ├── param
│ └── parport.zing
├── Philosophers1
│ ├── Philosophers1.zing
│ ├── compile_param
│ ├── golden_1.txt
│ ├── golden_2.txt
│ ├── golden_3.txt
│ ├── golden_4.txt
│ ├── golden_5.txt
│ └── param
├── Philosophers2
│ ├── Philosophers2.zing
│ ├── compile_param
│ ├── golden_1.txt
│ ├── golden_2.txt
│ ├── golden_3.txt
│ ├── golden_4.txt
│ ├── golden_5.txt
│ └── param
├── QuoteSvc
│ ├── QuoteSvc.zing
│ ├── compile_param
│ ├── golden_1.txt
│ ├── golden_2.txt
│ ├── golden_3.txt
│ ├── golden_4.txt
│ ├── golden_5.txt
│ └── param
├── Shipping
│ ├── Shipping.zing
│ ├── compile_param
│ ├── golden_1.txt
│ ├── golden_2.txt
│ ├── golden_3.txt
│ ├── golden_4.txt
│ ├── golden_5.txt
│ └── param
├── TMTimerDisabledBug
│ ├── TMTimerDisabledBug.zing
│ ├── compile_param
│ ├── golden_1.txt
│ ├── golden_2.txt
│ ├── golden_3.txt
│ ├── golden_4.txt
│ ├── golden_5.txt
│ └── param
├── Test2
│ ├── Test2.zing
│ ├── compile_param
│ ├── golden_1.txt
│ ├── golden_2.txt
│ ├── golden_3.txt
│ ├── golden_4.txt
│ ├── golden_5.txt
│ └── param
├── Test3
│ ├── Test3.zing
│ ├── compile_param
│ ├── golden_1.txt
│ ├── golden_2.txt
│ ├── golden_3.txt
│ ├── golden_4.txt
│ ├── golden_5.txt
│ └── param
├── Test4
│ ├── Test4.zing
│ ├── compile_param
│ ├── golden_1.txt
│ ├── golden_2.txt
│ ├── golden_3.txt
│ ├── golden_4.txt
│ ├── golden_5.txt
│ └── param
├── Test5
│ ├── Test5.zing
│ ├── compile_param
│ ├── golden_1.txt
│ ├── golden_2.txt
│ ├── golden_3.txt
│ ├── golden_4.txt
│ ├── golden_5.txt
│ └── param
├── Test6
│ ├── Test6.zing
│ ├── compile_param
│ ├── golden_1.txt
│ ├── golden_2.txt
│ ├── golden_3.txt
│ ├── golden_4.txt
│ ├── golden_5.txt
│ └── param
├── ZingSet
│ ├── ZingSet.zing
│ ├── compile_param
│ ├── golden_1.txt
│ ├── golden_2.txt
│ ├── golden_3.txt
│ ├── golden_4.txt
│ ├── golden_5.txt
│ └── param
├── assume
│ ├── assume.cs
│ ├── assume.zing
│ ├── compile_param
│ ├── golden_1.txt
│ ├── golden_2.txt
│ ├── golden_3.txt
│ ├── golden_4.txt
│ ├── golden_5.txt
│ └── param
├── bakeryAlgo
│ ├── bakeryAlgo.zing
│ ├── compile_param
│ ├── golden_1.txt
│ ├── golden_2.txt
│ ├── golden_3.txt
│ ├── golden_4.txt
│ ├── golden_5.txt
│ └── param
├── chan1
│ ├── chan1.zing
│ ├── compile_param
│ ├── golden_1.txt
│ ├── golden_2.txt
│ ├── golden_3.txt
│ ├── golden_4.txt
│ ├── golden_5.txt
│ └── param
├── choose1
│ ├── choose1.zing
│ ├── compile_param
│ ├── golden_1.txt
│ ├── golden_2.txt
│ ├── golden_3.txt
│ ├── golden_4.txt
│ ├── golden_5.txt
│ └── param
├── clean.bat
├── golden.bat
├── interleave
│ ├── compile_param
│ ├── golden_1.txt
│ ├── golden_2.txt
│ ├── golden_3.txt
│ ├── golden_4.txt
│ ├── golden_5.txt
│ ├── interleave.zing
│ └── param
├── mutex
│ ├── compile_param
│ ├── golden_1.txt
│ ├── golden_2.txt
│ ├── golden_3.txt
│ ├── golden_4.txt
│ ├── golden_5.txt
│ ├── mutex.zing
│ └── param
├── n-peterson
│ ├── compile_param
│ ├── golden_1.txt
│ ├── golden_2.txt
│ ├── golden_3.txt
│ ├── golden_4.txt
│ ├── golden_5.txt
│ ├── n-peterson.zing
│ └── param
├── p-peterson
│ ├── compile_param
│ ├── golden_1.txt
│ ├── golden_2.txt
│ ├── golden_3.txt
│ ├── golden_4.txt
│ ├── golden_5.txt
│ ├── p-peterson.zing
│ └── param
└── regression.bat
├── Resources
├── Dronacharya
│ └── DronacharyaConfig.xml
├── Source_Zing.ico
├── Zing.jpg
└── external
│ └── CCI
│ ├── Microsoft.Comega.Runtime.dll
│ ├── Microsoft.Comega.dll
│ ├── System.Compiler.Framework.dll
│ ├── System.Compiler.Runtime.dll
│ └── System.Compiler.dll
├── ZING.sln
├── ZingExplorer
├── ZingExplorer.cs
├── ZingExplorer.csproj
├── ZingExplorerExhaustiveSearch.cs
├── ZingExplorerLivenessSampling.cs
├── ZingExplorerNDFSLiveness.cs
├── ZingExplorerSampling.cs
├── ZingExplorerStateLessSearch.cs
└── ZingerStateTable.cs
├── Zinger
├── App.ico
├── AssemblyInfo.cs
├── Source_Zing.ico
├── Zinger.cs
├── Zinger.csproj
├── ZingerCommandLine.cs
├── app.config
└── version.cs
└── zc
├── App.ico
├── AssemblyInfo.cs
├── Main.cs
├── app.config
└── zc.csproj
/.gitattributes:
--------------------------------------------------------------------------------
1 | ###############################################################################
2 | # Set default behavior to automatically normalize line endings.
3 | ###############################################################################
4 | * text=auto
5 |
6 | ###############################################################################
7 | # Set default behavior for command prompt diff.
8 | #
9 | # This is need for earlier builds of msysgit that does not have it on by
10 | # default for csharp files.
11 | # Note: This is only used by command line
12 | ###############################################################################
13 | #*.cs diff=csharp
14 |
15 | ###############################################################################
16 | # Set the merge driver for project and solution files
17 | #
18 | # Merging from the command prompt will add diff markers to the files if there
19 | # are conflicts (Merging from VS is not affected by the settings below, in VS
20 | # the diff markers are never inserted). Diff markers may cause the following
21 | # file extensions to fail to load in VS. An alternative would be to treat
22 | # these files as binary and thus will always conflict and require user
23 | # intervention with every merge. To do so, just uncomment the entries below
24 | ###############################################################################
25 | #*.sln merge=binary
26 | #*.csproj merge=binary
27 | #*.vbproj merge=binary
28 | #*.vcxproj merge=binary
29 | #*.vcproj merge=binary
30 | #*.dbproj merge=binary
31 | #*.fsproj merge=binary
32 | #*.lsproj merge=binary
33 | #*.wixproj merge=binary
34 | #*.modelproj merge=binary
35 | #*.sqlproj merge=binary
36 | #*.wwaproj merge=binary
37 |
38 | ###############################################################################
39 | # behavior for image files
40 | #
41 | # image files are treated as binary by default.
42 | ###############################################################################
43 | #*.jpg binary
44 | #*.png binary
45 | #*.gif binary
46 |
47 | ###############################################################################
48 | # diff behavior for common document formats
49 | #
50 | # Convert binary document formats to text before diffing them. This feature
51 | # is only available from the command line. Turn it on by uncommenting the
52 | # entries below.
53 | ###############################################################################
54 | #*.doc diff=astextplain
55 | #*.DOC diff=astextplain
56 | #*.docx diff=astextplain
57 | #*.DOCX diff=astextplain
58 | #*.dot diff=astextplain
59 | #*.DOT diff=astextplain
60 | #*.pdf diff=astextplain
61 | #*.PDF diff=astextplain
62 | #*.rtf diff=astextplain
63 | #*.RTF diff=astextplain
64 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | bin
2 | obj
3 |
--------------------------------------------------------------------------------
/Common/version.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | [assembly: AssemblyCompany("Microsoft Corporation")]
3 | [assembly: AssemblyProduct("Microsoft (R) Zing")]
4 | [assembly: AssemblyCopyright("Copyright (C) Microsoft Corp. 2002, 2003, 2004, 2005. All rights reserved")]
5 | [assembly: AssemblyTrademark("Microsoft and Windows are either registered trademarks or trademarks of Microsoft Corporation in the U.S. and/or other countries")]
6 | [assembly: AssemblyVersion("2.0.2004.0")]
7 | [assembly: AssemblyFileVersion("2.0.2004.0")]
8 |
--------------------------------------------------------------------------------
/DelayingSchedulers/CustomDelayingScheduler/CustomDelayingScheduler.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | AnyCPU
7 | {AEEAA9E8-6622-4C65-8798-646EC7F67C04}
8 | Library
9 | Properties
10 | CustomDelayingScheduler
11 | CustomDelayingScheduler
12 | v4.5
13 | 512
14 |
15 |
16 | true
17 | full
18 | false
19 | bin\Debug\
20 | DEBUG;TRACE
21 | prompt
22 | 4
23 |
24 |
25 | pdbonly
26 | true
27 | bin\Release\
28 | TRACE
29 | prompt
30 | 4
31 |
32 |
33 | x86
34 | bin\x86\Debug\
35 |
36 |
37 | x86
38 | bin\x86\Release\
39 |
40 |
41 | true
42 | bin\x64\Debug\
43 | DEBUG;TRACE
44 | full
45 | x64
46 | prompt
47 | MinimumRecommendedRules.ruleset
48 |
49 |
50 | bin\x64\Release\
51 | TRACE
52 | true
53 | pdbonly
54 | x64
55 | prompt
56 | MinimumRecommendedRules.ruleset
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 | {faf10deb-0879-4fbe-a08e-ef23f9016ae6}
74 | Microsoft.Zing.Runtime
75 |
76 |
77 |
78 |
85 |
--------------------------------------------------------------------------------
/DelayingSchedulers/CustomDelayingScheduler/CustomDelayingScheduler.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio 2012
4 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CustomDelayingScheduler", "CustomDelayingScheduler.csproj", "{AEEAA9E8-6622-4C65-8798-646EC7F67C04}"
5 | EndProject
6 | Global
7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
8 | Debug|Any CPU = Debug|Any CPU
9 | Debug|x64 = Debug|x64
10 | Debug|x86 = Debug|x86
11 | Release|Any CPU = Release|Any CPU
12 | Release|x64 = Release|x64
13 | Release|x86 = Release|x86
14 | EndGlobalSection
15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
16 | {AEEAA9E8-6622-4C65-8798-646EC7F67C04}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
17 | {AEEAA9E8-6622-4C65-8798-646EC7F67C04}.Debug|Any CPU.Build.0 = Debug|Any CPU
18 | {AEEAA9E8-6622-4C65-8798-646EC7F67C04}.Debug|x64.ActiveCfg = Debug|x64
19 | {AEEAA9E8-6622-4C65-8798-646EC7F67C04}.Debug|x64.Build.0 = Debug|x64
20 | {AEEAA9E8-6622-4C65-8798-646EC7F67C04}.Debug|x86.ActiveCfg = Debug|x86
21 | {AEEAA9E8-6622-4C65-8798-646EC7F67C04}.Debug|x86.Build.0 = Debug|x86
22 | {AEEAA9E8-6622-4C65-8798-646EC7F67C04}.Release|Any CPU.ActiveCfg = Release|Any CPU
23 | {AEEAA9E8-6622-4C65-8798-646EC7F67C04}.Release|Any CPU.Build.0 = Release|Any CPU
24 | {AEEAA9E8-6622-4C65-8798-646EC7F67C04}.Release|x64.ActiveCfg = Release|x64
25 | {AEEAA9E8-6622-4C65-8798-646EC7F67C04}.Release|x64.Build.0 = Release|x64
26 | {AEEAA9E8-6622-4C65-8798-646EC7F67C04}.Release|x86.ActiveCfg = Release|x86
27 | {AEEAA9E8-6622-4C65-8798-646EC7F67C04}.Release|x86.Build.0 = Release|x86
28 | EndGlobalSection
29 | GlobalSection(SolutionProperties) = preSolution
30 | HideSolutionNode = FALSE
31 | EndGlobalSection
32 | EndGlobal
33 |
--------------------------------------------------------------------------------
/DelayingSchedulers/CustomDelayingScheduler/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.InteropServices;
3 |
4 | // General Information about an assembly is controlled through the following
5 | // set of attributes. Change these attribute values to modify the information
6 | // associated with an assembly.
7 | [assembly: AssemblyTitle("PriorityScheduler")]
8 | [assembly: AssemblyDescription("")]
9 | [assembly: AssemblyConfiguration("")]
10 | [assembly: AssemblyCompany("")]
11 | [assembly: AssemblyProduct("PriorityScheduler")]
12 | [assembly: AssemblyCopyright("Copyright © 2014")]
13 | [assembly: AssemblyTrademark("")]
14 | [assembly: AssemblyCulture("")]
15 |
16 | // Setting ComVisible to false makes the types in this assembly not visible
17 | // to COM components. If you need to access a type in this assembly from
18 | // COM, set the ComVisible attribute to true on that type.
19 | [assembly: ComVisible(false)]
20 |
21 | // The following GUID is for the ID of the typelib if this project is exposed to COM
22 | [assembly: Guid("2d1a7c40-6620-42d3-bed2-18e09cd6514b")]
23 |
24 | // Version information for an assembly consists of the following four values:
25 | //
26 | // Major Version
27 | // Minor Version
28 | // Build Number
29 | // Revision
30 | //
31 | // You can specify all the values or you can default the Build and Revision Numbers
32 | // by using the '*' as shown below:
33 | // [assembly: AssemblyVersion("1.0.*")]
34 | [assembly: AssemblyVersion("1.0.0.0")]
35 | [assembly: AssemblyFileVersion("1.0.0.0")]
--------------------------------------------------------------------------------
/DelayingSchedulers/RandomDelayingScheduler/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/DelayingSchedulers/RandomDelayingScheduler/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.InteropServices;
3 |
4 | // General Information about an assembly is controlled through the following
5 | // set of attributes. Change these attribute values to modify the information
6 | // associated with an assembly.
7 | [assembly: AssemblyTitle("RandomDelayingScheduler")]
8 | [assembly: AssemblyDescription("")]
9 | [assembly: AssemblyConfiguration("")]
10 | [assembly: AssemblyCompany("")]
11 | [assembly: AssemblyProduct("RandomDelayingScheduler")]
12 | [assembly: AssemblyCopyright("Copyright © 2013")]
13 | [assembly: AssemblyTrademark("")]
14 | [assembly: AssemblyCulture("")]
15 |
16 | // Setting ComVisible to false makes the types in this assembly not visible
17 | // to COM components. If you need to access a type in this assembly from
18 | // COM, set the ComVisible attribute to true on that type.
19 | [assembly: ComVisible(false)]
20 |
21 | // The following GUID is for the ID of the typelib if this project is exposed to COM
22 | [assembly: Guid("234683b7-d4e5-4536-8d43-ea4f34acac95")]
23 |
24 | // Version information for an assembly consists of the following four values:
25 | //
26 | // Major Version
27 | // Minor Version
28 | // Build Number
29 | // Revision
30 | //
31 | // You can specify all the values or you can default the Build and Revision Numbers
32 | // by using the '*' as shown below:
33 | // [assembly: AssemblyVersion("1.0.*")]
34 | [assembly: AssemblyVersion("1.0.0.0")]
35 | [assembly: AssemblyFileVersion("1.0.0.0")]
--------------------------------------------------------------------------------
/DelayingSchedulers/RoundRobinDelayingScheduler/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.InteropServices;
3 |
4 | // General Information about an assembly is controlled through the following
5 | // set of attributes. Change these attribute values to modify the information
6 | // associated with an assembly.
7 | [assembly: AssemblyTitle("RoundRobinScheduler")]
8 | [assembly: AssemblyDescription("")]
9 | [assembly: AssemblyConfiguration("")]
10 | [assembly: AssemblyCompany("")]
11 | [assembly: AssemblyProduct("RoundRobinScheduler")]
12 | [assembly: AssemblyCopyright("Copyright © 2013")]
13 | [assembly: AssemblyTrademark("")]
14 | [assembly: AssemblyCulture("")]
15 |
16 | // Setting ComVisible to false makes the types in this assembly not visible
17 | // to COM components. If you need to access a type in this assembly from
18 | // COM, set the ComVisible attribute to true on that type.
19 | [assembly: ComVisible(false)]
20 |
21 | // The following GUID is for the ID of the typelib if this project is exposed to COM
22 | [assembly: Guid("fe36e77b-50aa-4511-ac8d-116ff519530d")]
23 |
24 | // Version information for an assembly consists of the following four values:
25 | //
26 | // Major Version
27 | // Minor Version
28 | // Build Number
29 | // Revision
30 | //
31 | // You can specify all the values or you can default the Build and Revision Numbers
32 | // by using the '*' as shown below:
33 | // [assembly: AssemblyVersion("1.0.*")]
34 | [assembly: AssemblyVersion("1.0.0.0")]
35 | [assembly: AssemblyFileVersion("1.0.0.0")]
--------------------------------------------------------------------------------
/DelayingSchedulers/RunToCompletionDelayingScheduler/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.InteropServices;
3 |
4 | // General Information about an assembly is controlled through the following
5 | // set of attributes. Change these attribute values to modify the information
6 | // associated with an assembly.
7 | [assembly: AssemblyTitle("RunToCompletionDBSched")]
8 | [assembly: AssemblyDescription("")]
9 | [assembly: AssemblyConfiguration("")]
10 | [assembly: AssemblyCompany("")]
11 | [assembly: AssemblyProduct("RunToCompletionDBSched")]
12 | [assembly: AssemblyCopyright("Copyright © 2013")]
13 | [assembly: AssemblyTrademark("")]
14 | [assembly: AssemblyCulture("")]
15 |
16 | // Setting ComVisible to false makes the types in this assembly not visible
17 | // to COM components. If you need to access a type in this assembly from
18 | // COM, set the ComVisible attribute to true on that type.
19 | [assembly: ComVisible(false)]
20 |
21 | // The following GUID is for the ID of the typelib if this project is exposed to COM
22 | [assembly: Guid("317fd543-f722-48f2-80e4-d1b96c017608")]
23 |
24 | // Version information for an assembly consists of the following four values:
25 | //
26 | // Major Version
27 | // Minor Version
28 | // Build Number
29 | // Revision
30 | //
31 | // You can specify all the values or you can default the Build and Revision Numbers
32 | // by using the '*' as shown below:
33 | // [assembly: AssemblyVersion("1.0.*")]
34 | [assembly: AssemblyVersion("1.0.0.0")]
35 | [assembly: AssemblyFileVersion("1.0.0.0")]
--------------------------------------------------------------------------------
/DelayingSchedulers/SealingScheduler/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("SealingScheduler")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("SealingScheduler")]
13 | [assembly: AssemblyCopyright("Copyright © 2016")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Setting ComVisible to false makes the types in this assembly not visible
18 | // to COM components. If you need to access a type in this assembly from
19 | // COM, set the ComVisible attribute to true on that type.
20 | [assembly: ComVisible(false)]
21 |
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM
23 | [assembly: Guid("8ee16ea4-1b20-42e8-a6be-d47153c3caf5")]
24 |
25 | // Version information for an assembly consists of the following four values:
26 | //
27 | // Major Version
28 | // Minor Version
29 | // Build Number
30 | // Revision
31 | //
32 | // You can specify all the values or you can default the Build and Revision Numbers
33 | // by using the '*' as shown below:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("1.0.0.0")]
36 | [assembly: AssemblyFileVersion("1.0.0.0")]
37 |
--------------------------------------------------------------------------------
/DelayingSchedulers/SealingScheduler/SealingScheduler.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | AnyCPU
7 | {8EE16EA4-1B20-42E8-A6BE-D47153C3CAF5}
8 | Library
9 | Properties
10 | SealingScheduler
11 | SealingScheduler
12 | v4.5
13 | 512
14 |
15 |
16 |
17 | true
18 | bin\x64\Debug\
19 | DEBUG;TRACE
20 | full
21 | x64
22 | prompt
23 | MinimumRecommendedRules.ruleset
24 | false
25 |
26 |
27 | bin\x64\Release\
28 | TRACE
29 | true
30 | pdbonly
31 | x64
32 | prompt
33 | MinimumRecommendedRules.ruleset
34 | false
35 |
36 |
37 | true
38 | bin\x86\Debug\
39 | DEBUG;TRACE
40 | full
41 | x86
42 | prompt
43 | MinimumRecommendedRules.ruleset
44 | false
45 |
46 |
47 | bin\x86\Release\
48 | TRACE
49 | true
50 | pdbonly
51 | x86
52 | prompt
53 | MinimumRecommendedRules.ruleset
54 | false
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 | {faf10deb-0879-4fbe-a08e-ef23f9016ae6}
73 | Microsoft.Zing.Runtime
74 |
75 |
76 |
77 |
84 |
--------------------------------------------------------------------------------
/Issues.txt:
--------------------------------------------------------------------------------
1 | Things to be done:
2 | 1) Passing the information that the P process is blocked.
3 | a. If you check the old(zinger) there is a function GetRunnableJoinStatements this function was used to identify if a process is blocked or runnable.
4 | b. We need something equivalent to be communicated to the Zinger for p state machines.
5 | 2) Better and efficient integration with delaying explorer.
6 |
--------------------------------------------------------------------------------
/LICENSE.txt:
--------------------------------------------------------------------------------
1 | The MIT License
2 |
3 | Copyright (c) 2015 Microsoft Corporation
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
16 | INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
17 | PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
18 | HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
20 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21 |
--------------------------------------------------------------------------------
/LongRegressions/TMCompletionEventBug/golden.txt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ZingModelChecker/Zing/a76daf8f7002a84730f02e762be5bb9c5b44b080/LongRegressions/TMCompletionEventBug/golden.txt
--------------------------------------------------------------------------------
/LongRegressions/TMCompletionEventBug/param:
--------------------------------------------------------------------------------
1 | :
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/LongRegressions/n-bt/compile_param:
--------------------------------------------------------------------------------
1 | /preemptive /nowarning:292;
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/LongRegressions/n-bt/golden.txt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ZingModelChecker/Zing/a76daf8f7002a84730f02e762be5bb9c5b44b080/LongRegressions/n-bt/golden.txt
--------------------------------------------------------------------------------
/LongRegressions/n-bt/param:
--------------------------------------------------------------------------------
1 | -entirezingtrace -p -ibound:100;
2 | -entirezingtrace -frontiertodisk -p -ibound:100;
3 | -entirezingtrace -p -delayb:../../DelayingSchedulers/RunToCompletionDelayingScheduler/bin/debug/RunToCompletionDelayingScheduler.dll -ibound:100;
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/LongRegressions/p-bt/compile_param:
--------------------------------------------------------------------------------
1 | /preemptive /nowarning:292;
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/LongRegressions/p-bt/param:
--------------------------------------------------------------------------------
1 | -entirezingtrace;
2 | -entirezingtrace -delayb:../../DelayingSchedulers/RunToCompletionDelayingScheduler/bin/x64/debug/RunToCompletionDelayingScheduler.dll;
3 | -entirezingtrace -delayb:../../DelayingSchedulers/RoundRobinDelayingScheduler/bin/x64/debug/RoundRobinDelayingScheduler.dll;
4 | -entirezingtrace -delayb:../../DelayingSchedulers/CustomDelayingScheduler/bin/x64/debug/CustomDelayingScheduler.dll;
5 | -entirezingtrace -pb;
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/Microsoft.Zing.Runtime/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Reflection;
3 | using System.Runtime.ConstrainedExecution;
4 | using System.Runtime.InteropServices;
5 |
6 | //
7 | // General Information about an assembly is controlled through the following
8 | // set of attributes. Change these attribute values to modify the information
9 | // associated with an assembly.
10 | //
11 |
12 | [assembly: AssemblyTitle("Microsoft.Zing")]
13 | [assembly: AssemblyDescription("Runtime for the Zing language")]
14 | [assembly: AssemblyConfiguration("")]
15 | [assembly: AssemblyCulture("")]
16 | [assembly: CLSCompliant(false)]
17 | [assembly: ComVisible(false)]
18 | [assembly: ReliabilityContractAttribute(
19 | Consistency.MayCorruptInstance, Cer.None)]
--------------------------------------------------------------------------------
/Microsoft.Zing.Runtime/Attributes.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Globalization;
3 | using System.Runtime.InteropServices;
4 | using System.Xml;
5 |
6 | namespace Microsoft.Zing
7 | {
8 | ///
9 | /// The base class for all Zing attributes.
10 | ///
11 | [ComVisible(true)]
12 | public abstract class ZingAttributeBaseAttribute : Attribute
13 | {
14 | ///
15 |
16 | public abstract void ToXml(XmlElement parent);
17 | }
18 |
19 | ///
20 | /// The base class for attributes used to correlate with foreign source code.
21 | ///
22 | ///
23 | /// This class is used as the base class for attributes that serve both
24 | /// as context markers and event generators. The constructor parameters
25 | /// for attributes derived from this class may include only string and
26 | /// integer literals.
27 | ///
28 | [ComVisible(true)]
29 | public abstract class ZingAttribute : ZingAttributeBaseAttribute
30 | {
31 | }
32 |
33 | // For testing, and simple usage scenarios, we provide a couple of simple
34 | // attributes.
35 | namespace Attributes
36 | {
37 | #if DEBUG
38 |
39 | ///
40 | /// This namespace contains attributes supported by the Zing compiler and runtime.
41 | /// These attributes are currently used to annotate Zing statements, but may be
42 | /// extended for other uses in the future.
43 | ///
44 | public class NamespaceDoc
45 | {
46 | }
47 |
48 | #endif
49 |
50 | ///
51 | /// This attribute is used to correlate foreign source code with Zing statements.
52 | /// Foreign source code locations are identified by a file path, a starting line
53 | /// number, and an ending line number.
54 | ///
55 | [AttributeUsage(AttributeTargets.All)]
56 | sealed public class SourceContextAttribute : ZingAttribute
57 | {
58 | ///
59 | /// The pathname of the foreign source code file.
60 | ///
61 | public string File { get { return file; } }
62 |
63 | private string file;
64 |
65 | ///
66 | /// The starting line number of the associated statement in the
67 | /// foreign source code.
68 | ///
69 | public int StartLine { get { return startLine; } }
70 |
71 | private int startLine;
72 |
73 | ///
74 | /// The ending line number of the associated statement in the
75 | /// foreign source code.
76 | ///
77 | public int EndLine { get { return endLine; } }
78 |
79 | private int endLine;
80 |
81 | ///
82 | /// Constructor for SourceContextAttribute
83 | ///
84 | /// Pathname of the foreign source code file
85 | /// Starting line of the foreign statement
86 | /// Ending line of the foreign statement
87 | public SourceContextAttribute(string file, int startLine, int endLine)
88 | {
89 | this.file = file;
90 | this.startLine = startLine;
91 | this.endLine = endLine;
92 | }
93 |
94 | ///
95 |
96 | public override string ToString()
97 | {
98 | return string.Format(CultureInfo.CurrentUICulture, "SourceContextAttribute: {0}, {1}, {2}", file, startLine, endLine);
99 | }
100 |
101 | ///
102 |
103 | public override void ToXml(XmlElement parent)
104 | {
105 | XmlDocument doc = parent.OwnerDocument;
106 |
107 | XmlElement elem = doc.CreateElement("SourceContextAttribute");
108 | parent.AppendChild(elem);
109 |
110 | XmlElement elemFile = doc.CreateElement("File");
111 | elemFile.InnerText = this.file;
112 | elem.AppendChild(elemFile);
113 |
114 | XmlElement elemStart = doc.CreateElement("StartLine");
115 | elemStart.InnerText = this.startLine.ToString(CultureInfo.CurrentUICulture);
116 | elem.AppendChild(elemStart);
117 |
118 | XmlElement elemEnd = doc.CreateElement("EndLine");
119 | elemEnd.InnerText = this.endLine.ToString(CultureInfo.CurrentUICulture);
120 | elem.AppendChild(elemEnd);
121 | }
122 | }
123 | }
124 | }
--------------------------------------------------------------------------------
/Microsoft.Zing.Runtime/Backtrace.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Globalization;
3 |
4 | namespace Microsoft.Zing
5 | {
6 | public abstract class Via
7 | {
8 | //silent is set to true for vias generated during
9 | //silent calls and returns in the summarization algorithm
10 | public bool silent;
11 |
12 | public abstract object Clone();
13 |
14 | public static void PrintTrace(Via[] bts)
15 | {
16 | int len = bts.Length;
17 | int i;
18 |
19 | Console.Write("{0} transitions: ", len);
20 | for (i = 0; i < len; i++)
21 | Console.Write(bts[i].ToString());
22 | Console.WriteLine("");
23 | }
24 | }
25 |
26 | public sealed class ViaChoose : Via
27 | {
28 | public readonly int ChoiceNumber;
29 |
30 | public override object Clone()
31 | {
32 | return new ViaChoose(ChoiceNumber, silent);
33 | }
34 |
35 | public ViaChoose(int n)
36 | {
37 | ChoiceNumber = n;
38 | silent = false;
39 | }
40 |
41 | public ViaChoose(int n, bool s)
42 | {
43 | ChoiceNumber = n;
44 | silent = s;
45 | }
46 |
47 | public override string ToString()
48 | {
49 | return ("->" + ChoiceNumber.ToString(CultureInfo.CurrentUICulture));
50 | }
51 |
52 | public override bool Equals(object o)
53 | {
54 | ViaChoose vc = o as ViaChoose;
55 |
56 | if (vc == null) return false;
57 |
58 | return (ChoiceNumber == vc.ChoiceNumber);
59 | }
60 |
61 | public override int GetHashCode()
62 | {
63 | return ChoiceNumber;
64 | }
65 | }
66 |
67 | public sealed class ViaExecute : Via
68 | {
69 | private int processExecuted;
70 |
71 | public int ProcessExecuted
72 | {
73 | get { return processExecuted; }
74 | }
75 |
76 | public override object Clone()
77 | {
78 | return new ViaExecute(processExecuted, silent);
79 | }
80 |
81 | public ViaExecute(int n)
82 | {
83 | processExecuted = n;
84 | silent = false;
85 | }
86 |
87 | public ViaExecute(int n, bool s)
88 | {
89 | processExecuted = n;
90 | silent = s;
91 | }
92 |
93 | public void ChangeProcessExecuted(int n)
94 | {
95 | processExecuted = n;
96 | }
97 |
98 | public override string ToString()
99 | {
100 | return "=>" + ProcessExecuted.ToString(CultureInfo.CurrentUICulture);
101 | }
102 |
103 | public override bool Equals(object o)
104 | {
105 | ViaExecute ve = o as ViaExecute;
106 |
107 | if (ve == null) return false;
108 |
109 | return (ProcessExecuted == ve.ProcessExecuted);
110 | }
111 |
112 | public override int GetHashCode()
113 | {
114 | return ProcessExecuted;
115 | }
116 | }
117 | }
--------------------------------------------------------------------------------
/Microsoft.Zing.Runtime/ZingPluginInterface.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace Microsoft.Zing
7 | {
8 | public abstract class ZingerPluginState
9 | {
10 | public abstract ZingerPluginState Clone();
11 | }
12 | public abstract class ZingerPluginInterface
13 | {
14 | public abstract void Invoke(int threadID, ZingerPluginState ZPluginState, params object[] Params);
15 |
16 | public abstract void EndPlugin();
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/Microsoft.Zing.Runtime/ZingPreemptionBounding.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using System.Linq;
3 |
4 | namespace Microsoft.Zing
5 | {
6 | ///
7 | /// This class stores the necessary information in traversalInfo
8 | /// for performing preemption bounding.
9 | ///
10 | public class ZingPreemptionBounding
11 | {
12 | public bool preempted;
13 |
14 | ///
15 | /// stores the current process being executed.
16 | ///
17 | public int currentProcess;
18 |
19 | ///
20 | /// list of enabled processes
21 | ///
22 | private List restOfEnabledProcesses;
23 |
24 | //
25 | ///
26 | /// get the next process to be executed.
27 | ///
28 | /// process id
29 | public int GetNextProcessToExecute()
30 | {
31 | if (restOfEnabledProcesses.Count == 0)
32 | {
33 | return -1;
34 | }
35 | var next = restOfEnabledProcesses.ElementAt(0);
36 | restOfEnabledProcesses.RemoveAt(0);
37 | currentProcess = next;
38 | return next;
39 | }
40 |
41 | public ZingPreemptionBounding()
42 | {
43 | restOfEnabledProcesses = new List();
44 | currentProcess = 0;
45 | preempted = false;
46 | }
47 |
48 | ///
49 | /// Initialize the object
50 | ///
51 | ///
52 | public ZingPreemptionBounding(ProcessInfo[] processInfo, int numSuccessor, int currentProcessParam)
53 | {
54 | int i = 0;
55 | restOfEnabledProcesses = new List();
56 | while (i < numSuccessor)
57 | {
58 | if (processInfo[i].Status == ProcessStatus.Runnable && i != currentProcess)
59 | {
60 | restOfEnabledProcesses.Add(i);
61 | }
62 | i++;
63 | }
64 | currentProcess = currentProcessParam;
65 | preempted = false;
66 | }
67 |
68 | public ZingPreemptionBounding Clone()
69 | {
70 | ZingPreemptionBounding cloned = new ZingPreemptionBounding();
71 | cloned.preempted = false;
72 | cloned.currentProcess = currentProcess;
73 | foreach (var item in restOfEnabledProcesses)
74 | {
75 | cloned.restOfEnabledProcesses.Add(item);
76 | }
77 |
78 | return cloned;
79 | }
80 | }
81 | }
--------------------------------------------------------------------------------
/Microsoft.Zing/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Reflection;
3 | using System.Runtime.ConstrainedExecution;
4 | using System.Runtime.InteropServices;
5 |
6 | [assembly: AssemblyTitle("Microsoft.Zing")]
7 | [assembly: AssemblyDescription("Compiler for the Zing language")]
8 | [assembly: ComVisible(false)]
9 | [assembly: CLSCompliant(false)]
10 | [assembly: ClassInterface(ClassInterfaceType.AutoDual)]
11 | [assembly: ReliabilityContractAttribute(
12 | Consistency.MayCorruptInstance, Cer.None)]
--------------------------------------------------------------------------------
/Microsoft.Zing/BBOptimizer.cs:
--------------------------------------------------------------------------------
1 | #if UNUSED // The splicer no longer uses the optimizer because it breaks summarization
2 | namespace Microsoft.Zing
3 | {
4 | internal sealed class BBOptimizer
5 | {
6 | internal static List Optimize(List blocks)
7 | {
8 | foreach (BasicBlock b in blocks)
9 | {
10 | BasicBlock target = b.UnconditionalTarget;
11 |
12 | // Look for:
13 | // 1. an unconditional atomic branch to the target block
14 | // 2. first block has no statements
15 | // 3. target block is referenced by nobody else
16 | //
17 | // If found:
18 | // Move the contents of the target block to the first block
19 | //
20 | if (b.ConditionalTarget == null && target != null &&
21 | (b.RelativeAtomicLevel > 0 || b.MiddleOfTransition) &&
22 | (b.Statement == null || ((b.Statement is Block) && ((Block)b.Statement).Statements.Length == 0)) &&
23 | RefCount(blocks, target) == 1)
24 | {
25 | //
26 | // Copy (almost all) the fields of the target to the first block,
27 | // leaving the target unreachable.
28 | //
29 | b.ConditionalExpression = target.ConditionalExpression;
30 | b.ConditionalTarget = target.ConditionalTarget;
31 | b.MiddleOfTransition = target.MiddleOfTransition;
32 | b.PropagatesException = target.PropagatesException;
33 | b.RelativeAtomicLevel = target.RelativeAtomicLevel;
34 | b.IsAtomicEntry = target.IsAtomicEntry;
35 | b.selectStmt = target.selectStmt;
36 | b.SkipNormalizer = target.SkipNormalizer;
37 | b.SourceContext = target.SourceContext;
38 | b.Statement = target.Statement;
39 | b.UnconditionalTarget = target.UnconditionalTarget;
40 |
41 | // Merge or copy block attributes, as necessary
42 | if (b.Attributes == null)
43 | b.Attributes = target.Attributes;
44 | else
45 | {
46 | if (target.Attributes != null)
47 | {
48 | for (int i=0, n=target.Attributes.Length; i < n ;i++)
49 | b.Attributes.Add(target.Attributes[i]);
50 | }
51 | }
52 | }
53 | }
54 |
55 | //
56 | // Some blocks will now be unreachable. Return a revised block list
57 | // containing only reachable blocks.
58 | //
59 | // TODO: make this reachability test more correct.
60 | //
61 | List optBlocks = new List();
62 |
63 | foreach (BasicBlock b in blocks)
64 | {
65 | if (b.IsEntryPoint || RefCount(blocks, b) > 0)
66 | optBlocks.Add(b);
67 | }
68 |
69 | return optBlocks;
70 | }
71 |
72 | private static int RefCount(List blocks, BasicBlock block)
73 | {
74 | int refcnt = 0;
75 |
76 | foreach (BasicBlock b in blocks)
77 | {
78 | if (b.UnconditionalTarget == block)
79 | refcnt++;
80 | if (b.ConditionalTarget == block)
81 | refcnt++;
82 | if (b.handlerTarget == block)
83 | refcnt++;
84 | }
85 |
86 | return refcnt;
87 | }
88 |
89 | private static void Redirect(List blocks, BasicBlock oldBlock, BasicBlock newBlock)
90 | {
91 | foreach (BasicBlock b in blocks)
92 | {
93 | if (b.UnconditionalTarget == oldBlock)
94 | b.UnconditionalTarget = newBlock;
95 | if (b.ConditionalTarget == oldBlock)
96 | b.ConditionalTarget = newBlock;
97 | }
98 | }
99 | }
100 | }
101 | #endif
--------------------------------------------------------------------------------
/Microsoft.Zing/Folders.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ZingModelChecker/Zing/a76daf8f7002a84730f02e762be5bb9c5b44b080/Microsoft.Zing/Folders.bmp
--------------------------------------------------------------------------------
/Microsoft.Zing/Restorer.cs:
--------------------------------------------------------------------------------
1 | using System.Compiler;
2 |
3 | namespace Microsoft.Zing
4 | {
5 | ///
6 | /// Patches the type nodes in an IR tree to refer to the given target module.
7 | ///
8 | internal sealed class Restorer : System.Compiler.StandardVisitor
9 | {
10 | public Restorer(Module targetModule)
11 | : base()
12 | {
13 | this.targetModule = targetModule;
14 | }
15 |
16 | private Module targetModule;
17 |
18 | public override Node Visit(Node node)
19 | {
20 | if (node == null) return null;
21 |
22 | TypeNode tn = node as TypeNode;
23 |
24 | if (tn != null)
25 | tn.DeclaringModule = targetModule;
26 |
27 | return base.Visit(node);
28 | }
29 |
30 | public override Node VisitUnknownNodeType(Node node)
31 | {
32 | // wrwg+sriram 20/7/04: review
33 | return node;
34 | }
35 | }
36 | }
--------------------------------------------------------------------------------
/Microsoft.Zing/Runtime.cs:
--------------------------------------------------------------------------------
1 | using System.Compiler;
2 | using System.IO;
3 |
4 | namespace Microsoft.Zing
5 | {
6 | internal sealed class RuntimeAssemblyLocation
7 | {
8 | internal static string Location = null; //Can be set by compiler in cross compilation scenarios
9 | }
10 |
11 | public sealed class TargetPlatform
12 | {
13 | public static void SetToV1()
14 | {
15 | TargetPlatform.SetToV1(null);
16 | }
17 |
18 | public static void SetToV1(string platformAssembliesLocation)
19 | {
20 | System.Compiler.TargetPlatform.SetToV1(platformAssembliesLocation);
21 | RuntimeAssemblyLocation.Location = Path.Combine(Path.GetDirectoryName(SystemAssemblyLocation.Location), "microsoft.zing.runtime.dll");
22 | }
23 |
24 | public static void SetToV1_1()
25 | {
26 | TargetPlatform.SetToV1_1(null);
27 | }
28 |
29 | public static void SetToV1_1(string platformAssembliesLocation)
30 | {
31 | System.Compiler.TargetPlatform.SetToV1_1(platformAssembliesLocation);
32 | RuntimeAssemblyLocation.Location = Path.Combine(Path.GetDirectoryName(SystemAssemblyLocation.Location), "microsoft.zing.runtime.dll");
33 | }
34 |
35 | ///
36 | /// Use this to set the target platform to a platform with a superset of the platform assemblies in version 1.1, but
37 | /// where the public key tokens and versions numbers are determined by reading in the actual assemblies from
38 | /// the supplied location. Only assemblies recognized as platform assemblies in version 1.1 will be unified.
39 | ///
40 | public static void SetToPostV1_1(string platformAssembliesLocation)
41 | {
42 | }
43 | }
44 | }
--------------------------------------------------------------------------------
/Microsoft.Zing/TemplateExprs.cs:
--------------------------------------------------------------------------------
1 | namespace Microsoft.Zing
2 | {
3 | public class ExpressionTemplates
4 | {
5 | int NativeZOMCallFirstArgument = p;
6 |
7 | int NativeZOMCallee = ((_TypeName)(application.LookupObject(_Pointer)))._MethodName;
8 |
9 | int NativeZOMStaticCall = _ClassName._MethodName;
10 |
11 | int PtrAllocation = application.Allocate(new Z.Application._Constructor(application));
12 |
13 | int InitializerPtrAllocation = application.Allocate(new Z.Application._Constructor(application));
14 |
15 | int NativeZOMPtrAllocation = application.Allocate(new Z._Constructor(application));
16 |
17 | int InitializerNativeZOMPtrAllocation = application.Allocate(new Z._Constructor(application));
18 |
19 | int ArrayPtrAllocation = application.Allocate(new Z.Application._Constructor(application, _size));
20 |
21 | int InitializerArrayPtrAllocation = application.Allocate(new Z.Application._Constructor(application, _size));
22 |
23 | int GlobalFieldAccess = application.globals._fieldName;
24 |
25 | int StructFieldAccess = (_structExpr)._fieldName;
26 |
27 | int SelfAccess = (int)p.Id;
28 |
29 | int ClassFieldAccess = ((Z.Application._objectType) application.LookupObject(_ptrExpr))._fieldName;
30 |
31 | int IndexerAccess = ((Z.Application._arrayType) application.LookupObject(_ptrExpr))[_indexExpr];
32 |
33 | int ThisFieldAccess = ((Z.Application._objectType) application.LookupObject(This))._fieldName;
34 |
35 | int ReceivePatternPredicate = ((Z.Application._chanType) application.LookupObject(_chanExpr)).CanReceive;
36 |
37 | int EnumTypeRestoration = ((_enumType) _enumValue);
38 |
39 | int IntTypeRestoration = ((int) _enumValue);
40 |
41 | int CatchTest = CurrentException == (int) Exceptions._exception;
42 |
43 | int Sizeof = ((ZingCollectionType) application.LookupObject(_sizeofOperand)).Count;
44 |
45 | int JoinStatementTester = (this.SavedRunnableJoinStatements & _jsBitMask) != 0ul;
46 |
47 | int JoinStatementRunnableBit = (_jsRunnableBoolExpr ? _jsBitMask : 0ul);
48 |
49 | int NDSelectTest = application.SetPendingSelectChoices(p, SavedRunnableJoinStatements);
50 |
51 | int SetMembershipTest = ((ZingSet) application.LookupObject(_setOperand)).IsMember(_itemOperand);
52 |
53 | int foreachTest = locals._iterator < ((ZingCollectionType) application.LookupObject(_sourceEnumerable)).Count;
54 |
55 | int SimpleFieldRef = this._fieldName;
56 |
57 | int GetFieldInfo = typeof(_class).GetField(_fieldName);
58 |
59 | int ContextAttributeConstructor = new Z.Attributes._AttributeName();
60 | }
61 | }
--------------------------------------------------------------------------------
/Microsoft.Zing/TemplateProps.cs:
--------------------------------------------------------------------------------
1 | namespace Microsoft.Zing
2 | {
3 | public class PropertyTemplates
4 | {
5 | public int globalAccessor
6 | {
7 | get
8 | {
9 | return _fieldName;
10 | }
11 | set
12 | {
13 | SetDirty();
14 | _fieldName = value;
15 | }
16 | }
17 |
18 | public int localAccessor
19 | {
20 | get
21 | {
22 | return _fieldName;
23 | }
24 | set
25 | {
26 | SetDirty();
27 | _fieldName = value;
28 | }
29 | }
30 |
31 | public int inputAccessor
32 | {
33 | get
34 | {
35 | return _fieldName;
36 | }
37 | set
38 | {
39 | SetDirty();
40 | _fieldName = value;
41 | }
42 | }
43 |
44 | public int outputAccessor
45 | {
46 | get
47 | {
48 | return _fieldName;
49 | }
50 | set
51 | {
52 | SetDirty();
53 | _fieldName = value;
54 | }
55 | }
56 |
57 | public int lastFunctionOutputAccessor
58 | {
59 | get
60 | {
61 | return _fieldName;
62 | }
63 | }
64 |
65 | public int structAccessor
66 | {
67 | get
68 | {
69 | return _fieldName;
70 | }
71 | set
72 | {
73 | SetDirty();
74 | _fieldName = value;
75 | }
76 | }
77 |
78 | public override int thisAccessor
79 | {
80 | get
81 | {
82 | return _fieldName;
83 | }
84 | set
85 | {
86 | _fieldName = value;
87 | }
88 | }
89 |
90 | public int ptrFieldAccessor
91 | {
92 | get
93 | {
94 | return _fieldName;
95 | }
96 | set
97 | {
98 | SetDirty();
99 | _fieldName = value;
100 | }
101 | }
102 |
103 | public int fieldAccessor
104 | {
105 | get
106 | {
107 | return _fieldName;
108 | }
109 | set
110 | {
111 | SetDirty();
112 | _fieldName = value;
113 | }
114 | }
115 | }
116 | }
117 |
--------------------------------------------------------------------------------
/Microsoft.Zing/ZDeclarer.cs:
--------------------------------------------------------------------------------
1 | using System.Compiler;
2 |
3 | namespace Microsoft.Zing
4 | {
5 | ///
6 | /// Walks the statement list of a Block, entering any declarations into the associated scope. Does not recurse.
7 | /// This visitor is instantiated and called by Looker.
8 | ///
9 | internal sealed class Declarer : System.Compiler.Declarer
10 | {
11 | public Declarer(Zing.ErrorHandler errorHandler)
12 | : base(errorHandler)
13 | {
14 | }
15 |
16 | public override Node Visit(Node node)
17 | {
18 | if (node == null) return null;
19 | switch (((ZingNodeType)node.NodeType))
20 | {
21 | // None of these nodes may contain variable declarations, so we don't need to
22 | // explore them. If an atomic block (erroneously) contains declarations, we'll
23 | // discover that in the "checker" phase.
24 |
25 | case ZingNodeType.Array:
26 | case ZingNodeType.Accept:
27 | case ZingNodeType.Assert:
28 | case ZingNodeType.Assume:
29 | case ZingNodeType.Async:
30 | case ZingNodeType.Atomic:
31 | case ZingNodeType.Chan:
32 | case ZingNodeType.Choose:
33 | case ZingNodeType.Event:
34 | case ZingNodeType.EventPattern:
35 | case ZingNodeType.JoinStatement:
36 | case ZingNodeType.InvokePlugin:
37 | case ZingNodeType.InvokeSched:
38 | case ZingNodeType.Range:
39 | case ZingNodeType.ReceivePattern:
40 | case ZingNodeType.Select:
41 | case ZingNodeType.Self:
42 | case ZingNodeType.Send:
43 | case ZingNodeType.Set:
44 | case ZingNodeType.TimeoutPattern:
45 | case ZingNodeType.Trace:
46 | case ZingNodeType.Try:
47 | case ZingNodeType.WaitPattern:
48 | case ZingNodeType.With:
49 | case ZingNodeType.Yield:
50 | case ZingNodeType.In:
51 | return node;
52 |
53 | case ZingNodeType.AttributedStatement:
54 | return this.VisitAttributedStatement((AttributedStatement)node);
55 |
56 | default:
57 | return base.Visit(node);
58 | }
59 | }
60 |
61 | private AttributedStatement VisitAttributedStatement(AttributedStatement attributedStmt)
62 | {
63 | attributedStmt.Statement = (Statement)this.Visit(attributedStmt.Statement);
64 | return attributedStmt;
65 | }
66 | }
67 | }
--------------------------------------------------------------------------------
/Microsoft.Zing/ZScoper.cs:
--------------------------------------------------------------------------------
1 | using System.Compiler;
2 |
3 | namespace Microsoft.Zing
4 | {
5 | ///
6 | /// Walks a CompilationUnit and creates a scope for each namespace and each type.
7 | /// The scopes are attached to the corresponding instances via the ScopeFor hash table.
8 | ///
9 | internal class Scoper : System.Compiler.Scoper
10 | {
11 | internal Scoper(TrivialHashtable scopeFor)
12 | : base(scopeFor)
13 | {
14 | }
15 |
16 | public override Node VisitUnknownNodeType(Node node)
17 | {
18 | if (node == null) return null;
19 |
20 | switch ((ZingNodeType)node.NodeType)
21 | {
22 | case ZingNodeType.Array:
23 | case ZingNodeType.Chan:
24 | case ZingNodeType.Set:
25 | case ZingNodeType.Range:
26 | return base.VisitTypeNode((TypeNode)node);
27 |
28 | default:
29 | return base.VisitUnknownNodeType(node);
30 | }
31 | }
32 | }
33 | }
--------------------------------------------------------------------------------
/Microsoft.Zing/debugger.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Runtime.InteropServices;
3 |
4 | namespace Microsoft.Zing
5 | {
6 | [Guid("6398952D-5CC9-4bb4-B026-7A5C53FA9D41")]
7 | internal class DebuggerLanguage { }
8 |
9 | #if !ReducedFootprint
10 | /* LJW
11 | [ComVisible(true), Guid("55A681C2-CD89-4961-BC58-0804BF3B27BE")]
12 | public class DebuggerEE : Microsoft.VisualStudio.IntegrationHelper.BaseExpressionEvaluator
13 | {
14 | public DebuggerEE()
15 | {
16 | this.cciEvaluator.ExprCompiler = new Microsoft.Zing.Compiler();
17 | this.cciEvaluator.ExprErrorHandler = new Microsoft.Zing.ErrorHandler(new ErrorNodeList());
18 | }
19 | }
20 | */
21 | #endif
22 | }
--------------------------------------------------------------------------------
/Plugins/MotionPlanning/Complan.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using Microsoft.Zing;
7 |
8 | namespace ZingExternalPlugin
9 | {
10 | public class ComplanMotionPlannerState : ZingerPluginState
11 | {
12 | public List Obstacles;
13 |
14 | public ComplanMotionPlannerState(){
15 | Obstacles = new List();
16 | }
17 |
18 | override public ZingerPluginState Clone()
19 | {
20 | var cloneVal = new ComplanMotionPlannerState();
21 | foreach(var item in Obstacles)
22 | {
23 | cloneVal.Obstacles.Add(item);
24 | }
25 |
26 | return cloneVal;
27 | }
28 |
29 | override public string ToString()
30 | {
31 | var output = "";
32 | foreach (var item in Obstacles)
33 | output += (" " + item.ToString());
34 |
35 | return output;
36 | }
37 | }
38 | public class ComplanMotionPlanner : ZingerPluginInterface
39 | {
40 | private ComplanMotionPlannerState[] complanState;
41 |
42 | public ComplanMotionPlanner()
43 | {
44 | complanState = new ComplanMotionPlannerState[ZingerConfiguration.DegreeOfParallelism];
45 | for(int i = 0; i();
67 | }
68 | }
69 |
70 | override public void EndPlugin()
71 | {
72 | Console.WriteLine("Complan plugin closed");
73 | }
74 | }
75 | }
76 |
--------------------------------------------------------------------------------
/Plugins/MotionPlanning/Complan.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | AnyCPU
7 | {09827C57-CD29-4B66-81CE-02A3448F75C0}
8 | Library
9 | Properties
10 | Complan
11 | Complan
12 | v4.0
13 | 512
14 |
15 |
16 |
17 | true
18 | full
19 | false
20 | bin\Debug\
21 | DEBUG;TRACE
22 | prompt
23 | 4
24 |
25 |
26 | pdbonly
27 | true
28 | bin\Release\
29 | TRACE
30 | prompt
31 | 4
32 |
33 |
34 | true
35 | bin\x64\Debug\
36 | DEBUG;TRACE
37 | full
38 | x64
39 | prompt
40 | MinimumRecommendedRules.ruleset
41 |
42 |
43 | bin\x64\Release\
44 | TRACE
45 | true
46 | pdbonly
47 | x64
48 | prompt
49 | MinimumRecommendedRules.ruleset
50 |
51 |
52 | true
53 | bin\x86\Debug\
54 | DEBUG;TRACE
55 | full
56 | x86
57 | prompt
58 | MinimumRecommendedRules.ruleset
59 |
60 |
61 | bin\x86\Release\
62 | TRACE
63 | true
64 | pdbonly
65 | x86
66 | prompt
67 | MinimumRecommendedRules.ruleset
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 | {faf10deb-0879-4fbe-a08e-ef23f9016ae6}
85 | Microsoft.Zing.Runtime
86 |
87 |
88 |
89 |
96 |
--------------------------------------------------------------------------------
/Plugins/MotionPlanning/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("MotionPlanning")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("MotionPlanning")]
13 | [assembly: AssemblyCopyright("Copyright © 2015")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Setting ComVisible to false makes the types in this assembly not visible
18 | // to COM components. If you need to access a type in this assembly from
19 | // COM, set the ComVisible attribute to true on that type.
20 | [assembly: ComVisible(false)]
21 |
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM
23 | [assembly: Guid("4f1fa73a-daa8-4735-8ab0-1bd0741a8286")]
24 |
25 | // Version information for an assembly consists of the following four values:
26 | //
27 | // Major Version
28 | // Minor Version
29 | // Build Number
30 | // Revision
31 | //
32 | // You can specify all the values or you can default the Build and Revision Numbers
33 | // by using the '*' as shown below:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("1.0.0.0")]
36 | [assembly: AssemblyFileVersion("1.0.0.0")]
37 |
--------------------------------------------------------------------------------
/Plugins/StateCoveragePlugin/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("StateCoveragePlugin")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("StateCoveragePlugin")]
13 | [assembly: AssemblyCopyright("Copyright © 2013")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Setting ComVisible to false makes the types in this assembly not visible
18 | // to COM components. If you need to access a type in this assembly from
19 | // COM, set the ComVisible attribute to true on that type.
20 | [assembly: ComVisible(false)]
21 |
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM
23 | [assembly: Guid("4f6490ec-d393-49a7-a627-d4b6f364b9d0")]
24 |
25 | // Version information for an assembly consists of the following four values:
26 | //
27 | // Major Version
28 | // Minor Version
29 | // Build Number
30 | // Revision
31 | //
32 | // You can specify all the values or you can default the Build and Revision Numbers
33 | // by using the '*' as shown below:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("1.0.0.0")]
36 | [assembly: AssemblyFileVersion("1.0.0.0")]
37 |
--------------------------------------------------------------------------------
/Plugins/StateCoveragePlugin/StateCoveragePlugin.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Zing;
2 | using System;
3 | using System.Collections.Concurrent;
4 | using System.Collections.Generic;
5 | using System.IO;
6 | using System.Linq;
7 | using System.Text;
8 | using System.Threading.Tasks;
9 |
10 | namespace ExternalPlugin
11 | {
12 | public class StateCoverageState : ZingerPluginState
13 | {
14 | public ConcurrentDictionary> StatesReached;
15 |
16 | public StateCoverageState()
17 | {
18 | StatesReached = new ConcurrentDictionary>();
19 | }
20 |
21 | override public ZingerPluginState Clone()
22 | {
23 | return this;
24 | }
25 |
26 | override public string ToString()
27 | {
28 | return "";
29 | }
30 | }
31 |
32 | public class StateCoveragePlugin : ZingerPluginInterface
33 | {
34 | private StateCoverageState sc;
35 |
36 | public StateCoveragePlugin()
37 | {
38 | sc = new StateCoverageState();
39 | }
40 |
41 | override public void Invoke(int threadID, ZingerPluginState ZPluginState, params object[] Params)
42 | {
43 | var par1_MachineStringName = (string)Params[1];
44 | var par2_StateStringName = (string)Params[2];
45 | if (!sc.StatesReached.ContainsKey(par1_MachineStringName))
46 | {
47 | ConcurrentDictionary temp = new ConcurrentDictionary();
48 | temp.TryAdd(par2_StateStringName, true);
49 | sc.StatesReached.TryAdd(par1_MachineStringName, temp);
50 | }
51 | else
52 | {
53 | ConcurrentDictionary temp;
54 | var getStateList = sc.StatesReached.TryGetValue(par1_MachineStringName, out temp);
55 | temp.TryAdd(par2_StateStringName, true);
56 | }
57 | }
58 |
59 | override public void EndPlugin()
60 | {
61 | string fileName = "StateCoveragePlugin_Output.txt";
62 | StreamWriter logWriter = new StreamWriter(fileName);
63 | logWriter.WriteLine("************************************************");
64 | logWriter.WriteLine(" States Coverage ");
65 | logWriter.WriteLine("************************************************");
66 | logWriter.WriteLine();
67 | foreach (var Machine in sc.StatesReached)
68 | {
69 | foreach (var state in Machine.Value)
70 | {
71 | logWriter.WriteLine("< {0} , {1} >", Machine.Key, state.Key);
72 | }
73 | }
74 | logWriter.WriteLine("************************************************");
75 | logWriter.Close();
76 | }
77 | }
78 | }
--------------------------------------------------------------------------------
/Plugins/StateCoveragePlugin/StateCoveragePlugin.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | AnyCPU
7 | {B0212FBE-2205-4678-90F1-F29AC5222191}
8 | Library
9 | Properties
10 | StateCoveragePlugin
11 | StateCoveragePlugin
12 | v4.0
13 | 512
14 |
15 | SAK
16 | SAK
17 | SAK
18 | SAK
19 |
20 |
21 | true
22 | full
23 | false
24 | bin\Debug\
25 | DEBUG;TRACE
26 | prompt
27 | 4
28 | x64
29 |
30 |
31 | pdbonly
32 | true
33 | bin\Release\
34 | TRACE
35 | prompt
36 | 4
37 |
38 |
39 | true
40 | bin\x64\Debug\
41 | DEBUG;TRACE
42 | full
43 | x64
44 | prompt
45 | MinimumRecommendedRules.ruleset
46 |
47 |
48 | bin\x64\Release\
49 | TRACE
50 | true
51 | pdbonly
52 | x64
53 | prompt
54 | MinimumRecommendedRules.ruleset
55 |
56 |
57 | true
58 | bin\x86\Debug\
59 | DEBUG;TRACE
60 | full
61 | x86
62 | prompt
63 | MinimumRecommendedRules.ruleset
64 |
65 |
66 | bin\x86\Release\
67 | TRACE
68 | true
69 | pdbonly
70 | x86
71 | prompt
72 | MinimumRecommendedRules.ruleset
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 | {faf10deb-0879-4fbe-a08e-ef23f9016ae6}
90 | Microsoft.Zing.Runtime
91 |
92 |
93 |
94 |
101 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Zing
2 | Zing : An explicit state model checker for concurrent and message passing programs.
3 |
4 | The goal of the Zing project is to build a flexible and scalable systematic state space exploration infrastructure for software.
5 | Zing is a flexible and scalable infrastructure for exploring states of concurrent software systems. This infrastructure can be used for validating software at various levels: high-level protocol descriptions, work-flow specifications, web services, device drivers, and protocols in the core of the operating system. Zing is currently being used for developing drivers for Windows and Windows Phone.
6 |
7 | For more details and documentation.
8 | http://research.microsoft.com/en-us/projects/zing/
9 |
--------------------------------------------------------------------------------
/Regression/AllocObject/AllocObject.zing:
--------------------------------------------------------------------------------
1 | class Main {
2 | static Foo f;
3 |
4 | activate static void main() {
5 | async main1();
6 | async main2();
7 | }
8 | static void main1() {
9 | bar();
10 | bar();
11 | }
12 |
13 | static void main2() {
14 | bar();
15 | bar();
16 | }
17 |
18 | static void bar() {
19 | f = new Foo;
20 | f.x = 1;
21 | assert(f.x == 1);
22 | }
23 | };
24 |
25 | class Foo {
26 | int x;
27 | };
--------------------------------------------------------------------------------
/Regression/AllocObject/compile_param:
--------------------------------------------------------------------------------
1 | /preemptive /nowarning:292;
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/Regression/AllocObject/param:
--------------------------------------------------------------------------------
1 | -entirezingtrace;
2 | -entirezingtrace -delayb:../../DelayingSchedulers/RunToCompletionDelayingScheduler/bin/x64/debug/RunToCompletionDelayingScheduler.dll;
3 | -entirezingtrace -delayb:../../DelayingSchedulers/RoundRobinDelayingScheduler/bin/x64/debug/RoundRobinDelayingScheduler.dll;
4 | -entirezingtrace -delayb:../../DelayingSchedulers/CustomDelayingScheduler/bin/x64/debug/CustomDelayingScheduler.dll;
5 | -entirezingtrace -pb;
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/Regression/AlternatingBit/AlternatingBit.zing:
--------------------------------------------------------------------------------
1 | class Msg {
2 | bool body;
3 | bool bit;
4 | };
5 |
6 | class Ack {
7 | bool bit;
8 | };
9 |
10 | chan MsgChan Msg;
11 | chan AckChan Ack;
12 |
13 | chan BoolChan bool;
14 |
15 | class Sender {
16 | static MsgChan xmit;
17 | static AckChan recv;
18 |
19 | static void TransmitMsg(bool body, bool bit)
20 | {
21 | Msg m;
22 |
23 | select {
24 | wait(true) -> {
25 | assume(sizeof(xmit) < Main.QueueSize);
26 | m = new Msg;
27 | m.body = body;
28 | m.bit = bit;
29 | send(xmit, m);
30 | }
31 | wait(true) -> /* lost message */ ;
32 | }
33 | }
34 |
35 | static void Run()
36 | {
37 | bool currentBit = false;
38 | Ack a;
39 | bool body;
40 | bool gotAck;
41 |
42 | while (true) {
43 | atomic {
44 | body = choose(bool);
45 | send(Main.reliableChan, body);
46 |
47 | TransmitMsg(body, currentBit);
48 |
49 | gotAck = false;
50 | }
51 |
52 | while (!gotAck) {
53 | atomic {
54 | select first {
55 | receive(recv, a) -> gotAck = (a.bit == currentBit);
56 | timeout -> TransmitMsg(body, currentBit);
57 | }
58 | }
59 | }
60 |
61 | currentBit = !currentBit;
62 | }
63 | }
64 | };
65 |
66 | class Receiver {
67 | static MsgChan recv;
68 | static AckChan xmit;
69 |
70 | static void TransmitAck(bool bit)
71 | {
72 | Ack a;
73 |
74 | select {
75 | wait(true) -> {
76 | a = new Ack;
77 | a.bit = bit;
78 | send(xmit, a);
79 | }
80 | wait(true) -> /* lost ack */ ;
81 | }
82 | }
83 |
84 | static void Run()
85 | {
86 | bool expectedBit = false;
87 | bool trueBody;
88 | Msg m;
89 |
90 | // Loop forever consuming messages
91 | while (true) {
92 | select { receive(recv, m) -> ; }
93 |
94 | atomic {
95 | // Always send an ack with the same bit
96 | TransmitAck(m.bit);
97 |
98 | if (expectedBit == m.bit) {
99 | // Consume the message here and verify it's body matches
100 | // what we received through the reliable channel
101 | select { receive(Main.reliableChan, trueBody) -> ; }
102 | assert(trueBody == m.body);
103 |
104 | expectedBit = !expectedBit;
105 | }
106 | }
107 | }
108 | }
109 | };
110 |
111 |
112 | class Main {
113 |
114 | static int QueueSize = 2;
115 |
116 | static BoolChan reliableChan;
117 |
118 | activate static void Run()
119 | {
120 | atomic {
121 | reliableChan = new BoolChan;
122 |
123 | Sender.xmit = Receiver.recv = new MsgChan;
124 | Sender.recv = Receiver.xmit = new AckChan;
125 |
126 | async Sender.Run();
127 | async Receiver.Run();
128 | }
129 | }
130 | };
131 |
--------------------------------------------------------------------------------
/Regression/AlternatingBit/compile_param:
--------------------------------------------------------------------------------
1 | /preemptive /nowarning:292;
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/Regression/AlternatingBit/golden_1.txt:
--------------------------------------------------------------------------------
1 | ##################
2 | Check Passed
3 | ##################
4 | 5201 distinct states explored
5 |
--------------------------------------------------------------------------------
/Regression/AlternatingBit/golden_2.txt:
--------------------------------------------------------------------------------
1 | ##################
2 | Check Passed
3 | ##################
4 | 5201 distinct states explored
5 |
--------------------------------------------------------------------------------
/Regression/AlternatingBit/golden_3.txt:
--------------------------------------------------------------------------------
1 | ##################
2 | Check Passed
3 | ##################
4 | 5201 distinct states explored
5 |
--------------------------------------------------------------------------------
/Regression/AlternatingBit/golden_4.txt:
--------------------------------------------------------------------------------
1 | ##################
2 | Check Passed
3 | ##################
4 | 5201 distinct states explored
5 |
--------------------------------------------------------------------------------
/Regression/AlternatingBit/golden_5.txt:
--------------------------------------------------------------------------------
1 | ##################
2 | Check Passed
3 | ##################
4 | 5201 distinct states explored
5 |
--------------------------------------------------------------------------------
/Regression/AlternatingBit/param:
--------------------------------------------------------------------------------
1 | -entirezingtrace;
2 | -entirezingtrace -delayb:../../DelayingSchedulers/RunToCompletionDelayingScheduler/bin/x64/debug/RunToCompletionDelayingScheduler.dll;
3 | -entirezingtrace -delayb:../../DelayingSchedulers/RoundRobinDelayingScheduler/bin/x64/debug/RoundRobinDelayingScheduler.dll;
4 | -entirezingtrace -delayb:../../DelayingSchedulers/CustomDelayingScheduler/bin/x64/debug/CustomDelayingScheduler.dll;
5 | -entirezingtrace -pb;
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/Regression/Array1/Array1.zing:
--------------------------------------------------------------------------------
1 | array GooArray[] Goo;
2 |
3 | class Goo {
4 | int f;
5 | };
6 |
7 | class Foo {
8 | activate static void main() {
9 | int x = 3;
10 | GooArray b = new GooArray[x];
11 | b[2] = new Goo;
12 | b[2].f = 4;
13 | assert(b[1].f < 3);
14 | }
15 |
16 |
17 | };
--------------------------------------------------------------------------------
/Regression/Array1/compile_param:
--------------------------------------------------------------------------------
1 | /preemptive /nowarning:292;
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/Regression/Array1/golden_1.txt:
--------------------------------------------------------------------------------
1 | Program Runtime Error
2 | *******************************************************************************
3 | Error trace 0: length: 6 states
4 | #### State 0 :
5 | State:[fingerprint =16581ec7:6606d9b6]
6 |
7 | Globals:
8 |
9 |
10 | Processes: (1)
11 |
12 | Process 0: Name='main', Id=0
13 | Status: Runnable
14 | Choice pending: False
15 | Entry point: Microsoft.Zing.Application+Foo+main
16 | Stack:
17 | Function : Microsoft.Zing.Application+Foo+main
18 | NextBlock: Enter
19 | Inputs:
20 | Outputs:
21 | Locals:
22 | System.Int32 x = 0
23 | ZingPointer b = 0
24 |
25 | #### State 1 (ran process 0) :
26 | State:[fingerprint =52641536:08e4d18f]
27 |
28 | Globals:
29 |
30 |
31 | Processes: (1)
32 |
33 | Process 0: Name='main', Id=0
34 | Status: Runnable
35 | Choice pending: False
36 | Entry point: Microsoft.Zing.Application+Foo+main
37 | Stack:
38 | Function : Microsoft.Zing.Application+Foo+main
39 | NextBlock: B4
40 | Inputs:
41 | Outputs:
42 | Locals:
43 | System.Int32 x = 3
44 | ZingPointer b = 0
45 |
46 | #### State 2 (ran process 0) :
47 | State:[fingerprint =38e7d320:0941eea0]
48 |
49 | Globals:
50 |
51 | Heap: (1 items)
52 | Addr= 1
53 | Type= Microsoft.Zing.Application+GooArray
54 | Contents:
55 | Array: ElementType=Microsoft.Zing.Application+Goo, 3 elements
56 | 0: 0
57 | 1: 0
58 | 2: 0
59 |
60 |
61 | Processes: (1)
62 |
63 | Process 0: Name='main', Id=0
64 | Status: Runnable
65 | Choice pending: False
66 | Entry point: Microsoft.Zing.Application+Foo+main
67 | Stack:
68 | Function : Microsoft.Zing.Application+Foo+main
69 | NextBlock: B3
70 | Inputs:
71 | Outputs:
72 | Locals:
73 | System.Int32 x = 3
74 | ZingPointer b = 1
75 |
76 | #### State 3 (ran process 0) :
77 | State:[fingerprint =764bb79b:382d762c]
78 |
79 | Globals:
80 |
81 | Heap: (2 items)
82 | Addr= 1
83 | Type= Microsoft.Zing.Application+GooArray
84 | Contents:
85 | Array: ElementType=Microsoft.Zing.Application+Goo, 3 elements
86 | 0: 0
87 | 1: 0
88 | 2: 2
89 |
90 | Addr= 2
91 | Type= Microsoft.Zing.Application+Goo
92 | Contents:
93 | System.Int32 f = 0
94 |
95 |
96 | Processes: (1)
97 |
98 | Process 0: Name='main', Id=0
99 | Status: Runnable
100 | Choice pending: False
101 | Entry point: Microsoft.Zing.Application+Foo+main
102 | Stack:
103 | Function : Microsoft.Zing.Application+Foo+main
104 | NextBlock: B2
105 | Inputs:
106 | Outputs:
107 | Locals:
108 | System.Int32 x = 3
109 | ZingPointer b = 1
110 |
111 | #### State 4 (ran process 0) :
112 | State:[fingerprint =517195c9:3102d47e]
113 |
114 | Globals:
115 |
116 | Heap: (2 items)
117 | Addr= 1
118 | Type= Microsoft.Zing.Application+GooArray
119 | Contents:
120 | Array: ElementType=Microsoft.Zing.Application+Goo, 3 elements
121 | 0: 0
122 | 1: 0
123 | 2: 2
124 |
125 | Addr= 2
126 | Type= Microsoft.Zing.Application+Goo
127 | Contents:
128 | System.Int32 f = 4
129 |
130 |
131 | Processes: (1)
132 |
133 | Process 0: Name='main', Id=0
134 | Status: Runnable
135 | Choice pending: False
136 | Entry point: Microsoft.Zing.Application+Foo+main
137 | Stack:
138 | Function : Microsoft.Zing.Application+Foo+main
139 | NextBlock: B1
140 | Inputs:
141 | Outputs:
142 | Locals:
143 | System.Int32 x = 3
144 | ZingPointer b = 1
145 |
146 | #### State 5 (ran process 0) :
147 | State:[fingerprint =517195c9:3102d47e]
148 |
149 | Globals:
150 |
151 | Heap: (2 items)
152 | Addr= 1
153 | Type= Microsoft.Zing.Application+GooArray
154 | Contents:
155 | Array: ElementType=Microsoft.Zing.Application+Goo, 3 elements
156 | 0: 0
157 | 1: 0
158 | 2: 2
159 |
160 | Addr= 2
161 | Type= Microsoft.Zing.Application+Goo
162 | Contents:
163 | System.Int32 f = 4
164 |
165 |
166 | Processes: (1)
167 |
168 | Process 0: Name='main', Id=0
169 | Status: Runnable
170 | Choice pending: False
171 | Entry point: Microsoft.Zing.Application+Foo+main
172 | Stack:
173 | Function : Microsoft.Zing.Application+Foo+main
174 | NextBlock: B1
175 | Inputs:
176 | Outputs:
177 | Locals:
178 | System.Int32 x = 3
179 | ZingPointer b = 1
180 |
181 |
182 | Error in state:
183 | A Zing null pointer was dereferenced.
184 |
185 |
186 | Stack trace:
187 | Foo.main (Array1.zing, Line 13)
188 |
189 |
190 | 1 distinct states explored
191 |
--------------------------------------------------------------------------------
/Regression/Array1/param:
--------------------------------------------------------------------------------
1 | -entirezingtrace;
2 | -entirezingtrace -delayb:../../DelayingSchedulers/RunToCompletionDelayingScheduler/bin/x64/debug/RunToCompletionDelayingScheduler.dll;
3 | -entirezingtrace -delayb:../../DelayingSchedulers/RoundRobinDelayingScheduler/bin/x64/debug/RoundRobinDelayingScheduler.dll;
4 | -entirezingtrace -delayb:../../DelayingSchedulers/CustomDelayingScheduler/bin/x64/debug/CustomDelayingScheduler.dll;
5 | -entirezingtrace -pb;
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/Regression/Array2/Array2.zing:
--------------------------------------------------------------------------------
1 | array IntArray[3] int;
2 | array IntDArray[] int;
3 |
4 | class Foo {
5 | activate static void main() {
6 | int x = 3;
7 | IntArray a = new IntArray;
8 | a[2] = 2;
9 | IntDArray b = new IntDArray[x];
10 | b[x-1] = x + a[2];
11 | assert(b[2] > 3);
12 | }
13 |
14 |
15 | };
--------------------------------------------------------------------------------
/Regression/Array2/compile_param:
--------------------------------------------------------------------------------
1 | /preemptive /nowarning:292;
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/Regression/Array2/golden_1.txt:
--------------------------------------------------------------------------------
1 | ##################
2 | Check Passed
3 | ##################
4 | 1 distinct states explored
5 |
--------------------------------------------------------------------------------
/Regression/Array2/golden_2.txt:
--------------------------------------------------------------------------------
1 | ##################
2 | Check Passed
3 | ##################
4 | 1 distinct states explored
5 |
--------------------------------------------------------------------------------
/Regression/Array2/golden_3.txt:
--------------------------------------------------------------------------------
1 | ##################
2 | Check Passed
3 | ##################
4 | 1 distinct states explored
5 |
--------------------------------------------------------------------------------
/Regression/Array2/golden_4.txt:
--------------------------------------------------------------------------------
1 | ##################
2 | Check Passed
3 | ##################
4 | 1 distinct states explored
5 |
--------------------------------------------------------------------------------
/Regression/Array2/golden_5.txt:
--------------------------------------------------------------------------------
1 | ##################
2 | Check Passed
3 | ##################
4 | 1 distinct states explored
5 |
--------------------------------------------------------------------------------
/Regression/Array2/param:
--------------------------------------------------------------------------------
1 | -entirezingtrace;
2 | -entirezingtrace -delayb:../../DelayingSchedulers/RunToCompletionDelayingScheduler/bin/x64/debug/RunToCompletionDelayingScheduler.dll;
3 | -entirezingtrace -delayb:../../DelayingSchedulers/RoundRobinDelayingScheduler/bin/x64/debug/RoundRobinDelayingScheduler.dll;
4 | -entirezingtrace -delayb:../../DelayingSchedulers/CustomDelayingScheduler/bin/x64/debug/CustomDelayingScheduler.dll;
5 | -entirezingtrace -pb;
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/Regression/Array3/Array3.zing:
--------------------------------------------------------------------------------
1 | array IntDArray[] int;
2 |
3 | class Foo {
4 | activate static void main() {
5 | int x = 3;
6 | IntDArray b = new IntDArray[x];
7 | b[3] = -1;
8 | }
9 |
10 |
11 | };
--------------------------------------------------------------------------------
/Regression/Array3/compile_param:
--------------------------------------------------------------------------------
1 | /preemptive /nowarning:292;
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/Regression/Array3/golden_1.txt:
--------------------------------------------------------------------------------
1 | Program Runtime Error
2 | *******************************************************************************
3 | Error trace 0: length: 4 states
4 | #### State 0 :
5 | State:[fingerprint =2dd2862d:6a19f1a8]
6 |
7 | Globals:
8 |
9 |
10 | Processes: (1)
11 |
12 | Process 0: Name='main', Id=0
13 | Status: Runnable
14 | Choice pending: False
15 | Entry point: Microsoft.Zing.Application+Foo+main
16 | Stack:
17 | Function : Microsoft.Zing.Application+Foo+main
18 | NextBlock: Enter
19 | Inputs:
20 | Outputs:
21 | Locals:
22 | System.Int32 x = 0
23 | ZingPointer b = 0
24 |
25 | #### State 1 (ran process 0) :
26 | State:[fingerprint =003b8033:18f5aef7]
27 |
28 | Globals:
29 |
30 |
31 | Processes: (1)
32 |
33 | Process 0: Name='main', Id=0
34 | Status: Runnable
35 | Choice pending: False
36 | Entry point: Microsoft.Zing.Application+Foo+main
37 | Stack:
38 | Function : Microsoft.Zing.Application+Foo+main
39 | NextBlock: B2
40 | Inputs:
41 | Outputs:
42 | Locals:
43 | System.Int32 x = 3
44 | ZingPointer b = 0
45 |
46 | #### State 2 (ran process 0) :
47 | State:[fingerprint =39c33035:454f6afc]
48 |
49 | Globals:
50 |
51 | Heap: (1 items)
52 | Addr= 1
53 | Type= Microsoft.Zing.Application+IntDArray
54 | Contents:
55 | Array: ElementType=System.Int32, 3 elements
56 | 0: 0
57 | 1: 0
58 | 2: 0
59 |
60 |
61 | Processes: (1)
62 |
63 | Process 0: Name='main', Id=0
64 | Status: Runnable
65 | Choice pending: False
66 | Entry point: Microsoft.Zing.Application+Foo+main
67 | Stack:
68 | Function : Microsoft.Zing.Application+Foo+main
69 | NextBlock: B1
70 | Inputs:
71 | Outputs:
72 | Locals:
73 | System.Int32 x = 3
74 | ZingPointer b = 1
75 |
76 | #### State 3 (ran process 0) :
77 | State:[fingerprint =39c33035:454f6afc]
78 |
79 | Globals:
80 |
81 | Heap: (1 items)
82 | Addr= 1
83 | Type= Microsoft.Zing.Application+IntDArray
84 | Contents:
85 | Array: ElementType=System.Int32, 3 elements
86 | 0: 0
87 | 1: 0
88 | 2: 0
89 |
90 |
91 | Processes: (1)
92 |
93 | Process 0: Name='main', Id=0
94 | Status: Runnable
95 | Choice pending: False
96 | Entry point: Microsoft.Zing.Application+Foo+main
97 | Stack:
98 | Function : Microsoft.Zing.Application+Foo+main
99 | NextBlock: B1
100 | Inputs:
101 | Outputs:
102 | Locals:
103 | System.Int32 x = 3
104 | ZingPointer b = 1
105 |
106 |
107 | Error in state:
108 | Invalid index in a Zing array reference.
109 |
110 |
111 | Stack trace:
112 | Foo.main (Array3.zing, Line 7)
113 |
114 |
115 | 1 distinct states explored
116 |
--------------------------------------------------------------------------------
/Regression/Array3/golden_2.txt:
--------------------------------------------------------------------------------
1 | Program Runtime Error
2 | *******************************************************************************
3 | Error trace 0: length: 4 states
4 | #### State 0 :
5 | State:[fingerprint =2dd2862d:6a19f1a8]
6 |
7 | Globals:
8 |
9 |
10 | Processes: (1)
11 |
12 | Process 0: Name='main', Id=0
13 | Status: Runnable
14 | Choice pending: False
15 | Entry point: Microsoft.Zing.Application+Foo+main
16 | Stack:
17 | Function : Microsoft.Zing.Application+Foo+main
18 | NextBlock: Enter
19 | Inputs:
20 | Outputs:
21 | Locals:
22 | System.Int32 x = 0
23 | ZingPointer b = 0
24 |
25 | #### State 1 (ran process 0) :
26 | State:[fingerprint =003b8033:18f5aef7]
27 |
28 | Globals:
29 |
30 |
31 | Processes: (1)
32 |
33 | Process 0: Name='main', Id=0
34 | Status: Runnable
35 | Choice pending: False
36 | Entry point: Microsoft.Zing.Application+Foo+main
37 | Stack:
38 | Function : Microsoft.Zing.Application+Foo+main
39 | NextBlock: B2
40 | Inputs:
41 | Outputs:
42 | Locals:
43 | System.Int32 x = 3
44 | ZingPointer b = 0
45 |
46 | #### State 2 (ran process 0) :
47 | State:[fingerprint =39c33035:454f6afc]
48 |
49 | Globals:
50 |
51 | Heap: (1 items)
52 | Addr= 1
53 | Type= Microsoft.Zing.Application+IntDArray
54 | Contents:
55 | Array: ElementType=System.Int32, 3 elements
56 | 0: 0
57 | 1: 0
58 | 2: 0
59 |
60 |
61 | Processes: (1)
62 |
63 | Process 0: Name='main', Id=0
64 | Status: Runnable
65 | Choice pending: False
66 | Entry point: Microsoft.Zing.Application+Foo+main
67 | Stack:
68 | Function : Microsoft.Zing.Application+Foo+main
69 | NextBlock: B1
70 | Inputs:
71 | Outputs:
72 | Locals:
73 | System.Int32 x = 3
74 | ZingPointer b = 1
75 |
76 | #### State 3 (ran process 0) :
77 | State:[fingerprint =39c33035:454f6afc]
78 |
79 | Globals:
80 |
81 | Heap: (1 items)
82 | Addr= 1
83 | Type= Microsoft.Zing.Application+IntDArray
84 | Contents:
85 | Array: ElementType=System.Int32, 3 elements
86 | 0: 0
87 | 1: 0
88 | 2: 0
89 |
90 |
91 | Processes: (1)
92 |
93 | Process 0: Name='main', Id=0
94 | Status: Runnable
95 | Choice pending: False
96 | Entry point: Microsoft.Zing.Application+Foo+main
97 | Stack:
98 | Function : Microsoft.Zing.Application+Foo+main
99 | NextBlock: B1
100 | Inputs:
101 | Outputs:
102 | Locals:
103 | System.Int32 x = 3
104 | ZingPointer b = 1
105 |
106 |
107 | Error in state:
108 | Invalid index in a Zing array reference.
109 |
110 |
111 | Stack trace:
112 | Foo.main (Array3.zing, Line 7)
113 |
114 |
115 | 1 distinct states explored
116 |
--------------------------------------------------------------------------------
/Regression/Array3/golden_3.txt:
--------------------------------------------------------------------------------
1 | Program Runtime Error
2 | *******************************************************************************
3 | Error trace 0: length: 4 states
4 | #### State 0 :
5 | State:[fingerprint =2dd2862d:6a19f1a8]
6 |
7 | Globals:
8 |
9 |
10 | Processes: (1)
11 |
12 | Process 0: Name='main', Id=0
13 | Status: Runnable
14 | Choice pending: False
15 | Entry point: Microsoft.Zing.Application+Foo+main
16 | Stack:
17 | Function : Microsoft.Zing.Application+Foo+main
18 | NextBlock: Enter
19 | Inputs:
20 | Outputs:
21 | Locals:
22 | System.Int32 x = 0
23 | ZingPointer b = 0
24 |
25 | #### State 1 (ran process 0) :
26 | State:[fingerprint =003b8033:18f5aef7]
27 |
28 | Globals:
29 |
30 |
31 | Processes: (1)
32 |
33 | Process 0: Name='main', Id=0
34 | Status: Runnable
35 | Choice pending: False
36 | Entry point: Microsoft.Zing.Application+Foo+main
37 | Stack:
38 | Function : Microsoft.Zing.Application+Foo+main
39 | NextBlock: B2
40 | Inputs:
41 | Outputs:
42 | Locals:
43 | System.Int32 x = 3
44 | ZingPointer b = 0
45 |
46 | #### State 2 (ran process 0) :
47 | State:[fingerprint =39c33035:454f6afc]
48 |
49 | Globals:
50 |
51 | Heap: (1 items)
52 | Addr= 1
53 | Type= Microsoft.Zing.Application+IntDArray
54 | Contents:
55 | Array: ElementType=System.Int32, 3 elements
56 | 0: 0
57 | 1: 0
58 | 2: 0
59 |
60 |
61 | Processes: (1)
62 |
63 | Process 0: Name='main', Id=0
64 | Status: Runnable
65 | Choice pending: False
66 | Entry point: Microsoft.Zing.Application+Foo+main
67 | Stack:
68 | Function : Microsoft.Zing.Application+Foo+main
69 | NextBlock: B1
70 | Inputs:
71 | Outputs:
72 | Locals:
73 | System.Int32 x = 3
74 | ZingPointer b = 1
75 |
76 | #### State 3 (ran process 0) :
77 | State:[fingerprint =39c33035:454f6afc]
78 |
79 | Globals:
80 |
81 | Heap: (1 items)
82 | Addr= 1
83 | Type= Microsoft.Zing.Application+IntDArray
84 | Contents:
85 | Array: ElementType=System.Int32, 3 elements
86 | 0: 0
87 | 1: 0
88 | 2: 0
89 |
90 |
91 | Processes: (1)
92 |
93 | Process 0: Name='main', Id=0
94 | Status: Runnable
95 | Choice pending: False
96 | Entry point: Microsoft.Zing.Application+Foo+main
97 | Stack:
98 | Function : Microsoft.Zing.Application+Foo+main
99 | NextBlock: B1
100 | Inputs:
101 | Outputs:
102 | Locals:
103 | System.Int32 x = 3
104 | ZingPointer b = 1
105 |
106 |
107 | Error in state:
108 | Invalid index in a Zing array reference.
109 |
110 |
111 | Stack trace:
112 | Foo.main (Array3.zing, Line 7)
113 |
114 |
115 | 1 distinct states explored
116 |
--------------------------------------------------------------------------------
/Regression/Array3/golden_4.txt:
--------------------------------------------------------------------------------
1 | Program Runtime Error
2 | *******************************************************************************
3 | Error trace 0: length: 4 states
4 | #### State 0 :
5 | State:[fingerprint =2dd2862d:6a19f1a8]
6 |
7 | Globals:
8 |
9 |
10 | Processes: (1)
11 |
12 | Process 0: Name='main', Id=0
13 | Status: Runnable
14 | Choice pending: False
15 | Entry point: Microsoft.Zing.Application+Foo+main
16 | Stack:
17 | Function : Microsoft.Zing.Application+Foo+main
18 | NextBlock: Enter
19 | Inputs:
20 | Outputs:
21 | Locals:
22 | System.Int32 x = 0
23 | ZingPointer b = 0
24 |
25 | #### State 1 (ran process 0) :
26 | State:[fingerprint =003b8033:18f5aef7]
27 |
28 | Globals:
29 |
30 |
31 | Processes: (1)
32 |
33 | Process 0: Name='main', Id=0
34 | Status: Runnable
35 | Choice pending: False
36 | Entry point: Microsoft.Zing.Application+Foo+main
37 | Stack:
38 | Function : Microsoft.Zing.Application+Foo+main
39 | NextBlock: B2
40 | Inputs:
41 | Outputs:
42 | Locals:
43 | System.Int32 x = 3
44 | ZingPointer b = 0
45 |
46 | #### State 2 (ran process 0) :
47 | State:[fingerprint =39c33035:454f6afc]
48 |
49 | Globals:
50 |
51 | Heap: (1 items)
52 | Addr= 1
53 | Type= Microsoft.Zing.Application+IntDArray
54 | Contents:
55 | Array: ElementType=System.Int32, 3 elements
56 | 0: 0
57 | 1: 0
58 | 2: 0
59 |
60 |
61 | Processes: (1)
62 |
63 | Process 0: Name='main', Id=0
64 | Status: Runnable
65 | Choice pending: False
66 | Entry point: Microsoft.Zing.Application+Foo+main
67 | Stack:
68 | Function : Microsoft.Zing.Application+Foo+main
69 | NextBlock: B1
70 | Inputs:
71 | Outputs:
72 | Locals:
73 | System.Int32 x = 3
74 | ZingPointer b = 1
75 |
76 | #### State 3 (ran process 0) :
77 | State:[fingerprint =39c33035:454f6afc]
78 |
79 | Globals:
80 |
81 | Heap: (1 items)
82 | Addr= 1
83 | Type= Microsoft.Zing.Application+IntDArray
84 | Contents:
85 | Array: ElementType=System.Int32, 3 elements
86 | 0: 0
87 | 1: 0
88 | 2: 0
89 |
90 |
91 | Processes: (1)
92 |
93 | Process 0: Name='main', Id=0
94 | Status: Runnable
95 | Choice pending: False
96 | Entry point: Microsoft.Zing.Application+Foo+main
97 | Stack:
98 | Function : Microsoft.Zing.Application+Foo+main
99 | NextBlock: B1
100 | Inputs:
101 | Outputs:
102 | Locals:
103 | System.Int32 x = 3
104 | ZingPointer b = 1
105 |
106 |
107 | Error in state:
108 | Invalid index in a Zing array reference.
109 |
110 |
111 | Stack trace:
112 | Foo.main (Array3.zing, Line 7)
113 |
114 |
115 | 1 distinct states explored
116 |
--------------------------------------------------------------------------------
/Regression/Array3/golden_5.txt:
--------------------------------------------------------------------------------
1 | Program Runtime Error
2 | *******************************************************************************
3 | Error trace 0: length: 4 states
4 | #### State 0 :
5 | State:[fingerprint =2dd2862d:6a19f1a8]
6 |
7 | Globals:
8 |
9 |
10 | Processes: (1)
11 |
12 | Process 0: Name='main', Id=0
13 | Status: Runnable
14 | Choice pending: False
15 | Entry point: Microsoft.Zing.Application+Foo+main
16 | Stack:
17 | Function : Microsoft.Zing.Application+Foo+main
18 | NextBlock: Enter
19 | Inputs:
20 | Outputs:
21 | Locals:
22 | System.Int32 x = 0
23 | ZingPointer b = 0
24 |
25 | #### State 1 (ran process 0) :
26 | State:[fingerprint =003b8033:18f5aef7]
27 |
28 | Globals:
29 |
30 |
31 | Processes: (1)
32 |
33 | Process 0: Name='main', Id=0
34 | Status: Runnable
35 | Choice pending: False
36 | Entry point: Microsoft.Zing.Application+Foo+main
37 | Stack:
38 | Function : Microsoft.Zing.Application+Foo+main
39 | NextBlock: B2
40 | Inputs:
41 | Outputs:
42 | Locals:
43 | System.Int32 x = 3
44 | ZingPointer b = 0
45 |
46 | #### State 2 (ran process 0) :
47 | State:[fingerprint =39c33035:454f6afc]
48 |
49 | Globals:
50 |
51 | Heap: (1 items)
52 | Addr= 1
53 | Type= Microsoft.Zing.Application+IntDArray
54 | Contents:
55 | Array: ElementType=System.Int32, 3 elements
56 | 0: 0
57 | 1: 0
58 | 2: 0
59 |
60 |
61 | Processes: (1)
62 |
63 | Process 0: Name='main', Id=0
64 | Status: Runnable
65 | Choice pending: False
66 | Entry point: Microsoft.Zing.Application+Foo+main
67 | Stack:
68 | Function : Microsoft.Zing.Application+Foo+main
69 | NextBlock: B1
70 | Inputs:
71 | Outputs:
72 | Locals:
73 | System.Int32 x = 3
74 | ZingPointer b = 1
75 |
76 | #### State 3 (ran process 0) :
77 | State:[fingerprint =39c33035:454f6afc]
78 |
79 | Globals:
80 |
81 | Heap: (1 items)
82 | Addr= 1
83 | Type= Microsoft.Zing.Application+IntDArray
84 | Contents:
85 | Array: ElementType=System.Int32, 3 elements
86 | 0: 0
87 | 1: 0
88 | 2: 0
89 |
90 |
91 | Processes: (1)
92 |
93 | Process 0: Name='main', Id=0
94 | Status: Runnable
95 | Choice pending: False
96 | Entry point: Microsoft.Zing.Application+Foo+main
97 | Stack:
98 | Function : Microsoft.Zing.Application+Foo+main
99 | NextBlock: B1
100 | Inputs:
101 | Outputs:
102 | Locals:
103 | System.Int32 x = 3
104 | ZingPointer b = 1
105 |
106 |
107 | Error in state:
108 | Invalid index in a Zing array reference.
109 |
110 |
111 | Stack trace:
112 | Foo.main (Array3.zing, Line 7)
113 |
114 |
115 | 1 distinct states explored
116 |
--------------------------------------------------------------------------------
/Regression/Array3/param:
--------------------------------------------------------------------------------
1 | -entirezingtrace;
2 | -entirezingtrace -delayb:../../DelayingSchedulers/RunToCompletionDelayingScheduler/bin/x64/debug/RunToCompletionDelayingScheduler.dll;
3 | -entirezingtrace -delayb:../../DelayingSchedulers/RoundRobinDelayingScheduler/bin/x64/debug/RoundRobinDelayingScheduler.dll;
4 | -entirezingtrace -delayb:../../DelayingSchedulers/CustomDelayingScheduler/bin/x64/debug/CustomDelayingScheduler.dll;
5 | -entirezingtrace -pb;
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/Regression/Array4/Array4.zing:
--------------------------------------------------------------------------------
1 | array GooArray[] Goo;
2 |
3 | class Goo {
4 | int f;
5 | };
6 |
7 | class Foo {
8 | activate static void main() {
9 | int x = 3;
10 | GooArray b = new GooArray[x];
11 | b[2] = new Goo;
12 | b[2].f = 4;
13 | assert(b[2].f > 3);
14 | }
15 |
16 |
17 | };
--------------------------------------------------------------------------------
/Regression/Array4/compile_param:
--------------------------------------------------------------------------------
1 | /preemptive /nowarning:292;
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/Regression/Array4/golden_1.txt:
--------------------------------------------------------------------------------
1 | ##################
2 | Check Passed
3 | ##################
4 | 1 distinct states explored
5 |
--------------------------------------------------------------------------------
/Regression/Array4/golden_2.txt:
--------------------------------------------------------------------------------
1 | ##################
2 | Check Passed
3 | ##################
4 | 1 distinct states explored
5 |
--------------------------------------------------------------------------------
/Regression/Array4/golden_3.txt:
--------------------------------------------------------------------------------
1 | ##################
2 | Check Passed
3 | ##################
4 | 1 distinct states explored
5 |
--------------------------------------------------------------------------------
/Regression/Array4/golden_4.txt:
--------------------------------------------------------------------------------
1 | ##################
2 | Check Passed
3 | ##################
4 | 1 distinct states explored
5 |
--------------------------------------------------------------------------------
/Regression/Array4/golden_5.txt:
--------------------------------------------------------------------------------
1 | ##################
2 | Check Passed
3 | ##################
4 | 1 distinct states explored
5 |
--------------------------------------------------------------------------------
/Regression/Array4/param:
--------------------------------------------------------------------------------
1 | -entirezingtrace;
2 | -entirezingtrace -delayb:../../DelayingSchedulers/RunToCompletionDelayingScheduler/bin/x64/debug/RunToCompletionDelayingScheduler.dll;
3 | -entirezingtrace -delayb:../../DelayingSchedulers/RoundRobinDelayingScheduler/bin/x64/debug/RoundRobinDelayingScheduler.dll;
4 | -entirezingtrace -delayb:../../DelayingSchedulers/CustomDelayingScheduler/bin/x64/debug/CustomDelayingScheduler.dll;
5 | -entirezingtrace -pb;
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/Regression/AuctionHouse/compile_param:
--------------------------------------------------------------------------------
1 | /preemptive /nowarning:292;
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/Regression/AuctionHouse/golden_1.txt:
--------------------------------------------------------------------------------
1 | ##################
2 | Check Passed
3 | ##################
4 | 2276 distinct states explored
5 |
--------------------------------------------------------------------------------
/Regression/AuctionHouse/golden_2.txt:
--------------------------------------------------------------------------------
1 | ##################
2 | Check Passed
3 | ##################
4 | 2276 distinct states explored
5 |
--------------------------------------------------------------------------------
/Regression/AuctionHouse/golden_3.txt:
--------------------------------------------------------------------------------
1 | ##################
2 | Check Passed
3 | ##################
4 | 2276 distinct states explored
5 |
--------------------------------------------------------------------------------
/Regression/AuctionHouse/golden_4.txt:
--------------------------------------------------------------------------------
1 | ##################
2 | Check Passed
3 | ##################
4 | 2276 distinct states explored
5 |
--------------------------------------------------------------------------------
/Regression/AuctionHouse/golden_5.txt:
--------------------------------------------------------------------------------
1 | ##################
2 | Check Passed
3 | ##################
4 | 2276 distinct states explored
5 |
--------------------------------------------------------------------------------
/Regression/AuctionHouse/param:
--------------------------------------------------------------------------------
1 | -entirezingtrace;
2 | -entirezingtrace -delayb:../../DelayingSchedulers/RunToCompletionDelayingScheduler/bin/x64/debug/RunToCompletionDelayingScheduler.dll;
3 | -entirezingtrace -delayb:../../DelayingSchedulers/RoundRobinDelayingScheduler/bin/x64/debug/RoundRobinDelayingScheduler.dll;
4 | -entirezingtrace -delayb:../../DelayingSchedulers/CustomDelayingScheduler/bin/x64/debug/CustomDelayingScheduler.dll;
5 | -entirezingtrace -pb;
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/Regression/BlueGlobal/BlueGlobal.zing:
--------------------------------------------------------------------------------
1 |
2 | class BlueTooth
3 | {
4 | static bool stopped;
5 | static bool driverStoppingFlag;
6 | static bool stoppingEvent;
7 | static int pendingIo;
8 | activate atomic static void main() {
9 | pendingIo = 1;
10 | stoppingEvent = false;
11 | async BCSP_Miniport_PnpAdd ();
12 | async BCSP_Miniport_PnpStop();
13 | }
14 |
15 | static void BCSP_Miniport_PnpStop () {
16 | driverStoppingFlag = true;
17 | BCSP_IoDecrement();
18 | KeWaitForStoppingEvent();
19 | stopped = true;
20 | }
21 |
22 | static void BCSP_Miniport_PnpAdd () {
23 | int status;
24 | status = BCSP_IoIncrement ();
25 | if (status > 0) {
26 | // do work here
27 | assert(!stopped);
28 | }
29 | BCSP_IoDecrement();
30 | }
31 |
32 | static int BCSP_IoIncrement() {
33 | int status;
34 | if (driverStoppingFlag == true)
35 | return -1;
36 | else {
37 | InterlockedIncrementPendingIo();
38 | return 1;
39 | }
40 | }
41 |
42 | static void BCSP_IoDecrement() {
43 | int pendingIo;
44 | pendingIo = InterlockedDecrementPendingIo();
45 | if (pendingIo == 0)
46 | KeSetEventStoppingEvent();
47 | }
48 |
49 | static atomic int InterlockedIncrementPendingIo() {
50 | pendingIo = pendingIo + 1;
51 | return pendingIo;
52 | }
53 |
54 | static atomic int InterlockedDecrementPendingIo() {
55 | pendingIo = pendingIo - 1;
56 | return pendingIo;
57 | }
58 |
59 | static void KeSetEventStoppingEvent() {
60 | stoppingEvent = true;
61 | }
62 |
63 | static void KeWaitForStoppingEvent() {
64 | select { wait (stoppingEvent) -> ; }
65 | }
66 | };
--------------------------------------------------------------------------------
/Regression/BlueGlobal/compile_param:
--------------------------------------------------------------------------------
1 | /preemptive /nowarning:292;
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/Regression/BlueGlobal/param:
--------------------------------------------------------------------------------
1 | -entirezingtrace;
2 | -entirezingtrace -delayb:../../DelayingSchedulers/RunToCompletionDelayingScheduler/bin/x64/debug/RunToCompletionDelayingScheduler.dll;
3 | -entirezingtrace -delayb:../../DelayingSchedulers/RoundRobinDelayingScheduler/bin/x64/debug/RoundRobinDelayingScheduler.dll;
4 | -entirezingtrace -delayb:../../DelayingSchedulers/CustomDelayingScheduler/bin/x64/debug/CustomDelayingScheduler.dll;
5 | -entirezingtrace -pb;
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/Regression/BlueGlobalFix2/BlueGlobalFix2.zing:
--------------------------------------------------------------------------------
1 |
2 | class BlueTooth
3 | {
4 | static bool stopped;
5 | static bool driverStoppingFlag;
6 | static bool stoppingEvent;
7 | static int pendingIo;
8 | activate atomic static void main() {
9 | pendingIo = 1;
10 | stoppingEvent = false;
11 | async BCSP_Miniport_PnpAdd ();
12 | async BCSP_Miniport_PnpStop();
13 | }
14 |
15 | static void BCSP_Miniport_PnpStop () {
16 | driverStoppingFlag = true;
17 | BCSP_IoDecrement();
18 | KeWaitForStoppingEvent();
19 | stopped = true;
20 | }
21 |
22 | static void BCSP_Miniport_PnpAdd () {
23 | int status;
24 | status = BCSP_IoIncrement ();
25 | if (status > 0) {
26 | // do work here
27 | assert(!stopped);
28 | }
29 | BCSP_IoDecrement();
30 | }
31 |
32 | static int BCSP_IoIncrement() {
33 | int status;
34 | InterlockedIncrementPendingIo();
35 | if (driverStoppingFlag == true){
36 | BCSP_IoDecrement();
37 | return -1;
38 | }
39 | else {
40 | return 1;
41 | }
42 | }
43 |
44 | static void BCSP_IoDecrement() {
45 | int pendingIo;
46 | pendingIo = InterlockedDecrementPendingIo();
47 | if (pendingIo == 0)
48 | KeSetEventStoppingEvent();
49 | }
50 |
51 | static atomic int InterlockedIncrementPendingIo() {
52 | pendingIo = pendingIo + 1;
53 | return pendingIo;
54 | }
55 |
56 | static atomic int InterlockedDecrementPendingIo() {
57 | pendingIo = pendingIo - 1;
58 | return pendingIo;
59 | }
60 |
61 | static void KeSetEventStoppingEvent() {
62 | stoppingEvent = true;
63 | }
64 |
65 | static void KeWaitForStoppingEvent() {
66 | select { wait (stoppingEvent) -> ; }
67 | }
68 | };
--------------------------------------------------------------------------------
/Regression/BlueGlobalFix2/compile_param:
--------------------------------------------------------------------------------
1 | /preemptive /nowarning:292;
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/Regression/BlueGlobalFix2/golden_1.txt:
--------------------------------------------------------------------------------
1 | ##################
2 | Check Passed
3 | ##################
4 | 599 distinct states explored
5 |
--------------------------------------------------------------------------------
/Regression/BlueGlobalFix2/golden_2.txt:
--------------------------------------------------------------------------------
1 | ##################
2 | Check Passed
3 | ##################
4 | 599 distinct states explored
5 |
--------------------------------------------------------------------------------
/Regression/BlueGlobalFix2/golden_3.txt:
--------------------------------------------------------------------------------
1 | ##################
2 | Check Passed
3 | ##################
4 | 599 distinct states explored
5 |
--------------------------------------------------------------------------------
/Regression/BlueGlobalFix2/golden_4.txt:
--------------------------------------------------------------------------------
1 | ##################
2 | Check Passed
3 | ##################
4 | 599 distinct states explored
5 |
--------------------------------------------------------------------------------
/Regression/BlueGlobalFix2/golden_5.txt:
--------------------------------------------------------------------------------
1 | ##################
2 | Check Passed
3 | ##################
4 | 599 distinct states explored
5 |
--------------------------------------------------------------------------------
/Regression/BlueGlobalFix2/param:
--------------------------------------------------------------------------------
1 | -entirezingtrace;
2 | -entirezingtrace -delayb:../../DelayingSchedulers/RunToCompletionDelayingScheduler/bin/x64/debug/RunToCompletionDelayingScheduler.dll;
3 | -entirezingtrace -delayb:../../DelayingSchedulers/RoundRobinDelayingScheduler/bin/x64/debug/RoundRobinDelayingScheduler.dll;
4 | -entirezingtrace -delayb:../../DelayingSchedulers/CustomDelayingScheduler/bin/x64/debug/CustomDelayingScheduler.dll;
5 | -entirezingtrace -pb;
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/Regression/Bluetooth/Bluetooth.zing:
--------------------------------------------------------------------------------
1 | class DEVICE_EXTENSION {
2 | bool stopped;
3 | bool driverStoppingFlag;
4 | bool stoppingEvent;
5 | int pendingIo;
6 | };
7 |
8 | class DEVICE_OBJECT {
9 | DEVICE_EXTENSION deviceExtension;
10 | };
11 |
12 | class BlueTooth
13 | {
14 | activate atomic static void main() {
15 | DEVICE_OBJECT device = new DEVICE_OBJECT;
16 | device.deviceExtension = new DEVICE_EXTENSION;
17 | device.deviceExtension.pendingIo = 1;
18 | device.deviceExtension.stoppingEvent = false;
19 | async BCSP_Miniport_PnpAdd (device);
20 | async BCSP_Miniport_PnpStop(device);
21 | }
22 |
23 | static void BCSP_Miniport_PnpStop (DEVICE_OBJECT BtDevice) {
24 | DEVICE_EXTENSION deviceExtension = BtDevice.deviceExtension;
25 | deviceExtension.driverStoppingFlag = true;
26 | BCSP_IoDecrement(deviceExtension);
27 | KeWaitForStoppingEvent(deviceExtension);
28 | deviceExtension.stopped = true;
29 | }
30 |
31 | static void BCSP_Miniport_PnpAdd (DEVICE_OBJECT BtDevice) {
32 | DEVICE_EXTENSION deviceExtension = BtDevice.deviceExtension;
33 | int status;
34 | status = BCSP_IoIncrement (deviceExtension);
35 | if (status > 0) {
36 | // do work here
37 | assert(!deviceExtension.stopped);
38 | }
39 | BCSP_IoDecrement(deviceExtension);
40 | }
41 |
42 | static int BCSP_IoIncrement(DEVICE_EXTENSION e) {
43 | int status;
44 | if (e.driverStoppingFlag == true)
45 | return -1;
46 | else {
47 | InterlockedIncrementPendingIo(e);
48 | return 1;
49 | }
50 | }
51 |
52 | static void BCSP_IoDecrement(DEVICE_EXTENSION e) {
53 | int pendingIo;
54 | pendingIo = InterlockedDecrementPendingIo(e);
55 | if (pendingIo == 0)
56 | KeSetEventStoppingEvent(e);
57 | }
58 |
59 | static atomic int InterlockedIncrementPendingIo(DEVICE_EXTENSION e) {
60 | e.pendingIo = e.pendingIo + 1;
61 | return e.pendingIo;
62 | }
63 |
64 | static atomic int InterlockedDecrementPendingIo(DEVICE_EXTENSION e) {
65 | e.pendingIo = e.pendingIo - 1;
66 | return e.pendingIo;
67 | }
68 |
69 | static void KeSetEventStoppingEvent(DEVICE_EXTENSION e) {
70 | e.stoppingEvent = true;
71 | }
72 |
73 | static void KeWaitForStoppingEvent(DEVICE_EXTENSION e) {
74 | select { wait (e.stoppingEvent) -> ; }
75 | }
76 | };
--------------------------------------------------------------------------------
/Regression/Bluetooth/compile_param:
--------------------------------------------------------------------------------
1 | /preemptive /nowarning:292;
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/Regression/Bluetooth/param:
--------------------------------------------------------------------------------
1 | -entirezingtrace;
2 | -entirezingtrace -delayb:../../DelayingSchedulers/RunToCompletionDelayingScheduler/bin/x64/debug/RunToCompletionDelayingScheduler.dll;
3 | -entirezingtrace -delayb:../../DelayingSchedulers/RoundRobinDelayingScheduler/bin/x64/debug/RoundRobinDelayingScheduler.dll;
4 | -entirezingtrace -delayb:../../DelayingSchedulers/CustomDelayingScheduler/bin/x64/debug/CustomDelayingScheduler.dll;
5 | -entirezingtrace -pb;
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/Regression/BluetoothFix/BluetoothFix.zing:
--------------------------------------------------------------------------------
1 | class DEVICE_EXTENSION
2 | {
3 | bool stopped;
4 | bool driverStoppingFlag;
5 | bool stoppingEvent;
6 | int pendingIo;
7 | };
8 |
9 | class DEVICE_OBJECT
10 | {
11 | DEVICE_EXTENSION deviceExtension;
12 | };
13 |
14 | class BlueTooth
15 | {
16 | static void BCSP_Miniport_PnpStop (DEVICE_OBJECT BtDevice)
17 | {
18 | DEVICE_EXTENSION deviceExtension = BtDevice.deviceExtension;
19 | deviceExtension.driverStoppingFlag = true;
20 | BCSP_IoDecrement(deviceExtension);
21 | KeWaitForStoppingEvent(deviceExtension);
22 | deviceExtension.stopped = true;
23 | }
24 |
25 | static void BCSP_Miniport_PnpAdd (DEVICE_OBJECT BtDevice)
26 | {
27 | DEVICE_EXTENSION deviceExtension = BtDevice.deviceExtension;
28 | int status;
29 | status = BCSP_IoIncrement (deviceExtension);
30 | if(status > 0)
31 | {
32 | // do work here
33 | assert(!deviceExtension.stopped);
34 | }
35 | BCSP_IoDecrement(deviceExtension);
36 | }
37 |
38 |
39 | static int BCSP_IoIncrement(DEVICE_EXTENSION e)
40 | {
41 | int status;
42 | InterlockedIncrementPendingIo(e);
43 | if(e.driverStoppingFlag == true){
44 | InterlockedDecrementPendingIo(e);
45 | status = -1;
46 | }
47 | else {
48 | status = 1;
49 | }
50 | return(status);
51 | }
52 |
53 | static void BCSP_IoDecrement(DEVICE_EXTENSION e)
54 | {
55 | int pendingIo;
56 | pendingIo = InterlockedDecrementPendingIo(e);
57 | if(pendingIo == 0)
58 | KeSetEventStoppingEvent(e);
59 | }
60 |
61 | static atomic int InterlockedIncrementPendingIo(DEVICE_EXTENSION e)
62 | {
63 | e.pendingIo = e.pendingIo + 1;
64 | return(e.pendingIo);
65 | }
66 |
67 | static atomic int InterlockedDecrementPendingIo(DEVICE_EXTENSION e)
68 | {
69 | e.pendingIo = e.pendingIo - 1;
70 | return(e.pendingIo);
71 | }
72 |
73 | static void KeSetEventStoppingEvent(DEVICE_EXTENSION e)
74 | {
75 | e.stoppingEvent = true;
76 | }
77 |
78 | static void KeWaitForStoppingEvent(DEVICE_EXTENSION e)
79 | {
80 | select { wait (e.stoppingEvent) -> ; }
81 | }
82 |
83 | activate static void main(){
84 | DEVICE_OBJECT device = new DEVICE_OBJECT;
85 | device.deviceExtension = new DEVICE_EXTENSION;
86 | device.deviceExtension.pendingIo = 1;
87 | device.deviceExtension.stoppingEvent = false;
88 | async BCSP_Miniport_PnpAdd (device);
89 | async BCSP_Miniport_PnpStop(device);
90 | }
91 | };
--------------------------------------------------------------------------------
/Regression/BluetoothFix/compile_param:
--------------------------------------------------------------------------------
1 | /preemptive /nowarning:292;
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/Regression/BluetoothFix/param:
--------------------------------------------------------------------------------
1 | -entirezingtrace;
2 | -entirezingtrace -delayb:../../DelayingSchedulers/RunToCompletionDelayingScheduler/bin/x64/debug/RunToCompletionDelayingScheduler.dll;
3 | -entirezingtrace -delayb:../../DelayingSchedulers/RoundRobinDelayingScheduler/bin/x64/debug/RoundRobinDelayingScheduler.dll;
4 | -entirezingtrace -delayb:../../DelayingSchedulers/CustomDelayingScheduler/bin/x64/debug/CustomDelayingScheduler.dll;
5 | -entirezingtrace -pb;
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/Regression/BluetoothFix2/BluetoothFix2.zing:
--------------------------------------------------------------------------------
1 | class DEVICE_EXTENSION
2 | {
3 | bool stopped;
4 | bool driverStoppingFlag;
5 | bool stoppingEvent;
6 | int pendingIo;
7 | };
8 |
9 | class DEVICE_OBJECT
10 | {
11 | DEVICE_EXTENSION deviceExtension;
12 | };
13 |
14 | class BlueTooth
15 | {
16 | static void BCSP_Miniport_PnpStop (DEVICE_OBJECT BtDevice)
17 | {
18 | DEVICE_EXTENSION deviceExtension = BtDevice.deviceExtension;
19 | deviceExtension.driverStoppingFlag = true;
20 | BCSP_IoDecrement(deviceExtension);
21 | KeWaitForStoppingEvent(deviceExtension);
22 | deviceExtension.stopped = true;
23 | }
24 |
25 | static void BCSP_Miniport_PnpAdd (DEVICE_OBJECT BtDevice)
26 | {
27 | DEVICE_EXTENSION deviceExtension = BtDevice.deviceExtension;
28 | int status;
29 | status = BCSP_IoIncrement (deviceExtension);
30 | if(status > 0)
31 | {
32 | // do work here
33 | assert(!deviceExtension.stopped);
34 | }
35 | BCSP_IoDecrement(deviceExtension);
36 | }
37 |
38 |
39 | static int BCSP_IoIncrement(DEVICE_EXTENSION e)
40 | {
41 | int status;
42 | InterlockedIncrementPendingIo(e);
43 | if(e.driverStoppingFlag == true){
44 | BCSP_IoDecrement(e);
45 | status = -1;
46 | }
47 | else {
48 | status = 1;
49 | }
50 | return(status);
51 | }
52 |
53 | static void BCSP_IoDecrement(DEVICE_EXTENSION e)
54 | {
55 | int pendingIo;
56 | pendingIo = InterlockedDecrementPendingIo(e);
57 | if(pendingIo == 0)
58 | KeSetEventStoppingEvent(e);
59 | }
60 |
61 | static atomic int InterlockedIncrementPendingIo(DEVICE_EXTENSION e)
62 | {
63 | e.pendingIo = e.pendingIo + 1;
64 | return(e.pendingIo);
65 | }
66 |
67 | static atomic int InterlockedDecrementPendingIo(DEVICE_EXTENSION e)
68 | {
69 | e.pendingIo = e.pendingIo - 1;
70 | return(e.pendingIo);
71 | }
72 |
73 | static void KeSetEventStoppingEvent(DEVICE_EXTENSION e)
74 | {
75 | e.stoppingEvent = true;
76 | }
77 |
78 | static void KeWaitForStoppingEvent(DEVICE_EXTENSION e)
79 | {
80 | select { wait (e.stoppingEvent) -> ; }
81 | }
82 |
83 | activate static void main(){
84 | DEVICE_OBJECT device = new DEVICE_OBJECT;
85 | device.deviceExtension = new DEVICE_EXTENSION;
86 | device.deviceExtension.pendingIo = 1;
87 | device.deviceExtension.stoppingEvent = false;
88 | async BCSP_Miniport_PnpAdd (device);
89 | async BCSP_Miniport_PnpStop(device);
90 | }
91 | };
--------------------------------------------------------------------------------
/Regression/BluetoothFix2/compile_param:
--------------------------------------------------------------------------------
1 | /preemptive /nowarning:292;
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/Regression/BluetoothFix2/golden_1.txt:
--------------------------------------------------------------------------------
1 | ##################
2 | Check Passed
3 | ##################
4 | 1335 distinct states explored
5 |
--------------------------------------------------------------------------------
/Regression/BluetoothFix2/golden_2.txt:
--------------------------------------------------------------------------------
1 | ##################
2 | Check Passed
3 | ##################
4 | 1335 distinct states explored
5 |
--------------------------------------------------------------------------------
/Regression/BluetoothFix2/golden_3.txt:
--------------------------------------------------------------------------------
1 | ##################
2 | Check Passed
3 | ##################
4 | 1335 distinct states explored
5 |
--------------------------------------------------------------------------------
/Regression/BluetoothFix2/golden_4.txt:
--------------------------------------------------------------------------------
1 | ##################
2 | Check Passed
3 | ##################
4 | 1335 distinct states explored
5 |
--------------------------------------------------------------------------------
/Regression/BluetoothFix2/golden_5.txt:
--------------------------------------------------------------------------------
1 | ##################
2 | Check Passed
3 | ##################
4 | 1335 distinct states explored
5 |
--------------------------------------------------------------------------------
/Regression/BluetoothFix2/param:
--------------------------------------------------------------------------------
1 | -entirezingtrace;
2 | -entirezingtrace -delayb:../../DelayingSchedulers/RunToCompletionDelayingScheduler/bin/x64/debug/RunToCompletionDelayingScheduler.dll;
3 | -entirezingtrace -delayb:../../DelayingSchedulers/RoundRobinDelayingScheduler/bin/x64/debug/RoundRobinDelayingScheduler.dll;
4 | -entirezingtrace -delayb:../../DelayingSchedulers/CustomDelayingScheduler/bin/x64/debug/CustomDelayingScheduler.dll;
5 | -entirezingtrace -pb;
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/Regression/Casting/Casting.zing:
--------------------------------------------------------------------------------
1 |
2 | class Hello
3 | { int i;
4 | };
5 |
6 | chan HelloChan Hello;
7 |
8 | class Program
9 | {
10 | static activate void main()
11 | { Hello a = new Hello;
12 | Hello b = a;
13 | object c = b;
14 | Hello d = c;
15 | //
16 | HelloChan ca = new HelloChan;
17 | HelloChan cb = ca;
18 | object cc = cb;
19 | HelloChan cd = cc;
20 | }
21 | };
22 |
--------------------------------------------------------------------------------
/Regression/Casting/compile_param:
--------------------------------------------------------------------------------
1 | /preemptive /nowarning:292;
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/Regression/Casting/golden_1.txt:
--------------------------------------------------------------------------------
1 | ##################
2 | Check Passed
3 | ##################
4 | 1 distinct states explored
5 |
--------------------------------------------------------------------------------
/Regression/Casting/golden_2.txt:
--------------------------------------------------------------------------------
1 | ##################
2 | Check Passed
3 | ##################
4 | 1 distinct states explored
5 |
--------------------------------------------------------------------------------
/Regression/Casting/golden_3.txt:
--------------------------------------------------------------------------------
1 | ##################
2 | Check Passed
3 | ##################
4 | 1 distinct states explored
5 |
--------------------------------------------------------------------------------
/Regression/Casting/golden_4.txt:
--------------------------------------------------------------------------------
1 | ##################
2 | Check Passed
3 | ##################
4 | 1 distinct states explored
5 |
--------------------------------------------------------------------------------
/Regression/Casting/golden_5.txt:
--------------------------------------------------------------------------------
1 | ##################
2 | Check Passed
3 | ##################
4 | 1 distinct states explored
5 |
--------------------------------------------------------------------------------
/Regression/Casting/param:
--------------------------------------------------------------------------------
1 | -entirezingtrace;
2 | -entirezingtrace -delayb:../../DelayingSchedulers/RunToCompletionDelayingScheduler/bin/x64/debug/RunToCompletionDelayingScheduler.dll;
3 | -entirezingtrace -delayb:../../DelayingSchedulers/RoundRobinDelayingScheduler/bin/x64/debug/RoundRobinDelayingScheduler.dll;
4 | -entirezingtrace -delayb:../../DelayingSchedulers/CustomDelayingScheduler/bin/x64/debug/CustomDelayingScheduler.dll;
5 | -entirezingtrace -pb;
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/Regression/Copy.bat:
--------------------------------------------------------------------------------
1 | @echo off
2 | @if not "%ECHO%" == "" echo %ECHO%
3 |
4 | for /d %%d in (*) do cp param %%d/param
5 |
6 | ::for /d %%d in (*) do del %%d\golden.txt
7 | goto :EOF
8 |
9 |
10 |
--------------------------------------------------------------------------------
/Regression/Ex1/Ex1.zing:
--------------------------------------------------------------------------------
1 | class Foo {
2 | bool y;
3 | void Block() {
4 | atomic {
5 | assume(y);
6 | y = false;
7 | }
8 | }
9 | };
10 |
11 | class Main {
12 | static Foo x = new Foo;
13 |
14 | activate static void main1() {
15 | helper();
16 | assert(!x.y);
17 | }
18 |
19 | static void helper() {
20 | helper2();
21 | }
22 |
23 | static void helper2() {
24 | x.Block();
25 | }
26 |
27 | activate static void main2() {
28 | x.y = true;
29 | x.y = true;
30 | }
31 | };
32 |
--------------------------------------------------------------------------------
/Regression/Ex1/compile_param:
--------------------------------------------------------------------------------
1 | /preemptive /nowarning:292;
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/Regression/Ex1/golden_5.txt:
--------------------------------------------------------------------------------
1 | ##################
2 | Check Passed
3 | ##################
4 | 16 distinct states explored
5 |
--------------------------------------------------------------------------------
/Regression/Ex1/param:
--------------------------------------------------------------------------------
1 | -entirezingtrace;
2 | -entirezingtrace -delayb:../../DelayingSchedulers/RunToCompletionDelayingScheduler/bin/x64/debug/RunToCompletionDelayingScheduler.dll;
3 | -entirezingtrace -delayb:../../DelayingSchedulers/RoundRobinDelayingScheduler/bin/x64/debug/RoundRobinDelayingScheduler.dll;
4 | -entirezingtrace -delayb:../../DelayingSchedulers/CustomDelayingScheduler/bin/x64/debug/CustomDelayingScheduler.dll;
5 | -entirezingtrace -pb;
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/Regression/Ex2/Ex2.zing:
--------------------------------------------------------------------------------
1 | class Foo {
2 | bool y;
3 | void Block() {
4 | atomic {
5 | assume(y);
6 | y = false;
7 | }
8 | }
9 | };
10 |
11 | class Main {
12 | static Foo x = new Foo;
13 |
14 | activate static void helper2() {
15 | x.Block();
16 | assert(!x.y);
17 | }
18 |
19 | activate static void main2() {
20 | x.y = true;
21 | x.y = true;
22 | }
23 | };
24 |
--------------------------------------------------------------------------------
/Regression/Ex2/compile_param:
--------------------------------------------------------------------------------
1 | /preemptive /nowarning:292;
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/Regression/Ex2/golden_5.txt:
--------------------------------------------------------------------------------
1 | ##################
2 | Check Passed
3 | ##################
4 | 8 distinct states explored
5 |
--------------------------------------------------------------------------------
/Regression/Ex2/param:
--------------------------------------------------------------------------------
1 | -entirezingtrace;
2 | -entirezingtrace -delayb:../../DelayingSchedulers/RunToCompletionDelayingScheduler/bin/x64/debug/RunToCompletionDelayingScheduler.dll;
3 | -entirezingtrace -delayb:../../DelayingSchedulers/RoundRobinDelayingScheduler/bin/x64/debug/RoundRobinDelayingScheduler.dll;
4 | -entirezingtrace -delayb:../../DelayingSchedulers/CustomDelayingScheduler/bin/x64/debug/CustomDelayingScheduler.dll;
5 | -entirezingtrace -pb;
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/Regression/Ex3/Ex3.zing:
--------------------------------------------------------------------------------
1 | class ___X_TransactionTable {
2 | void ___RunTimer() {}
3 | };
4 |
5 | class ___X_Init {
6 | static ___X_TransactionTable ___tx_table;
7 |
8 | static activate void ___Main() {
9 |
10 | ___tx_table = new ___X_TransactionTable;
11 |
12 | foo();
13 |
14 | assert(false);
15 | }
16 |
17 | static void foo() {
18 | async ___X_Init.___tx_table.___RunTimer();
19 | }
20 |
21 | };
22 |
--------------------------------------------------------------------------------
/Regression/Ex3/compile_param:
--------------------------------------------------------------------------------
1 | /preemptive /nowarning:292;
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/Regression/Ex3/param:
--------------------------------------------------------------------------------
1 | -entirezingtrace;
2 | -entirezingtrace -delayb:../../DelayingSchedulers/RunToCompletionDelayingScheduler/bin/x64/debug/RunToCompletionDelayingScheduler.dll;
3 | -entirezingtrace -delayb:../../DelayingSchedulers/RoundRobinDelayingScheduler/bin/x64/debug/RoundRobinDelayingScheduler.dll;
4 | -entirezingtrace -delayb:../../DelayingSchedulers/CustomDelayingScheduler/bin/x64/debug/CustomDelayingScheduler.dll;
5 | -entirezingtrace -pb;
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/Regression/Indigo/Indigo.zing:
--------------------------------------------------------------------------------
1 | class ___X_LightweightTransaction {
2 | ___X_LtmInternalTransaction ___internalTransaction;
3 | };
4 |
5 | class ___X_LtmInternalTransaction {
6 | ___X_TransactionState ___State;
7 | };
8 |
9 | enum ___X_TS {
10 | ___TransactionStateActive,
11 | ___TransactionStatePhase0,
12 | };
13 |
14 | class ___X_Init {
15 | static activate void ___Main() {
16 | atomic {
17 |
18 | ___X_TransactionState.____TransactionStateActive = new ___X_TransactionState;
19 |
20 | ___X_TransactionState.____TransactionStateActive.___TransactionState_ctor(___X_TS.___TransactionStateActive);
21 |
22 | ___X_TransactionState.____TransactionStatePhase0 = new ___X_TransactionState;
23 |
24 | ___X_TransactionState.____TransactionStatePhase0.___TransactionState_ctor(___X_TS.___TransactionStatePhase0);
25 |
26 | }
27 | ___X_LightweightTransaction ___tx;
28 | ___tx = new ___X_LightweightTransaction;
29 |
30 | ___tx.___internalTransaction = new ___X_LtmInternalTransaction;
31 |
32 | ___tx.___internalTransaction.___State = ___X_TransactionState.____TransactionStateActive;
33 |
34 | if (___X_TransactionState.____TransactionStatePhase0.___ts == 0) {
35 |
36 | assert(___tx.___internalTransaction.___State != ___X_TransactionState.____TransactionStateActive);
37 |
38 | }
39 |
40 | }
41 |
42 | };
43 |
44 | class ___X_TransactionState {
45 | ___X_TS ___ts;
46 |
47 | static ___X_TransactionState ____TransactionStateActive;
48 |
49 | static ___X_TransactionState ____TransactionStatePhase0;
50 |
51 | void ___TransactionState_ctor(___X_TS ___x) {
52 | this.___ts = ___x;
53 |
54 | }
55 |
56 | };
57 |
58 |
--------------------------------------------------------------------------------
/Regression/Indigo/compile_param:
--------------------------------------------------------------------------------
1 | /preemptive /nowarning:292;
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/Regression/Indigo/golden_1.txt:
--------------------------------------------------------------------------------
1 | ##################
2 | Check Passed
3 | ##################
4 | 1 distinct states explored
5 |
--------------------------------------------------------------------------------
/Regression/Indigo/golden_2.txt:
--------------------------------------------------------------------------------
1 | ##################
2 | Check Passed
3 | ##################
4 | 1 distinct states explored
5 |
--------------------------------------------------------------------------------
/Regression/Indigo/golden_3.txt:
--------------------------------------------------------------------------------
1 | ##################
2 | Check Passed
3 | ##################
4 | 1 distinct states explored
5 |
--------------------------------------------------------------------------------
/Regression/Indigo/golden_4.txt:
--------------------------------------------------------------------------------
1 | ##################
2 | Check Passed
3 | ##################
4 | 1 distinct states explored
5 |
--------------------------------------------------------------------------------
/Regression/Indigo/golden_5.txt:
--------------------------------------------------------------------------------
1 | ##################
2 | Check Passed
3 | ##################
4 | 1 distinct states explored
5 |
--------------------------------------------------------------------------------
/Regression/Indigo/param:
--------------------------------------------------------------------------------
1 | -entirezingtrace;
2 | -entirezingtrace -delayb:../../DelayingSchedulers/RunToCompletionDelayingScheduler/bin/x64/debug/RunToCompletionDelayingScheduler.dll;
3 | -entirezingtrace -delayb:../../DelayingSchedulers/RoundRobinDelayingScheduler/bin/x64/debug/RoundRobinDelayingScheduler.dll;
4 | -entirezingtrace -delayb:../../DelayingSchedulers/CustomDelayingScheduler/bin/x64/debug/CustomDelayingScheduler.dll;
5 | -entirezingtrace -pb;
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/Regression/Objects/Objects.zing:
--------------------------------------------------------------------------------
1 | //
2 | // select.zing - blocking in Zing
3 | //
4 |
5 | //
6 | // In Zing, objects are very simple. There is no inheritance, no overloading
7 | // of operators or methods, no access qualifiers, and no constructors.
8 | // Object members may be marked as "static" with essentially the same meaning
9 | // as in C#. A static field is effectively a global variable.
10 | //
11 | // A static method serves much the same purpose as in C#. A static method which
12 | // returns void and has no parameters may also be qualified with the "activate"
13 | // keyword which causes a process executing the method to be created in the
14 | // initial state of the model.
15 | //
16 | // Objects (and other complex types like sets and arrays) are created through
17 | // the "new" operator.
18 | //
19 |
20 | class Main {
21 | //
22 | // Every Zing model must include at least one "activate static" method to
23 | // cause an executable process to be created. If multiple processes are
24 | // required, each executing the same method, a separate process would be
25 | // needed to activate them using async method calls, as in:
26 | //
27 | // activate static void RunSeveral()
28 | // {
29 | // atomic {
30 | // async Run();
31 | // async Run();
32 | // async Run();
33 | // }
34 | // }
35 | //
36 | // Another advantage of asynchronous calls over the "activate" keyword is
37 | // that async calls may have input parameters. The "atomic" block is used
38 | // to reduce the size of a model's state-space by preventing the
39 | // consideration of process interleavings that are uninteresting. In this
40 | // case, all three instances of Run() will become activated and runnable
41 | // at precisely the same instant.
42 | //
43 |
44 | activate static void Run()
45 | {
46 | int i;
47 | Simple s = new Simple;
48 | s.val = 5;
49 | i = s.foo();
50 | i = s.bar(2);
51 | }
52 | };
53 |
54 | //
55 | // Note that we also could have included Run() as a static member of the
56 | // "Simple" class. Static and non-static members may be mixed freely.
57 | //
58 | class Simple {
59 | int val;
60 |
61 | int foo()
62 | {
63 | return val+1;
64 | }
65 |
66 | int bar(int x)
67 | {
68 | int a;
69 |
70 | //
71 | // Make a nested call using an implicit "this". Note that we can't
72 | // simply say "return baz(x);" because method calls are only
73 | // permitted in simple assignment statements or expression statements.
74 | //
75 | a = baz(x);
76 |
77 | return a;
78 | }
79 |
80 | int baz(int y)
81 | {
82 | return this.val + y;
83 | }
84 | };
85 |
--------------------------------------------------------------------------------
/Regression/Objects/compile_param:
--------------------------------------------------------------------------------
1 | /preemptive /nowarning:292;
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/Regression/Objects/golden_1.txt:
--------------------------------------------------------------------------------
1 | ##################
2 | Check Passed
3 | ##################
4 | 1 distinct states explored
5 |
--------------------------------------------------------------------------------
/Regression/Objects/golden_2.txt:
--------------------------------------------------------------------------------
1 | ##################
2 | Check Passed
3 | ##################
4 | 1 distinct states explored
5 |
--------------------------------------------------------------------------------
/Regression/Objects/golden_3.txt:
--------------------------------------------------------------------------------
1 | ##################
2 | Check Passed
3 | ##################
4 | 1 distinct states explored
5 |
--------------------------------------------------------------------------------
/Regression/Objects/golden_4.txt:
--------------------------------------------------------------------------------
1 | ##################
2 | Check Passed
3 | ##################
4 | 1 distinct states explored
5 |
--------------------------------------------------------------------------------
/Regression/Objects/golden_5.txt:
--------------------------------------------------------------------------------
1 | ##################
2 | Check Passed
3 | ##################
4 | 1 distinct states explored
5 |
--------------------------------------------------------------------------------
/Regression/Objects/param:
--------------------------------------------------------------------------------
1 | -entirezingtrace;
2 | -entirezingtrace -delayb:../../DelayingSchedulers/RunToCompletionDelayingScheduler/bin/x64/debug/RunToCompletionDelayingScheduler.dll;
3 | -entirezingtrace -delayb:../../DelayingSchedulers/RoundRobinDelayingScheduler/bin/x64/debug/RoundRobinDelayingScheduler.dll;
4 | -entirezingtrace -delayb:../../DelayingSchedulers/CustomDelayingScheduler/bin/x64/debug/CustomDelayingScheduler.dll;
5 | -entirezingtrace -pb;
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/Regression/ParPort/compile_param:
--------------------------------------------------------------------------------
1 | /preemptive /nowarning:292;
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/Regression/ParPort/golden_1.txt:
--------------------------------------------------------------------------------
1 | ##################
2 | Check Passed
3 | ##################
4 | 309 distinct states explored
5 |
--------------------------------------------------------------------------------
/Regression/ParPort/golden_2.txt:
--------------------------------------------------------------------------------
1 | ##################
2 | Check Passed
3 | ##################
4 | 309 distinct states explored
5 |
--------------------------------------------------------------------------------
/Regression/ParPort/golden_3.txt:
--------------------------------------------------------------------------------
1 | ##################
2 | Check Passed
3 | ##################
4 | 309 distinct states explored
5 |
--------------------------------------------------------------------------------
/Regression/ParPort/golden_4.txt:
--------------------------------------------------------------------------------
1 | ##################
2 | Check Passed
3 | ##################
4 | 309 distinct states explored
5 |
--------------------------------------------------------------------------------
/Regression/ParPort/golden_5.txt:
--------------------------------------------------------------------------------
1 | ##################
2 | Check Passed
3 | ##################
4 | 309 distinct states explored
5 |
--------------------------------------------------------------------------------
/Regression/ParPort/param:
--------------------------------------------------------------------------------
1 | -entirezingtrace;
2 | -entirezingtrace -delayb:../../DelayingSchedulers/RunToCompletionDelayingScheduler/bin/x64/debug/RunToCompletionDelayingScheduler.dll;
3 | -entirezingtrace -delayb:../../DelayingSchedulers/RoundRobinDelayingScheduler/bin/x64/debug/RoundRobinDelayingScheduler.dll;
4 | -entirezingtrace -delayb:../../DelayingSchedulers/CustomDelayingScheduler/bin/x64/debug/CustomDelayingScheduler.dll;
5 | -entirezingtrace -pb;
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/Regression/ParPort/parport.zing:
--------------------------------------------------------------------------------
1 | //
2 | // This code was manually constructed by looking at the parPort driver in Windows
3 | // The objective is to show that a particular race never happens if certain increment
4 | // and decrement operations are done atomically.
5 | // If increment and decrement are non-atomic then certain interleavings can lead
6 | // to a race
7 | //
8 | class DEVICE_EXTENSION {
9 | int OpenCloseRefCount = 0;
10 | bool devExtAccess;
11 | };
12 |
13 | class DEVICE_OBJECT {
14 | DEVICE_EXTENSION deviceExtension;
15 | };
16 |
17 | class IRP{
18 | int dummy;
19 | };
20 |
21 | class myClass {
22 |
23 | activate static void main() {
24 | DEVICE_OBJECT Pdo = new DEVICE_OBJECT ;
25 | IRP irp = new IRP;
26 | Pdo.deviceExtension = new DEVICE_EXTENSION;
27 | Pdo.deviceExtension.devExtAccess = false;
28 | Pdo.deviceExtension.OpenCloseRefCount = 0;
29 | async PptPdoCreateOpen(Pdo, irp);
30 | async PptPdoCreateOpen(Pdo, irp);
31 | }
32 |
33 | static atomic int InterlockedIncrement(DEVICE_EXTENSION pd) {
34 | int temp;
35 | temp = pd.OpenCloseRefCount + 1;
36 | pd.OpenCloseRefCount = temp;
37 | return pd.OpenCloseRefCount ;
38 | }
39 |
40 | static atomic void InterlockedDecrement(DEVICE_EXTENSION pd) {
41 | int temp;
42 | temp = pd.OpenCloseRefCount - 1;
43 | pd.OpenCloseRefCount = temp;
44 | return;
45 | }
46 |
47 | static void PptPdoCreateOpen(
48 | DEVICE_OBJECT Pdo,
49 | IRP Irp)
50 | {
51 | DEVICE_EXTENSION pdx = Pdo.deviceExtension;
52 |
53 | int x;
54 | x = InterlockedIncrement(pdx);
55 | if( x != 1 ) {
56 | InterlockedDecrement(pdx);
57 | return;
58 | }
59 |
60 | assert(!Pdo.deviceExtension.devExtAccess);
61 | Pdo.deviceExtension.devExtAccess = true;
62 | // do stuff
63 | Pdo.deviceExtension.devExtAccess = false;
64 | InterlockedDecrement(pdx);
65 | return;
66 | }
67 | };
--------------------------------------------------------------------------------
/Regression/Philosophers1/Philosophers1.zing:
--------------------------------------------------------------------------------
1 | class Fork {
2 | Philosopher holder;
3 |
4 | void PickUp(Philosopher eater)
5 | {
6 | atomic {
7 | select { wait(holder == null) -> holder = eater; }
8 | }
9 | }
10 |
11 | void PutDown()
12 | {
13 | holder = null;
14 | }
15 |
16 | bool InUse()
17 | {
18 | return holder != null;
19 | }
20 | };
21 |
22 | class Philosopher {
23 | Fork leftFork;
24 | Fork rightFork;
25 |
26 | void Run()
27 | {
28 | while (true)
29 | {
30 | // pick up forks
31 | leftFork.PickUp(this);
32 | rightFork.PickUp(this);
33 | // eat for a while
34 | leftFork.PutDown();
35 | rightFork.PutDown();
36 | // think for a while
37 | }
38 | }
39 | };
40 |
41 | class Init {
42 | activate static void Run()
43 | {
44 | Philosopher p;
45 | Fork f;
46 |
47 | atomic {
48 | p = new Philosopher;
49 | f = new Fork;
50 |
51 | p.leftFork = f;
52 | p.rightFork = f;
53 |
54 | async p.Run();
55 | }
56 | }
57 | };
--------------------------------------------------------------------------------
/Regression/Philosophers1/compile_param:
--------------------------------------------------------------------------------
1 | /preemptive /nowarning:292;
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/Regression/Philosophers1/param:
--------------------------------------------------------------------------------
1 | -entirezingtrace;
2 | -entirezingtrace -delayb:../../DelayingSchedulers/RunToCompletionDelayingScheduler/bin/x64/debug/RunToCompletionDelayingScheduler.dll;
3 | -entirezingtrace -delayb:../../DelayingSchedulers/RoundRobinDelayingScheduler/bin/x64/debug/RoundRobinDelayingScheduler.dll;
4 | -entirezingtrace -delayb:../../DelayingSchedulers/CustomDelayingScheduler/bin/x64/debug/CustomDelayingScheduler.dll;
5 | -entirezingtrace -pb;
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/Regression/Philosophers2/Philosophers2.zing:
--------------------------------------------------------------------------------
1 | class Fork {
2 | Philosopher holder;
3 |
4 | void PickUp(Philosopher eater)
5 | {
6 | atomic {
7 | select { wait(Free()) -> holder = eater; }
8 | }
9 | }
10 |
11 | void Grab(Philosopher eater)
12 | {
13 | assert(holder == null);
14 | holder = eater;
15 | }
16 |
17 | void PutDown()
18 | {
19 | holder = null;
20 | }
21 |
22 | bool InUse()
23 | {
24 | return holder != null;
25 | }
26 |
27 | bool Free()
28 | {
29 | return holder == null;
30 | }
31 | };
32 |
33 | class Philosopher {
34 | Fork leftFork;
35 | Fork rightFork;
36 |
37 | void Run()
38 | {
39 | while (true)
40 | {
41 | // pick up forks
42 | atomic {
43 | select {
44 | wait(leftFork.Free() && rightFork.Free()) ->
45 | { leftFork.Grab(this); rightFork.Grab(this); }
46 | }
47 | }
48 | // eat for a while
49 | leftFork.PutDown();
50 | rightFork.PutDown();
51 | // think for a while
52 | }
53 | }
54 | };
55 |
56 | array Philosophers[4] Philosopher;
57 | array Forks[4] Fork;
58 |
59 | class Init {
60 | activate static void Run()
61 | {
62 | Philosophers p;
63 | Forks f;
64 | int i;
65 |
66 | atomic {
67 | // Allocate the arrays of forks and philosophers
68 | p = new Philosophers;
69 | f = new Forks;
70 |
71 | // Allocate the individual fork and philosopher objects
72 | i = 0;
73 | while (i < sizeof(Philosophers))
74 | {
75 | p[i] = new Philosopher;
76 | f[i] = new Fork;
77 | i = i + 1;
78 | }
79 |
80 | // Associate the philosophers with their forks and let them begin
81 | i = 0;
82 | while (i < sizeof(Philosophers))
83 | {
84 | p[i].leftFork = f[i];
85 | p[i].rightFork = f[(i+1) % sizeof(Philosophers)];
86 |
87 | async p[i].Run();
88 | i = i + 1;
89 | }
90 | }
91 | }
92 | };
93 |
--------------------------------------------------------------------------------
/Regression/Philosophers2/compile_param:
--------------------------------------------------------------------------------
1 | /preemptive /nowarning:292;
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/Regression/Philosophers2/golden_1.txt:
--------------------------------------------------------------------------------
1 | ##################
2 | Check Passed
3 | ##################
4 | 4303 distinct states explored
5 |
--------------------------------------------------------------------------------
/Regression/Philosophers2/golden_2.txt:
--------------------------------------------------------------------------------
1 | ##################
2 | Check Passed
3 | ##################
4 | 4303 distinct states explored
5 |
--------------------------------------------------------------------------------
/Regression/Philosophers2/golden_3.txt:
--------------------------------------------------------------------------------
1 | ##################
2 | Check Passed
3 | ##################
4 | 4303 distinct states explored
5 |
--------------------------------------------------------------------------------
/Regression/Philosophers2/golden_4.txt:
--------------------------------------------------------------------------------
1 | ##################
2 | Check Passed
3 | ##################
4 | 4303 distinct states explored
5 |
--------------------------------------------------------------------------------
/Regression/Philosophers2/golden_5.txt:
--------------------------------------------------------------------------------
1 | ##################
2 | Check Passed
3 | ##################
4 | 4303 distinct states explored
5 |
--------------------------------------------------------------------------------
/Regression/Philosophers2/param:
--------------------------------------------------------------------------------
1 | -entirezingtrace;
2 | -entirezingtrace -delayb:../../DelayingSchedulers/RunToCompletionDelayingScheduler/bin/x64/debug/RunToCompletionDelayingScheduler.dll;
3 | -entirezingtrace -delayb:../../DelayingSchedulers/RoundRobinDelayingScheduler/bin/x64/debug/RoundRobinDelayingScheduler.dll;
4 | -entirezingtrace -delayb:../../DelayingSchedulers/CustomDelayingScheduler/bin/x64/debug/CustomDelayingScheduler.dll;
5 | -entirezingtrace -pb;
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/Regression/QuoteSvc/compile_param:
--------------------------------------------------------------------------------
1 | /preemptive /nowarning:292;
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/Regression/QuoteSvc/golden_1.txt:
--------------------------------------------------------------------------------
1 | ##################
2 | Check Passed
3 | ##################
4 | 18 distinct states explored
5 |
--------------------------------------------------------------------------------
/Regression/QuoteSvc/golden_2.txt:
--------------------------------------------------------------------------------
1 | ##################
2 | Check Passed
3 | ##################
4 | 18 distinct states explored
5 |
--------------------------------------------------------------------------------
/Regression/QuoteSvc/golden_3.txt:
--------------------------------------------------------------------------------
1 | ##################
2 | Check Passed
3 | ##################
4 | 18 distinct states explored
5 |
--------------------------------------------------------------------------------
/Regression/QuoteSvc/golden_4.txt:
--------------------------------------------------------------------------------
1 | ##################
2 | Check Passed
3 | ##################
4 | 18 distinct states explored
5 |
--------------------------------------------------------------------------------
/Regression/QuoteSvc/golden_5.txt:
--------------------------------------------------------------------------------
1 | ##################
2 | Check Passed
3 | ##################
4 | 18 distinct states explored
5 |
--------------------------------------------------------------------------------
/Regression/QuoteSvc/param:
--------------------------------------------------------------------------------
1 | -entirezingtrace;
2 | -entirezingtrace -delayb:../../DelayingSchedulers/RunToCompletionDelayingScheduler/bin/x64/debug/RunToCompletionDelayingScheduler.dll;
3 | -entirezingtrace -delayb:../../DelayingSchedulers/RoundRobinDelayingScheduler/bin/x64/debug/RoundRobinDelayingScheduler.dll;
4 | -entirezingtrace -delayb:../../DelayingSchedulers/CustomDelayingScheduler/bin/x64/debug/CustomDelayingScheduler.dll;
5 | -entirezingtrace -pb;
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/Regression/Shipping/compile_param:
--------------------------------------------------------------------------------
1 | /preemptive /nowarning:292;
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/Regression/Shipping/golden_1.txt:
--------------------------------------------------------------------------------
1 | ##################
2 | Check Passed
3 | ##################
4 | 1312 distinct states explored
5 |
--------------------------------------------------------------------------------
/Regression/Shipping/golden_2.txt:
--------------------------------------------------------------------------------
1 | ##################
2 | Check Passed
3 | ##################
4 | 1312 distinct states explored
5 |
--------------------------------------------------------------------------------
/Regression/Shipping/golden_3.txt:
--------------------------------------------------------------------------------
1 | ##################
2 | Check Passed
3 | ##################
4 | 1312 distinct states explored
5 |
--------------------------------------------------------------------------------
/Regression/Shipping/golden_4.txt:
--------------------------------------------------------------------------------
1 | ##################
2 | Check Passed
3 | ##################
4 | 1312 distinct states explored
5 |
--------------------------------------------------------------------------------
/Regression/Shipping/golden_5.txt:
--------------------------------------------------------------------------------
1 | ##################
2 | Check Passed
3 | ##################
4 | 1312 distinct states explored
5 |
--------------------------------------------------------------------------------
/Regression/Shipping/param:
--------------------------------------------------------------------------------
1 | -entirezingtrace;
2 | -entirezingtrace -delayb:../../DelayingSchedulers/RunToCompletionDelayingScheduler/bin/x64/debug/RunToCompletionDelayingScheduler.dll;
3 | -entirezingtrace -delayb:../../DelayingSchedulers/RoundRobinDelayingScheduler/bin/x64/debug/RoundRobinDelayingScheduler.dll;
4 | -entirezingtrace -delayb:../../DelayingSchedulers/CustomDelayingScheduler/bin/x64/debug/CustomDelayingScheduler.dll;
5 | -entirezingtrace -pb;
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/Regression/TMTimerDisabledBug/compile_param:
--------------------------------------------------------------------------------
1 | /preemptive /nowarning:292;
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/Regression/TMTimerDisabledBug/param:
--------------------------------------------------------------------------------
1 | -entirezingtrace;
2 | -entirezingtrace -delayb:../../DelayingSchedulers/RunToCompletionDelayingScheduler/bin/x64/debug/RunToCompletionDelayingScheduler.dll;
3 | -entirezingtrace -delayb:../../DelayingSchedulers/RoundRobinDelayingScheduler/bin/x64/debug/RoundRobinDelayingScheduler.dll;
4 | -entirezingtrace -delayb:../../DelayingSchedulers/CustomDelayingScheduler/bin/x64/debug/CustomDelayingScheduler.dll;
5 | -entirezingtrace -pb;
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/Regression/Test2/Test2.zing:
--------------------------------------------------------------------------------
1 | //
2 | // Simple test showing a single function (Main) invoked on startup that calls
3 | // an Increment method.
4 | //
5 | class SimpleTest
6 | {
7 | activate static void Main()
8 | {
9 | y = SimpleTest.Increment(x);
10 | }
11 |
12 | static int Increment(int a)
13 | {
14 | int b = a + 1;
15 | return b;
16 | }
17 |
18 | static int x = 5;
19 | static int y;
20 | };
21 |
22 | //
23 | // Variation on the above with two concurrent processes on startup, each racing
24 | // to read one global and update another.
25 | //
26 | class SimpleTest2
27 | {
28 | activate static void Main1()
29 | {
30 | y = SimpleTest.Increment(x);
31 | }
32 |
33 | activate static void Main2()
34 | {
35 | y = SimpleTest.Increment(x);
36 | }
37 |
38 | static int Increment(int a)
39 | {
40 | int b = a + 1;
41 | return b;
42 | }
43 |
44 | static int x = 5;
45 | static int y;
46 | };
47 |
--------------------------------------------------------------------------------
/Regression/Test2/compile_param:
--------------------------------------------------------------------------------
1 | /preemptive /nowarning:292;
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/Regression/Test2/golden_1.txt:
--------------------------------------------------------------------------------
1 | ##################
2 | Check Passed
3 | ##################
4 | 124 distinct states explored
5 |
--------------------------------------------------------------------------------
/Regression/Test2/golden_2.txt:
--------------------------------------------------------------------------------
1 | ##################
2 | Check Passed
3 | ##################
4 | 124 distinct states explored
5 |
--------------------------------------------------------------------------------
/Regression/Test2/golden_3.txt:
--------------------------------------------------------------------------------
1 | ##################
2 | Check Passed
3 | ##################
4 | 124 distinct states explored
5 |
--------------------------------------------------------------------------------
/Regression/Test2/golden_4.txt:
--------------------------------------------------------------------------------
1 | ##################
2 | Check Passed
3 | ##################
4 | 124 distinct states explored
5 |
--------------------------------------------------------------------------------
/Regression/Test2/golden_5.txt:
--------------------------------------------------------------------------------
1 | ##################
2 | Check Passed
3 | ##################
4 | 124 distinct states explored
5 |
--------------------------------------------------------------------------------
/Regression/Test2/param:
--------------------------------------------------------------------------------
1 | -entirezingtrace;
2 | -entirezingtrace -delayb:../../DelayingSchedulers/RunToCompletionDelayingScheduler/bin/x64/debug/RunToCompletionDelayingScheduler.dll;
3 | -entirezingtrace -delayb:../../DelayingSchedulers/RoundRobinDelayingScheduler/bin/x64/debug/RoundRobinDelayingScheduler.dll;
4 | -entirezingtrace -delayb:../../DelayingSchedulers/CustomDelayingScheduler/bin/x64/debug/CustomDelayingScheduler.dll;
5 | -entirezingtrace -pb;
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/Regression/Test3/Test3.zing:
--------------------------------------------------------------------------------
1 | class Foo {
2 | static int y = 0;
3 | int x = 0;
4 |
5 | activate static void Main() {
6 | Foo f = new Foo;
7 |
8 | y = 1;
9 |
10 | atomic {
11 | f.x = 1;
12 | f.x = 2;
13 | f.x = 3;
14 | f.x = 4;
15 | y = 2;
16 | }
17 |
18 | y = 2;
19 |
20 | f.x = 5;
21 |
22 | y = 5;
23 |
24 | assert (f.x == 3);
25 | }
26 |
27 | };
--------------------------------------------------------------------------------
/Regression/Test3/compile_param:
--------------------------------------------------------------------------------
1 | /preemptive /nowarning:292;
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/Regression/Test3/param:
--------------------------------------------------------------------------------
1 | -entirezingtrace;
2 | -entirezingtrace -delayb:../../DelayingSchedulers/RunToCompletionDelayingScheduler/bin/x64/debug/RunToCompletionDelayingScheduler.dll;
3 | -entirezingtrace -delayb:../../DelayingSchedulers/RoundRobinDelayingScheduler/bin/x64/debug/RoundRobinDelayingScheduler.dll;
4 | -entirezingtrace -delayb:../../DelayingSchedulers/CustomDelayingScheduler/bin/x64/debug/CustomDelayingScheduler.dll;
5 | -entirezingtrace -pb;
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/Regression/Test4/Test4.zing:
--------------------------------------------------------------------------------
1 | class Foo {
2 | static int y = 0;
3 | int x = 0;
4 |
5 | activate static void Main() {
6 | Foo f = new Foo;
7 |
8 | y = 1;
9 |
10 | y = 2;
11 |
12 | y = 3;
13 |
14 | Foo g = new Foo;
15 |
16 | g.x = 3;
17 |
18 | atomic {
19 | f.x = 1;
20 | f.x = 2;
21 | f.x = 3;
22 | f.x = 4;
23 | y = 2;
24 | }
25 |
26 | g = f;
27 |
28 | y = 2;
29 |
30 | g.x = 5;
31 |
32 | y = 5;
33 |
34 | assert (f.x == 5);
35 | }
36 |
37 | };
--------------------------------------------------------------------------------
/Regression/Test4/compile_param:
--------------------------------------------------------------------------------
1 | /preemptive /nowarning:292;
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/Regression/Test4/golden_1.txt:
--------------------------------------------------------------------------------
1 | ##################
2 | Check Passed
3 | ##################
4 | 1 distinct states explored
5 |
--------------------------------------------------------------------------------
/Regression/Test4/golden_2.txt:
--------------------------------------------------------------------------------
1 | ##################
2 | Check Passed
3 | ##################
4 | 1 distinct states explored
5 |
--------------------------------------------------------------------------------
/Regression/Test4/golden_3.txt:
--------------------------------------------------------------------------------
1 | ##################
2 | Check Passed
3 | ##################
4 | 1 distinct states explored
5 |
--------------------------------------------------------------------------------
/Regression/Test4/golden_4.txt:
--------------------------------------------------------------------------------
1 | ##################
2 | Check Passed
3 | ##################
4 | 1 distinct states explored
5 |
--------------------------------------------------------------------------------
/Regression/Test4/golden_5.txt:
--------------------------------------------------------------------------------
1 | ##################
2 | Check Passed
3 | ##################
4 | 1 distinct states explored
5 |
--------------------------------------------------------------------------------
/Regression/Test4/param:
--------------------------------------------------------------------------------
1 | -entirezingtrace;
2 | -entirezingtrace -delayb:../../DelayingSchedulers/RunToCompletionDelayingScheduler/bin/x64/debug/RunToCompletionDelayingScheduler.dll;
3 | -entirezingtrace -delayb:../../DelayingSchedulers/RoundRobinDelayingScheduler/bin/x64/debug/RoundRobinDelayingScheduler.dll;
4 | -entirezingtrace -delayb:../../DelayingSchedulers/CustomDelayingScheduler/bin/x64/debug/CustomDelayingScheduler.dll;
5 | -entirezingtrace -pb;
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/Regression/Test5/Test5.zing:
--------------------------------------------------------------------------------
1 | struct Foo {
2 | int x;
3 | int y;
4 | };
5 |
6 | chan FooChan Foo;
7 |
8 | class Test {
9 | static FooChan c = new FooChan;
10 |
11 | activate static void sender() {
12 | Foo a;
13 |
14 | a.x = 0;
15 | a.y = 0;
16 |
17 | send(c, a);
18 | }
19 |
20 | activate static void receiver() {
21 | Foo b;
22 |
23 | select { receive(c, b) -> ; }
24 | }
25 | };
--------------------------------------------------------------------------------
/Regression/Test5/compile_param:
--------------------------------------------------------------------------------
1 | /preemptive /nowarning:292;
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/Regression/Test5/golden_1.txt:
--------------------------------------------------------------------------------
1 | ##################
2 | Check Passed
3 | ##################
4 | 10 distinct states explored
5 |
--------------------------------------------------------------------------------
/Regression/Test5/golden_2.txt:
--------------------------------------------------------------------------------
1 | ##################
2 | Check Passed
3 | ##################
4 | 10 distinct states explored
5 |
--------------------------------------------------------------------------------
/Regression/Test5/golden_3.txt:
--------------------------------------------------------------------------------
1 | ##################
2 | Check Passed
3 | ##################
4 | 10 distinct states explored
5 |
--------------------------------------------------------------------------------
/Regression/Test5/golden_4.txt:
--------------------------------------------------------------------------------
1 | ##################
2 | Check Passed
3 | ##################
4 | 10 distinct states explored
5 |
--------------------------------------------------------------------------------
/Regression/Test5/golden_5.txt:
--------------------------------------------------------------------------------
1 | ##################
2 | Check Passed
3 | ##################
4 | 10 distinct states explored
5 |
--------------------------------------------------------------------------------
/Regression/Test5/param:
--------------------------------------------------------------------------------
1 | -entirezingtrace;
2 | -entirezingtrace -delayb:../../DelayingSchedulers/RunToCompletionDelayingScheduler/bin/x64/debug/RunToCompletionDelayingScheduler.dll;
3 | -entirezingtrace -delayb:../../DelayingSchedulers/RoundRobinDelayingScheduler/bin/x64/debug/RoundRobinDelayingScheduler.dll;
4 | -entirezingtrace -delayb:../../DelayingSchedulers/CustomDelayingScheduler/bin/x64/debug/CustomDelayingScheduler.dll;
5 | -entirezingtrace -pb;
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/Regression/Test6/Test6.zing:
--------------------------------------------------------------------------------
1 | chan IntChan int;
2 |
3 | class Test {
4 | static IntChan c = new IntChan;
5 |
6 | activate static void sender() {
7 | int a;
8 |
9 | a = 0;
10 |
11 | send(c, a);
12 | }
13 |
14 | activate static void receiver() {
15 | int b;
16 |
17 | select { receive(c, b) -> ; }
18 | }
19 | };
--------------------------------------------------------------------------------
/Regression/Test6/compile_param:
--------------------------------------------------------------------------------
1 | /preemptive /nowarning:292;
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/Regression/Test6/golden_1.txt:
--------------------------------------------------------------------------------
1 | ##################
2 | Check Passed
3 | ##################
4 | 9 distinct states explored
5 |
--------------------------------------------------------------------------------
/Regression/Test6/golden_2.txt:
--------------------------------------------------------------------------------
1 | ##################
2 | Check Passed
3 | ##################
4 | 9 distinct states explored
5 |
--------------------------------------------------------------------------------
/Regression/Test6/golden_3.txt:
--------------------------------------------------------------------------------
1 | ##################
2 | Check Passed
3 | ##################
4 | 9 distinct states explored
5 |
--------------------------------------------------------------------------------
/Regression/Test6/golden_4.txt:
--------------------------------------------------------------------------------
1 | ##################
2 | Check Passed
3 | ##################
4 | 9 distinct states explored
5 |
--------------------------------------------------------------------------------
/Regression/Test6/golden_5.txt:
--------------------------------------------------------------------------------
1 | ##################
2 | Check Passed
3 | ##################
4 | 9 distinct states explored
5 |
--------------------------------------------------------------------------------
/Regression/Test6/param:
--------------------------------------------------------------------------------
1 | -entirezingtrace;
2 | -entirezingtrace -delayb:../../DelayingSchedulers/RunToCompletionDelayingScheduler/bin/x64/debug/RunToCompletionDelayingScheduler.dll;
3 | -entirezingtrace -delayb:../../DelayingSchedulers/RoundRobinDelayingScheduler/bin/x64/debug/RoundRobinDelayingScheduler.dll;
4 | -entirezingtrace -delayb:../../DelayingSchedulers/CustomDelayingScheduler/bin/x64/debug/CustomDelayingScheduler.dll;
5 | -entirezingtrace -pb;
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/Regression/ZingSet/ZingSet.zing:
--------------------------------------------------------------------------------
1 | set IntSet int;
2 | chan IntChan int;
3 |
4 | class Main
5 | {
6 | static IntChan sender;
7 |
8 | static void senderr()
9 | {
10 | IntSet xyz = new IntSet;
11 | int i = 0;
12 | int c ;
13 | int b;
14 | atomic
15 | {
16 | while(i<10)
17 | {
18 | xyz = xyz + i;
19 | i =i + 1;
20 | }
21 | }
22 | c = choose(xyz);
23 | b = choose(xyz);
24 | send(sender,c + b);
25 | }
26 |
27 | static void receiverr()
28 | {
29 | int m;
30 | while(true)
31 | {
32 | select
33 | {
34 | receive(sender,m) -> ;
35 | }
36 | }
37 | assert(m<20);
38 | }
39 | activate static void Run()
40 | {
41 |
42 | atomic
43 | {
44 | sender = new IntChan;
45 | async senderr();
46 | async receiverr();
47 | }
48 | }
49 | };
--------------------------------------------------------------------------------
/Regression/ZingSet/compile_param:
--------------------------------------------------------------------------------
1 | /preemptive /nowarning:292;
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/Regression/ZingSet/param:
--------------------------------------------------------------------------------
1 | -entirezingtrace;
2 | -entirezingtrace -delayb:../../DelayingSchedulers/RunToCompletionDelayingScheduler/bin/x64/debug/RunToCompletionDelayingScheduler.dll;
3 | -entirezingtrace -delayb:../../DelayingSchedulers/RoundRobinDelayingScheduler/bin/x64/debug/RoundRobinDelayingScheduler.dll;
4 | -entirezingtrace -delayb:../../DelayingSchedulers/CustomDelayingScheduler/bin/x64/debug/CustomDelayingScheduler.dll;
5 | -entirezingtrace -pb;
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/Regression/assume/assume.zing:
--------------------------------------------------------------------------------
1 | //
2 | // assume.zing - the "assume" statement
3 | //
4 |
5 | //
6 | // In Zing, the "assume" statement is used to identify states that
7 | // are not interesting to consider. One simple example of this, in
8 | // which we wish to apply a constraint to a set of non-deterministic
9 | // choices, is demonstrated here. We perform two "choose" operations
10 | // on the enumeration E, which has 3 elements. Following the second
11 | // "choose", there are 9 alternatives available for consideration by
12 | // the state explorer. A "choose" statement allows us to effectively
13 | // prune those combinations where some predicate is satisfied. In this
14 | // case, our predicate eliminates those states in which the same choice
15 | // was made by each "choose", which reduces the number of states to
16 | // consider from 9 to 6.
17 | //
18 | // In concurrent systems, the assume statement can also be helpful. To
19 | // ensure that a Zing channel never contains more than one element, we
20 | // can require message senders to block until the channel is empty and
21 | // then (atomically) send their message. Alternatively, we can simply
22 | // "assume" the emptiness of the channel before sending (atomically,
23 | // again). The advantage here is that instead of reaching an undesirable
24 | // state and then waiting for the desired predicate to become true, we
25 | // simply remove from consideration those interleavings for which the
26 | // predicate was allowed to become false. For this scenario, we wind up
27 | // only considering "fair" interleavings between producers and consumers.
28 | //
29 |
30 | enum E { element1, element2, element3 };
31 |
32 | class Test {
33 | activate static void main() {
34 | E e1;
35 | E e2;
36 |
37 | e1 = choose(E);
38 | e2 = choose(E);
39 |
40 | assume(e1 != e2);
41 |
42 | trace("e1={0}, e2={1}", e1, e2);
43 | }
44 | };
45 |
--------------------------------------------------------------------------------
/Regression/assume/compile_param:
--------------------------------------------------------------------------------
1 | /preemptive /nowarning:292;
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/Regression/assume/golden_1.txt:
--------------------------------------------------------------------------------
1 | ##################
2 | Check Passed
3 | ##################
4 | 5 distinct states explored
5 |
--------------------------------------------------------------------------------
/Regression/assume/golden_2.txt:
--------------------------------------------------------------------------------
1 | ##################
2 | Check Passed
3 | ##################
4 | 5 distinct states explored
5 |
--------------------------------------------------------------------------------
/Regression/assume/golden_3.txt:
--------------------------------------------------------------------------------
1 | ##################
2 | Check Passed
3 | ##################
4 | 5 distinct states explored
5 |
--------------------------------------------------------------------------------
/Regression/assume/golden_4.txt:
--------------------------------------------------------------------------------
1 | ##################
2 | Check Passed
3 | ##################
4 | 5 distinct states explored
5 |
--------------------------------------------------------------------------------
/Regression/assume/golden_5.txt:
--------------------------------------------------------------------------------
1 | ##################
2 | Check Passed
3 | ##################
4 | 5 distinct states explored
5 |
--------------------------------------------------------------------------------
/Regression/assume/param:
--------------------------------------------------------------------------------
1 | -entirezingtrace;
2 | -entirezingtrace -delayb:../../DelayingSchedulers/RunToCompletionDelayingScheduler/bin/x64/debug/RunToCompletionDelayingScheduler.dll;
3 | -entirezingtrace -delayb:../../DelayingSchedulers/RoundRobinDelayingScheduler/bin/x64/debug/RoundRobinDelayingScheduler.dll;
4 | -entirezingtrace -delayb:../../DelayingSchedulers/CustomDelayingScheduler/bin/x64/debug/CustomDelayingScheduler.dll;
5 | -entirezingtrace -pb;
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/Regression/bakeryAlgo/bakeryAlgo.zing:
--------------------------------------------------------------------------------
1 | class bakeryAlgo
2 | {
3 | static bool choosing1;
4 | static bool choosing2;
5 | static bool choosing3;
6 | static int number1;
7 | static int number2;
8 | static int number3;
9 | static bool p1InCS;
10 | static bool p2InCS;
11 | static bool p3InCS;
12 |
13 | static void p1()
14 | {
15 | int max=0;
16 | choosing1 = true;
17 | if(number2 > max)
18 | max = number2;
19 | if(number3 > max)
20 | max = number3;
21 | number1 = max+1;
22 | choosing1 = false;
23 | while(choosing2);
24 | while((number2 != 0) && (number2 < number1));
25 | while(choosing3);
26 | while((number3 != 0) && (number3 < number1));
27 |
28 | //CS begins here
29 | p1InCS = true;
30 | assert(!p2InCS);
31 | assert(!p3InCS);
32 |
33 | p1InCS = false;
34 | //CS ends here
35 |
36 | number1 = 0;
37 | }
38 |
39 | static void p2()
40 | {
41 | int max=0;
42 | choosing2 = true;
43 | if(number1 > max)
44 | max = number1;
45 | if(number3 > max)
46 | max = number3;
47 | number2 = max+1;
48 | choosing2 = false;
49 | while(choosing1);
50 | while((number1 != 0) && (number1 <= number2));
51 | while(choosing3);
52 | while((number3 != 0) && (number3 < number2));
53 |
54 | //CS begins here
55 | p2InCS = true;
56 | assert(!p1InCS);
57 | assert(!p3InCS);
58 |
59 | p2InCS = false;
60 | //CS ends here
61 |
62 | number2 = 0;
63 | }
64 |
65 | static void p3()
66 | {
67 | int max=0;
68 | choosing3 = true;
69 | if(number1 > max)
70 | max = number1;
71 | if(number2 > max)
72 | max = number2;
73 | number3 = max+1;
74 | choosing3 = false;
75 | while(choosing1);
76 | while((number1 != 0) && (number1 <= number3));
77 | while(choosing2);
78 | while((number2 != 0) && (number2 <= number3));
79 |
80 | //CS begins here
81 | p3InCS = true;
82 | assert(!p2InCS);
83 | assert(!p1InCS);
84 |
85 | p3InCS = false;
86 | //CS ends here
87 |
88 | number3 = 0;
89 | }
90 |
91 | activate static void main()
92 | {
93 | choosing1 = false;
94 | choosing2 = false;
95 | choosing3 = false;
96 |
97 | number1 = 0;
98 | number2 = 0;
99 | number3 = 0;
100 |
101 | async p1();
102 | async p2();
103 | async p3();
104 | }
105 | };
--------------------------------------------------------------------------------
/Regression/bakeryAlgo/compile_param:
--------------------------------------------------------------------------------
1 | /preemptive /nowarning:292;
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/Regression/bakeryAlgo/golden_1.txt:
--------------------------------------------------------------------------------
1 | ##################
2 | Check Passed
3 | ##################
4 | 34100 distinct states explored
5 |
--------------------------------------------------------------------------------
/Regression/bakeryAlgo/golden_2.txt:
--------------------------------------------------------------------------------
1 | ##################
2 | Check Passed
3 | ##################
4 | 34100 distinct states explored
5 |
--------------------------------------------------------------------------------
/Regression/bakeryAlgo/golden_3.txt:
--------------------------------------------------------------------------------
1 | ##################
2 | Check Passed
3 | ##################
4 | 34100 distinct states explored
5 |
--------------------------------------------------------------------------------
/Regression/bakeryAlgo/golden_4.txt:
--------------------------------------------------------------------------------
1 | ##################
2 | Check Passed
3 | ##################
4 | 34100 distinct states explored
5 |
--------------------------------------------------------------------------------
/Regression/bakeryAlgo/golden_5.txt:
--------------------------------------------------------------------------------
1 | ##################
2 | Check Passed
3 | ##################
4 | 34100 distinct states explored
5 |
--------------------------------------------------------------------------------
/Regression/bakeryAlgo/param:
--------------------------------------------------------------------------------
1 | -entirezingtrace;
2 | -entirezingtrace -delayb:../../DelayingSchedulers/RunToCompletionDelayingScheduler/bin/x64/debug/RunToCompletionDelayingScheduler.dll;
3 | -entirezingtrace -delayb:../../DelayingSchedulers/RoundRobinDelayingScheduler/bin/x64/debug/RoundRobinDelayingScheduler.dll;
4 | -entirezingtrace -delayb:../../DelayingSchedulers/CustomDelayingScheduler/bin/x64/debug/CustomDelayingScheduler.dll;
5 | -entirezingtrace -pb;
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/Regression/chan1/chan1.zing:
--------------------------------------------------------------------------------
1 | //
2 | // chan1.zing - basic channel sample
3 | //
4 |
5 | //
6 | // Channels are message queues of unbounded size. A channel declaration
7 | // provides the type of message carried by the channel. Messages may be
8 | // of simple or complex types. Simple types are passed by value, complex
9 | // types by reference.
10 | //
11 | // Messages are placed in a channel using a "send" statement, which is
12 | // always a non-blocking operation. Messages are received using a "select"
13 | // statement with a "receive" join condition, which will block if the
14 | // channel is empty. Currently, one may only read the next available
15 | // message. A language facility for receiving messages in a more
16 | // discriminating way may be provided in the future.
17 | //
18 | // The number of messages currently in a channel can be obtained by use of
19 | // the "sizeof" operator on a queue variable.
20 | //
21 | // A channel is itself a complex type and must be allocated via "new"
22 | // prior to use.
23 |
24 |
25 | // Declare a channel named "IntChan" which carries messages of type "int".
26 | chan IntChan int;
27 |
28 | class ChanTest
29 | {
30 | // Declare an instance of IntChan and initialize it.
31 | static IntChan sendInts = new IntChan;
32 |
33 | // Activate an instance of Sender() in the model's initial state.
34 | activate static void Sender()
35 | {
36 | send(sendInts, 42);
37 | }
38 |
39 | // Activate a process to receive from the channel
40 | activate static void Receiver()
41 | {
42 | int n;
43 |
44 | // Wait for a message to arrive, receive it in variable 'n', then
45 | // do nothing.
46 |
47 | select { receive(sendInts, n) -> ; }
48 | }
49 | };
50 |
--------------------------------------------------------------------------------
/Regression/chan1/compile_param:
--------------------------------------------------------------------------------
1 | /preemptive /nowarning:292;
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/Regression/chan1/golden_1.txt:
--------------------------------------------------------------------------------
1 | ##################
2 | Check Passed
3 | ##################
4 | 8 distinct states explored
5 |
--------------------------------------------------------------------------------
/Regression/chan1/golden_2.txt:
--------------------------------------------------------------------------------
1 | ##################
2 | Check Passed
3 | ##################
4 | 8 distinct states explored
5 |
--------------------------------------------------------------------------------
/Regression/chan1/golden_3.txt:
--------------------------------------------------------------------------------
1 | ##################
2 | Check Passed
3 | ##################
4 | 8 distinct states explored
5 |
--------------------------------------------------------------------------------
/Regression/chan1/golden_4.txt:
--------------------------------------------------------------------------------
1 | ##################
2 | Check Passed
3 | ##################
4 | 8 distinct states explored
5 |
--------------------------------------------------------------------------------
/Regression/chan1/golden_5.txt:
--------------------------------------------------------------------------------
1 | ##################
2 | Check Passed
3 | ##################
4 | 8 distinct states explored
5 |
--------------------------------------------------------------------------------
/Regression/chan1/param:
--------------------------------------------------------------------------------
1 | -entirezingtrace;
2 | -entirezingtrace -delayb:../../DelayingSchedulers/RunToCompletionDelayingScheduler/bin/x64/debug/RunToCompletionDelayingScheduler.dll;
3 | -entirezingtrace -delayb:../../DelayingSchedulers/RoundRobinDelayingScheduler/bin/x64/debug/RoundRobinDelayingScheduler.dll;
4 | -entirezingtrace -delayb:../../DelayingSchedulers/CustomDelayingScheduler/bin/x64/debug/CustomDelayingScheduler.dll;
5 | -entirezingtrace -pb;
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/Regression/choose1/choose1.zing:
--------------------------------------------------------------------------------
1 | //
2 | // choose1.zing - non-deterministic choice
3 | //
4 |
5 | //
6 | // Zing accommodates non-determinism through the "choose" operator. This is
7 | // an effective tool for coping with those parts of a system that, while outside
8 | // the scope of the Zing model, do contribute to its behavior. Think of "choose"
9 | // as a roll of an n-sided die. The Zing state explorer will consider all of the
10 | // possible outcomes and their affect on the subsequent behavior of the model.
11 | //
12 | // Choose may be used in two distinct ways. One may choose from a number of
13 | // alternatives known statically by appying choose to an enumeration, a range
14 | // type, or the "bool" type. The result of the "choose" operator is a value of
15 | // the appropriate type (the enum type, an integer, or a boolean, respectively).
16 | //
17 | // The second, dynamic, form of choice occurs when it is applied to variables of
18 | // set or array types. In this case, the argument to "choose" is a variable
19 | // rather than a type, and the choice is made dynamically among the members of
20 | // the set or array. (NOTE: this form is not yet implemented).
21 | //
22 | // The Zing compiler & runtime will place arbitrary limits on the number of
23 | // choice alternatives to reduce the potential for state-space explosion.
24 | //
25 | // In the state explorer, states resulting from different "choose" selections
26 | // are named "cN", where "N" is the number of the choice selected.
27 | //
28 | // NOTE: The choose operator may only be used in simple assignment statements
29 | // currently. The compiler will report a syntax error if choose is embedded
30 | // within a more complex expression or within the conditional expression for
31 | // a "while" or "if" statement.
32 | //
33 |
34 | enum myEnum { a, b, c, d };
35 |
36 | range smallInts 1 .. 5;
37 |
38 | class SimpleTest
39 | {
40 | activate static void Main()
41 | {
42 | myEnum e;
43 | int n;
44 | bool f;
45 |
46 | e = choose(myEnum);
47 |
48 | n = choose(smallInts);
49 |
50 | f = choose(bool);
51 | }
52 | };
--------------------------------------------------------------------------------
/Regression/choose1/compile_param:
--------------------------------------------------------------------------------
1 | /preemptive /nowarning:292;
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/Regression/choose1/golden_1.txt:
--------------------------------------------------------------------------------
1 | ##################
2 | Check Passed
3 | ##################
4 | 26 distinct states explored
5 |
--------------------------------------------------------------------------------
/Regression/choose1/golden_2.txt:
--------------------------------------------------------------------------------
1 | ##################
2 | Check Passed
3 | ##################
4 | 26 distinct states explored
5 |
--------------------------------------------------------------------------------
/Regression/choose1/golden_3.txt:
--------------------------------------------------------------------------------
1 | ##################
2 | Check Passed
3 | ##################
4 | 26 distinct states explored
5 |
--------------------------------------------------------------------------------
/Regression/choose1/golden_4.txt:
--------------------------------------------------------------------------------
1 | ##################
2 | Check Passed
3 | ##################
4 | 26 distinct states explored
5 |
--------------------------------------------------------------------------------
/Regression/choose1/golden_5.txt:
--------------------------------------------------------------------------------
1 | ##################
2 | Check Passed
3 | ##################
4 | 26 distinct states explored
5 |
--------------------------------------------------------------------------------
/Regression/choose1/param:
--------------------------------------------------------------------------------
1 | -entirezingtrace;
2 | -entirezingtrace -delayb:../../DelayingSchedulers/RunToCompletionDelayingScheduler/bin/x64/debug/RunToCompletionDelayingScheduler.dll;
3 | -entirezingtrace -delayb:../../DelayingSchedulers/RoundRobinDelayingScheduler/bin/x64/debug/RoundRobinDelayingScheduler.dll;
4 | -entirezingtrace -delayb:../../DelayingSchedulers/CustomDelayingScheduler/bin/x64/debug/CustomDelayingScheduler.dll;
5 | -entirezingtrace -pb;
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/Regression/clean.bat:
--------------------------------------------------------------------------------
1 | @echo off
2 | @if not "%ECHO%" == "" echo %ECHO%
3 |
4 | del *~
5 | for /d %%d in (*) do call :CLEAN %%d
6 | goto :EOF
7 |
8 | :CLEAN
9 | echo %1
10 | cd %1
11 | del %1.dll i_* o_* stripped*.txt output*.txt diff*.txt *~
12 | cd ..
13 | goto :EOF
14 |
--------------------------------------------------------------------------------
/Regression/golden.bat:
--------------------------------------------------------------------------------
1 | @echo off
2 | @if not "%ECHO%" == "" echo %ECHO%
3 |
4 | if {%1} == {} (
5 | for /d %%d in (*) do call :CHECKDIR %%d %2
6 | ) else (
7 | call :CHECKDIR %1 %2
8 | )
9 | goto :EOF
10 |
11 | :CHECKDIR
12 | echo %1
13 | cd %1
14 | if exist compile_param (
15 | for /f "delims=;" %%n in (compile_param) do ..\..\zc\bin\x64\Debug\zc.exe %%n %1.zing
16 | ) else (
17 | @echo no compile_param declared.
18 | )
19 | set /A counter = 0
20 | for /f "delims=;" %%n in (param) do call :CHECKFILE %1 "%%n" %2
21 | cd ..
22 | goto :EOF
23 |
24 | :CHECKFILE
25 | set /A counter = counter + 1
26 | set "arg=%~2"
27 | if "%3" == "" (
28 | @echo golden for %arg%
29 | cmd /c "..\..\Zinger\bin\x64\Debug\Zinger.exe %1.dll %arg% >golden_%counter%.txt"
30 | goto :EOF
31 | ) else if "%3" == "%counter%" (
32 | @echo golden for %arg%
33 | cmd /c "..\..\Zinger\bin\x64\Debug\Zinger.exe %1.dll %arg% >golden_%counter%.txt"
34 | goto :EOF
35 | ) else (
36 | goto :EOF
37 | )
38 |
--------------------------------------------------------------------------------
/Regression/interleave/compile_param:
--------------------------------------------------------------------------------
1 | /preemptive /nowarning:292;
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/Regression/interleave/interleave.zing:
--------------------------------------------------------------------------------
1 | class SingletonLock {
2 | static bool locked;
3 |
4 | atomic static void acquire () {
5 | select { wait (!locked) -> locked = true; }
6 | }
7 |
8 | atomic static void release () {
9 | locked = false;
10 | }
11 | };
12 |
13 |
14 | class BoolProg {
15 | static bool g0;
16 | activate static void main() {
17 |
18 | async foo_1();
19 | async bar_1();
20 | }
21 |
22 |
23 | static void bar_1() {
24 | g0=false;
25 | return;
26 | }
27 |
28 | static void foo_1() {
29 | g0=true;
30 | assume (!(g0));
31 | assert (false);
32 | }
33 |
34 |
35 | };
36 |
--------------------------------------------------------------------------------
/Regression/interleave/param:
--------------------------------------------------------------------------------
1 | -entirezingtrace;
2 | -entirezingtrace -delayb:../../DelayingSchedulers/RunToCompletionDelayingScheduler/bin/x64/debug/RunToCompletionDelayingScheduler.dll;
3 | -entirezingtrace -delayb:../../DelayingSchedulers/RoundRobinDelayingScheduler/bin/x64/debug/RoundRobinDelayingScheduler.dll;
4 | -entirezingtrace -delayb:../../DelayingSchedulers/CustomDelayingScheduler/bin/x64/debug/CustomDelayingScheduler.dll;
5 | -entirezingtrace -pb;
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/Regression/mutex/compile_param:
--------------------------------------------------------------------------------
1 | /preemptive /nowarning:292;
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/Regression/mutex/golden_1.txt:
--------------------------------------------------------------------------------
1 | ##################
2 | Check Passed
3 | ##################
4 | 188 distinct states explored
5 |
--------------------------------------------------------------------------------
/Regression/mutex/golden_2.txt:
--------------------------------------------------------------------------------
1 | ##################
2 | Check Passed
3 | ##################
4 | 188 distinct states explored
5 |
--------------------------------------------------------------------------------
/Regression/mutex/golden_3.txt:
--------------------------------------------------------------------------------
1 | ##################
2 | Check Passed
3 | ##################
4 | 188 distinct states explored
5 |
--------------------------------------------------------------------------------
/Regression/mutex/golden_4.txt:
--------------------------------------------------------------------------------
1 | ##################
2 | Check Passed
3 | ##################
4 | 188 distinct states explored
5 |
--------------------------------------------------------------------------------
/Regression/mutex/golden_5.txt:
--------------------------------------------------------------------------------
1 | ##################
2 | Check Passed
3 | ##################
4 | 188 distinct states explored
5 |
--------------------------------------------------------------------------------
/Regression/mutex/mutex.zing:
--------------------------------------------------------------------------------
1 | class mutex
2 | {
3 | static bool flag1;
4 | static bool flag2;
5 | static bool p1InCS;
6 | static bool p2InCS;
7 | static int turn;
8 |
9 | void p1(){
10 | flag1 = true;
11 | turn = 2;
12 | while(flag2 && (turn == 2)) ;
13 |
14 | // CS begins here
15 | p1InCS = true;
16 | assert(!p2InCS);
17 |
18 | // CS ends here
19 |
20 | p1InCS = false;
21 | flag1 = false;
22 | }
23 |
24 |
25 | void p2(){
26 | flag2 = true;
27 | turn = 1;
28 | while(flag1 && (turn == 1)) ;
29 |
30 | // CS begins here
31 | p2InCS = true;
32 | assert(!p1InCS);
33 | p2InCS = false;
34 | // CS ends here
35 |
36 | flag2 = false;
37 | }
38 |
39 | activate static void main(){
40 | mutex m = new mutex;
41 | flag1 = false;
42 | flag2 = false;
43 | async m.p1();
44 | async m.p2();
45 | }
46 | };
--------------------------------------------------------------------------------
/Regression/mutex/param:
--------------------------------------------------------------------------------
1 | -entirezingtrace;
2 | -entirezingtrace -delayb:../../DelayingSchedulers/RunToCompletionDelayingScheduler/bin/x64/debug/RunToCompletionDelayingScheduler.dll;
3 | -entirezingtrace -delayb:../../DelayingSchedulers/RoundRobinDelayingScheduler/bin/x64/debug/RoundRobinDelayingScheduler.dll;
4 | -entirezingtrace -delayb:../../DelayingSchedulers/CustomDelayingScheduler/bin/x64/debug/CustomDelayingScheduler.dll;
5 | -entirezingtrace -pb;
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/Regression/n-peterson/compile_param:
--------------------------------------------------------------------------------
1 | /preemptive /nowarning:292;
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/Regression/n-peterson/param:
--------------------------------------------------------------------------------
1 | -entirezingtrace;
2 | -entirezingtrace -delayb:../../DelayingSchedulers/RunToCompletionDelayingScheduler/bin/x64/debug/RunToCompletionDelayingScheduler.dll;
3 | -entirezingtrace -delayb:../../DelayingSchedulers/RoundRobinDelayingScheduler/bin/x64/debug/RoundRobinDelayingScheduler.dll;
4 | -entirezingtrace -delayb:../../DelayingSchedulers/CustomDelayingScheduler/bin/x64/debug/CustomDelayingScheduler.dll;
5 | -entirezingtrace -pb;
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/Regression/p-peterson/compile_param:
--------------------------------------------------------------------------------
1 | /preemptive /nowarning:292;
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/Regression/p-peterson/golden_1.txt:
--------------------------------------------------------------------------------
1 | ##################
2 | Check Passed
3 | ##################
4 | 9451 distinct states explored
5 |
--------------------------------------------------------------------------------
/Regression/p-peterson/golden_2.txt:
--------------------------------------------------------------------------------
1 | ##################
2 | Check Passed
3 | ##################
4 | 9451 distinct states explored
5 |
--------------------------------------------------------------------------------
/Regression/p-peterson/golden_3.txt:
--------------------------------------------------------------------------------
1 | ##################
2 | Check Passed
3 | ##################
4 | 9451 distinct states explored
5 |
--------------------------------------------------------------------------------
/Regression/p-peterson/golden_4.txt:
--------------------------------------------------------------------------------
1 | ##################
2 | Check Passed
3 | ##################
4 | 9451 distinct states explored
5 |
--------------------------------------------------------------------------------
/Regression/p-peterson/golden_5.txt:
--------------------------------------------------------------------------------
1 | ##################
2 | Check Passed
3 | ##################
4 | 9451 distinct states explored
5 |
--------------------------------------------------------------------------------
/Regression/p-peterson/param:
--------------------------------------------------------------------------------
1 | -entirezingtrace;
2 | -entirezingtrace -delayb:../../DelayingSchedulers/RunToCompletionDelayingScheduler/bin/x64/debug/RunToCompletionDelayingScheduler.dll;
3 | -entirezingtrace -delayb:../../DelayingSchedulers/RoundRobinDelayingScheduler/bin/x64/debug/RoundRobinDelayingScheduler.dll;
4 | -entirezingtrace -delayb:../../DelayingSchedulers/CustomDelayingScheduler/bin/x64/debug/CustomDelayingScheduler.dll;
5 | -entirezingtrace -pb;
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/Regression/regression.bat:
--------------------------------------------------------------------------------
1 | @echo off
2 | @if not "%ECHO%" == "" echo %ECHO%
3 |
4 | if {%1} == {} (
5 | for /d %%d in (*) do call :CHECKDIR %%d %2
6 | ) else (
7 | call :CHECKDIR %1 %2
8 | )
9 | goto :EOF
10 |
11 | :CHECKDIR
12 | echo %1
13 | cd %1
14 | if exist compile_param (
15 | for /f "delims=;" %%n in (compile_param) do ..\..\zc\bin\x64\Debug\zc.exe %%n %1.zing
16 | ) else (
17 | @echo no compile_param declared.
18 | )
19 | set /A counter = 0
20 | if exist param (
21 | for /f "delims=;" %%n in (param) do call :CHECKFILE %1 "%%n" %2
22 | @echo --------------------------------------------------------------
23 | cd ..
24 | goto :EOF
25 | ) else (
26 | @echo no param file declared.
27 | )
28 |
29 |
30 |
31 |
32 | :CHECKFILE
33 | set /A counter = counter + 1
34 | set "arg=%~2"
35 | if "%3" == "" (
36 |
37 | cmd /c "..\..\Zinger\bin\x64\Debug\Zinger.exe %1.dll %arg% >output_%counter%.txt"
38 | sleep 1
39 | cmd /c "grep -v State: golden_%counter%.txt >stripped_golden_%counter%.txt"
40 | cmd /c "grep -v State: output_%counter%.txt >stripped_output_%counter%.txt"
41 | cmd /c "diff stripped_golden_%counter%.txt stripped_output_%counter%.txt >diff_%counter%.txt"
42 | fc stripped_golden_%counter%.txt stripped_output_%counter%.txt >regression_tmp
43 |
44 | if ERRORLEVEL 1 (
45 | @echo %1 failed with options %arg%
46 | ) else (
47 | @echo %1 passed with options %arg%
48 | )
49 |
50 | del regression_tmp
51 | goto :EOF
52 |
53 | )
54 | if "%3" == "%counter%" (
55 |
56 | cmd /c "..\..\Zinger\bin\x64\Debug\Zinger.exe %1.dll %arg% >output_%counter%.txt"
57 | sleep 1
58 | cmd /c "grep -v State: golden_%counter%.txt >stripped_golden_%counter%.txt"
59 | cmd /c "grep -v State: output_%counter%.txt >stripped_output_%counter%.txt"
60 | cmd /c "diff stripped_golden_%counter%.txt stripped_output_%counter%.txt >diff_%counter%.txt"
61 | fc stripped_golden_%counter%.txt stripped_output_%counter%.txt >regression_tmp
62 |
63 | if ERRORLEVEL 1 (
64 | @echo %1 failed with options %arg%
65 | ) else (
66 | @echo %1 passed with options %arg%
67 | )
68 | del regression_tmp
69 | goto :EOF
70 |
71 | )
72 | goto :EOF
73 |
74 |
75 |
--------------------------------------------------------------------------------
/Resources/Dronacharya/DronacharyaConfig.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | C:\WorkSpace\Zing\Plugins\MotionPlanning\bin\x64\Debug\Complan.dll
4 | C:\WorkSpace\ComplanV2\Src\Debug\x64\Complan_v2.dll
5 | C:\WorkSpace\dronacharya\Examples\AnimalHerd_V1\
6 | C:\WorkSpace\dronacharya\Examples\AnimalHerd_V1\TaskPlanning.p
7 | C:\WorkSpace\dronacharya\Binaries\P\Pc.exe
8 | C:\WorkSpace\Zing\Zinger\bin\x64\Debug\Zinger.exe
9 |
10 | 4
11 | 4
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/Resources/Source_Zing.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ZingModelChecker/Zing/a76daf8f7002a84730f02e762be5bb9c5b44b080/Resources/Source_Zing.ico
--------------------------------------------------------------------------------
/Resources/Zing.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ZingModelChecker/Zing/a76daf8f7002a84730f02e762be5bb9c5b44b080/Resources/Zing.jpg
--------------------------------------------------------------------------------
/Resources/external/CCI/Microsoft.Comega.Runtime.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ZingModelChecker/Zing/a76daf8f7002a84730f02e762be5bb9c5b44b080/Resources/external/CCI/Microsoft.Comega.Runtime.dll
--------------------------------------------------------------------------------
/Resources/external/CCI/Microsoft.Comega.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ZingModelChecker/Zing/a76daf8f7002a84730f02e762be5bb9c5b44b080/Resources/external/CCI/Microsoft.Comega.dll
--------------------------------------------------------------------------------
/Resources/external/CCI/System.Compiler.Framework.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ZingModelChecker/Zing/a76daf8f7002a84730f02e762be5bb9c5b44b080/Resources/external/CCI/System.Compiler.Framework.dll
--------------------------------------------------------------------------------
/Resources/external/CCI/System.Compiler.Runtime.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ZingModelChecker/Zing/a76daf8f7002a84730f02e762be5bb9c5b44b080/Resources/external/CCI/System.Compiler.Runtime.dll
--------------------------------------------------------------------------------
/Resources/external/CCI/System.Compiler.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ZingModelChecker/Zing/a76daf8f7002a84730f02e762be5bb9c5b44b080/Resources/external/CCI/System.Compiler.dll
--------------------------------------------------------------------------------
/ZingExplorer/ZingerStateTable.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Concurrent;
3 | using System.Diagnostics.Contracts;
4 |
5 | namespace Microsoft.Zing
6 | {
7 | [Serializable]
8 | public class StateData
9 | {
10 | ///
11 | /// Magic bit used during NDFS liveness algorithm to distinguish between red and green states
12 | ///
13 | private bool magicBit = false;
14 |
15 | public bool MagicBit
16 | {
17 | get { return magicBit; }
18 | set { magicBit = value; }
19 | }
20 |
21 | public StateData(bool magic)
22 | {
23 | MagicBit = magic;
24 | }
25 |
26 | public StateData()
27 | {
28 | }
29 |
30 | public override bool Equals(object obj)
31 | {
32 | if (obj == null)
33 | return false;
34 | else
35 | {
36 | if (obj is StateData)
37 | {
38 | return magicBit == (obj as StateData).magicBit;
39 | }
40 | else
41 | return false;
42 | }
43 | }
44 |
45 | public bool Equals(StateData st)
46 | {
47 | return st.magicBit == magicBit;
48 | }
49 |
50 | public override int GetHashCode()
51 | {
52 | return base.GetHashCode();
53 | }
54 | }
55 |
56 | ///
57 | /// The global state used during state full search to store all the visited states.
58 | ///
59 | public class ZingerStateTable
60 | {
61 | ///
62 | /// State table map from fingerprint to the state-data.
63 | ///
64 | private ConcurrentDictionary hashTable = new ConcurrentDictionary();
65 |
66 | public void AddOrUpdate(Fingerprint fp, StateData sd)
67 | {
68 | if (hashTable.ContainsKey(fp))
69 | {
70 | StateData oldValue;
71 | hashTable.TryGetValue(fp, out oldValue);
72 | hashTable.TryUpdate(fp, sd, oldValue);
73 | }
74 | else
75 | {
76 | if (hashTable.TryAdd(fp, sd))
77 | {
78 | ZingerStats.IncrementStatesCount();
79 | }
80 | }
81 | }
82 |
83 | public bool Contains(Fingerprint fp)
84 | {
85 | return hashTable.ContainsKey(fp);
86 | }
87 |
88 | public StateData GetStateData(Fingerprint fp)
89 | {
90 | StateData statedata;
91 | var check = hashTable.TryGetValue(fp, out statedata);
92 | Contract.Assert(check);
93 | return statedata;
94 | }
95 | }
96 | }
--------------------------------------------------------------------------------
/Zinger/App.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ZingModelChecker/Zing/a76daf8f7002a84730f02e762be5bb9c5b44b080/Zinger/App.ico
--------------------------------------------------------------------------------
/Zinger/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 |
3 | [assembly: AssemblyTitle("Zinger")]
4 | [assembly: AssemblyDescription("Zing model-checker command line driver")]
5 | [assembly: AssemblyConfiguration("")]
6 | [assembly: AssemblyCulture("")]
7 | [assembly: AssemblyDelaySign(false)]
8 | [assembly: AssemblyKeyFile("")]
9 | [assembly: AssemblyKeyName("")]
--------------------------------------------------------------------------------
/Zinger/Source_Zing.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ZingModelChecker/Zing/a76daf8f7002a84730f02e762be5bb9c5b44b080/Zinger/Source_Zing.ico
--------------------------------------------------------------------------------
/Zinger/Zinger.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Microsoft.Zing
4 | {
5 | ///
6 | /// Main entry point for Zinger.
7 | ///
8 | internal class Zinger
9 | {
10 | ///
11 | /// The main entry point for the application.
12 | ///
13 | private static void Main(string[] args)
14 | {
15 | //Parse Command Line and Initialize the ZingerConfiguration
16 | if (!ZingerCommandLine.ParseCommandLine(args))
17 | {
18 | Environment.Exit((int)ZingerResult.InvalidParameters);
19 | }
20 | //capture the commandline arguments for dronaworker
21 | if(ZingerConfiguration.DronacharyaEnabled)
22 | {
23 | ZingDronacharya.ZingerCommandline = args;
24 | }
25 |
26 | //Infer the Zinger Configuration and make sure all flags are set correctly.
27 | ZingerConfiguration.InferConfiguration();
28 | //Print the Current Configuration of Zinger
29 | ZingerConfiguration.PrintConfiguration();
30 |
31 | try
32 | {
33 | ZingerResult result;
34 |
35 | ZingExplorer zingExplorer;
36 |
37 | //check if dronacharya is enabled and this is the main worker
38 | if(ZingerConfiguration.DronacharyaEnabled && ZingerConfiguration.IsDronaMain)
39 | {
40 | ZingDronacharya.PerformIterativeSearch();
41 | return;
42 | }
43 |
44 |
45 | //currently the only search allowed with dronacharya enabled is exhaustive
46 | if(ZingerConfiguration.DronacharyaEnabled)
47 | {
48 | zingExplorer = new ZingExplorerExhaustiveSearch();
49 | }
50 | else
51 | {
52 | if (ZingerConfiguration.DoNDFSLiveness)
53 | zingExplorer = new ZingExplorerNDFSLiveness();
54 | else if (ZingerConfiguration.DoRandomSampling && !ZingerConfiguration.DoDelayBounding)
55 | zingExplorer = new ZingExplorerNaiveRandomWalk();
56 | else if (ZingerConfiguration.DoRandomSampling && ZingerConfiguration.DoDelayBounding)
57 | zingExplorer = new ZingExplorerDelayBoundedSampling();
58 | else if (ZingerConfiguration.DoLivenessSampling)
59 | zingExplorer = new ZingExplorerLivenessSampling();
60 | else
61 | zingExplorer = new ZingExplorerExhaustiveSearch();
62 | }
63 |
64 | //start periodic stats
65 | if (ZingerConfiguration.PrintStats)
66 | {
67 | ZingerStats.StartPeriodicStats();
68 | }
69 |
70 | //start the time out timer
71 | ZingerUtilities.StartTimeOut();
72 |
73 | //start the search
74 | if(ZingerConfiguration.DronacharyaEnabled && !ZingerConfiguration.IsDronaMain)
75 | {
76 | result = zingExplorer.ExploreWithDronacharya();
77 | }
78 | else
79 | {
80 | result = zingExplorer.Explore();
81 | }
82 |
83 | //Print Final Stats
84 | ZingerStats.PrintFinalStats();
85 |
86 | //Close operations
87 | if (ZingerConfiguration.PrintStats)
88 | {
89 | ZingerStats.StopPeriodicStats();
90 | }
91 |
92 | Environment.Exit((int)result);
93 | }
94 | catch (Exception e)
95 | {
96 | Console.WriteLine("Exception from Zing model checker:");
97 | Console.WriteLine(e);
98 | Environment.Exit((int)ZingerResult.ZingRuntimeError);
99 | }
100 | }
101 | }
102 | }
--------------------------------------------------------------------------------
/Zinger/app.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/Zinger/version.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 |
3 | [assembly: AssemblyCompany("Microsoft Corporation")]
4 | [assembly: AssemblyProduct("Microsoft (R) Zing")]
5 | [assembly: AssemblyCopyright("Copyright (C) Microsoft Corp. 2002, 2003, 2004, 2005. All rights reserved")]
6 | [assembly: AssemblyTrademark("Microsoft and Windows are either registered trademarks or trademarks of Microsoft Corporation in the U.S. and/or other countries")]
7 | [assembly: AssemblyVersion("2.0.2004.0")]
8 | [assembly: AssemblyFileVersion("2.0.2004.0")]
--------------------------------------------------------------------------------
/zc/App.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ZingModelChecker/Zing/a76daf8f7002a84730f02e762be5bb9c5b44b080/zc/App.ico
--------------------------------------------------------------------------------
/zc/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 |
3 | [assembly: AssemblyTitle("Zing Compiler")]
4 | [assembly: AssemblyDescription("Zing Compiler command-line driver")]
5 | [assembly: AssemblyConfiguration("")]
6 | [assembly: AssemblyCulture("")]
7 | [assembly: AssemblyDelaySign(false)]
8 | [assembly: AssemblyKeyFile("")]
9 | [assembly: AssemblyKeyName("")]
--------------------------------------------------------------------------------
/zc/Main.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.CodeDom.Compiler;
3 | using System.Compiler;
4 | using System.IO;
5 |
6 | internal class main
7 | {
8 | ///
9 | /// The main entry point for the application.
10 | ///
11 | [MTAThread]
12 | private static int Main(string[] args)
13 | {
14 | int rc = 0;
15 | int n = (args == null) ? 0 : args.Length;
16 | bool testsuite = false;
17 | for (int i = 0; i < n; i++)
18 | {
19 | string arg = args[i];
20 | char ch = arg[0];
21 | if (ch != '@')
22 | {
23 | if (Path.GetExtension(arg) == ".suite")
24 | testsuite = true;
25 | }
26 | }
27 | CompilerOptions options = new Microsoft.Zing.ZingCompilerOptions();
28 | options.TempFiles = new TempFileCollection(Directory.GetCurrentDirectory(), true);
29 | options.GenerateExecutable = false;
30 | options.CompileAndExecute = testsuite;
31 | ErrorNodeList errors = new ErrorNodeList(0);
32 | Compiler compiler = new Microsoft.Zing.Compiler();
33 | string[] fileNames = compiler.ParseCompilerParameters(options, args, errors);
34 | if (options.DisplayCommandLineHelp)
35 | {
36 | Console.WriteLine("\nZing compiler options:");
37 | Console.WriteLine(options.GetOptionHelp());
38 | return 0;
39 | }
40 |
41 | string fatalErrorString = null;
42 | n = errors.Count;
43 |
44 | for (int i = 0; i < n; i++)
45 | {
46 | ErrorNode e = errors[i];
47 | if (e == null) continue;
48 | rc++;
49 | if (fatalErrorString == null) fatalErrorString = compiler.GetFatalErrorString();
50 | Console.Write(fatalErrorString, e.Code.ToString("0000"));
51 | Console.WriteLine(e.GetMessage());
52 | }
53 | if (rc > 0) return 1;
54 |
55 | CompilerResults results;
56 | if (fileNames.Length == 1)
57 | results = compiler.CompileAssemblyFromFile(options, fileNames[0]);
58 | else
59 | results = compiler.CompileAssemblyFromFileBatch(options, fileNames);
60 |
61 | string errorString = null;
62 | string warningString = null;
63 |
64 | Console.WriteLine();
65 |
66 | foreach (CompilerError e in results.Errors)
67 | {
68 | //nowarning
69 | var warningno = (options as Microsoft.Zing.ZingCompilerOptions).Warningnumber;
70 | if (e.IsWarning && warningno.Contains(int.Parse(e.ErrorNumber)))
71 | continue;
72 |
73 | if (e.IsWarning)
74 | {
75 | Console.ForegroundColor = ConsoleColor.Gray;
76 | }
77 | else
78 | {
79 | Console.ForegroundColor = ConsoleColor.Red;
80 | }
81 |
82 | if (e.FileName != null && e.FileName.Length > 0)
83 | {
84 | Console.Write(e.FileName);
85 | Console.Write('(');
86 | Console.Write(e.Line);
87 | Console.Write(',');
88 | Console.Write(e.Column);
89 | Console.Write("): ");
90 | }
91 | if (e.IsWarning)
92 | {
93 | if (e.ErrorNumber.Length == 4)
94 | {
95 | if (warningString == null) warningString = compiler.GetWarningString();
96 | Console.Write(warningString, e.ErrorNumber);
97 | }
98 | }
99 | else
100 | {
101 | if (e.ErrorNumber.Length == 4)
102 | {
103 | rc++; //REVIEW: include related location errors?
104 | if (errorString == null) errorString = compiler.GetErrorString();
105 | Console.Write(errorString, e.ErrorNumber);
106 | }
107 | }
108 | Console.WriteLine(e.ErrorText);
109 | }
110 | Console.ResetColor();
111 |
112 | if (rc > 0) return 1;
113 | if ((rc = results.NativeCompilerReturnValue) == 0 && options.CompileAndExecute &&
114 | results.CompiledAssembly != null && results.CompiledAssembly.EntryPoint != null)
115 | {
116 | if (results.CompiledAssembly.EntryPoint.GetParameters().Length == 0)
117 | results.CompiledAssembly.EntryPoint.Invoke(null, null);
118 | else
119 | results.CompiledAssembly.EntryPoint.Invoke(null, new object[] { new string[0] });
120 | }
121 | if (rc > 0) return 1;
122 | return 0;
123 | }
124 | }
--------------------------------------------------------------------------------
/zc/app.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------