-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
131 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
.PHONY: test | ||
|
||
# Main | ||
SRC = unit_tests.cpp | ||
|
||
# Test source files | ||
SRC += temporal-logic/nnf.cpp \ | ||
# Empty last line | ||
|
||
INCLUDES= -I ../src/ -I . -I $(CPROVER_DIR)/unit -I $(CPROVER_DIR)/src | ||
|
||
CPROVER_DIR = ../lib/cbmc | ||
|
||
include $(CPROVER_DIR)/src/config.inc | ||
include $(CPROVER_DIR)/src/common | ||
|
||
CXXFLAGS += -D'LOCAL_IREP_IDS=<hw_cbmc_irep_ids.h>' | ||
|
||
OBJ += ../src/temporal-logic/temporal-logic$(LIBEXT) | ||
|
||
cprover.dir: | ||
$(MAKE) $(MAKEARGS) -C ../src | ||
|
||
CPROVER_LIBS = $(CPROVER_DIR)/src/util/util$(LIBEXT) \ | ||
$(CPROVER_DIR)/src/big-int/big-int$(LIBEXT) \ | ||
# Empty last line | ||
|
||
OBJ += $(CPROVER_LIBS) | ||
|
||
all: test | ||
|
||
test: unit_tests$(EXEEXT) | ||
./unit_tests$(EXEEXT) | ||
|
||
############################################################################### | ||
|
||
unit_tests$(EXEEXT): $(OBJ) | ||
$(LINKBIN) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/*******************************************************************\ | ||
Module: NNF Unit Tests | ||
Author: Daniel Kroening, Amazon, [email protected] | ||
\*******************************************************************/ | ||
|
||
#include <temporal-logic/ltl.h> | ||
#include <temporal-logic/nnf.h> | ||
#include <testing-utils/use_catch.h> | ||
|
||
SCENARIO("Generating NNF") | ||
{ | ||
GIVEN("A formula not in NNF") | ||
{ | ||
auto p = symbol_exprt{"p", bool_typet{}}; | ||
auto formula = not_exprt{G_exprt{p}}; | ||
REQUIRE(property_nnf(formula) == F_exprt{not_exprt{p}}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
/*******************************************************************\ | ||
Module: Unit Tests Main | ||
Author: Daniel Kroening, Amazon, [email protected] | ||
\*******************************************************************/ | ||
|
||
#define CATCH_CONFIG_MAIN | ||
#include <util/irep.h> | ||
|
||
#include <testing-utils/use_catch.h> | ||
|
||
// Debug printer for irept | ||
std::ostream &operator<<(std::ostream &os, const irept &value) | ||
{ | ||
os << value.pretty(); | ||
return os; | ||
} |