Skip to content
Open
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
4 changes: 4 additions & 0 deletions Test/SyntaxSugar.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#include "Lib/Environment.hpp"
#include "Kernel/Inference.hpp"
#include "Kernel/Clause.hpp"
#include "Kernel/FormulaUnit.hpp"
#include "Kernel/SortHelper.hpp"
#include "Kernel/NumTraits.hpp"
#include "Kernel/ApplicativeHelper.hpp"
Expand Down Expand Up @@ -720,6 +721,9 @@ inline Stack<Clause*> clauses(std::initializer_list<std::initializer_list<Lit>>
return out;
}

inline FormulaUnit* formula(Lit lit)
{ return new FormulaUnit(new AtomicFormula(lit), Inference(Kernel::NonspecificInference0(UnitInputType::ASSUMPTION, InferenceRule::INPUT))); }

inline void createTermAlgebra(SortSugar sort, std::initializer_list<FuncSugar> fs) {
// avoid redeclaration
if (env.signature->isTermAlgebraSort(sort.sugaredExpr())) {
Expand Down
38 changes: 38 additions & 0 deletions UnitTests/tProperty.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/*
* This file is part of the source code of the software program
* Vampire. It is protected by applicable
* copyright laws.
*
* This source code is distributed under the licence found here
* https://vprover.github.io/license.html
* and in the source directory
*/

#include "Test/UnitTesting.hpp"
#include "Test/SyntaxSugar.hpp"

#include "Shell/Property.hpp"

using namespace Shell;

/**
* NECESSARY: We need to tell the tester which syntax sugar to import for creating terms & clauses.
* See Test/SyntaxSugar.hpp for which kinds of syntax sugar are available
*/
#define MY_SYNTAX_SUGAR \
DECL_DEFAULT_VARS \
DECL_SORT(s) \
DECL_FUNC(f, {s}, s) \
DECL_CONST(c, s) \
DECL_PRED(p, {s}) \

TEST_FUN(test01) {
__ALLOW_UNUSED(MY_SYNTAX_SUGAR);

auto units = UnitList::empty();
UnitList::push(clause({ f(c) == c, ~p(x) }), units);
UnitList::push(formula(f(c) != c), units);

auto prop = Property::scan(units);
ASS_EQ(prop->category(), Property::NEQ);
}
1 change: 1 addition & 0 deletions cmake/sources.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ set(UNIT_TESTS
UnitTests/tList.cpp
UnitTests/tOption.cpp
UnitTests/tOptionConstraints.cpp
UnitTests/tProperty.cpp
UnitTests/tPushUnaryMinus.cpp
UnitTests/tQKbo.cpp
UnitTests/tQuotientE.cpp
Expand Down
Loading