Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Classifications of error on TP and FP #170

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all 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: 2 additions & 0 deletions include/klee/Core/TerminationTypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ enum class StateTerminationType : std::uint8_t {
/// \endcond
};

enum StateTerminationConfidenceCategory { CONFIDENT, PROBABLY };

namespace HaltExecution {
enum Reason {
NotHalt = 0,
Expand Down
17 changes: 12 additions & 5 deletions lib/Core/CodeEvent.h
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,10 @@ struct ErrorEvent : public CodeEvent {
/// @brief ID for this error.
const StateTerminationType ruleID;

/// @brief Confidence of this error: may be considered
/// as a flag of `true positive` error for instance.
const StateTerminationConfidenceCategory confidence;

/// @brief Message describing this error.
const std::string message;

Expand All @@ -161,14 +165,17 @@ struct ErrorEvent : public CodeEvent {
const std::optional<ref<CodeEvent>> source;

ErrorEvent(const ref<CodeEvent> &source, const ref<CodeLocation> &sink,
StateTerminationType ruleID, const std::string &message)
: CodeEvent(EventKind::ERR, sink), ruleID(ruleID), message(message),
source(source) {}
StateTerminationType ruleID,
StateTerminationConfidenceCategory confidence,
const std::string &message)
: CodeEvent(EventKind::ERR, sink), ruleID(ruleID), confidence(confidence),
message(message), source(source) {}

ErrorEvent(const ref<CodeLocation> &sink, StateTerminationType ruleID,
StateTerminationConfidenceCategory confidence,
const std::string &message)
: CodeEvent(EventKind::ERR, sink), ruleID(ruleID), message(message),
source(std::nullopt) {}
: CodeEvent(EventKind::ERR, sink), ruleID(ruleID), confidence(confidence),
message(message), source(std::nullopt) {}

std::string description() const override { return message; }

Expand Down
4 changes: 3 additions & 1 deletion lib/Core/ExecutionState.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,9 @@ ExecutionState::~ExecutionState() {
ExecutionState::ExecutionState(const ExecutionState &state)
: initPC(state.initPC), pc(state.pc), prevPC(state.prevPC),
stack(state.stack), stackBalance(state.stackBalance),
incomingBBIndex(state.incomingBBIndex), depth(state.depth),
incomingBBIndex(state.incomingBBIndex),
lastBrConfidently(state.lastBrConfidently),
nullPointerMarkers(state.nullPointerMarkers), depth(state.depth),
level(state.level), addressSpace(state.addressSpace),
constraints(state.constraints), eventsRecorder(state.eventsRecorder),
targetForest(state.targetForest), pathOS(state.pathOS),
Expand Down
6 changes: 6 additions & 0 deletions lib/Core/ExecutionState.h
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,12 @@ class ExecutionState {

// Overall state of the state - Data specific

/// @brief: TODO:
bool lastBrConfidently = true;

/// @brief: TODO:
ImmutableList<ref<Expr>> nullPointerMarkers;

/// @brief Exploration depth, i.e., number of times KLEE branched for this
/// state
std::uint32_t depth = 0;
Expand Down
Loading
Loading