Skip to content
patrigg edited this page Aug 28, 2014 · 4 revisions

AbstractDataTypes

Library and tool to define and test abstract data types. This library is for educational purposes to learn about abstract data types. It is written in C#. A simple tool called AdtPlayground is also included. It allows you to create abstract data types and also test them by evaluating various expressions and see the results after applying the axioms.

Installation

Currently there is no binary release available so you need to download the source and open the Visual Studio 2013 solution. The 2012 version of Visual Studio should also work fine but is not officially supported.

Getting Started

To run the tool, simply open the solution and run the AdtPlayground project. The main window of the application consists of four regions depicted below:

Screenshot of AdtPlayground application.

Region 1:

List of available abstract datatypes. In the current release four types are implemented by default: bool, Number, stack, queue. Types that could not be loaded correctly are indicated with an error message after the name. New types can be added by clicking the New button on the bottom. Remove temporarily removes a type from the list. Reload updates all types with their current definition. Reload also restores types which were previously removed.

Region 2:

Shows the definition of the abstract datatype selected in Region 1. The definition can be edited here and saved. Types will be reloaded automatically after saving.

Region 3:

You can type statements here. The tool uses namespaces for the types. Operations are prefixed by their typename followed by a colon (e.g. bool:true() ). The namespace can be omitted for operations on the type that is selected in Region 1. An expression can be evaluated by pressing the Process button. The results will be shown in Region 4.

Typing of numbers is directly supported by the input parser. They will be automatically translated in "Number:inc" and "Number:zero" operations. Only positive numbers are supported.

Statements may either be stand-alone expressions or assignments to variables using the syntax: Variable = Expression. For example two numbers may be added like shown below (assuming the Number type is currently selected):

A = inc(zero())
B = inc(inc(inc(A)))
add(A, B)

Region 4:

Result of recursively applying axioms to the expressions typed in Region 3. The pretty print check box sets whether numbers will be shown in their native form using Number:inc and Number:zero operations or printed as digits.