Skip to content
Snippets Groups Projects
Commit 36aa36d6 authored by Ali Sinan Köksal's avatar Ali Sinan Köksal
Browse files

product methods do not need arity suffix in their name

parent d087bf60
No related branches found
No related tags found
No related merge requests found
...@@ -5,15 +5,18 @@ object Product { ...@@ -5,15 +5,18 @@ object Product {
def main(args: Array[String]): Unit = { def main(args: Array[String]): Unit = {
val c1 = ((x: Int) => x > 5).c val c1 = ((x: Int) => x > 5).c
val c2 = ((x: Int) => x > 41).c val c2 = ((x: Int) => x > 41).c
val c22 = ((x: Int, y: Int, z: Int) => x > y).c
val c3 = c1 product1 c2 val c3 = c1 product c2
val c32 = c1 product c22
val c4 = ((a: Boolean, b: Int) => a == b > 0).c val c4 = ((a: Boolean, b: Int) => a == b > 0).c
val c5 = ((i: Int, j: Int) => i > j).c val c5 = ((i: Int, j: Int) => i > j).c
val c6 = c4 product2 c5 val c6 = c4 product c5
println(c3.solve) println(c3.solve)
println(c32.solve)
println(c6.solve) println(c6.solve)
} }
} }
This diff is collapsed.
...@@ -98,11 +98,11 @@ object Utils { ...@@ -98,11 +98,11 @@ object Utils {
val scalaFunction = "(%s) => %s && %s" format (scalaFunctionParamsString, thisApplication, otherApplication) val scalaFunction = "(%s) => %s && %s" format (scalaFunctionParamsString, thisApplication, otherApplication)
val methodString = val methodString =
"""def product%d[%s](other: Term%d[%s])(implicit isBoolean: R =:= Boolean): Term%d[%s] = { """def product[%s](other: Term%d[%s])(implicit isBoolean: R =:= Boolean): Term%d[%s] = {
val (newExpr, newTypes) = Terms.product(this, other) val (newExpr, newTypes) = Terms.product(this, other)
Term%d(this.program, newExpr, if (this.scalaFunction == null || other.scalaFunction == null) null else %s, newTypes, this.converter, this.lVars ++ other.lVars) Term%d(this.program, newExpr, if (this.scalaFunction == null || other.scalaFunction == null) null else %s, newTypes, this.converter, this.lVars ++ other.lVars)
} }
""" format (otherArity, otherParamsString, otherArity, otherTermParamsString, productArity, resultTermParamsString, productArity, scalaFunction) """ format (otherParamsString, otherArity, otherTermParamsString, productArity, resultTermParamsString, productArity, scalaFunction)
methodString methodString
}).mkString("\n\n") }).mkString("\n\n")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment