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

Proof obligation exception when assigning to a record's sequence by index #777

Open
ghost opened this issue Mar 9, 2021 · 2 comments
Open
Assignees
Labels
bug Incorrect behaviour of the tool language Issues in parser, TC, interpreter, POG or CG Mergable A fix is available on a branch to merge for release

Comments

@ghost
Copy link

ghost commented Mar 9, 2021

Description

The following exception is generated when attempting to generate the proof obligations for an operation that assigns a value to a record's sequence:
org.overture.pog.utility.POException: Cannot invoke "org.overture.ast.intf.lex.ILexNameToken.clone()" because the return value of "org.overture.ast.statements.AFieldStateDesignator.getObjectfield()" is null.

Steps to Reproduce

Example VDM-SL:

module TestPO
definitions

types
	Record ::
		myMember: seq of nat
	;

state myState of
	myRecord: Record
	
	init s == s = mk_myState(mk_Record([0]))
end;

operations
	assign() == (
		myRecord.myMember(1) := 1;
	);
end TestPO

Expected behavior: The proof obligations to be generated.

Actual behavior: Fails with exception org.overture.pog.utility.POException: Cannot invoke "org.overture.ast.intf.lex.ILexNameToken.clone()" because the return value of "org.overture.ast.statements.AFieldStateDesignator.getObjectfield()" is null

Reproduces how often: Every time

Versions

Tested on versions 3.0.2 and 2.7.4. (Tested on Linux)

Additional Information

This may also effect other compound types, however I have only seen this issue for sequences.

@nickbattle
Copy link
Contributor

Thanks for reporting this. I'm able to reproduce it from your example. It looks like it's something that would work in VDM++ but not VDM-SL. I'm testing the fix now.

@nickbattle nickbattle self-assigned this Mar 9, 2021
@nickbattle nickbattle added bug Incorrect behaviour of the tool language Issues in parser, TC, interpreter, POG or CG labels Mar 9, 2021
@nickbattle nickbattle added the Mergable A fix is available on a branch to merge for release label Mar 9, 2021
@nickbattle
Copy link
Contributor

Fix now available in ncb/development.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Incorrect behaviour of the tool language Issues in parser, TC, interpreter, POG or CG Mergable A fix is available on a branch to merge for release
Projects
None yet
Development

No branches or pull requests

1 participant