New type definitions

6 views
Skip to first unread message

Nicolas Ayache

unread,
Aug 6, 2011, 8:35:50 AM8/6/11
to baoug
Dear list,

First of all, thank you for baoug.org! I am really enthusiastic about
this initiative of a website that (partly) checks the behavior of
ocaml programs.

A few months ago, I was thinking about this kind of service for
teaching purposes, but I will come back on this in the "expected
features" thread.

For now, I have a question about proposing a problem that introduces
new type definitions.

Simple example: suppose that the problem asks to write a particular
function main of type my_type -> int where my_type is a newly defined
type.

Is it possible to introduce new type definitions in a challenge? If
yes, where should the new types be defined: in the control code by the
contributor, in the solution code by the user, or both?

I suppose that only the control code must define the types, but I
would rather wait for a confirmation before proposing a contribution.

Also and more generally, this raises the issue of having some
predefined code (types, values, modules, functors, objects, etc) set
by the contributor and available for the user through a given
signature. For now, the only way I can imagine to make it visible for
the user is via the description of the puzzle. Is there any other way?
If no, do you have anything planned to make it more convenient?

Thank you in advance for your kind answers.

Cheers,

Nicolas

gallais @ ensl.org

unread,
Aug 6, 2011, 8:44:34 AM8/6/11
to ba...@googlegroups.com
Hi everyone,

Here is a relevant link: http://as305.dyndns.org/aps/. It is a similar
contest website (for Coq) where definitions can be given as part
of a problem.

Cheers,

--
gallais

William Le Ferrand

unread,
Aug 6, 2011, 12:58:28 PM8/6/11
to ba...@googlegroups.com


Hi, 

Well, right now the "control code" is embedded in a module "B", and the solution is embedded in a module "S", so if you introduce a new type t, the solver will see it as B.t. 

What we could do is to add a new field in the problem description that would be a "solution template" or a "solution header" : when someone wants to solve the problem, then he starts from this template, not from a blank page.

Interested by pushing those changes in the code ? :) 

Cheers

William
--
William Le Ferrand

Mobile : (+1) (415) 683-1484


Reply all
Reply to author
Forward
0 new messages