P4C
The P4 Compiler
Loading...
Searching...
No Matches
depth_first.h
1/*
2 * SPDX-FileCopyrightText: 2023 The P4 Language Consortium
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
7#ifndef BACKENDS_P4TOOLS_MODULES_TESTGEN_CORE_SYMBOLIC_EXECUTOR_DEPTH_FIRST_H_
8#define BACKENDS_P4TOOLS_MODULES_TESTGEN_CORE_SYMBOLIC_EXECUTOR_DEPTH_FIRST_H_
9
10#include <vector>
11
12#include "ir/solver.h"
13
14#include "backends/p4tools/modules/testgen/core/program_info.h"
15#include "backends/p4tools/modules/testgen/core/symbolic_executor/symbolic_executor.h"
16
17namespace P4::P4Tools::P4Testgen {
18
23class DepthFirstSearch : public SymbolicExecutor {
24 public:
28 void runImpl(const Callback &callBack, ExecutionStateReference executionState) override;
29
32
33 private:
35 // Each element on this vector represents a set of alternative choices that could have been
43 std::vector<Branch> unexploredBranches;
44
51 [[nodiscard]] std::optional<ExecutionStateReference> pickSuccessor(StepResult successors);
52};
53
54} // namespace P4::P4Tools::P4Testgen
55
56#endif /* BACKENDS_P4TOOLS_MODULES_TESTGEN_CORE_SYMBOLIC_EXECUTOR_DEPTH_FIRST_H_ */
Provides a higher-level interface for an SMT solver.
Definition solver.h:30
DepthFirstSearch(AbstractSolver &solver, const ProgramInfo &programInfo)
Constructor for this strategy, considering inheritance.
Definition depth_first.cpp:23
void runImpl(const Callback &callBack, ExecutionStateReference executionState) override
Definition depth_first.cpp:45
Stores target-specific information about a P4 program.
Definition core/program_info.h:27
const ProgramInfo & programInfo
Target-specific information about the P4 program.
Definition symbolic_executor.h:68
std::function< bool(const FinalState &)> Callback
Definition symbolic_executor.h:42
Definition phv/solver/action_constraint_solver.cpp:33