Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
fb0adca
Draft: model synthesis
Jun 20, 2022
11c47d9
m
AbdullinAM Jun 20, 2022
4aaa8e5
first prototype, needs debugging and tuning
AbdullinAM Jun 22, 2022
9c63ba0
prototype
AbdullinAM Jun 28, 2022
707fa6d
refactor
AbdullinAM Jun 29, 2022
10c4193
very early prototype
AbdullinAM Jul 8, 2022
4285a5c
UtConstraintModel implemented
AbdullinAM Jul 12, 2022
22e2266
partial UtConstraint to UtExpression convertion
AbdullinAM Jul 14, 2022
6b47a9a
working prototypes
AbdullinAM Jul 19, 2022
a75a840
bugfixes + expression support in constraints
AbdullinAM Jul 21, 2022
fb392f6
m
AbdullinAM Jul 26, 2022
5f35311
everything kind of works, but some constraints need to be added
AbdullinAM Jul 27, 2022
ba9bb62
first working protoype with arrays
AbdullinAM Aug 1, 2022
065924f
renaming
AbdullinAM Aug 1, 2022
8cc7515
first tests and fixes
AbdullinAM Aug 2, 2022
4a14606
more expressions supported
AbdullinAM Aug 3, 2022
bbf525b
some cleanup + more expressions supported
AbdullinAM Aug 8, 2022
850b530
cleanup
AbdullinAM Aug 8, 2022
8799691
support for multidimensional arrays + fix for array generation
AbdullinAM Aug 9, 2022
60df4a4
first support of lists
AbdullinAM Aug 10, 2022
8963a7e
support sets
AbdullinAM Aug 10, 2022
1578c96
small refactorings
AbdullinAM Aug 11, 2022
1dd4b25
maps
AbdullinAM Aug 12, 2022
313757d
some cleanup and parameters
AbdullinAM Aug 12, 2022
faa0047
test write fix
AbdullinAM Aug 12, 2022
94740c9
m
AbdullinAM Aug 22, 2022
9920283
Merge branch 'main' into abdullin/constraint-model-synthesis
AbdullinAM Aug 22, 2022
fd22077
merge with master
AbdullinAM Aug 24, 2022
4e97b5f
first prototype of constraint scoring selector
AbdullinAM Aug 26, 2022
2544b31
m
AbdullinAM Aug 30, 2022
e585371
fixes
AbdullinAM Aug 31, 2022
d2564e9
Merge branch 'main' into abdullin/constraint-model-synthesis
AbdullinAM Sep 7, 2022
bb1acbc
Merge branch 'main' into abdullin/constraint-model-synthesis
AbdullinAM Sep 7, 2022
c6fbeb0
Split constraint models into a set of non-intersecting subsets before…
AbdullinAM Sep 12, 2022
2553ef7
m
AbdullinAM Sep 12, 2022
e943a16
some cleanup
AbdullinAM Sep 13, 2022
cd5fff8
more cleanup
AbdullinAM Sep 13, 2022
c2a7d31
order models in the subsets
AbdullinAM Sep 13, 2022
d1b09c8
simple caching of synthesis unit contexts
AbdullinAM Sep 13, 2022
eedccb9
option to enable/disable caching of synthesis contexts
AbdullinAM Sep 14, 2022
11eea4d
m
AbdullinAM Sep 14, 2022
9712e70
tests
AbdullinAM Sep 14, 2022
1c6b679
unit tests fixed
AbdullinAM Sep 19, 2022
4e37763
Merge branch 'main' into abdullin/constraint-model-synthesis
AbdullinAM Sep 28, 2022
34ed6fe
merge with main
AbdullinAM Sep 28, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Merge branch 'main' into abdullin/constraint-model-synthesis
# Conflicts:
#	utbot-framework-api/src/main/kotlin/org/utbot/framework/UtSettings.kt
#	utbot-framework-test/src/test/kotlin/org/utbot/framework/assemble/AssembleModelGeneratorTests.kt
#	utbot-framework/src/main/kotlin/org/utbot/engine/UtBotSymbolicEngine.kt
#	utbot-framework/src/main/kotlin/org/utbot/framework/plugin/api/TestCaseGenerator.kt
  • Loading branch information
AbdullinAM committed Sep 7, 2022
commit d2564e956254a849e3303ec6c206672746b9b200
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,6 @@ object UtSettings : AbstractSettings(
*/
var ignoreStaticsFromTrustedLibraries by getBooleanProperty(true)


/**
* Flag for enabling model synthesis
*/
Expand All @@ -391,12 +390,16 @@ object UtSettings : AbstractSettings(
*/
var synthesisMaxDepth by getIntProperty(10)

override fun toString(): String =
settingsValues
.mapKeys { it.key.name }
.entries
.sortedBy { it.key }
.joinToString(separator = System.lineSeparator()) { "\t${it.key}=${it.value}" }
/**
* Use the sandbox in the concrete executor.
*
* If true (default), the sandbox will prevent potentially dangerous calls, e.g., file access, reading
* or modifying the environment, calls to `Unsafe` methods etc.
*
* If false, all these operations will be enabled and may lead to data loss during code analysis
* and test generation.
*/
var useSandbox by getBooleanProperty(true)
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,7 @@ import org.junit.jupiter.api.Assertions.assertTrue
import org.junit.jupiter.api.BeforeEach
import org.junit.jupiter.api.Disabled
import org.junit.jupiter.api.Test
import org.utbot.common.packageName
import org.utbot.examples.assemble.*
import org.utbot.framework.util.SootUtils

/**
* Test classes must be located in the same folder as [AssembleTestUtils] class.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,16 +116,16 @@ private var stateSelectedCount = 0
internal val defaultIdGenerator = ReferencePreservingIntIdGenerator()

private fun pathSelector(
type: PathSelectorType,
graph: InterProceduralUnitGraph,
typeRegistry: TypeRegistry,
traverser: Traverser,
postConditionConstructor: PostConditionConstructor
) = when (type) {
) = when (pathSelectorType) {
PathSelectorType.COVERED_NEW_SELECTOR -> coveredNewSelector(graph) {
withStepsLimit(pathSelectorStepsLimit)
}

PathSelectorType.INHERITORS_SELECTOR -> inheritorsSelector(graph, traverser.typeRegistry) {
PathSelectorType.INHERITORS_SELECTOR -> inheritorsSelector(graph, typeRegistry) {
withStepsLimit(pathSelectorStepsLimit)
}

Expand All @@ -141,7 +141,11 @@ private fun pathSelector(
withStepsLimit(pathSelectorStepsLimit)
}

PathSelectorType.NN_REWARD_GUIDED_SELECTOR -> nnRewardGuidedSelector(graph, StrategyOption.DISTANCE) {
PathSelectorType.ML_SELECTOR -> mlSelector(graph, StrategyOption.DISTANCE) {
withStepsLimit(pathSelectorStepsLimit)
}

PathSelectorType.TORCH_SELECTOR -> mlSelector(graph, StrategyOption.DISTANCE) {
withStepsLimit(pathSelectorStepsLimit)
}

Expand Down Expand Up @@ -464,15 +468,11 @@ class UtBotSymbolicEngine(
null
}


else -> {
ObjectModelProvider(defaultIdGenerator).withFallback(fallbackModelProvider).generate(
FuzzedMethodDescription(
"thisInstance",
voidClassId,
listOf(utMethod.clazz.id),
constantValues
)
).take(10).shuffled(Random(0)).map { it.value.model }.first().apply {
FuzzedMethodDescription("thisInstance", voidClassId, listOf(utMethod.clazz.id), constantValues)
).take(10).shuffled(random).map { it.value.model }.first().apply {
if (this is UtNullModel) { // it will definitely fail because of NPE,
return@flow
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package org.utbot.engine.z3

import com.microsoft.z3.Context
import com.microsoft.z3.Global
import com.microsoft.z3.Native
import org.utbot.common.FileUtil
import java.io.File
import java.nio.file.Files.createTempDirectory
Expand Down Expand Up @@ -61,6 +62,7 @@ abstract class Z3Initializer : AutoCloseable {
}

allLibraries.forEach { System.load("$libFolder/$it$ext") }
Native.globalParamSet("memory_max_size", "${8L * 1024 * 1024 * 1024}")
}

init {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ import org.utbot.framework.plugin.api.util.withUtContext
import org.utbot.framework.synthesis.Synthesizer
import org.utbot.framework.synthesis.postcondition.constructors.EmptyPostCondition
import org.utbot.framework.synthesis.postcondition.constructors.PostConditionConstructor
import org.utbot.framework.util.SootUtils
import org.utbot.framework.util.jimpleBody
import org.utbot.framework.util.toModel
import org.utbot.instrumentation.ConcreteExecutor
Expand Down
You are viewing a condensed version of this merge commit. You can view the full changes here.