GillianPlatform / Gillian

The Gillian Platform main repository
https://GillianPlatform.github.io
BSD 3-Clause "New" or "Revised" License
74 stars 11 forks source link

Gavin/ptr chunk v2 #250

Closed ggwg closed 1 year ago

ggwg commented 1 year ago

Pattern match based on the type of the chunk

Test Program 1

struct IntPtrWrapper {
    int *age;
};

int *getPtrFromStruct(struct IntPtrWrapper *a) {
    int *age = a->age;
    return age;
}

Test Program 2

typedef struct node_s {
    int val;
    struct node_s *next;
    struct node_s *prev;
} Node;

typedef struct list_s {
    Node *head;
    Node *tail;
} List;

int test(List *list) {
    Node *node = list->head;
    // Node *next = node->next;
    // return next->val;
    return 0;
}

Example Output of load operation with matched pointer type

--test: 2--
TIME: 0.059568
CMD: gvar__1 := "i__loadv"("ptr", gvar__0)
LOC: unknown loc
PROCS: [test]
LOOPS: [] ++ []
BRANCHING: 0
ggwg commented 1 year ago

TODO:

Things to double check

ggwg commented 1 year ago

Thank you so much for reviewing on the bank holiday!