Skip to content
Snippets Groups Projects
Commit 2b35cd58 authored by Katja Goltsova's avatar Katja Goltsova Committed by Viktor Kunčak
Browse files

Factor out common implicits and FOL values into test utils

parent e4ab8f41
No related branches found
No related tags found
4 merge requests!62Easy tactics,!58Easy tactics,!54Front integration,!53Front integration
......@@ -5,23 +5,7 @@ import lisa.kernel.proof.SequentCalculus.Sequent
import lisa.utils.Helpers.*
import org.scalatest.funsuite.AnyFunSuite
class ParserTest extends AnyFunSuite {
val (a, b, c) = (ConstantPredicateLabel("a", 0), ConstantPredicateLabel("b", 0), ConstantPredicateLabel("c", 0))
val (x, y, z) = (VariableLabel("x"), VariableLabel("y"), VariableLabel("z"))
val (x1, y1, z1) = (VariableLabel("x1"), VariableLabel("y1"), VariableLabel("z1"))
val (xPrime, yPrime, zPrime) = (VariableLabel("x'"), VariableLabel("y'"), VariableLabel("z'"))
val (cx, cy, cz) = (ConstantFunctionLabel("x", 0), ConstantFunctionLabel("y", 0), ConstantFunctionLabel("z", 0))
val (f0, f1, f2, f3) = (ConstantFunctionLabel("f", 0), ConstantFunctionLabel("f", 1), ConstantFunctionLabel("f", 2), ConstantFunctionLabel("f", 3))
val (sf1, sf2, sf3) = (SchematicFunctionLabel("f", 1), SchematicFunctionLabel("f", 2), SchematicFunctionLabel("f", 3))
val (sPhi1, sPhi2) = (SchematicNPredicateLabel("phi", 1), SchematicNPredicateLabel("phi", 2))
given Conversion[PredicateLabel, PredicateFormula] = PredicateFormula(_, Seq.empty)
given Conversion[ConstantFunctionLabel, FunctionTerm] = FunctionTerm(_, Seq())
given Conversion[VariableLabel, VariableTerm] = VariableTerm.apply
class ParserTest extends AnyFunSuite with TestUtils {
test("constant") {
assert(Parser.parseTerm("x") == FunctionTerm(cx, Seq()))
}
......
......@@ -7,13 +7,7 @@ import org.scalatest.funsuite.AnyFunSuite
import scala.language.adhocExtensions
class PrinterTest extends AnyFunSuite {
val (a, b, c) = (ConstantPredicateLabel("a", 0), ConstantPredicateLabel("b", 0), ConstantPredicateLabel("c", 0))
val (x, y, z) = (VariableLabel("x"), VariableLabel("y"), VariableLabel("z"))
given Conversion[PredicateLabel, PredicateFormula] = PredicateFormula(_, Seq.empty)
given Conversion[VariableLabel, VariableTerm] = VariableTerm.apply
class PrinterTest extends AnyFunSuite with TestUtils {
test("Minimal parenthesization") {
assert(Parser.printFormula(ConnectorFormula(And, Seq(a, b))) == "a ∧ b")
......
package lisa.utils
import lisa.kernel.fol.FOL._
import lisa.utils.Helpers.*
trait TestUtils {
val (a, b, c) = (ConstantPredicateLabel("a", 0), ConstantPredicateLabel("b", 0), ConstantPredicateLabel("c", 0))
val (x, y, z) = (VariableLabel("x"), VariableLabel("y"), VariableLabel("z"))
val (x1, y1, z1) = (VariableLabel("x1"), VariableLabel("y1"), VariableLabel("z1"))
val (xPrime, yPrime, zPrime) = (VariableLabel("x'"), VariableLabel("y'"), VariableLabel("z'"))
val (cx, cy, cz) = (ConstantFunctionLabel("x", 0), ConstantFunctionLabel("y", 0), ConstantFunctionLabel("z", 0))
val (f0, f1, f2, f3) = (ConstantFunctionLabel("f", 0), ConstantFunctionLabel("f", 1), ConstantFunctionLabel("f", 2), ConstantFunctionLabel("f", 3))
val (sf1, sf2, sf3) = (SchematicFunctionLabel("f", 1), SchematicFunctionLabel("f", 2), SchematicFunctionLabel("f", 3))
val (sPhi1, sPhi2) = (SchematicNPredicateLabel("phi", 1), SchematicNPredicateLabel("phi", 2))
given Conversion[PredicateLabel, PredicateFormula] = PredicateFormula(_, Seq.empty)
given Conversion[ConstantFunctionLabel, FunctionTerm] = FunctionTerm(_, Seq())
given Conversion[VariableLabel, VariableTerm] = VariableTerm.apply
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment