Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
pro
ndl
Commits
c4c8868a
Commit
c4c8868a
authored
Apr 22, 2018
by
Marcin Moskal
Browse files
Add ((1 x) (2 y) (x) (y 8)) test case
parent
3bf0fb3a
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/test/scala/pl/edu/agh/kis/eis/ndl/KnowledgeBaseSpec.scala
View file @
c4c8868a
...
...
@@ -126,6 +126,24 @@ class KnowledgeBaseSpec extends FlatSpec with Matchers {
kb
.
queryAll
(
Functor
(
x
),
Functor
(
x
,
Const
(
1
))).
toSeq
should
be
(
empty
)
}
"Query ((1 x) (2 y) (x) (y 8))"
should
"be unified"
in
{
val
kb
=
new
KnowledgeBase
[
Int
](
Set
(
Tuple1
(
2
),
Tuple1
(
3
),
Tuple1
(
4
),
(
1
,
3
),
(
2
,
5
),
Tuple1
(
4
),
(
2
,
2
),
(
2
,
8
),
(
7
,
8
),
Tuple1
(
7
),
(
1
,
4
),
(
1
,
8
)
))
val
x
=
Variable
[
Int
](
"x"
)
val
y
=
Variable
[
Int
](
"y"
)
kb
.
queryAll
(
Functor
(
x
),
Functor
(
Const
(
1
),
x
),
Functor
(
Const
(
2
),
y
),
Functor
(
y
,
Const
(
8
))
).
toSeq
should
contain
theSameElementsAs
Seq
(
Set
(
Variable
(
"x"
,
3
),
Variable
(
"y"
,
2
)),
Set
(
Variable
(
"x"
,
4
),
Variable
(
"y"
,
2
))
)
}
"Query ((x) (y) (x y))"
should
"be unified"
ignore
{
val
kb
:
KnowledgeBase
[
Int
]
=
new
KnowledgeBase
[
Int
](
Set
(
Tuple1
(
2
),
Tuple1
(
8
),
(
2
,
8
),
// solution: x = 2, y = 8
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment