Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » OCL » Failed to evaluate 'OclElement::allInstances() : Set(OclSelf)' for ...
Failed to evaluate 'OclElement::allInstances() : Set(OclSelf)' for ... [message #1860726] Tue, 29 August 2023 17:32 Go to next message
Steve Hickman is currently offline Steve HickmanFriend
Messages: 56
Registered: August 2017
Member
Context:
I'm testing some OCL defined in a plugin in my first Eclipse by launching a second Eclipse. I then use OCL->Load Document->Browse File System to load the initial OCL file containing the highest level 'def's and 'inv's. This file then loads other files referenced via : "include 'platform:/plugin/..." . Some of those included OCL files include others. In addition, these files contain references to the relevant ecore files via "import 'platform/plugin/..." . There are 4 ecore metamodels generated from XText, with each building on the next ('with' in XText terminology). See screenshot #1 (10.14.22 AM)

I can see the results of loading these files in the ValidityView. I can evaluate the invariants and many of them pass or provide only warnings against my test model, as expected. Some of the invariants that pass call 'allInstances()`. See Screenshot #2: (10.16.24 AM)

Problem:
I'm getting some errors that, when I mouse over the failure in the ValidityView, display as a StackOverflowError. See screenshot #3 (10.19.16 AM). When I attempt to debug these, the failure occurs in a call to `allInstances()`, whch is typically the first thing done (so there isn't a recursive loop or any other obvious cause of a StackOverflowError AFAIK). The models I'm using aren't that large - I have < 100 instances of each type. If this is really a Stack Overflow problem, then it seems like I should set my JVM parameters better when I launch the second Eclipse. Currently, they are:
-Dorg.eclipse.swt.graphics.Resource.reportNonDisposed=true -Xms4G -Xmx8G -XX:+UseStringDeduplication

FWIW, I'm running on a 16Gb M1 Macbook Pro. See screenshot #4 (10.26.49 AM)

I have not seen any recommendation in the OCL doc on JVM memory settings. Is there any? Is it possible that the problem is not the size of my model but the number of OCL 'def's and 'inv's I've got? Or is there something about how 'allInstances()' works that I need to be aware of? I think all OCL calls to 'allInstances()' are in the same plugin as the ecore file containing the metamodel that particular 'allInstances()' needs. Or is it that the type on which `allInstances()` is called must also be the `context` type?


Sample Stacktrace:
Diagnostic ERROR source=org.eclipse.ocl.examples.debug.evaluation code=120 Failed to evaluate 'OclElement::allInstances() : Set(OclSelf)' for 'ConceptualEntity' and 'uddl::ConceptualEntity.allInstances()' data=[java.lang.UnsupportedOperationException]
[Java cause:]
java.lang.UnsupportedOperationException
	at org.eclipse.ocl.examples.debug.evaluator.OCLVMModelManager.get(OCLVMModelManager.java:54)
	at org.eclipse.ocl.pivot.library.classifier.ClassifierAllInstancesOperation.evaluate(ClassifierAllInstancesOperation.java:63)
	at org.eclipse.ocl.pivot.library.classifier.ClassifierAllInstancesOperation.evaluate(ClassifierAllInstancesOperation.java:1)
	at org.eclipse.ocl.pivot.library.AbstractUnaryOperation.dispatch(AbstractUnaryOperation.java:39)
	at org.eclipse.ocl.pivot.internal.evaluation.BasicEvaluationVisitor.visitOperationCallExp(BasicEvaluationVisitor.java:725)
	at org.eclipse.ocl.pivot.internal.OperationCallExpImpl.accept(OperationCallExpImpl.java:572)
	at org.eclipse.ocl.examples.debug.vm.evaluator.AbstractVMEvaluationStepper.visiting(AbstractVMEvaluationStepper.java:449)
	at org.eclipse.ocl.examples.debug.evaluator.OCLVMEvaluationVisitor.visiting(OCLVMEvaluationVisitor.java:235)
	at org.eclipse.ocl.pivot.util.AbstractMergedVisitor.visitOperationCallExp(AbstractMergedVisitor.java:379)
	at org.eclipse.ocl.pivot.internal.OperationCallExpImpl.accept(OperationCallExpImpl.java:572)
	at org.eclipse.ocl.pivot.internal.evaluation.BasicEvaluationVisitor.visitIteratorExp(BasicEvaluationVisitor.java:473)
	at org.eclipse.ocl.pivot.internal.IteratorExpImpl.accept(IteratorExpImpl.java:2046)
	at org.eclipse.ocl.examples.debug.vm.evaluator.AbstractVMEvaluationStepper.visiting(AbstractVMEvaluationStepper.java:449)
	at org.eclipse.ocl.examples.debug.evaluator.OCLVMEvaluationVisitor.visiting(OCLVMEvaluationVisitor.java:235)
	at org.eclipse.ocl.pivot.util.AbstractMergedVisitor.visitIteratorExp(AbstractMergedVisitor.java:269)
	at org.eclipse.ocl.pivot.internal.IteratorExpImpl.accept(IteratorExpImpl.java:2046)
	at org.eclipse.ocl.pivot.internal.evaluation.BasicEvaluationVisitor.visitOperationCallExp(BasicEvaluationVisitor.java:654)
	at org.eclipse.ocl.pivot.internal.OperationCallExpImpl.accept(OperationCallExpImpl.java:572)
	at org.eclipse.ocl.examples.debug.vm.evaluator.AbstractVMEvaluationStepper.visiting(AbstractVMEvaluationStepper.java:449)
	at org.eclipse.ocl.examples.debug.evaluator.OCLVMEvaluationVisitor.visiting(OCLVMEvaluationVisitor.java:235)
	at org.eclipse.ocl.pivot.util.AbstractMergedVisitor.visitOperationCallExp(AbstractMergedVisitor.java:379)
	at org.eclipse.ocl.pivot.internal.OperationCallExpImpl.accept(OperationCallExpImpl.java:572)
	at org.eclipse.ocl.pivot.internal.evaluation.BasicEvaluationVisitor.evaluate(BasicEvaluationVisitor.java:142)
	at org.eclipse.ocl.examples.debug.evaluator.OCLVMEvaluationVisitor.evaluate(OCLVMEvaluationVisitor.java:66)
	at org.eclipse.ocl.pivot.internal.evaluation.AbstractExecutor.evaluate(AbstractExecutor.java:206)
	at org.eclipse.ocl.pivot.internal.library.ConstrainedOperation.basicEvaluate(ConstrainedOperation.java:60)
	at org.eclipse.ocl.pivot.internal.evaluation.EvaluationCache.getCachedEvaluationResult(EvaluationCache.java:133)
	at org.eclipse.ocl.pivot.internal.evaluation.AbstractExecutor.getCachedEvaluationResult(AbstractExecutor.java:219)
	at org.eclipse.ocl.pivot.library.AbstractOperation.evaluate(AbstractOperation.java:82)
	at org.eclipse.ocl.pivot.internal.library.ConstrainedOperation.dispatch(ConstrainedOperation.java:81)
	at org.eclipse.ocl.pivot.internal.evaluation.BasicEvaluationVisitor.visitOperationCallExp(BasicEvaluationVisitor.java:725)
	at org.eclipse.ocl.pivot.internal.OperationCallExpImpl.accept(OperationCallExpImpl.java:572)
	at org.eclipse.ocl.examples.debug.vm.evaluator.AbstractVMEvaluationStepper.visiting(AbstractVMEvaluationStepper.java:449)
	at org.eclipse.ocl.examples.debug.evaluator.OCLVMEvaluationVisitor.visiting(OCLVMEvaluationVisitor.java:235)
	at org.eclipse.ocl.pivot.util.AbstractMergedVisitor.visitOperationCallExp(AbstractMergedVisitor.java:379)
	at org.eclipse.ocl.pivot.internal.OperationCallExpImpl.accept(OperationCallExpImpl.java:572)
	at org.eclipse.ocl.pivot.internal.evaluation.BasicEvaluationVisitor.visitOperationCallExp(BasicEvaluationVisitor.java:654)
	at org.eclipse.ocl.pivot.internal.OperationCallExpImpl.accept(OperationCallExpImpl.java:572)
	at org.eclipse.ocl.examples.debug.vm.evaluator.AbstractVMEvaluationStepper.visiting(AbstractVMEvaluationStepper.java:449)
	at org.eclipse.ocl.examples.debug.evaluator.OCLVMEvaluationVisitor.visiting(OCLVMEvaluationVisitor.java:235)
	at org.eclipse.ocl.pivot.util.AbstractMergedVisitor.visitOperationCallExp(AbstractMergedVisitor.java:379)
	at org.eclipse.ocl.pivot.internal.OperationCallExpImpl.accept(OperationCallExpImpl.java:572)
	at org.eclipse.ocl.pivot.internal.evaluation.BasicEvaluationVisitor.visitVariable(BasicEvaluationVisitor.java:903)
	at org.eclipse.ocl.pivot.util.AbstractExtendingVisitor.visitLetVariable(AbstractExtendingVisitor.java:302)
	at org.eclipse.ocl.pivot.internal.LetVariableImpl.accept(LetVariableImpl.java:334)
	at org.eclipse.ocl.examples.debug.vm.evaluator.AbstractVMEvaluationStepper.visiting(AbstractVMEvaluationStepper.java:449)
	at org.eclipse.ocl.examples.debug.evaluator.OCLVMEvaluationVisitor.visiting(OCLVMEvaluationVisitor.java:235)
	at org.eclipse.ocl.pivot.util.AbstractMergedVisitor.visitLetVariable(AbstractMergedVisitor.java:294)
	at org.eclipse.ocl.pivot.internal.LetVariableImpl.accept(LetVariableImpl.java:334)
	at org.eclipse.ocl.pivot.internal.evaluation.BasicEvaluationVisitor.visitLetExp(BasicEvaluationVisitor.java:573)
	at org.eclipse.ocl.pivot.internal.LetExpImpl.accept(LetExpImpl.java:580)
	at org.eclipse.ocl.examples.debug.vm.evaluator.AbstractVMEvaluationStepper.visiting(AbstractVMEvaluationStepper.java:449)
	at org.eclipse.ocl.examples.debug.evaluator.OCLVMEvaluationVisitor.visiting(OCLVMEvaluationVisitor.java:235)
	at org.eclipse.ocl.pivot.util.AbstractMergedVisitor.visitLetExp(AbstractMergedVisitor.java:289)
	at org.eclipse.ocl.pivot.internal.LetExpImpl.accept(LetExpImpl.java:580)
	at org.eclipse.ocl.pivot.internal.evaluation.BasicEvaluationVisitor.evaluate(BasicEvaluationVisitor.java:142)
	at org.eclipse.ocl.examples.debug.evaluator.OCLVMEvaluationVisitor.evaluate(OCLVMEvaluationVisitor.java:66)
	at org.eclipse.ocl.pivot.internal.evaluation.AbstractExecutor.evaluate(AbstractExecutor.java:206)
	at org.eclipse.ocl.pivot.internal.library.ConstrainedOperation.basicEvaluate(ConstrainedOperation.java:60)
	at org.eclipse.ocl.pivot.internal.evaluation.EvaluationCache.getCachedEvaluationResult(EvaluationCache.java:133)
	at org.eclipse.ocl.pivot.internal.evaluation.AbstractExecutor.getCachedEvaluationResult(AbstractExecutor.java:219)
	at org.eclipse.ocl.pivot.library.AbstractOperation.evaluate(AbstractOperation.java:82)
	at org.eclipse.ocl.pivot.internal.library.ConstrainedOperation.dispatch(ConstrainedOperation.java:81)
	at org.eclipse.ocl.pivot.internal.evaluation.BasicEvaluationVisitor.visitOperationCallExp(BasicEvaluationVisitor.java:725)
	at org.eclipse.ocl.pivot.internal.OperationCallExpImpl.accept(OperationCallExpImpl.java:572)
	at org.eclipse.ocl.examples.debug.vm.evaluator.AbstractVMEvaluationStepper.visiting(AbstractVMEvaluationStepper.java:449)
	at org.eclipse.ocl.examples.debug.evaluator.OCLVMEvaluationVisitor.visiting(OCLVMEvaluationVisitor.java:235)
	at org.eclipse.ocl.pivot.util.AbstractMergedVisitor.visitOperationCallExp(AbstractMergedVisitor.java:379)
	at org.eclipse.ocl.pivot.internal.OperationCallExpImpl.accept(OperationCallExpImpl.java:572)
	at org.eclipse.ocl.pivot.internal.evaluation.BasicEvaluationVisitor.evaluate(BasicEvaluationVisitor.java:142)
	at org.eclipse.ocl.examples.debug.evaluator.OCLVMEvaluationVisitor.evaluate(OCLVMEvaluationVisitor.java:66)
	at org.eclipse.ocl.pivot.internal.evaluation.AbstractExecutor.evaluate(AbstractExecutor.java:206)
	at org.eclipse.ocl.pivot.internal.library.ConstrainedOperation.dispatch(ConstrainedOperation.java:79)
	at org.eclipse.ocl.pivot.internal.evaluation.BasicEvaluationVisitor.visitOperationCallExp(BasicEvaluationVisitor.java:725)
	at org.eclipse.ocl.pivot.internal.OperationCallExpImpl.accept(OperationCallExpImpl.java:572)
	at org.eclipse.ocl.examples.debug.vm.evaluator.AbstractVMEvaluationStepper.visiting(AbstractVMEvaluationStepper.java:449)
	at org.eclipse.ocl.examples.debug.evaluator.OCLVMEvaluationVisitor.visiting(OCLVMEvaluationVisitor.java:235)
	at org.eclipse.ocl.pivot.util.AbstractMergedVisitor.visitOperationCallExp(AbstractMergedVisitor.java:379)
	at org.eclipse.ocl.pivot.internal.OperationCallExpImpl.accept(OperationCallExpImpl.java:572)
	at org.eclipse.ocl.pivot.internal.evaluation.BasicEvaluationVisitor.evaluate(BasicEvaluationVisitor.java:142)
	at org.eclipse.ocl.examples.debug.evaluator.OCLVMEvaluationVisitor.evaluate(OCLVMEvaluationVisitor.java:66)
	at org.eclipse.ocl.pivot.internal.evaluation.AbstractExecutor.evaluate(AbstractExecutor.java:206)
	at org.eclipse.ocl.pivot.internal.library.ConstrainedOperation.basicEvaluate(ConstrainedOperation.java:60)
	at org.eclipse.ocl.pivot.internal.evaluation.EvaluationCache.getCachedEvaluationResult(EvaluationCache.java:133)
	at org.eclipse.ocl.pivot.internal.evaluation.AbstractExecutor.getCachedEvaluationResult(AbstractExecutor.java:219)
	at org.eclipse.ocl.pivot.library.AbstractOperation.evaluate(AbstractOperation.java:82)
	at org.eclipse.ocl.pivot.internal.library.ConstrainedOperation.dispatch(ConstrainedOperation.java:81)
	at org.eclipse.ocl.pivot.internal.evaluation.BasicEvaluationVisitor.visitOperationCallExp(BasicEvaluationVisitor.java:725)
	at org.eclipse.ocl.pivot.internal.OperationCallExpImpl.accept(OperationCallExpImpl.java:572)
	at org.eclipse.ocl.examples.debug.vm.evaluator.AbstractVMEvaluationStepper.visiting(AbstractVMEvaluationStepper.java:449)
	at org.eclipse.ocl.examples.debug.evaluator.OCLVMEvaluationVisitor.visiting(OCLVMEvaluationVisitor.java:235)
	at org.eclipse.ocl.pivot.util.AbstractMergedVisitor.visitOperationCallExp(AbstractMergedVisitor.java:379)
	at org.eclipse.ocl.pivot.internal.OperationCallExpImpl.accept(OperationCallExpImpl.java:572)
	at org.eclipse.ocl.pivot.internal.evaluation.BasicEvaluationVisitor.visitVariable(BasicEvaluationVisitor.java:903)
	at org.eclipse.ocl.pivot.util.AbstractExtendingVisitor.visitLetVariable(AbstractExtendingVisitor.java:302)
	at org.eclipse.ocl.pivot.internal.LetVariableImpl.accept(LetVariableImpl.java:334)
	at org.eclipse.ocl.examples.debug.vm.evaluator.AbstractVMEvaluationStepper.visiting(AbstractVMEvaluationStepper.java:449)
	at org.eclipse.ocl.examples.debug.evaluator.OCLVMEvaluationVisitor.visiting(OCLVMEvaluationVisitor.java:235)
	at org.eclipse.ocl.pivot.util.AbstractMergedVisitor.visitLetVariable(AbstractMergedVisitor.java:294)
	at org.eclipse.ocl.pivot.internal.LetVariableImpl.accept(LetVariableImpl.java:334)
	at org.eclipse.ocl.pivot.internal.evaluation.BasicEvaluationVisitor.visitLetExp(BasicEvaluationVisitor.java:573)
	at org.eclipse.ocl.pivot.internal.LetExpImpl.accept(LetExpImpl.java:580)
	at org.eclipse.ocl.examples.debug.vm.evaluator.AbstractVMEvaluationStepper.visiting(AbstractVMEvaluationStepper.java:449)
	at org.eclipse.ocl.examples.debug.evaluator.OCLVMEvaluationVisitor.visiting(OCLVMEvaluationVisitor.java:235)
	at org.eclipse.ocl.pivot.util.AbstractMergedVisitor.visitLetExp(AbstractMergedVisitor.java:289)
	at org.eclipse.ocl.pivot.internal.LetExpImpl.accept(LetExpImpl.java:580)
	at org.eclipse.ocl.pivot.internal.evaluation.BasicEvaluationVisitor.evaluate(BasicEvaluationVisitor.java:142)
	at org.eclipse.ocl.examples.debug.evaluator.OCLVMEvaluationVisitor.evaluate(OCLVMEvaluationVisitor.java:66)
	at org.eclipse.ocl.pivot.internal.evaluation.AbstractExecutor.evaluate(AbstractExecutor.java:206)
	at org.eclipse.ocl.pivot.internal.library.ConstrainedOperation.basicEvaluate(ConstrainedOperation.java:60)
	at org.eclipse.ocl.pivot.internal.evaluation.EvaluationCache.getCachedEvaluationResult(EvaluationCache.java:133)
	at org.eclipse.ocl.pivot.internal.evaluation.AbstractExecutor.getCachedEvaluationResult(AbstractExecutor.java:219)
	at org.eclipse.ocl.pivot.library.AbstractOperation.evaluate(AbstractOperation.java:82)
	at org.eclipse.ocl.pivot.internal.library.ConstrainedOperation.dispatch(ConstrainedOperation.java:81)
	at org.eclipse.ocl.pivot.internal.evaluation.BasicEvaluationVisitor.visitOperationCallExp(BasicEvaluationVisitor.java:725)
	at org.eclipse.ocl.pivot.internal.OperationCallExpImpl.accept(OperationCallExpImpl.java:572)
	at org.eclipse.ocl.examples.debug.vm.evaluator.AbstractVMEvaluationStepper.visiting(AbstractVMEvaluationStepper.java:449)
	at org.eclipse.ocl.examples.debug.evaluator.OCLVMEvaluationVisitor.visiting(OCLVMEvaluationVisitor.java:235)
	at org.eclipse.ocl.pivot.util.AbstractMergedVisitor.visitOperationCallExp(AbstractMergedVisitor.java:379)
	at org.eclipse.ocl.pivot.internal.OperationCallExpImpl.accept(OperationCallExpImpl.java:572)
	at org.eclipse.ocl.pivot.internal.evaluation.BasicEvaluationVisitor.visitVariable(BasicEvaluationVisitor.java:903)
	at org.eclipse.ocl.pivot.util.AbstractExtendingVisitor.visitLetVariable(AbstractExtendingVisitor.java:302)
	at org.eclipse.ocl.pivot.internal.LetVariableImpl.accept(LetVariableImpl.java:334)
	at org.eclipse.ocl.examples.debug.vm.evaluator.AbstractVMEvaluationStepper.visiting(AbstractVMEvaluationStepper.java:449)
	at org.eclipse.ocl.examples.debug.evaluator.OCLVMEvaluationVisitor.visiting(OCLVMEvaluationVisitor.java:235)
	at org.eclipse.ocl.pivot.util.AbstractMergedVisitor.visitLetVariable(AbstractMergedVisitor.java:294)
	at org.eclipse.ocl.pivot.internal.LetVariableImpl.accept(LetVariableImpl.java:334)
	at org.eclipse.ocl.pivot.internal.evaluation.BasicEvaluationVisitor.visitLetExp(BasicEvaluationVisitor.java:573)
	at org.eclipse.ocl.pivot.internal.LetExpImpl.accept(LetExpImpl.java:580)
	at org.eclipse.ocl.examples.debug.vm.evaluator.AbstractVMEvaluationStepper.visiting(AbstractVMEvaluationStepper.java:449)
	at org.eclipse.ocl.examples.debug.evaluator.OCLVMEvaluationVisitor.visiting(OCLVMEvaluationVisitor.java:235)
	at org.eclipse.ocl.pivot.util.AbstractMergedVisitor.visitLetExp(AbstractMergedVisitor.java:289)
	at org.eclipse.ocl.pivot.internal.LetExpImpl.accept(LetExpImpl.java:580)
	at org.eclipse.ocl.pivot.internal.evaluation.BasicEvaluationVisitor.evaluate(BasicEvaluationVisitor.java:142)
	at org.eclipse.ocl.examples.debug.evaluator.OCLVMEvaluationVisitor.evaluate(OCLVMEvaluationVisitor.java:66)
	at org.eclipse.ocl.pivot.internal.evaluation.AbstractExecutor.evaluate(AbstractExecutor.java:206)
	at org.eclipse.ocl.pivot.internal.library.ConstrainedOperation.dispatch(ConstrainedOperation.java:79)
	at org.eclipse.ocl.pivot.internal.evaluation.BasicEvaluationVisitor.visitOperationCallExp(BasicEvaluationVisitor.java:725)
	at org.eclipse.ocl.pivot.internal.OperationCallExpImpl.accept(OperationCallExpImpl.java:572)
	at org.eclipse.ocl.examples.debug.vm.evaluator.AbstractVMEvaluationStepper.visiting(AbstractVMEvaluationStepper.java:449)
	at org.eclipse.ocl.examples.debug.evaluator.OCLVMEvaluationVisitor.visiting(OCLVMEvaluationVisitor.java:235)
	at org.eclipse.ocl.pivot.util.AbstractMergedVisitor.visitOperationCallExp(AbstractMergedVisitor.java:379)
	at org.eclipse.ocl.pivot.internal.OperationCallExpImpl.accept(OperationCallExpImpl.java:572)
	at org.eclipse.ocl.pivot.internal.evaluation.BasicEvaluationVisitor.evaluate(BasicEvaluationVisitor.java:142)
	at org.eclipse.ocl.examples.debug.evaluator.OCLVMEvaluationVisitor.evaluate(OCLVMEvaluationVisitor.java:66)
	at org.eclipse.ocl.pivot.internal.evaluation.AbstractExecutor.evaluate(AbstractExecutor.java:206)
	at org.eclipse.ocl.pivot.library.logical.BooleanImpliesOperation.dispatch(BooleanImpliesOperation.java:42)
	at org.eclipse.ocl.pivot.internal.evaluation.BasicEvaluationVisitor.visitOperationCallExp(BasicEvaluationVisitor.java:725)
	at org.eclipse.ocl.pivot.internal.OperationCallExpImpl.accept(OperationCallExpImpl.java:572)
	at org.eclipse.ocl.examples.debug.vm.evaluator.AbstractVMEvaluationStepper.visiting(AbstractVMEvaluationStepper.java:449)
	at org.eclipse.ocl.examples.debug.evaluator.OCLVMEvaluationVisitor.visiting(OCLVMEvaluationVisitor.java:235)
	at org.eclipse.ocl.pivot.util.AbstractMergedVisitor.visitOperationCallExp(AbstractMergedVisitor.java:379)
	at org.eclipse.ocl.pivot.internal.OperationCallExpImpl.accept(OperationCallExpImpl.java:572)
	at org.eclipse.ocl.pivot.internal.evaluation.BasicEvaluationVisitor.visitTupleLiteralPart(BasicEvaluationVisitor.java:839)
	at org.eclipse.ocl.pivot.internal.TupleLiteralPartImpl.accept(TupleLiteralPartImpl.java:560)
	at org.eclipse.ocl.examples.debug.vm.evaluator.AbstractVMEvaluationStepper.visiting(AbstractVMEvaluationStepper.java:449)
	at org.eclipse.ocl.examples.debug.evaluator.OCLVMEvaluationVisitor.visiting(OCLVMEvaluationVisitor.java:235)
	at org.eclipse.ocl.pivot.util.AbstractMergedVisitor.visitTupleLiteralPart(AbstractMergedVisitor.java:589)
	at org.eclipse.ocl.pivot.internal.TupleLiteralPartImpl.accept(TupleLiteralPartImpl.java:560)
	at org.eclipse.ocl.pivot.internal.evaluation.BasicEvaluationVisitor.visitTupleLiteralExp(BasicEvaluationVisitor.java:831)
	at org.eclipse.ocl.pivot.internal.TupleLiteralExpImpl.accept(TupleLiteralExpImpl.java:287)
	at org.eclipse.ocl.examples.debug.vm.evaluator.AbstractVMEvaluationStepper.visiting(AbstractVMEvaluationStepper.java:449)
	at org.eclipse.ocl.examples.debug.evaluator.OCLVMEvaluationVisitor.visiting(OCLVMEvaluationVisitor.java:235)
	at org.eclipse.ocl.pivot.util.AbstractMergedVisitor.visitTupleLiteralExp(AbstractMergedVisitor.java:584)
	at org.eclipse.ocl.pivot.internal.TupleLiteralExpImpl.accept(TupleLiteralExpImpl.java:287)
	at org.eclipse.ocl.pivot.internal.evaluation.BasicEvaluationVisitor.visitPropertyCallExp(BasicEvaluationVisitor.java:776)
	at org.eclipse.ocl.pivot.internal.PropertyCallExpImpl.accept(PropertyCallExpImpl.java:445)
	at org.eclipse.ocl.examples.debug.vm.evaluator.AbstractVMEvaluationStepper.visiting(AbstractVMEvaluationStepper.java:449)
	at org.eclipse.ocl.examples.debug.evaluator.OCLVMEvaluationVisitor.visiting(OCLVMEvaluationVisitor.java:235)
	at org.eclipse.ocl.pivot.util.AbstractMergedVisitor.visitPropertyCallExp(AbstractMergedVisitor.java:449)
	at org.eclipse.ocl.pivot.internal.PropertyCallExpImpl.accept(PropertyCallExpImpl.java:445)
	at org.eclipse.ocl.pivot.internal.evaluation.BasicEvaluationVisitor.safeVisit(BasicEvaluationVisitor.java:160)
	at org.eclipse.ocl.pivot.internal.evaluation.BasicEvaluationVisitor.visitExpressionInOCL(BasicEvaluationVisitor.java:316)
	at org.eclipse.ocl.pivot.internal.ExpressionInOCLImpl.accept(ExpressionInOCLImpl.java:535)
	at org.eclipse.ocl.examples.debug.vm.evaluator.AbstractVMEvaluationStepper.visiting(AbstractVMEvaluationStepper.java:449)
	at org.eclipse.ocl.examples.debug.evaluator.OCLVMEvaluationVisitor.visiting(OCLVMEvaluationVisitor.java:235)
	at org.eclipse.ocl.pivot.util.AbstractMergedVisitor.visitExpressionInOCL(AbstractMergedVisitor.java:204)
	at org.eclipse.ocl.pivot.internal.ExpressionInOCLImpl.accept(ExpressionInOCLImpl.java:535)
	at org.eclipse.ocl.examples.debug.evaluator.OCLVMExecutor.execute(OCLVMExecutor.java:112)
	at org.eclipse.ocl.examples.debug.vm.launching.InternalDebuggableExecutor.doExecute(InternalDebuggableExecutor.java:164)
	at org.eclipse.ocl.examples.debug.vm.launching.InternalDebuggableExecutor.execute(InternalDebuggableExecutor.java:269)
	at org.eclipse.ocl.examples.debug.vm.launching.DebuggableRunner.execute(DebuggableRunner.java:118)
	at org.eclipse.ocl.examples.debug.vm.launching.DebuggableRunner$2.execute(DebuggableRunner.java:85)
	at org.eclipse.ocl.examples.debug.vm.VMVirtualMachine.execute(VMVirtualMachine.java:164)
	at org.eclipse.ocl.examples.debug.vm.VMVirtualMachine.access$14(VMVirtualMachine.java:161)
	at org.eclipse.ocl.examples.debug.vm.VMVirtualMachine$1.run(VMVirtualMachine.java:221)
	at java.base/java.lang.Thread.run(Thread.java:833)
Diagnostic ERROR source=org.eclipse.ocl.examples.debug.evaluation code=120 Failed to evaluate 'OclElement::allInstances() : Set(OclSelf)' for 'ConceptualEntity' and 'uddl::ConceptualEntity.allInstances()' data=[java.lang.UnsupportedOperationException]

[Updated on: Tue, 29 August 2023 20:18]

Report message to a moderator

Re: Failed to evaluate 'OclElement::allInstances() : Set(OclSelf)' for ... [message #1860746 is a reply to message #1860726] Thu, 31 August 2023 09:56 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7665
Registered: July 2009
Senior Member
https://bugs.eclipse.org/bugs/show_bug.cgi?id=582351 raised for the UnsupportedOperationException.

StackOverflowError is never good and hard to get a useful stack trace. You do not provide one. Your screen shot only shows part of an OCL expression, but the expression includes an operation call, so the infinite loop might be 'your' fault. Need a full repro.

AFAAIA Mac is mainly a problem for users trying to get 'install' paths correct before anything works. Thereafter new-line / file-names can be OS-specific, but I find that working with Unix new-lines always avoids most problems.

(The OCL debugger is just a stepping stone to the QVTd debugger and together with the OCL Validity View represents capabilities that I felt should be available to users. I produced prototypes in the hope of inspiring others. Sadly I think you are the only user. When I occasionally try them, I find that the UX offers ample scope for improvement. If you care to raise a Bugzilla with constructive criticisms it might get onto my todo list.)
Re: Failed to evaluate 'OclElement::allInstances() : Set(OclSelf)' for ... [message #1860765 is a reply to message #1860746] Fri, 01 September 2023 20:00 Go to previous messageGo to next message
Steve Hickman is currently offline Steve HickmanFriend
Messages: 56
Registered: August 2017
Member
As a next step, I picked one failing invariant and created a single
test.ocl
file containing all the 'def's used to implement that invariant. Using that, I was able to get a useful call stack in the OCL debugger and did not detect an infinite loop prior to the failed call to 'allInstances()' (That doesn't mean there wasn't one - I just haven't detected one yet). I have attached a screenshot of the OCL debugger call stack (2023-09-01 at 12.25.34 PM) as well as the
test.ocl
file. I recognize this isn't a complete repro - that will take either providing access to my Github (which I suspect you don't have time for) or more winnowing on my part - which I plan to do in the next few days. I post this intermediate step now just to illustrate what I'm doing in case it proves helpful.

This intermediate result eliminates loading other OCL files from plugins as a potential source of problems. And the line numbers in the OCL debugger call stack match the
test.ocl
file that was loaded via OCL -> Load Document -> Browse File System.

Next, I will create invariants that use as little OCL as possible to isolate when the failure occurs. Expect another post on that soon.

[Updated on: Fri, 01 September 2023 21:23]

Report message to a moderator

Re: Failed to evaluate 'OclElement::allInstances() : Set(OclSelf)' for ... [message #1860766 is a reply to message #1860765] Fri, 01 September 2023 22:18 Go to previous messageGo to next message
Steve Hickman is currently offline Steve HickmanFriend
Messages: 56
Registered: August 2017
Member
As is often the case, in the process of trying to create a repro I have discovered the problem. The culprit (lines 493-4 of the 'test.ocl' file) was:
		def: isTypeOrSpecializationOf(t: ConceptualEntity): Boolean =
			self = t or self?.specializes.isTypeOrSpecializationOf(t)


I read a PDF on OCL documentation that describes Safe Navigation Operators (section 4.3.6) - which is where I believe I got that syntax. However, I apparently forgot that it replaces the null value with a null operation result, rather than a 'false'. Replacing that with
		def: isTypeOrSpecializationOf(t: ConceptualEntity): Boolean =
			self = t or if (self.specializes->notEmpty()) then self.specializes.isTypeOrSpecializationOf(t) else false endif


solves my problem. I'm not certain what happened exactly when it tried to use the null pointer but that can't be good.

[Updated on: Sat, 02 September 2023 02:51]

Report message to a moderator

Re: Failed to evaluate 'OclElement::allInstances() : Set(OclSelf)' for ... [message #1860770 is a reply to message #1860766] Sat, 02 September 2023 06:46 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7665
Registered: July 2009
Senior Member
Thanks for getting back with the solution. I too find that preparing repros often reveals my mistakes.

The potential formality of OCL offers an opportunity to guarantee at compile time that an OCL expression / 'program' cannot crash. My recent papers report some work on this, but it requires a speculative evaluation at compile-time that requires different APIs making upward compatibility hard. The stronger checking is therefore not yet available.

In practice I have discovered limits to the guarantee in respect of numeric overflow. It is almost certainly impossible to analyze all numeric expressions to guarantee no corruption when an unbounded OCL Integer result is persisted to a practical 8/16/32/64 bit memory location. This is not actually an OCL problem since OMG OCL has no assigns or EInt or EShort types. I'm still looking for a more elegant way than the arguably correct crash to help the extended OCL user.
Re: Failed to evaluate 'OclElement::allInstances() : Set(OclSelf)' for ... [message #1860775 is a reply to message #1860770] Sat, 02 September 2023 12:45 Go to previous messageGo to next message
Steve Hickman is currently offline Steve HickmanFriend
Messages: 56
Registered: August 2017
Member
Here's the repro. I created a stripped down XText plugin project with a (pretty) minimal metamodel. There is a shortened version of the same test.ocl file at `org.epistimis.oclrepro/model/generated/test.ocl'. I've also created a smallish test file that I'm attaching separately. The invariant 'AnyNaturalPersons' will fail with the stack overflow. The other 2 pass. I loaded 'test.ocl' using OCL -> Load Document -> Browse File System and ran it from the ValidityView,
Re: Failed to evaluate 'OclElement::allInstances() : Set(OclSelf)' for ... [message #1860777 is a reply to message #1860775] Sat, 02 September 2023 12:58 Go to previous messageGo to next message
Steve Hickman is currently offline Steve HickmanFriend
Messages: 56
Registered: August 2017
Member
In response to your comment about OCL Integers: Is it possible, in cases like this one, to do some type checking to identify the problem? The null pointer should be OclInvalid, correct? Which shouldn't be the same as a Boolean value? Or do I not yet understand the OCL type system properly?
Re: Failed to evaluate 'OclElement::allInstances() : Set(OclSelf)' for ... [message #1860883 is a reply to message #1860777] Thu, 07 September 2023 07:19 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7665
Registered: July 2009
Senior Member
Going forward, I am in favour of as much type checking as possible., But it is often necessary to enhance the specification.
The root of the problem is that OMG OCL has very poor specification of failure; constraints are assumed to be two-valued when they have in general 3-outcomes: true/success/satisfied or false/fail/unsatisfied or crash.
For the Pivot OCL, I elaborated the returns to treat invalid as a serious failure and null as a minor failure/warning and to allow a Tuple return to combine a status and message and ...
My goal is to ensure that any possibility of a return other than true/false from a Constraint is diagnosed at edit time; but that requires a deep symbolic evaluation and some user help in the form of asserts.
invalid is 'the' instance of OclInvalid defined by the InvalidType.
null is an 'instance' of OclVoid which is defined by the VoidType.
Re: Failed to evaluate 'OclElement::allInstances() : Set(OclSelf)' for ... [message #1860886 is a reply to message #1860883] Thu, 07 September 2023 08:41 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7665
Registered: July 2009
Senior Member
wrt
def: isTypeOrSpecializationOf(t: ConceptualEntity): Boolean =
			self = t or self?.specializes.isTypeOrSpecializationOf(t)


self is never null so you presumably meant
self.specializes?.isTypeOrSpecializationOf(t)


However you have certainly identified a type checking hole.

https://bugs.eclipse.org/bugs/show_bug.cgi?id=582381 raised.
Re: Failed to evaluate 'OclElement::allInstances() : Set(OclSelf)' for ... [message #1861214 is a reply to message #1860886] Fri, 29 September 2023 18:57 Go to previous message
Steve Hickman is currently offline Steve HickmanFriend
Messages: 56
Registered: August 2017
Member
correct
Previous Topic:Retrieving EEnumLiteral attributes
Next Topic:Non-deterministic error with OCL validation in Xtext project
Goto Forum:
  


Current Time: Thu Jul 18 03:28:39 GMT 2024

Powered by FUDForum. Page generated in 0.04620 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top