Interactive Programs in Dependent Type Theory

نویسندگان

  • Peter Hancock
  • Anton Setzer
چکیده

We propose a representation of interactive systems in dependent type theory. This is meant as a basis for an execution environment for dependently typed programs, and for reasoning about their construction; there may be wider applications. The inspiration is the ‘I/O-monad’ of Haskell. The fundamental notion is an I/O-tree; its definition is parameterised over a general notion of dependently typed, command-response interactions called a world. I/O-trees represent strategies for one of the parties in a command/response interaction – the notion is not confined to functional programming. The definitions make essential use of the expressive strength of dependent typing. We present I/O-trees in two forms that we call ‘non-normalising’ and ‘normalising’. The first form, which is simpler, is suitable for Turing-complete functional programming languages with general recursion. The second is definable within (ordinary) normalising type theory and we identify programs written in it as ‘normalising I/O-programs’. We define new looping constructs (while and repeat), and a new refinement construct (redirect), which permits the implementation of libraries. We introduce a bisimulation relation between interactive programs, with respect to which we prove the monad laws and defining equations of while.

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

State Dependent IO-Monads in Type Theory

We introduce the notion of state dependent interactive programs for Martin-Löf Type Theory. These programs are elements of coalgebras of an endofunctor on the presheaf category S → Set. We prove the existence of final coalgebras for these functors. This shows as well the consistency of type theory plus rules expressing the existence of weakly final coalgebras for these functors, which represent...

متن کامل

Interactive Programs and Weakly Final Coalgebras in Dependent Type Theory (Extended Version)

We reconsider the representation of interactive programs in dependent type theory that the authors proposed in earlier papers. Whereas in previous versions the type of interactive programs was introduced in an ad hoc way, it is here defined as a weakly final coalgebra for a general form of polynomial functor. The are two versions: in the first the interface with the real world is fixed, while i...

متن کامل

Object-oriented programming in dependent type theory

We introduce basic concepts from object-oriented programming into dependent type theory based on the idea of modelling objects as interactive programs. We consider methods, interfaces, and the interaction between a fixed number of objects, including self-referential method calls. We introduce a monad like syntax for developing objects in dependent type theory.

متن کامل

Verifying Haskell programs by combining testing, model checking and interactive theorem proving

We propose a program verification method that combines random testing, model checking and interactive theorem proving. Testing and model checking are used for debugging programs and specifications before a costly interactive proof attempt. During proof development, testing and model checking quickly eliminate false conjectures and generate counterexamples which help to correct them. With an int...

متن کامل

Guarded Induction and Weakly Final Coalgebras in Dependent Type Theory

We introduce concepts for representing interactive programs in dependent type theory. The representation uses a monad, as in Haskell. We consider two versions, one, in which the interface with the real world is fixed, and another one, in which the interface varies depending on previous interactions. We then generalise the monadic construction to polynomial functors. Then we look at rules needed...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 2000