For Programmers: Free Programming Magazines  


Home > Archive > Prolog > November 2007 > Using B-Prolog as a command line ?









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Using B-Prolog as a command line ?
Ecirbaf

2007-11-04, 7:08 pm

Hi !

I read the B-Prolog doc "Command line arguments".
The only command line I'm able to make work is :
bp -g 'writeln(hello)'
on my linux ( must add quotes for bash).

I tried :
bp file.pl -g 'solve(S)'

and

bp file.out -g 'solve(S)'

(where file.out is the compiled file.pl)

None works here but solve(S) are OK for both cases 'inside' bp.

Please, what should be a right command line ?

Thanks,

Fabrice

Neng-Fa Zhou

2007-11-04, 10:10 pm


"Ecirbaf" <fabrice.marchant@orange.fr> wrote in message
news:1194218879.326134.39810@o38g2000hse.googlegroups.com...
> Hi !
>
> I read the B-Prolog doc "Command line arguments".
> The only command line I'm able to make work is :
> bp -g 'writeln(hello)'
> on my linux ( must add quotes for bash).
>
> I tried :
> bp file.pl -g 'solve(S)'
>
> and
>
> bp file.out -g 'solve(S)'
>
> (where file.out is the compiled file.pl)
>
> None works here but solve(S) are OK for both cases 'inside' bp.
>
> Please, what should be a right command line ?


Try

bp file.out -g "solve(S),writeln(S)".

The initial goal should be double quoted unless it is an atomic formula in
the form of p(t1,t2,..,tn). So both the command line

bp -g writeln(hello)

and

bp -g "writeln(hello)"

work.

Cheers,
Neng-Fa


Ecirbaf

2007-11-05, 4:24 am

On Nov 5, 3:05 am, "Neng-Fa Zhou" <nz...@acm.org> wrote:
> bp file.out -g "solve(S),writeln(S)".


So it was this ! Thanks a lot for your swift and efficient answer.

Regards,

Fabrice

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com