The logic-programming tag has no wiki summary.
2
votes
1answer
115 views
Given a situation, and some conditions, verify is that situation is possible
Well it's a problem me and my friend had thought of, and well, haven't come up with anything to solve the following problem(I'll try to phrase it in the best way I can):
Given that there are n ...
1
vote
1answer
347 views
Need help understanding Dice Game question [closed]
I am stuck at a question preparing for a gaming firm, and my problem is that I don't understand the game that is presented.
Create a dice game in which there are two players and three 6-sided dice ...
7
votes
2answers
184 views
How would I combine 'Command' and 'Composite' to simulate a time delay?
As a learning exercise (I am not in school - just an old guy trying to learn something new), I am trying to write a logic gate simulation that incorporates propagation delay. The user should also be ...
7
votes
8answers
665 views
AND is better or using Internal “IF”
In a situation like this:"
if ((metadata != null) && (metadata.TypeEnum != VariantInfoMetadata.CellTypeEnum.Status))
do you recommend to keep the code as it is above? Or is it better to ...
4
votes
3answers
503 views
Is saying “if ( $a != null && $a == 5)” the same as “if ($a == 5)”
First off, sorry if this is answered somewhere else. I did a brief search, but wasn't sure how to ask in search terms.
I'm looking at some code and came across lot's of statements like this:
if ( ...
0
votes
1answer
352 views
Strategy for writing a logic program
I have had a hard time learning logic programming thus far, and my request for outside resources on this site was met with some opprobrium, so perhaps this question better addresses both my needs and ...
8
votes
1answer
652 views
Is the Mercury Programming Language used in the field?
I've strong interests in Functional and Logic programming and Mercury seems like a good blend of the two. Is it used in industry at all? I'm one to learn a language just for the fun of it but it would ...
3
votes
1answer
291 views
Good introduction to metaprogramming in Prolog?
I would like to make for example imperative programs as output of Prolog (shaders of graphic card) and also event-driven programs (game logic) ... also I would like to learn how to metaprogram in ...
1
vote
4answers
3k views
What simple logic question can I ask a trainee to test their problem solving skills?
We are hiring for a junior trainee role. The specification for the job is a higher school leaver (18) with a background in IT/Programming and some experience in making web pages.
The candidate will ...
3
votes
4answers
361 views
Data Structures to represent logical expressions
Here is a logical statement:
term1 AND (term2 OR term3) OR term4
What is an effective way of storing this information in a data structure?
For example, should I use a graph, with a property on ...
3
votes
3answers
251 views
Scheme and Functional programming is to “Structure and Interpretation of Computer Programs” as Prolog and Logic programming is to what book?
I'm looking for some advice how to get started with Logic programming, and I am really enjoying working through the Scheme book "Structure and Interpretation of Computer Programs." Is there a similar ...
6
votes
3answers
792 views
Why (not) logic programming?
I have not yet heard about any uses of a logical programming language (such as Prolog) in the software industry, nor do I know of usage of it in hobby programming or open source projects. It (Prolog) ...