6 #include <gtest/gtest.h>
7 #include "knowrob/terms/ListTerm.h"
8 #include "knowrob/terms/String.h"
9 #include "knowrob/integration/python/utils.h"
14 :
Function(listFunctor(), elements) {
23 static std::shared_ptr<ListTerm> x(
new ListTerm(
24 std::vector<std::shared_ptr<Term>>(0)));
34 for (uint32_t i = 0; i <
arguments_.size(); i++) {
47 class_<ListTerm, std::shared_ptr<ListTerm>, bases<Function>>
48 (
"ListTerm", init<const std::vector<TermPtr> &>())
61 EXPECT_TRUE(
ListTerm({}).elements().empty());
68 auto x = std::make_shared<String>(
"x");
69 auto y = std::make_shared<String>(
"y");
70 EXPECT_TRUE(
ListTerm({x}).isGround());
71 EXPECT_FALSE(
ListTerm({x}).isAtomic());
72 EXPECT_FALSE(
ListTerm({x}).elements().empty());
73 EXPECT_EQ(
ListTerm({x, y}).elements()[0], x);
74 EXPECT_EQ(
ListTerm({x, y}).elements()[1], y);
static std::shared_ptr< knowrob::Atom > Tabled(std::string_view stringForm)
const std::vector< TermPtr > arguments_
ListTerm(const std::vector< TermPtr > &elements)
void write(std::ostream &os) const override
static std::shared_ptr< ListTerm > nil()
static const AtomPtr & listFunctor()
void createType< ListTerm >()
std::shared_ptr< Atom > AtomPtr