-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rewritten debugVar with a custom reifier
- Loading branch information
Yury Kamenev
committed
Apr 3, 2023
1 parent
1768656
commit e640074
Showing
2 changed files
with
24 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package org.klogic.core | ||
|
||
import org.junit.jupiter.api.Test | ||
import org.klogic.utils.terms.PeanoLogicNumber | ||
import org.klogic.utils.terms.PeanoLogicNumber.Companion.succ | ||
import org.klogic.utils.terms.ZeroNaturalNumber.Z | ||
|
||
class ReifyTest { | ||
@Test | ||
fun testDebugVar() { | ||
// TODO test plus here. | ||
} | ||
|
||
// TODO rewrite using debugVar. | ||
private fun plus(x: Term<PeanoLogicNumber>, y: Term<PeanoLogicNumber>, z: Term<PeanoLogicNumber>): Goal = conde( | ||
(x `===` Z) and (z `===` y), | ||
freshTypedVars<PeanoLogicNumber, PeanoLogicNumber> { a, b -> | ||
(x `===` succ(a)) and (z `===` succ(b)) and plus(a, y, b) | ||
} | ||
) | ||
} |