Skip to content

Commit

Permalink
(codethorn) merge with dev branch
Browse files Browse the repository at this point in the history
CODETHORN-70
  • Loading branch information
mschordan committed Oct 11, 2022
2 parents 5d7f037 + b779ec9 commit 1268584
Show file tree
Hide file tree
Showing 18 changed files with 42 additions and 16 deletions.
6 changes: 3 additions & 3 deletions tools/CodeThorn/src/CodeThornCommandLineOptions.C
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
#include "sage3basic.h"
// required for checking of: HAVE_SPOT
#include "rose_config.h"

#include "CodeThornException.h"
#include "CodeThornCommandLineOptions.h"
#include "CppStdUtilities.h"
Expand All @@ -7,9 +10,6 @@
#include <sstream>
#include <iostream>

// required for checking of: HAVE_SPOT, HAVE_Z3
#include "rose_config.h"

#include "Rose/Diagnostics.h"
using namespace Sawyer::Message;
using namespace std;
Expand Down
1 change: 1 addition & 0 deletions tools/CodeThorn/src/LTLThornLib.C
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include "sage3basic.h"
#include "rose_config.h"

#include <string> // std::string, std::stoi
#include <regex>
Expand Down
2 changes: 2 additions & 0 deletions tools/CodeThorn/src/PropertyValueTable.C
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#include "sage3basic.h"

#include "PropertyValueTable.h"
#include "CodeThornException.h"
#include "Miscellaneous2.h"
Expand Down
6 changes: 3 additions & 3 deletions tools/CodeThorn/src/Thorn1CommandLineOptions.C
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
#include "sage3basic.h"
// required for checking of: HAVE_SPOT, HAVE_Z3
#include "rose_config.h"

#include "CodeThornException.h"
#include "CodeThornCommandLineOptions.h"
#include "CppStdUtilities.h"
Expand All @@ -7,9 +10,6 @@
#include <sstream>
#include <iostream>

// required for checking of: HAVE_SPOT, HAVE_Z3
#include "rose_config.h"

#include "Rose/Diagnostics.h"
using namespace Sawyer::Message;
using namespace std;
Expand Down
2 changes: 2 additions & 0 deletions tools/CodeThorn/src/ltlthorn-lib/CounterexampleAnalyzer.C
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
// Author: Marc Jasper, 2014, 2015.
#include "sage3basic.h"
#include "rose_config.h"

#ifdef HAVE_SPOT

Expand Down
18 changes: 9 additions & 9 deletions tools/CodeThorn/src/ltlthorn-lib/CounterexampleAnalyzer.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ namespace CodeThorn {
enum IoType {IO_TYPE_UNKNOWN,IO_TYPE_INPUT,IO_TYPE_OUTPUT,IO_TYPE_ERROR};

typedef std::pair<int, IoType> CeIoVal;
typedef std::pair<list<CeIoVal> , std::list<CeIoVal> > PrefixAndCycle;
typedef std::pair<std::list<CeIoVal> , std::list<CeIoVal> > PrefixAndCycle;
typedef std::list<std::unordered_set<EStatePtr> > StateSets;
typedef std::unordered_map<EStatePtr, list<int> > InputsAtEState;
typedef std::unordered_map<EStatePtr, std::list<int> > InputsAtEState;

/*!
* \author Marc Jasper
Expand Down Expand Up @@ -63,7 +63,7 @@ namespace CodeThorn {
public:
// initializing the CounterexampleAnalyzer, using "analyzer" to trace paths of the original program
CounterexampleAnalyzer(IOAnalyzer* analyzer);
CounterexampleAnalyzer(IOAnalyzer* analyzer, stringstream* csvOutput);
CounterexampleAnalyzer(IOAnalyzer* analyzer, std::stringstream* csvOutput);
// Check whether or not the "counterexample" is spurious.
// If "returnSpuriousLabel" is set to true: In the case of a spurious counterexample, the result includes a label that should not
// be reachable according to the original program but is reachable in the counterexample
Expand Down Expand Up @@ -108,29 +108,29 @@ namespace CodeThorn {
// marks index in "v" as true iff the entry in "erroneousBranches" that corresponds to "eState" containts (index+1) in its mapping.

//std::vector<bool> setErrorBranches(vector<bool> v, EStatePtr eState, InputsAtEState erroneousBranches);
std::vector<bool> setErrorBranches(vector<bool> v, EStatePtr eState);
std::list<pair<EStatePtr, int> > removeTraceLeadingToErrorState(EStatePtr errorState, TransitionGraph* stg);
std::vector<bool> setErrorBranches(std::vector<bool> v, EStatePtr eState);
std::list<std::pair<EStatePtr, int> > removeTraceLeadingToErrorState(EStatePtr errorState, TransitionGraph* stg);

// Adds all output states in the prefix to "startAndOuputStatesPrefix" and returns the set.
EStatePtrSet addAllPrefixOutputStates(EStatePtrSet& startAndOuputStatesPrefix, TransitionGraph* model);
// identify states needed to disconnect the concrete prefix and the over-approximated part in the initial abstract model
pair<EStatePtrSet, EStatePtrSet> getConcreteOutputAndAbstractInput(TransitionGraph* model);
std::pair<EStatePtrSet, EStatePtrSet> getConcreteOutputAndAbstractInput(TransitionGraph* model);
// sort the |<input_alphabet>| abstract input states according to their input value and insert them into the vector "v".
vector<EStatePtr> sortAbstractInputStates(vector<EStatePtr> v, EStatePtrSet abstractInputStates);
std::vector<EStatePtr> sortAbstractInputStates(std::vector<EStatePtr> v, EStatePtrSet abstractInputStates);
// deprecated: now implemented as function of EState ("isRersTopified(...)");
bool isPrefixState(EStatePtr state);
// prints #transitions, details about states and #counterexamples analyzed
void printStgSizeAndCeCount(TransitionGraph* model, int counterexampleCount, int property);

//for debugging purposes
std::string ceIoValToString(CeIoVal& ioVal);
std::string ioErrTraceToString(list<pair<int, IoType> > trace);
std::string ioErrTraceToString(std::list<std::pair<int, IoType> > trace);
void writeDotGraphToDisk(std::string filename, Visualizer& visualizer);

CodeThorn::VariableId globalVarIdByName(std::string);

IOAnalyzer* _analyzer;
stringstream* _csvOutput;
std::stringstream* _csvOutput;
int _maxCounterexamples;
InputsAtEState _erroneousBranches;
};
Expand Down
2 changes: 2 additions & 0 deletions tools/CodeThorn/src/ltlthorn-lib/ParProAutomata.C
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#include "sage3basic.h"
#include "rose_config.h"

#include "CodeThornCommandLineOptions.h"
#include "ParProAutomata.h"
#include "DotGraphCfgFrontend.h"
Expand Down
7 changes: 6 additions & 1 deletion tools/CodeThorn/src/ltlthorn-lib/ParProExplorer.C
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
// Author: Marc Jasper, 2016.

#include "sage3basic.h"
#include "rose_config.h"

#include "ParProExplorer.h"
#include "LtsminConnection.h"
#include "ParProAutomataGenerator.h"


using namespace CodeThorn;
using namespace std;

#ifdef HAVE_SPOT

#include "SpotState.h" // requires HAVE_SPOT to be defined

/*!
* \author Marc Jasper
* \date 2016.
Expand Down
1 change: 1 addition & 0 deletions tools/CodeThorn/src/ltlthorn-lib/ParProSpotState.C
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include "sage3basic.h"
#include "rose_config.h"
#ifdef HAVE_SPOT

#include "ParProSpotState.h"
Expand Down
1 change: 1 addition & 0 deletions tools/CodeThorn/src/ltlthorn-lib/ParProSpotSuccIter.C
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include "sage3basic.h"
#include "rose_config.h"
#ifdef HAVE_SPOT

#include "ParProSpotSuccIter.h"
Expand Down
1 change: 1 addition & 0 deletions tools/CodeThorn/src/ltlthorn-lib/ParProSpotTgba.C
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include "sage3basic.h"
#include "rose_config.h"
#ifdef HAVE_SPOT

#include "ParProSpotTgba.h"
Expand Down
2 changes: 2 additions & 0 deletions tools/CodeThorn/src/ltlthorn-lib/SpotConnection.C
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#include "sage3basic.h"
#include "rose_config.h"
#include "SpotConnection.h"

using namespace std;
using namespace CodeThorn;

Expand Down
1 change: 1 addition & 0 deletions tools/CodeThorn/src/ltlthorn-lib/SpotMiscellaneous.C
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include "sage3basic.h"
#include "rose_config.h"
#ifdef HAVE_SPOT

#include "SpotMiscellaneous.h"
Expand Down
1 change: 1 addition & 0 deletions tools/CodeThorn/src/ltlthorn-lib/SpotRenameVisitor.C
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include "sage3basic.h"
#include "rose_config.h"
#ifdef HAVE_SPOT

#include "SpotRenameVisitor.h"
Expand Down
1 change: 1 addition & 0 deletions tools/CodeThorn/src/ltlthorn-lib/SpotState.C
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include "sage3basic.h"
#include "rose_config.h"
#ifdef HAVE_SPOT

#include "SpotState.h"
Expand Down
1 change: 1 addition & 0 deletions tools/CodeThorn/src/ltlthorn-lib/SpotState.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

#ifdef HAVE_SPOT

#ifndef SPOT_STATE_H
Expand Down
3 changes: 3 additions & 0 deletions tools/CodeThorn/src/ltlthorn-lib/SpotSuccIter.C
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
#include "sage3basic.h"
// required for checking of: HAVE_SPOT
#include "rose_config.h"

#ifdef HAVE_SPOT

#include <list>
Expand Down
2 changes: 2 additions & 0 deletions tools/CodeThorn/src/ltlthorn-lib/SpotTgba.C
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#include "sage3basic.h"
// required for checking of: HAVE_SPOT
#include "rose_config.h"
#ifdef HAVE_SPOT

#include "SpotTgba.h"
Expand Down

0 comments on commit 1268584

Please sign in to comment.