Re: Help using currypp

From: James Koppel <jkoppel_at_mit.edu>
Date: Sat, 1 Apr 2017 13:09:06 -0400

Thanks! I am now able to see how the default rules work.

I see that the implementation uses encapsulated search. If I understand
correctly, this prevents default rules from being used when the arguments
contain logic variables (which are not bound on other threads), which
explains why default rules did not work for my intended application. It
seems that it would be straightforward to change the implementation to use
booleans instead of failure, which would not have this problem.

On Sat, Apr 1, 2017 at 7:40 AM, Michael Hanus <mh_at_informatik.uni-kiel.de>
wrote:

> Hi James,
>
> the Curry preprocessor is intended to be called by the Curry
> parser/frontend where it is supplied with the right arguments.
> In particular, <InputFilePath> is a temporary file which is always
> different from <OrgFileName>. This was implicitly assumed in the
> implementation of currypp and caused this strange error message.
> The one line fix will be part of the next distribution,
> but, if you want to proceed now, you should keep in mind
> this assumption. Hence, you can invoke currypp as follows:
>
> > cp ilp.curry tmp
> > curry pp ilp.curry tmp ilp_out.curry defaultrules -v
>
> If you want to invoke currypp automatically when loading a Curry
> program, you should add the following line as the first line
> of your module:
>
> {-# OPTIONS_CYMAKE -F --pgmF=currypp --optF=defaultrules --optF=-o #-}
>
> The option "-o" has the effect that the translated program
> is also written to "ilp.curry.CURRYPP" so that you can look
> at the performed transformations.
>
> I hope this helps.
>
> Best regards,
>
> Michael
>
> On 31.03.2017 22:58, James Koppel wrote:
> > Hello!
> >
> > I'm trying to inspect the output of currypp so I can debug an issue I've
> > been having with default cases. I'm having substantial difficulty
> > figuring out how it's supposed to be used.
> >
> > The usage instructions say:
> >
> > Usage: curry pp <OrgFileName> <InputFilePath> <OutputFilePath>
> > <options>
> >
> >
> >
> > <OrgFileName> : name of original program source file
> >
> > <InputFilePath> : name of the actual input file
> >
> > <OutputFilePath>: name of the file where output should be written
> >
> >
> >
> >
> > I don't understand the difference between OrgFileName and
> > InputFileName. My best guess of how to invoke currypp is an invocation
> > like this:
> >
> > curry pp ilp.curry ilp.curry ilp_out.curry defaultrules -v
> >
> >
> > Where "ilp.curry" is the file I want to transform, and I am running this
> > from the directory that contains ilp.curry .
> >
> > However, this simply gives the following error:
> >
> >
> > =========================================
> >
> > Curry Preprocessor (version of 12/01/2017)
> >
> > ==========================================
> >
> > ERROR: context(:(system,/(open,4)),No such file or directory)
> >
> >
> > I'd appreciate help finding a way to understand the output of the
> > preprocessor.
> >
> > Sincerely,
> > James Koppel
> > MIT CSAIL
> >
> >
> > _______________________________________________
> > curry mailing list
> > curry_at_lists.rwth-aachen.de
> > https://mailman.rwth-aachen.de/mailman/listinfo/curry
> >
>
>

Received on So Apr 02 2017 - 17:17:13 CEST

This archive was generated by hypermail 2.3.0 : Do Feb 01 2024 - 07:15:12 CET