Skip to content

Proving createdness of sequence elements #3696

@FliegendeWurst

Description

@FliegendeWurst

Description

I would like to be able to prove ==> (ClassName)seq[i_0].<created> = TRUE, where I already know ==> (ClassName)seq[i_0] = null.

My current solution is to add a new taclet:

referencedObjectIsCreatedRightSeqGet {
    \schemaVar \term Heap h;
    \schemaVar \term Seq s1;
    \schemaVar \term int iv;

    \assumes( ==> alpha::seqGet(s1, iv) = null)
    \find( ==> boolean::select(h,
            alpha::seqGet(s1, iv),
            java.lang.Object::<created>) = TRUE)

    \replacewith( ==> wellFormed(h))

    \heuristics(concrete)
};

with type definitions

\sorts {
    \generic alpha \extends java.lang.Object;
}

But @WolframPfeifer pointed out that sequence elements are not necessarily created objects.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions