Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
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
2 changes: 1 addition & 1 deletion VSharp.Explorer/AISearcher.fs
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ type internal AISearcher(oracle: Oracle, aiAgentTrainingMode: Option<AIAgentTrai
firstFreePositionInParentsOf <- firstFreePositionInParentsOf + state.Children.Length
Comment thread
gsvgit marked this conversation as resolved.

index_pcToState.[firstFreePositionInPcToState] <-
int64 pathConditionVerticesIds[state.PathCondition.Id]
int64 pathConditionVerticesIds[state.PathCondition.[firstFreePositionInPcToState]]
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks strange. You should add edges between state and all vertices in state.PathCondition.


index_pcToState.[firstFreePositionInPcToState + gameState.States.Length] <-
int64 stateIds[state.Id]
Expand Down
11 changes: 2 additions & 9 deletions VSharp.IL/Serializer.fs
Original file line number Diff line number Diff line change
Expand Up @@ -495,20 +495,13 @@ let collectGameState (basicBlocks: ResizeArray<BasicBlock>) filterStates process
for term in pathCondition do
pathConditionDelta.AddRange(collectPathCondition term termsWithId processedPathConditionVertices)

let pathConditionRoot =
PathConditionVertex(
id = getFirstFreePathConditionVertexId (),
pathConditionVertexType = pathConditionVertexType.PathConditionRoot,
children = [| for p in pathCondition -> termsWithId.[p] |]
)

pathConditionDelta.Add pathConditionRoot
let children = [| for p in pathCondition -> termsWithId.[p] |]

State(
s.Id,
(uint <| s.CodeLocation.offset - currentBasicBlock.StartOffset + 1<byte_offset>)
* 1u<byte_offset>,
pathConditionRoot,
children,
s.VisitedAgainVertices,
s.VisitedNotCoveredVerticesInZone,
s.VisitedNotCoveredVerticesOutOfZone,
Expand Down
2 changes: 1 addition & 1 deletion VSharp.ML.GameServer/Messages.fs
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ type StateHistoryElem =
type State =
val Id: uint<stateId>
val Position: uint<byte_offset> // to basic block id
val PathCondition: PathConditionVertex
val PathCondition: uint<pathConditionVertexId> array
val VisitedAgainVertices: uint
val VisitedNotCoveredVerticesInZone: uint
val VisitedNotCoveredVerticesOutOfZone: uint
Expand Down
Loading