Closed crowlogic closed 5 months ago
decompiled code
package arb.functions.real;
import arb.Integer;
import arb.Real;
import arb.functions.Function;
public class factorℝ1 implements
Function<Integer, Real>
{
private boolean isInitialized;
Integer c1;
public Real z;
public Integer p;
public Integer q;
public Real α;
public Real β;
public Integer N;
public Integer ℤ1;
public Real valueℝ2;
public Integer k;
public Real aℝ1;
public Integer endIndexℤ1;
public Real ℝ1;
public Integer ℤ2;
public Real ℝ2;
public Real ℝ3;
public Real valueℝ3;
public Real aℝ2;
public Integer endIndexℤ2;
public final factorℝ2 factorℝ2 = new factorℝ2();
public final factorℝ3 factorℝ3 = new factorℝ3();
public Real evaluate(Integer in, int order, int bits, Real result)
{
if (!isInitialized)
{
initialize();
}
Integer var10000 = z.pow(in, bits, ℤ1);
factorℝ2.n = in;
aℝ1.multiplicativeIdentity();
k.set(c1);
endIndexℤ1.set(p);
do
{
aℝ1.mul(factorℝ2.evaluate(k, bits, valueℝ2), bits);
}
while (k.increment().compareTo(endIndexℤ1) <= 0);
var10000.mul(aℝ1, bits, ℝ1);
Real var10001 = result.div(in.factorial(bits, ℤ2).set(ℝ2), bits, ℝ3);
factorℝ3.n = in;
aℝ2.multiplicativeIdentity();
k.set(c1);
endIndexℤ2.set(q);
do
{
aℝ2.mul(factorℝ3.evaluate(k, bits, valueℝ3), bits);
}
while (k.increment().compareTo(endIndexℤ2) <= 0);
return var10001.mul(aℝ2, bits, result);
}
public factorℝ1()
{
c1 = new Integer("1");
ℤ1 = new Integer();
valueℝ2 = new Real();
k = new Integer();
aℝ1 = new Real();
endIndexℤ1 = new Integer();
ℝ1 = new Real();
ℤ2 = new Integer();
ℝ2 = new Real();
ℝ3 = new Real();
valueℝ3 = new Real();
aℝ2 = new Real();
endIndexℤ2 = new Integer();
}
public void initialize()
{
if (isInitialized)
{
throw new AssertionError("Already initialized");
}
else if (p == null)
{
throw new AssertionError("p is null");
}
else if (q == null)
{
throw new AssertionError("q is null");
}
else
{
factorℝ2.p = p;
factorℝ2.q = q;
factorℝ2.α = α;
factorℝ2.β = β;
factorℝ2.N = N;
factorℝ3.p = p;
factorℝ3.q = q;
factorℝ3.α = α;
factorℝ3.β = β;
factorℝ3.N = N;
isInitialized = true;
}
}
public void close()
{
c1.close();
ℤ1.close();
valueℝ2.close();
k.close();
aℝ1.close();
endIndexℤ1.close();
ℝ1.close();
ℤ2.close();
ℝ2.close();
ℝ3.close();
valueℝ3.close();
aℝ2.close();
endIndexℤ2.close();
}
}```
the crux being
Description Resource Path Location Type
The method pow(Integer, int, Real) in the type Real is not applicable for the arguments (Integer, int, Integer) factorℝ1.java /arb4j/src/main/java/arb/functions/real line 40 Java Problem
The method set(String) in the type Integer is not applicable for the arguments (Real) factorℝ1.java /arb4j/src/main/java/arb/functions/real line 53 Java Problem
Generating z➔Σn➔z^n*∏k➔α[k]₍ₙ₎{k=1…p}/n!*∏k➔β[k]₍ₙ₎{k=1…q}{n=0…N}
class arb.expressions.nodes.nary.Sum.assignFieldNames(resultType=class arb.Real) factorFunctionFieldName=factorℝ1 factorValueFieldName=valueℝ1
Sum: generateFactorClass( expr=n➔z^n*∏k➔α[k]₍ₙ₎{k=1…p}/n!*∏k➔β[k]₍ₙ₎{k=1…q},resultType=class arb.Real)
Generating n➔z^n*∏k➔α[k]₍ₙ₎{k=1…p}/n!*∏k➔β[k]₍ₙ₎{k=1…q}
BinaryOperation.generate( this=BinaryOperation[left=\frac{{{z}^{n}} \cdot {\prod_{k = 1}^{p}{α[k]₍ₙ₎}}}{(n)!}, right=\prod_{k = 1}^{q}{β[k]₍ₙ₎}, operation=mul, generatedType=null], resultType=class arb.Real, left.type=class arb.Real, right.type=class arb.Real )
BinaryOperation.generate( this=BinaryOperation[left={{z}^{n}} \cdot {\prod_{k = 1}^{p}{α[k]₍ₙ₎}}, right=(n)!, operation=div, generatedType=null], resultType=class arb.Real, left.type=class arb.Real, right.type=class arb.Integer )
BinaryOperation.generate( this=BinaryOperation[left={z}^{n}, right=\prod_{k = 1}^{p}{α[k]₍ₙ₎}, operation=mul, generatedType=null], resultType=class arb.Real, left.type=class arb.Integer, right.type=class arb.Real )
BinaryOperation.generate( this=BinaryOperation[left=z, right=n, operation=pow, generatedType=null], resultType=class arb.Integer, left.type=class arb.Integer, right.type=class arb.Integer )
class arb.expressions.nodes.nary.Product.assignFieldNames(resultType=class arb.Real) factorFunctionFieldName=factorℝ2 factorValueFieldName=valueℝ2
Product: generateFactorClass( expr=k➔α[k]₍ₙ₎,resultType=class arb.Real)
Generating k➔α[k]₍ₙ₎
BinaryOperation.generate( this=BinaryOperation[left=α_{k}, right=n, operation=risingFactorial, generatedType=null], resultType=class arb.Real, left.type=class arb.Real, right.type=class arb.Integer )
FunctionCall.generate: this=FunctionCall[name=factorial, arg=n, targetResultType=arb.Real] resultType=class arb.Integer
class arb.expressions.nodes.nary.Product.assignFieldNames(resultType=class arb.Real) factorFunctionFieldName=factorℝ3 factorValueFieldName=valueℝ3
Product: generateFactorClass( expr=k➔β[k]₍ₙ₎,resultType=class arb.Real)
Generating k➔β[k]₍ₙ₎
BinaryOperation.generate( this=BinaryOperation[left=β_{k}, right=n, operation=risingFactorial, generatedType=null], resultType=class arb.Real, left.type=class arb.Real, right.type=class arb.Integer )
Exception in thread "main" java.lang.VerifyError: Bad type on operand stack
Exception Details:
Location:
factorℝ1.evaluate(Ljava/lang/Object;IILjava/lang/Object;)Ljava/lang/Object; @150: invokevirtual
Reason:
Type 'arb/Real' (current frame, stack[3]) is not assignable to 'arb/Integer'
Current Frame:
bci: @150
flags: { }
locals: { 'factorℝ1', 'java/lang/Object', integer, integer, 'java/lang/Object' }
stack: { 'arb/Real', 'java/lang/Object', 'arb/Integer', 'arb/Real' }
Description Resource Path Location Type
The method set(String) in the type Integer is not applicable for the arguments (Real) nzToThePowerOfnTimesProdkαknk1pDividedBynBangTimesProdkβknk1q.java /arb4j/src/main/java/arb/functions/real line 52 Java Problem
the wacked out line is
Real var10001 = result.div(in.factorial(bits, ℤ1).set(ℝ3), bits, ℝ4);
package arb.functions.real;
import arb.Integer;
import arb.Real;
import arb.functions.Function;
public class nzToThePowerOfnTimesProdkαknk1pDividedBynBangTimesProdkβknk1q implements
Function<Integer, Real>
{
private boolean isInitialized;
Integer c1;
public Integer p;
public Integer q;
public Real α;
public Real β;
public Real z;
public Real ℝ1;
public Real valueℝ1;
public Integer k;
public Real prodℝ1;
public Integer endIndexℤ1;
public Real ℝ2;
public Integer ℤ1;
public Real ℝ3;
public Real ℝ4;
public Real valueℝ2;
public Real prodℝ2;
public Integer endIndexℤ2;
public final factorℝ2 factorℝ2 = new factorℝ2();
public final factorℝ1 factorℝ1 = new factorℝ1();
public Real evaluate(Integer in, int order, int bits, Real result)
{
if (!isInitialized)
{
initialize();
}
Real var10000 = z.pow(in, bits, ℝ1);
factorℝ1.n = in;
prodℝ1.multiplicativeIdentity();
k.set(c1);
endIndexℤ1.set(p);
do
{
prodℝ1.mul(factorℝ1.evaluate(k, bits, valueℝ1), bits);
}
while (k.increment().compareTo(endIndexℤ1) <= 0);
var10000.mul(prodℝ1, bits, ℝ2);
Real var10001 = result.div(in.factorial(bits, ℤ1).set(ℝ3), bits, ℝ4);
factorℝ2.n = in;
prodℝ2.multiplicativeIdentity();
k.set(c1);
endIndexℤ2.set(q);
do
{
prodℝ2.mul(factorℝ2.evaluate(k, bits, valueℝ2), bits);
}
while (k.increment().compareTo(endIndexℤ2) <= 0);
return var10001.mul(prodℝ2, bits, result);
}
public nzToThePowerOfnTimesProdkαknk1pDividedBynBangTimesProdkβknk1q()
{
c1 = new Integer("1");
ℝ1 = new Real();
valueℝ1 = new Real();
k = new Integer();
prodℝ1 = new Real();
endIndexℤ1 = new Integer();
ℝ2 = new Real();
ℤ1 = new Integer();
ℝ3 = new Real();
ℝ4 = new Real();
valueℝ2 = new Real();
prodℝ2 = new Real();
endIndexℤ2 = new Integer();
}
public void initialize()
{
if (isInitialized)
{
throw new AssertionError("Already initialized");
}
else if (p == null)
{
throw new AssertionError("p is null");
}
else if (q == null)
{
throw new AssertionError("q is null");
}
else if (z == null)
{
throw new AssertionError("z is null");
}
else
{
factorℝ2.p = p;
factorℝ2.q = q;
factorℝ2.α = α;
factorℝ2.β = β;
factorℝ2.z = z;
factorℝ1.p = p;
factorℝ1.q = q;
factorℝ1.α = α;
factorℝ1.β = β;
factorℝ1.z = z;
isInitialized = true;
}
}
public void close()
{
c1.close();
ℝ1.close();
valueℝ1.close();
k.close();
prodℝ1.close();
endIndexℤ1.close();
ℝ2.close();
ℤ1.close();
ℝ3.close();
ℝ4.close();
valueℝ2.close();
prodℝ2.close();
endIndexℤ2.close();
}
}```
it might be incorrectly being identified as an indeterminate rather than an independent variable.. heres the debug output that generated the above code
Generating n➔z^n*∏k➔α[k]₍ₙ₎{k=1…p}/n!*∏k➔β[k]₍ₙ₎{k=1…q}
BinaryOperation.generate( this=BinaryOperation[left=\frac{{{z}^{n}} \cdot {\mul_{k = 1}^{p}{α[k]₍ₙ₎}}}{(n)!}, right=\mul_{k = 1}^{q}{β[k]₍ₙ₎}, operation=mul, generatedType=null], resultType=class arb.Real, left.type=class arb.Real, right.type=class arb.Real )
BinaryOperation.generate( this=BinaryOperation[left={{z}^{n}} \cdot {\mul_{k = 1}^{p}{α[k]₍ₙ₎}}, right=(n)!, operation=div, generatedType=null], resultType=class arb.Real, left.type=class arb.Real, right.type=class arb.Integer )
BinaryOperation.generate( this=BinaryOperation[left={z}^{n}, right=\mul_{k = 1}^{p}{α[k]₍ₙ₎}, operation=mul, generatedType=null], resultType=class arb.Real, left.type=class arb.Real, right.type=class arb.Real )
BinaryOperation.generate( this=BinaryOperation[left=z, right=n, operation=pow, generatedType=null], resultType=class arb.Real, left.type=class arb.Real, right.type=class arb.Integer )
Product.assignFieldNames(resultType=class arb.Real) factorFunctionFieldName=factorℝ1 factorValueFieldName=valueℝ1
Product: generateFactorClass( expr=k➔α[k]₍ₙ₎,resultType=class arb.Real)
Generating k➔α[k]₍ₙ₎
BinaryOperation.generate( this=BinaryOperation[left=α_{k}, right=n, operation=risingFactorial, generatedType=null], resultType=class arb.Real, left.type=class arb.Real, right.type=class arb.Integer )
FunctionCall.generate: this=FunctionCall[name=factorial, arg=n, targetResultType=arb.Real] resultType=class arb.Integer
Product.assignFieldNames(resultType=class arb.Real) factorFunctionFieldName=factorℝ2 factorValueFieldName=valueℝ2
Product: generateFactorClass( expr=k➔β[k]₍ₙ₎,resultType=class arb.Real)
Generating k➔β[k]₍ₙ₎
BinaryOperation.generate( this=BinaryOperation[left=β_{k}, right=n, operation=risingFactorial, generatedType=null], resultType=class arb.Real, left.type=class arb.Real, right.type=class arb.Integer )
this is the line that needs to be fixed
FunctionCall.generate: this=FunctionCall[name=factorial, arg=n, targetResultType=arb.Real] resultType=class arb.Integer
java.lang.AssertionError: generatedType=class arb.Real != resultType = class arb.Integer
at arb4j/arb.expressions.nodes.unary.FunctionCall.generate(FunctionCall.java:119)
at arb4j/arb.expressions.nodes.binary.BinaryOperation.generate(BinaryOperation.java:115)
at arb4j/arb.expressions.nodes.binary.BinaryOperation.generate(BinaryOperation.java:114)
at arb4j/arb.expressions.Expression.generateEvaluationMethod(Expression.java:998)
at arb4j/arb.expressions.Expression.compile(Expression.java:758)
at arb4j/arb.expressions.Compiler.express(Compiler.java:143)
at arb4j/arb.expressions.Compiler.express(Compiler.java:156)
at arb4j/arb.expressions.Compiler.express(Compiler.java:109)
at arb4j/arb.expressions.Expression.instantiate(Expression.java:150)
at arb4j/arb.functions.Function.express(Function.java:161)
at arb4j/arb.functions.polynomials.HypergeometricPolynomialTest.testSummand(HypergeometricPolynomialTest.java:29)
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
at java.base/java.lang.reflect.Method.invoke(Method.java:580)
at junit@4.13.2/junit.framework.TestCase.runTest(TestCase.java:177)
at junit@4.13.2/junit.framework.TestCase.runBare(TestCase.java:142)
at junit@4.13.2/junit.framework.TestResult$1.protect(TestResult.java:122)
at junit@4.13.2/junit.framework.TestResult.runProtected(TestResult.java:142)
at junit@4.13.2/junit.framework.TestResult.run(TestResult.java:125)
at junit@4.13.2/junit.framework.TestCase.run(TestCase.java:130)
at junit@4.13.2/junit.framework.TestSuite.runTest(TestSuite.java:241)
at junit@4.13.2/junit.framework.TestSuite.run(TestSuite.java:236)
at junit@4.13.2/org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:90)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:93)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:40)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:529)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:756)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:452)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:210)
@Override
public MethodVisitor generate(MethodVisitor mv, Class<?> resultType)
{
if (expression.traceGenerator)
{
System.out.format("FunctionCall.generate: this=%s resultType=%s\n", this, resultType);
}
if (functionName.equals(expression.functionName))
{
contextual = true;
mapping = new FunctionMapping<>();
generatedType = resultType;
mapping.range = generatedType;
mapping.domain = getDomainType();
mapping.name = functionName;
expression.recursive = true;
}
if (contextual)
{
generateContextualFunctionCall(mv, resultType);
}
else
{
generateBuiltinFunctionCall(mv, resultType);
}
assert getGeneratedType().equals(resultType) : String.format("TODO: type conversion for output where generatedType=%s != resultType = %s\n",
getGeneratedType(),
resultType);
return mv;
}
in this case it should only have a default generated type of Real if the input to which it is applied results in a Real number OR the result of the operation can possibly generate a real number for at least one point in the input domain.. you get the idea
possibly due to the way N is an integer but perhaps that particular method used expects a generic R type which is the range of the expression which is RealPolynomial in this case