P4C
The P4 Compiler
Loading...
Searching...
No Matches
selected_branches.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_SELECTED_BRANCHES_H_
8#define BACKENDS_P4TOOLS_MODULES_TESTGEN_CORE_SYMBOLIC_EXECUTOR_SELECTED_BRANCHES_H_
9
10#include <cstdint>
11#include <list>
12#include <string>
13#include <vector>
14
15#include "ir/solver.h"
16
17#include "backends/p4tools/modules/testgen/core/program_info.h"
18#include "backends/p4tools/modules/testgen/core/symbolic_executor/symbolic_executor.h"
19#include "backends/p4tools/modules/testgen/lib/execution_state.h"
20
21namespace P4::P4Tools::P4Testgen {
22
24class SelectedBranches : public SymbolicExecutor {
25 public:
29 void runImpl(const Callback &callBack, ExecutionStateReference executionState) override;
30
33 std::string selectedBranchesStr);
34
35 private:
39 ExecutionState *chooseBranch(const std::vector<Branch> &branches, uint64_t nextBranch);
40
42 std::list<uint64_t> selectedBranches;
43};
44
45} // namespace P4::P4Tools::P4Testgen
46
47#endif /* BACKENDS_P4TOOLS_MODULES_TESTGEN_CORE_SYMBOLIC_EXECUTOR_SELECTED_BRANCHES_H_ */
Provides a higher-level interface for an SMT solver.
Definition solver.h:30
Represents state of execution after having reached a program point.
Definition execution_state.h:40
Stores target-specific information about a P4 program.
Definition core/program_info.h:27
SelectedBranches(AbstractSolver &solver, const ProgramInfo &programInfo, std::string selectedBranchesStr)
Constructor for this strategy, considering inheritance.
Definition selected_branches.cpp:83
void runImpl(const Callback &callBack, ExecutionStateReference executionState) override
Definition selected_branches.cpp:23
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