chore: Naming conventions
This commit is contained in:
parent
4a6850527f
commit
bd5c825ca2
8 changed files with 8 additions and 10 deletions
|
@ -9,7 +9,7 @@ import kotlin.test.assertEquals
|
||||||
*
|
*
|
||||||
* These tests are based on the Prolog syntax.
|
* These tests are based on the Prolog syntax.
|
||||||
*/
|
*/
|
||||||
class LexerScanPrologTest {
|
class ScanPrologTests {
|
||||||
@Test
|
@Test
|
||||||
fun scan_simple_atom() {
|
fun scan_simple_atom() {
|
||||||
val tokens = Lexer("atom.").scan()
|
val tokens = Lexer("atom.").scan()
|
|
@ -4,7 +4,7 @@ import org.junit.jupiter.api.Test
|
||||||
import org.junit.jupiter.api.assertThrows
|
import org.junit.jupiter.api.assertThrows
|
||||||
import org.junit.jupiter.api.Assertions.*
|
import org.junit.jupiter.api.Assertions.*
|
||||||
|
|
||||||
class LexerScanTest {
|
class ScanTests {
|
||||||
@Test
|
@Test
|
||||||
fun scan_emptyString_returns_EOF() {
|
fun scan_emptyString_returns_EOF() {
|
||||||
val tokens = Lexer("").scan()
|
val tokens = Lexer("").scan()
|
|
@ -13,7 +13,7 @@ import prolog.ast.terms.Atom
|
||||||
import prolog.ast.terms.Structure
|
import prolog.ast.terms.Structure
|
||||||
import prolog.ast.terms.Variable
|
import prolog.ast.terms.Variable
|
||||||
|
|
||||||
class EvaluationTest {
|
class EvaluationTests {
|
||||||
@BeforeEach
|
@BeforeEach
|
||||||
fun setUp() {
|
fun setUp() {
|
||||||
Program.clear()
|
Program.clear()
|
|
@ -7,6 +7,7 @@ import prolog.ast.terms.Atom
|
||||||
import prolog.ast.terms.Structure
|
import prolog.ast.terms.Structure
|
||||||
import prolog.logic.atomic
|
import prolog.logic.atomic
|
||||||
import prolog.logic.compound
|
import prolog.logic.compound
|
||||||
|
import prolog.logic.functor
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Based on [Predicates for analyzing/constructing terms](https://github.com/dtonhofer/prolog_notes/blob/master/swipl_notes/about_term_analysis_and_construction/term_analysis_construction.png)
|
* Based on [Predicates for analyzing/constructing terms](https://github.com/dtonhofer/prolog_notes/blob/master/swipl_notes/about_term_analysis_and_construction/term_analysis_construction.png)
|
||||||
|
|
|
@ -6,7 +6,7 @@ import prolog.ast.terms.Atom
|
||||||
import prolog.ast.arithmetic.Integer
|
import prolog.ast.arithmetic.Integer
|
||||||
import prolog.ast.terms.Variable
|
import prolog.ast.terms.Variable
|
||||||
|
|
||||||
class UnificationTest {
|
class UnificationOperatorsTests {
|
||||||
/**
|
/**
|
||||||
* ?- X == a.
|
* ?- X == a.
|
||||||
* false.
|
* false.
|
|
@ -13,7 +13,7 @@ import prolog.builtins.Add
|
||||||
/*
|
/*
|
||||||
* Based on: https://en.wikipedia.org/wiki/Unification_%28computer_science%29#Examples_of_syntactic_unification_of_first-order_terms
|
* Based on: https://en.wikipedia.org/wiki/Unification_%28computer_science%29#Examples_of_syntactic_unification_of_first-order_terms
|
||||||
*/
|
*/
|
||||||
class UnifyTest {
|
class UnifyTests {
|
||||||
@Test
|
@Test
|
||||||
fun identical_atoms_unify() {
|
fun identical_atoms_unify() {
|
||||||
val atom1 = Atom("a")
|
val atom1 = Atom("a")
|
|
@ -1,4 +1,4 @@
|
||||||
package prolog.builtins
|
package prolog.logic
|
||||||
|
|
||||||
import org.junit.jupiter.api.Assertions.assertFalse
|
import org.junit.jupiter.api.Assertions.assertFalse
|
||||||
import org.junit.jupiter.api.Assertions.assertTrue
|
import org.junit.jupiter.api.Assertions.assertTrue
|
||||||
|
@ -7,11 +7,8 @@ import prolog.Substitutions
|
||||||
import prolog.ast.terms.Atom
|
import prolog.ast.terms.Atom
|
||||||
import prolog.ast.terms.Structure
|
import prolog.ast.terms.Structure
|
||||||
import prolog.ast.terms.Variable
|
import prolog.ast.terms.Variable
|
||||||
import prolog.logic.compound
|
|
||||||
import prolog.logic.nonvariable
|
|
||||||
import prolog.logic.variable
|
|
||||||
|
|
||||||
class VerificationTest {
|
class VerificationTests {
|
||||||
@Test
|
@Test
|
||||||
fun unbound_variable_is_var() {
|
fun unbound_variable_is_var() {
|
||||||
val variable = Variable("X")
|
val variable = Variable("X")
|
Reference in a new issue