The tag has no wiki summary.

learn more… | top users | synonyms

0
votes
1answer
108 views

Calculating WPM given a variable stream of input

I'm creating an application that sits in the background and records all key presses (currently this is done and working; an event is fired every keydown/keyup). I want to offer a feature for the user ...
0
votes
1answer
122 views

Trying to break elements which are lists in a list? [closed]

I am trying to write a program which make the following: ?- g([2,3, [22,[3],9] ,4,[5],99],X). X= [2,3,22,[3],9 ,4,5,99] so it searches for lists in the given list and replace it by their elements ...
18
votes
2answers
1k views

How to implement interactive programs (like games/simulations) using logic programming?

I've heard that logic programming can serve as a general-purpose alternative to other programming paradigms such as OO or functional programming. (Since Prolog is Turing-complete, this must be so!) ...
2
votes
1answer
201 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 ...
7
votes
2answers
453 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
876 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
614 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
561 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
1k 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
393 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
5k 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
587 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 ...
4
votes
3answers
375 views

Scheme and Functional programming is to “Structure and Interpretation of Computer Programs” as Prolog and Logic programming is to what book? [closed]

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 ...
9
votes
3answers
1k 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) ...