clingo: separate answer set predicates with newline - clingo

I'd like to know if there is an easy possibility to separate the predicates within an answer set by a newline instead of spaces. Example:
node(1..3).
called with
clingo path.lp
gives
clingo version 5.4.0
Reading from .../path.lp
Solving...
Answer: 1
node(1) node(2) node(3)
SATISFIABLE
But I would like to have this output
clingo version 5.4.0
Reading from .../path.lp
Solving...
Answer: 1
node(1)
node(2)
node(3)
SATISFIABLE

Found it. I call
clingo path.lp --out-ifs=\\n
instead of
clingo path.lp

Related

Stata: c.var1#c.var2 operator invalid version 10.1

I would like to check for moderation with Stata using the interaction # and two continuous variables:
version 10.1: xi: regress ................///
c.var1_m#c.var9_m c.var2_m#c.var9_m c.var3_m#c.var9_m ///
var9_m , vce(robust)
However, it seems that only the newest Stata versions support this command, as I get the following error message:
cvar1_m#c: operator invalid
Does anyone know a way to fix this command as such that it also works with Stata 10.1?
(For example to fix the i. command, I typed in version 10.1: xi: and then it also worked on my older version - does something similar exist for c.?)
What version of Stata are you using? Stata 10.1, it seems.
Factor variables were introduced in Stata 11. Regardless of what version you are using this is documented accessibly (e.g.) here.
The question that then arises is why are you using the prefix version 10.1?
If you are using version 10.1, that prefix is redundant; otherwise, it can at most set the clock back to the syntax of earlier versions. It should be clear that it cannot possibly set it forward to the syntax of later versions.
A more fundamental mix-up is that (a) syntax using xi: as aegis and (b) factor-variable notation are (a) old and (b) new versions of the same idea. They should not be mixed. It may be that this alone is the problem, but experts on either [not me] might wish also to see your complete syntax and/or a reproducible example.
In short, if you are using 10.1, or indeed some earlier version, your only option (other than upgrading your Stata) is to cast your problem in syntax acceptable to xi:.

Gitbook TOC Numbering discrepancy

When I use the gitbook editor's preview server, the numbering for the TOC is what I expect:
First Chapter
1.1 Sub-section
1.1.1. Sub-sub section
1.1.2. Second sub section
Second Chapter
2.1 Sub-section
When using command line gitbook to generate html, the result is different, and clearly incorrect:
First Chapter
1.2 Sub-section
1.2.3 Sub-sub section
1.2.4 Second sub section
Second Chapter
2.3 Sub-section
Any suggestions for what I'm doing wrong or how to correct it? Thank you!
From the documentation I think you need to prefix the subchapter lines with two dots:
..* Subchapter

Flex does not remove yyunput even with suitable flags

I'm Flexing a file with the
%option nounput
Option and using the command line
flex --nounput
And flex version 2.5.35.
However, the cpp output still contains the line
#define unput(c) yyunput( c, (yytext_ptr) )
And this causes compilation problems with g++ since unput is not used.
Is there some way to fix this problem in a "clean" way? The two dirty ways are obvious:
Use unput in some useless way.
Remove the line automatically from the generated cpp file using some script.
(I tried to flag this question as "problem no longer reproducible" but the flag timed-out/aged away. I'm answering it so that it does not remain an open unanswered question.)
As mentioned by #akond:
I don't experience this problem. The version I am using is the same (flex 2.5.35). %option nounput does the trick for me.
I also tried this on version 2.5.4 and can confirm there is no issue. The option --nounput is no longer recognised or documented; however, the %option nounput remains in the manual.
The cpp output still does contain the line #define unput(c) yyunput( c, yytext_ptr ) but this does not seem to generate any g++ errors for me. Are you using -pedantic-errors or some other similar option perhaps?
Good program but badly out of date documentation.
I found that version 2.6.4 accepts the nounput option and does the right thing.

check_assumptions via stdin/smt2?

Does the SMT2 standard (or a Z3 extension of it) offer a command equivalent to the API-call "check_assumptions"? According to Josh Berdine it is often faster to work with guard literals and check_assumptions than with push-pop scopes. However, I am stuck with using Z3 via stdio for now, and using (check-assumoptions p) only yields unsupported.
If you are using the smt2 command language, perhaps the 'get-core' command available with 'z3 -smtc -in' will do the job? Note that I think this command is not in the SMT-LIB 2 standard.
Cheers, Josh

What is the correct syntax for producing http links with custom text with pod2html?

The perlpod documentation tells me that I can link to URLs using
L<scheme:...> or L<text|scheme:...>, it even lists L<The Perl
Home Page|http://www.perl.org/> as an example.
The first case works fine for me: pod2html turns
L<http://example.com/>
into
http://example.com/
But it fails on
L<example|http://example.com/>
which is just turned into
<em>example</em>
along with a warning:
/usr/bin/pod2html: : cannot resolve L<example|http://example.com/> in paragraph 2.
I would have expected something like
example
to be produced. How can I achieve that?
UPDATE So this seems to be a bug in Pod::Html as Alan Haggai Alavi points out. Is there a workaround?
It indeed was a bug in Pod::Html. It has been fixed in bleadperl.
Now L<example|http://example.com/> gets converted to example.
Since Pod::Html is a pure Perl module, the files can be copied from bleadperl which will give you version 1.12. The module shipped with with perlv5.14.2 is version 1.11 and exhibits this bug.
Else, you can use Pod::Simple::Html which works as expected.
use it like
L<< example|http://example.com/ >>