source: CIVL/examples/verifyThis/treeBuffer/treebuffer.h

main
Last change on this file was ea777aa, checked in by Alex Wilton <awilton@…>, 3 years ago

Moved examples, include, build_default.properties, common.xml, and README out from dev.civl.com into the root of the repo.

git-svn-id: svn://vsl.cis.udel.edu/civl/trunk@5704 fb995dde-84ed-4084-dfe6-e5aef3e2452c

  • Property mode set to 100755
File size: 1.4 KB
Line 
1#if !defined TREEBUFFER_H
2#define TREEBUFFER_H
3
4//#include <stdio.h>
5
6enum algo { tb_naive = 0, tb_gc, tb_amortized, tb_real_time };
7
8typedef struct Node Node;
9typedef struct Tree Tree;
10
11//Node * tb_make_node(int data);
12//int tb_get_data(Node * node);
13//Tree * tb_initialize(int history, enum algo algo, Node * root);
14void delete(Tree * tree);
15
16/* NOTE: The client must allocate/deallocate the 0-terminated arrays |children|
17and |ancestors| that appear below. In contrast, clients allocate but do not
18deallocate |Node|s. */
19
20//void tb_add_child(Tree * tree, Node * parent, Node * child);
21//void tb_deactivate(Tree * tree, Node * node);
22//void tb_expand(Tree * tree, Node * parent, Node * children[]);
23//void tb_history(Tree * tree, Node * node, Node * ancestors[]);
24 /* history of |node| is put in |ancestors|, which is 0-terminated;
25 |node| must be active */
26
27/* Added for verifyThis 2017, always took "history" nodes from the
28 last one being added and is still active: */
29void take(Tree * tree, Node * ancestors[]);
30Tree * add(Tree * tree, int data);
31Tree * empty(int history);
32int get_data(Node * node);
33void check_heap_inbound(size_t heap_size, int history, Tree * tree, size_t * max);
34//Node * tb_active(const Tree * tree);
35//Node * tb_next_active(const Tree * tree, const Node * node);
36 // Intended use:
37 // for (Node * n = tb_active(t); n; n = tb_next_active(t, n)) { ... }
38
39#endif
Note: See TracBrowser for help on using the repository browser.