gprolog extended via C interface ignores command-line interface arguments

Simon Curry <[email protected]> Sat, 2 Dec 2017 01:14:38 -0500
Newsgroups gmane.comp.gnu.prolog.bugs
Message-ID <[email protected]>
This is a multi-part message in MIME format.
--===============8790418158663173517==
Content-Type: multipart/alternative;
 boundary="------------8009182ED5F7F31F6DD19B14"
Content-Language: en-US

This is a multi-part message in MIME format.
--------------8009182ED5F7F31F6DD19B14
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: quoted-printable

Hi,

I am using:

GNU Prolog 1.4.4 (64 bits)
Compiled Dec=C2=A0 1 2017, 19:56:55 with gcc
By Daniel Diaz
Copyright (C) 1999-2013 Daniel Diaz

running on a ubuntu machine:

Linux simon-Leopard-Extreme 4.4.0-98-generic #121-Ubuntu SMP Tue Oct 10=20
14:24:03 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

I am extending gprolog with a significant library of crypto functions in =

C and in general this works very well. The only exception is that the=20
new instance of gprolog, extended with these functions ignores the=20
'--init-goal', '--query-goal' command line arguments. These are useful=20
for running the prolog application from a cron job, for example.

"Fortunately", *your own example* in=20
/usr/local/gprolog-1.4.4/examples/ExamplesC manifests the same problem,=20
so I need not burden you with all of my code.

For example, when I build your example and compare the operation of the=20
new executable with that of the base gprolog, I get:


sjswc@simon-Leopard-Extreme:ExamplesC$ gprolog --query-goal "format('Hi=20
Mom', [])"
GNU Prolog 1.4.4 (64 bits)
Compiled May 15 2017, 21:17:39 with gcc
By Daniel Diaz
Copyright (C) 1999-2013 Daniel Diaz
| ?- format('Hi Mom', []).
Hi Mom

yes
| ?-

sjswc@simon-Leopard-Extreme:ExamplesC$ ./examp --query-goal "format('Hi=20
Mom', [])"
GNU Prolog 1.4.4 (64 bits)
Compiled May 15 2017, 21:17:39 with gcc
By Daniel Diaz
Copyright (C) 1999-2013 Daniel Diaz
| ?-

Everything else works perfectly. Have I misunderstood what is supposed=20
to happen or is this a bug?

Regards

Simon Curry


--------------8009182ED5F7F31F6DD19B14
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: 8bit

<html>
  <head>

    <meta http-equiv="content-type" content="text/html; charset=utf-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <p>Hi,</p>
    <p>I am using:</p>
    <p>GNU Prolog 1.4.4 (64 bits)<br>
      Compiled DecĀ  1 2017, 19:56:55 with gcc<br>
      By Daniel Diaz<br>
      Copyright (C) 1999-2013 Daniel Diaz</p>
    <p>running on a ubuntu machine:</p>
    <p>Linux simon-Leopard-Extreme 4.4.0-98-generic #121-Ubuntu SMP Tue
      Oct 10 14:24:03 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux<br>
    </p>
    <p>I am extending gprolog with a significant library of crypto
      functions in C and in general this works very well. The only
      exception is that the new instance of gprolog, extended with these
      functions ignores the '--init-goal', '--query-goal' command line
      arguments. These are useful for running the prolog application
      from a cron job, for example.</p>
    <p>"Fortunately", <b>your own example</b> in
      /usr/local/gprolog-1.4.4/examples/ExamplesC manifests the same
      problem, so I need not burden you with all of my code.</p>
    <p>For example, when I build your example and compare the operation
      of the new executable with that of the base gprolog, I get:</p>
    <p><br>
    </p>
    <p>sjswc@simon-Leopard-Extreme:ExamplesC$ gprolog --query-goal
      "format('Hi Mom', [])"<br>
      GNU Prolog 1.4.4 (64 bits)<br>
      Compiled May 15 2017, 21:17:39 with gcc<br>
      By Daniel Diaz<br>
      Copyright (C) 1999-2013 Daniel Diaz<br>
      | ?- format('Hi Mom', []).<br>
      Hi Mom<br>
      <br>
      yes<br>
      | ?- <br>
      <br>
    </p>
    <p>sjswc@simon-Leopard-Extreme:ExamplesC$ ./examp --query-goal
      "format('Hi Mom', [])"<br>
      GNU Prolog 1.4.4 (64 bits)<br>
      Compiled May 15 2017, 21:17:39 with gcc<br>
      By Daniel Diaz<br>
      Copyright (C) 1999-2013 Daniel Diaz<br>
      | ?-<br>
    </p>
    <p>Everything else works perfectly. Have I misunderstood what is
      supposed to happen or is this a bug?<br>
    </p>
    <p>Regards</p>
    <p>Simon Curry<br>
    </p>
  </body>
</html>

--------------8009182ED5F7F31F6DD19B14--


--===============8790418158663173517==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Bug-prolog mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/bug-prolog

--===============8790418158663173517==--