@@ -361,8 +361,12 @@ type internal AISearcher(oracle: Oracle, aiAgentTrainingMode: Option<AIAgentTrai
361361 let parentOf = Array.zeroCreate ( 2 * numOfParentOfEdges)
362362 let shapeOfHistory = [| 2 L; numOfHistoryEdges |]
363363 let historyIndex_vertexToState = Array.zeroCreate ( 2 * numOfHistoryEdges)
364- let shapeOfPcToState = [| 2 L; gameState.States.Length |]
365- let index_pcToState = Array.zeroCreate ( 2 * gameState.States.Length)
364+
365+ let pathConditionNum =
366+ gameState.States
367+ |> Array.sumBy( fun s -> s.PathCondition.Length)
368+ let shapeOfPcToState = [| 2 L; pathConditionNum |]
369+ let index_pcToState = Array.zeroCreate ( 2 * pathConditionNum)
366370
367371 let shapeOfHistoryAttributes =
368372 [| int64 numOfHistoryEdges; int64 numOfHistoryEdgeAttributes |]
@@ -381,15 +385,11 @@ type internal AISearcher(oracle: Oracle, aiAgentTrainingMode: Option<AIAgentTrai
381385 parentOf[ j] <- int64 stateIds[ state.Id]
382386 parentOf[ numOfParentOfEdges + j] <- int64 stateIds[ children])
383387
384- firstFreePositionInParentsOf <- firstFreePositionInParentsOf + state.Children.Length
385-
386- index_ pcToState.[ firstFreePositionInPcToState] <-
387- int64 pathConditionVerticesIds[ state.PathCondition.[ firstFreePositionInPcToState]]
388-
389- index_ pcToState.[ firstFreePositionInPcToState + gameState.States.Length] <-
390- int64 stateIds[ state.Id]
391-
392- firstFreePositionInPcToState <- firstFreePositionInPcToState + 1
388+ state.PathCondition
389+ |> Array.iteri ( fun i pcId ->
390+ let j = firstFreePositionInPcToState + i
391+ index_ pcToState[ j] <- int64 pathConditionVerticesIds[ pcId]
392+ index_ pcToState[ numOfParentOfEdges + j] <- int64 stateIds[ state.Id])
393393
394394 state.History
395395 |> Array.iteri ( fun i historyElem ->
0 commit comments