Checkpoint
This commit is contained in:
parent
23b2ce9362
commit
f9017da734
18 changed files with 814 additions and 412 deletions
17
src/prolog/ast/terms/AnonymousVariable.kt
Normal file
17
src/prolog/ast/terms/AnonymousVariable.kt
Normal file
|
@ -0,0 +1,17 @@
|
|||
package prolog.ast.terms
|
||||
|
||||
import io.Logger
|
||||
|
||||
class AnonymousVariable(id: Int) : Variable("_$id") {
|
||||
companion object {
|
||||
private var counter = 0
|
||||
fun create(): AnonymousVariable {
|
||||
val id = counter
|
||||
counter++
|
||||
Logger.debug("Creating anonymous variable: _${id}")
|
||||
return AnonymousVariable(id)
|
||||
}
|
||||
}
|
||||
|
||||
override fun toString(): String = "_"
|
||||
}
|
Reference in a new issue