[Attempto] Representing code (C++ etc)

Norbert E. Fuchs fuchs at ifi.uzh.ch
Mon Jan 30 20:43:17 CET 2012


Theodore

> It's my first post here. I was very interested in representing concepts in a formal, computable form. So I asked some questions and found this place!
> 
> How does attempto handle representing code. Let's say a simple function:
> 
> int GCD(int a, int b) {
> ...
> How would you describe that in attempto?

Attempto Controlled English (ACE) uses the syntax of English, not the syntax of C++. Thus you would have to describe your problem/algorithm – not your code – in (controlled) English.

The Attempto Parsing Engine (APE) translates syntactically correct ACE texts into a first-order representation called discourse representation structure (DRS). DRSs can be – in fact are – translated into many other languages, for instance OWL. For your GCD example you would have to provide a tool that translates the DRS into C++.

> I think describing code is very important. Doing reasoning about code could achieve many things, the smallest and most obvious of things would be to help eliminate bugs in code ;)

Right. Did you ever consider executable specifications?

> Also, could attempto ever get the ability to RUN code? Not just describe code, but run it. I mean, it stands to reason, that if you can describe code, the next step is to give the ability to run it?

The translation of ACE into OWL shows that you can generate executable code. There are other translations of ACE to produce, for instance, executable rules.

Regards.

Norbert E. Fuchs
Department of Informatics & Institute of Computational Linguistics
University of Zurich






More information about the attempto mailing list