question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add JavaDoc to "phase"

See original GitHub issue

I am reading https://github.com/logic-ng/LogicNG#first-steps:

final Literal notC = f.literal("C", false);

The documentation states that phase is a Boolean parameter. There is no documentation on the phase in README.md and not at the JavaDoc of literal.

I wonder why

a) phase is not en enum? An enum makes the possibilities clear. Currently with false I don’t know whether there is no phase processing, if its a phase, where all variables are false, an initialization phase, … - Reading the code I would have set it to true, but I am not sure.

b) There is no literal creator without any phase parameter (and then setting a default phase)

Would is be, additionally, possible to describe the phase in the README.md file?

(Issue created in my the context of my free-time project JabRef)

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
czenglercommented, Jun 25, 2020

You can always use the not function in LogicNG with a variable - so you never have to construct a literal explicitly 😃 You can write your example with

final FormulaFactory f = new FormulaFactory();
final Formula formula = f.or(f.not(f.variable("a")), f.variable("b"));

Internally the f.not(f.variable("a")) is stored as a literal with negative phase.

The main developers of LogicNG all have their PhDs in Automated Reasoning and SAT Solving - therefore we naturally stick to the terminology mainly used in our field.

But let’s not discuss about syntax - we will add a comment in the next version of LogicNG to clarify things.

0reactions
kopporcommented, Jun 25, 2020

In this case, compatibility is the code comment compatbilitiy. It is still binary compatible.

I think, it would help to add some more description (JavaDoc) on it. Maybe just putting the synonmy there and a little usage example.

I used the library in my context as programmer. I was expecting the library building an AST similar to or(not(a), b) - thus not being a function. With the current API, it feels more like or((a, negated), (b, not negated)), which is strange for me.

I am not sure about your target user group. In University of Stuttgart teaching and research I never heared “phase”. But I only leanred logics, theoretical computer science, petri nets, model checking (Javier Esparza), published papers applying Prolog and an LTL solver (LoLa). I also liked CTL very much. Seems to be a different group of researchers than the ones involved in LogicNG. Not sure whether I am a target group and whether there are others with a similar background wanting to use LogicNG.

Since I assume there are other users around there who might be confused by phase, I am proposing to add more JavaDoc. I would even suggest to comment extensively as outlined in Java by Comparison. - If it is “only” at the construction of literals, it would be fine for me. For me, this was really the hardest part of the library up to now.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Apache Maven Javadoc Plugin – Usage
To generate javadocs as part of the site generation, you should add the Javadoc Plugin in the <reporting> section of your pom: <project>...
Read more >
How to Write Doc Comments for the Javadoc Tool - Oracle
If you have more than one paragraph in the doc comment, separate the paragraphs with a <p> paragraph tag, as shown. Insert a...
Read more >
Maven-javadoc-plugin's "aggregate" goal and phase
xml , I added a exec-maven-plugin plugin that, ultimately, programatically calls the aggregate goal, in the "aggregatedJavadoc" profile, on the ...
Read more >
Phase (OptaPlanner Javadoc 8.31.0.Final API)
Add a PhaseLifecycleListener that is only notified of the phase and the step starting/ending events from this phase (and the solving events too...
Read more >
Two ways to integrate Javadoc into IntelliJ IDEA
On Maven projects, run the dependency:resolve phase with classifier=javadoc and IntelliJ will automatically acquire documentation superpowers.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found