Skip to content

Commit e8c605a

Browse files
author
Christine Zhou
committed
resolve merging conflict
2 parents a4a6195 + 2d58815 commit e8c605a

File tree

143 files changed

+14053
-87
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

143 files changed

+14053
-87
lines changed

.github/workflows/maven-publish.yml

Lines changed: 102 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,109 @@
1-
# This workflow will build a package using Maven and then publish it to GitHub packages when a release is created
2-
# For more information see: https://github.com/actions/setup-java/blob/main/docs/advanced-usage.md#apache-maven-with-a-settings-path
3-
4-
name: Maven Publish
1+
name: Publish to Maven Central
52

63
on:
7-
push:
8-
branches: [ "maven-publish-**" ]
4+
release:
5+
types: [published]
96
workflow_dispatch:
7+
inputs:
8+
version:
9+
description: 'Version to publish (e.g., 0.4.1). Leave empty to use current P version from pom.xml'
10+
required: false
11+
type: string
1012

1113
jobs:
12-
Maven-Publish-Ubuntu:
14+
publish:
1315
runs-on: ubuntu-latest
16+
1417
steps:
15-
- uses: actions/checkout@v3
16-
- name: Set up Java for publishing to Maven Central Repository
17-
uses: actions/setup-java@v3
18-
with:
19-
distribution: 'temurin'
20-
java-version: '11'
21-
server-id: ossrh
22-
server-username: MAVEN_USERNAME
23-
server-password: MAVEN_PASSWORD
24-
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }} # Value of the GPG private key to import
25-
gpg-passphrase: MAVEN_GPG_PASSPHRASE # env variable for GPG private key passphrase
26-
- name: Publish to the Maven Central Repository
27-
working-directory: Src/PRuntimes/PSymRuntime
28-
run: mvn --batch-mode deploy -P release -Dmaven.test.skip
29-
env:
30-
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
31-
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
32-
MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
33-
18+
- name: Checkout code
19+
uses: actions/checkout@v4
20+
21+
- name: Set up JDK 17
22+
uses: actions/setup-java@v4
23+
with:
24+
java-version: '17'
25+
distribution: 'temurin'
26+
27+
- name: Cache Maven dependencies
28+
uses: actions/cache@v3
29+
with:
30+
path: ~/.m2
31+
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
32+
restore-keys: ${{ runner.os }}-m2
33+
34+
- name: Import GPG key
35+
uses: crazy-max/ghaction-import-gpg@v6
36+
with:
37+
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
38+
passphrase: ${{ secrets.GPG_PASSPHRASE }}
39+
40+
- name: Extract version from release
41+
id: get_version
42+
run: |
43+
if [ "${{ github.event_name }}" = "release" ]; then
44+
VERSION=${{ github.event.release.tag_name }}
45+
# Remove 'v' prefix if present
46+
VERSION=${VERSION#v}
47+
else
48+
VERSION=${{ github.event.inputs.version }}
49+
fi
50+
echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
51+
echo "Publishing version: $VERSION"
52+
53+
- name: Update PEx version
54+
run: |
55+
cd Src/PEx
56+
# Update the revision property in pom.xml
57+
sed -i "s/<revision>.*<\/revision>/<revision>${{ steps.get_version.outputs.VERSION }}<\/revision>/" pom.xml
58+
echo "Updated PEx version to ${{ steps.get_version.outputs.VERSION }}"
59+
60+
- name: Create Maven settings.xml
61+
run: |
62+
mkdir -p ~/.m2
63+
cat > ~/.m2/settings.xml << 'EOF'
64+
<?xml version="1.0" encoding="UTF-8"?>
65+
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
66+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
67+
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
68+
http://maven.apache.org/xsd/settings-1.0.0.xsd">
69+
<servers>
70+
<server>
71+
<id>central</id>
72+
<username>${{ secrets.MAVEN_USERNAME }}</username>
73+
<password>${{ secrets.MAVEN_PASSWORD }}</password>
74+
</server>
75+
<server>
76+
<id>gpg.passphrase</id>
77+
<passphrase>${{ secrets.GPG_PASSPHRASE }}</passphrase>
78+
</server>
79+
</servers>
80+
</settings>
81+
EOF
82+
83+
- name: Publish to Maven Central
84+
run: |
85+
cd Src/PEx
86+
mvn clean deploy -P release -DskipTests
87+
env:
88+
MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
89+
90+
- name: Create deployment summary
91+
run: |
92+
echo "## 🚀 Maven Central Deployment" >> $GITHUB_STEP_SUMMARY
93+
echo "Successfully published **PEx ${{ steps.get_version.outputs.VERSION }}** to Maven Central!" >> $GITHUB_STEP_SUMMARY
94+
echo "" >> $GITHUB_STEP_SUMMARY
95+
echo "### 📦 Artifact Details" >> $GITHUB_STEP_SUMMARY
96+
echo "- **Group ID:** io.github.p-org" >> $GITHUB_STEP_SUMMARY
97+
echo "- **Artifact ID:** pex" >> $GITHUB_STEP_SUMMARY
98+
echo "- **Version:** ${{ steps.get_version.outputs.VERSION }}" >> $GITHUB_STEP_SUMMARY
99+
echo "" >> $GITHUB_STEP_SUMMARY
100+
echo "### 📋 Maven Dependency" >> $GITHUB_STEP_SUMMARY
101+
echo '```xml' >> $GITHUB_STEP_SUMMARY
102+
echo '<dependency>' >> $GITHUB_STEP_SUMMARY
103+
echo ' <groupId>io.github.p-org</groupId>' >> $GITHUB_STEP_SUMMARY
104+
echo ' <artifactId>pex</artifactId>' >> $GITHUB_STEP_SUMMARY
105+
echo " <version>${{ steps.get_version.outputs.VERSION }}</version>" >> $GITHUB_STEP_SUMMARY
106+
echo '</dependency>' >> $GITHUB_STEP_SUMMARY
107+
echo '```' >> $GITHUB_STEP_SUMMARY
108+
echo "" >> $GITHUB_STEP_SUMMARY
109+
echo "🔗 [View on Maven Central](https://central.sonatype.com/artifact/io.github.p-org/pex/${{ steps.get_version.outputs.VERSION }})" >> $GITHUB_STEP_SUMMARY

.github/workflows/pex.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# This workflow will build and test PEx, and cache/restore any dependencies to improve the workflow execution time
2+
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
3+
4+
name: PEx on Ubuntu
5+
6+
on:
7+
push:
8+
pull_request:
9+
workflow_dispatch:
10+
inputs:
11+
args:
12+
description: Additional arguments
13+
default: ""
14+
required: false
15+
jobs:
16+
PEx-Build-And-Test-Ubuntu:
17+
runs-on: ubuntu-latest
18+
steps:
19+
- uses: actions/checkout@v1
20+
- name: Setup .NET Core
21+
uses: actions/setup-dotnet@v1
22+
with:
23+
dotnet-version: 8.0.x
24+
- name: Set up JDK
25+
uses: actions/setup-java@v1
26+
with:
27+
java-version: 17
28+
- name: Cache Maven packages
29+
uses: actions/cache@v4
30+
with:
31+
path: ~/.m2
32+
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
33+
restore-keys: ${{ runner.os }}-m2
34+
- name: Build PEx
35+
working-directory: Src/PEx
36+
run: ./scripts/build_and_test.sh --build
37+
- name: Test PEx
38+
working-directory: Src/PEx
39+
run: ./scripts/build_and_test.sh --test

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,7 @@ Bld/*
230230
!Bld/Jars/
231231
!Bld/Deps/
232232
PGenerated/
233+
PCheckerOutput/
233234
!Src/**/Zing/*.zing
234235
stubs.c
235236
*.idb

Src/PChecker/CheckerCore/Checker.cs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,7 @@ public static void Run(CheckerConfiguration configuration)
3535
Error.Write(logger, ConsoleColor.Yellow, engine.GetReport());
3636
}
3737
break;
38-
case CheckerMode.Verification:
39-
case CheckerMode.Coverage:
38+
case CheckerMode.PEx:
4039
ExhaustiveEngine.Create(configuration).Run();
4140
break;
4241
default:
@@ -59,8 +58,7 @@ public static void Run(CheckerConfiguration configuration)
5958
}
6059
testingEngine.Run();
6160
break;
62-
case CheckerMode.Verification:
63-
case CheckerMode.Coverage:
61+
case CheckerMode.PEx:
6462
ExhaustiveEngine.Create(configuration).Run();
6563
break;
6664
default:
@@ -71,4 +69,4 @@ public static void Run(CheckerConfiguration configuration)
7169
logger.WriteLine(". Done");
7270
}
7371
}
74-
}
72+
}

Src/PChecker/CheckerCore/CheckerConfiguration.cs

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,12 @@ public int MaxSchedulingSteps
238238
[DataMember]
239239
public string CustomStateMachineRuntimeLogType;
240240

241+
/// <summary>
242+
/// Enables debugging.
243+
/// </summary>
244+
[DataMember]
245+
public bool EnableDebugging;
246+
241247

242248
/// <summary>
243249
/// The testing scheduler unique endpoint.
@@ -269,10 +275,10 @@ public int MaxSchedulingSteps
269275
public bool DisableEnvironmentExit;
270276

271277
/// <summary>
272-
/// Additional arguments to pass to PSym.
278+
/// Additional arguments to pass to checker.
273279
/// </summary>
274280
[DataMember]
275-
public string PSymArgs;
281+
public string CheckerArgs;
276282

277283
/// <summary>
278284
/// Additional arguments to pass to JVM-based checker.
@@ -321,11 +327,12 @@ protected CheckerConfiguration()
321327
DebugActivityCoverage = false;
322328

323329
IsVerbose = false;
330+
EnableDebugging = false;
324331

325332
EnableColoredConsoleOutput = false;
326333
DisableEnvironmentExit = true;
327334

328-
PSymArgs = "";
335+
CheckerArgs = "";
329336
JvmArgs = "";
330337
}
331338

Src/PChecker/CheckerCore/CheckerMode.cs

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,9 @@ public enum CheckerMode
99
/// Mode for prioritized random search
1010
/// </summary>
1111
BugFinding,
12+
1213
/// <summary>
13-
/// Mode for exhaustive symbolic exploration
14+
/// Mode for P exploration and execution
1415
/// </summary>
15-
Verification,
16-
/// <summary>
17-
/// Mode for exhaustive explicit-state search with state-space coverage reporting
18-
/// </summary>
19-
Coverage
20-
}
16+
PEx
17+
}

Src/PChecker/CheckerCore/ExhaustiveEngine.cs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,7 @@ private string CreateArguments()
7474
{
7575
switch (_checkerConfiguration.Mode)
7676
{
77-
case CheckerMode.Verification:
78-
arguments.Append("--strategy symbolic ");
79-
break;
80-
case CheckerMode.Coverage:
77+
case CheckerMode.PEx:
8178
arguments.Append($"--strategy {_checkerConfiguration.SchedulingStrategy} ");
8279
break;
8380
default:
@@ -109,7 +106,7 @@ private string CreateArguments()
109106
}
110107
}
111108

112-
arguments.Append($"{_checkerConfiguration.PSymArgs} ");
109+
arguments.Append($"{_checkerConfiguration.CheckerArgs} ");
113110

114111
return arguments.ToString();
115112
}
@@ -234,4 +231,4 @@ public void Run()
234231
}
235232
}
236233
}
237-
}
234+
}

Src/PChecker/CheckerCore/SystematicTesting/Strategies/Feedback/Coverage/TimelineObserver.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,11 @@
77

88
namespace PChecker.Feedback;
99

10-
internal class TimelineObserver: IControlledRuntimeLog
10+
internal class TimelineObserver : IControlledRuntimeLog
1111
{
12-
1312
private HashSet<(string, string, string)> _timelines = new();
1413
private Dictionary<string, HashSet<string>> _allEvents = new();
1514
private Dictionary<string, List<string>> _orderedEvents = new();
16-
// Removed unused field: private IControlledRuntimeLog _controlledRuntimeLogImplementation;
1715

1816
public static readonly List<(int, int)> Coefficients = new();
1917
public static int NumOfCoefficients = 50;

0 commit comments

Comments
 (0)