Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NPE in typechecking #296

Open
marat-rkh opened this issue May 2, 2021 · 2 comments
Open

NPE in typechecking #296

marat-rkh opened this issue May 2, 2021 · 2 comments
Labels

Comments

@marat-rkh
Copy link
Member

I was writing a proof, and at some point plugin stoped showing goals although I had a hole:

Screen Shot 2021-05-02 at 2 34 40 PM

As you can see <-trans is shown as proven, but this is not true. The log have the following NPE:

2021-05-02 14:34:10,472 [68609791]   INFO - .deployment.AsyncDevicesGetter - adb not found 
2021-05-02 14:34:10,602 [68609921]  ERROR - pechecking.TypeCheckingService - null 
java.lang.NullPointerException
	at org.arend.core.definition.DataDefinition.getTypeWithParams(DataDefinition.java:217)
	at org.arend.typechecking.result.DefCallResult.makeTResult(DefCallResult.java:40)
	at org.arend.typechecking.visitor.CheckTypeVisitor.typeCheckDefCall(CheckTypeVisitor.java:1495)
	at org.arend.typechecking.visitor.CheckTypeVisitor.visitReference(CheckTypeVisitor.java:1532)
	at org.arend.typechecking.implicitargs.StdImplicitArgsInference.infer(StdImplicitArgsInference.java:274)
	at org.arend.typechecking.visitor.CheckTypeVisitor.visitApp(CheckTypeVisitor.java:2631)
	at org.arend.typechecking.visitor.CheckTypeVisitor.visitApp(CheckTypeVisitor.java:93)
	at org.arend.term.concrete.Concrete$AppExpression.accept(Concrete.java:392)
	at org.arend.typechecking.visitor.CheckTypeVisitor.checkType(CheckTypeVisitor.java:835)
	at org.arend.typechecking.visitor.CheckTypeVisitor.finalCheckType(CheckTypeVisitor.java:873)
	at org.arend.typechecking.visitor.DefinitionTypechecker.typecheckParameters(DefinitionTypechecker.java:484)
	at org.arend.typechecking.visitor.DefinitionTypechecker.typecheckConstructor(DefinitionTypechecker.java:1799)
	at org.arend.typechecking.visitor.DefinitionTypechecker.typecheckDataBody(DefinitionTypechecker.java:1510)
	at org.arend.typechecking.visitor.DefinitionTypechecker.visitData(DefinitionTypechecker.java:180)
	at org.arend.typechecking.visitor.DefinitionTypechecker.visitData(DefinitionTypechecker.java:66)
	at org.arend.term.concrete.Concrete$DataDefinition.accept(Concrete.java:2226)
	at org.arend.typechecking.order.listener.TypecheckingOrderingListener.unitFound(TypecheckingOrderingListener.java:221)
	at org.arend.typechecking.order.listener.CollectingOrderingListener$MyUnit.feedTo(CollectingOrderingListener.java:49)
	at org.arend.typechecking.order.listener.CollectingOrderingListener.feed(CollectingOrderingListener.java:142)
	at org.arend.typechecking.order.listener.TypecheckingOrderingListener.lambda$typecheckCollected$4(TypecheckingOrderingListener.java:126)
	at org.arend.typechecking.computation.ComputationRunner.run(ComputationRunner.java:37)
	at org.arend.typechecking.computation.BooleanComputationRunner.run(BooleanComputationRunner.java:8)
	at org.arend.typechecking.order.listener.TypecheckingOrderingListener.typecheckCollected(TypecheckingOrderingListener.java:125)
	at org.arend.typechecking.execution.TypeCheckProcessHandler$startNotify$1.run(TypeCheckProcessHandler.kt:185)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:668)
	at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:665)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1.run(Executors.java:665)
	at java.base/java.lang.Thread.run(Thread.java:834)
2021-05-02 14:34:10,602 [68609921]  ERROR - pechecking.TypeCheckingService - IntelliJ IDEA 2021.1  Build #IC-211.6693.111 
2021-05-02 14:34:10,603 [68609922]  ERROR - pechecking.TypeCheckingService - JDK: 11.0.10; VM: Dynamic Code Evolution 64-Bit Server VM; Vendor: JetBrains s.r.o. 
2021-05-02 14:34:10,603 [68609922]  ERROR - pechecking.TypeCheckingService - OS: Mac OS X 
2021-05-02 14:34:10,603 [68609922]  ERROR - pechecking.TypeCheckingService - Plugin to blame: Arend version: 1.6.0.3

When I try to rerun the Typecheck, this exception appears again. The only way to fix this is to reopen the project.

I have seen this a number of times. Sometimes this bug can be very confusing as it looks like the proof is accepted, but I am not sure why (before I realize it is a bug).

@marat-rkh
Copy link
Member Author

marat-rkh commented May 2, 2021

Not sure if it clarifies anything, but it seems like the bug happens after I use actions like "Replace with constructor" or "Fill goal".

@ice1000 ice1000 added the bug label May 3, 2021
@valis
Copy link
Collaborator

valis commented May 8, 2021

I saw it too, but I cannot reproduce it stably.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants