Skip to content

Commit 16a7ded

Browse files
committed
Implement field-sensitive context-insensitive graph mining
1 parent 931f97a commit 16a7ded

File tree

7 files changed

+578
-0
lines changed

7 files changed

+578
-0
lines changed

build.gradle.kts

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
plugins {
2+
java
3+
kotlin("jvm") version "1.9.21"
4+
}
5+
6+
group = "me.pointsto.graph"
7+
version = "1.0-SNAPSHOT"
8+
9+
val jacoDbVersion: String by rootProject
10+
11+
repositories {
12+
mavenCentral()
13+
}
14+
15+
dependencies {
16+
testImplementation("org.jetbrains.kotlin:kotlin-test")
17+
18+
api(group = "org.jacodb", name = "jacodb-core", version = jacoDbVersion)
19+
api(group = "org.jacodb", name = "jacodb-analysis", version = jacoDbVersion)
20+
api(group = "org.jacodb", name = "jacodb-approximations", version = jacoDbVersion)
21+
}
22+
23+
tasks.test {
24+
useJUnitPlatform()
25+
}
26+
kotlin {
27+
jvmToolchain(17)
28+
}

gradle.properties

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
kotlin.code.style=official
2+
jacoDbVersion=1.4.3

gradle/wrapper/gradle-wrapper.jar

62.2 KB
Binary file not shown.
+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
distributionBase=GRADLE_USER_HOME
2+
distributionPath=wrapper/dists
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
4+
networkTimeout=10000
5+
validateDistributionUrl=true
6+
zipStoreBase=GRADLE_USER_HOME
7+
zipStorePath=wrapper/dists

settings.gradle.kts

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
rootProject.name = "PointsToGraphMiner"
2+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
package me.pointsto.graph
2+
3+
import org.jacodb.api.*
4+
import org.jacodb.api.ext.*
5+
6+
fun JcType.toRaw(): JcType {
7+
return when (this) {
8+
is JcArrayType -> this.classpath.arrayTypeOf(elementType.toRaw())
9+
is JcRefType -> this.jcClass.toType()
10+
else -> this
11+
}
12+
}
13+
14+
fun JcType.allRawSuperHierarchySequence(): Sequence<JcType> = toRaw().run {
15+
return when (this) {
16+
is JcRefType -> sequenceOf(this) + this.jcClass.allSuperHierarchySequence.distinct().map { it.toType() }
17+
else -> sequenceOf(this)
18+
}
19+
}

0 commit comments

Comments
 (0)