File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2727#include " Kernel/Inference.hpp"
2828#include " Kernel/Clause.hpp"
2929#include " Kernel/HOL/HOL.hpp"
30+ #include " Kernel/FormulaUnit.hpp"
3031#include " Kernel/SortHelper.hpp"
3132#include " Kernel/NumTraits.hpp"
3233#include " Kernel/TypedTermList.hpp"
@@ -713,9 +714,20 @@ inline Clause* clause(Stack<Lit> ls, Inference inf) {
713714inline Clause* clause (Stack<Lit> ls)
714715{ return clause (ls, Inference (Kernel::NonspecificInference0 (UnitInputType::ASSUMPTION, InferenceRule::INPUT))); }
715716
716- inline Clause* clause (std::initializer_list<Lit> ls)
717+ inline Clause* clause (std::initializer_list<Lit> ls)
717718{ return clause (Stack<Lit>(ls)); }
718719
720+ inline Stack<Clause*> clauses (std::initializer_list<std::initializer_list<Lit>> cls) {
721+ auto out = Stack<Clause*>();
722+ for (auto cl : cls) {
723+ out.push (clause (cl));
724+ }
725+ return out;
726+ }
727+
728+ inline FormulaUnit* formula (Lit lit)
729+ { return new FormulaUnit (new AtomicFormula (lit), Inference (Kernel::NonspecificInference0 (UnitInputType::ASSUMPTION, InferenceRule::INPUT))); }
730+
719731inline void createTermAlgebra (SortSugar sort, std::initializer_list<FuncSugar> fs) {
720732 // avoid redeclaration
721733 if (env.signature ->isTermAlgebraSort (sort.sugaredExpr ())) {
Original file line number Diff line number Diff line change 1+ /*
2+ * This file is part of the source code of the software program
3+ * Vampire. It is protected by applicable
4+ * copyright laws.
5+ *
6+ * This source code is distributed under the licence found here
7+ * https://vprover.github.io/license.html
8+ * and in the source directory
9+ */
10+
11+ #include " Test/UnitTesting.hpp"
12+ #include " Test/SyntaxSugar.hpp"
13+
14+ #include " Shell/Property.hpp"
15+
16+ using namespace Shell ;
17+
18+ /* *
19+ * NECESSARY: We need to tell the tester which syntax sugar to import for creating terms & clauses.
20+ * See Test/SyntaxSugar.hpp for which kinds of syntax sugar are available
21+ */
22+ #define MY_SYNTAX_SUGAR \
23+ DECL_DEFAULT_VARS \
24+ DECL_SORT (s) \
25+ DECL_FUNC(f, {s}, s) \
26+ DECL_CONST(c, s) \
27+ DECL_PRED(p, {s}) \
28+
29+ TEST_FUN(test01) {
30+ __ALLOW_UNUSED (MY_SYNTAX_SUGAR);
31+
32+ auto units = UnitList::empty ();
33+ UnitList::push (clause ({ f (c) == c, ~p (x) }), units);
34+ UnitList::push (formula (f (c) != c), units);
35+
36+ auto prop = Property::scan (units);
37+ ASS_EQ (prop->category (), Property::NEQ);
38+ }
Original file line number Diff line number Diff line change @@ -82,6 +82,7 @@ set(UNIT_TESTS
8282 UnitTests/tList.cpp
8383 UnitTests/tOption.cpp
8484 UnitTests/tOptionConstraints.cpp
85+ UnitTests/tProperty.cpp
8586 UnitTests/tQKbo.cpp
8687 UnitTests/tQuotientE.cpp
8788 UnitTests/tRebalance.cpp
You can’t perform that action at this time.
0 commit comments