forward and backward chaining in haskell [closed] - haskell

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 9 years ago.
I am trying to implement forward/Backward chaining in haskell something with a very a small database i.e some kind of text file and basic rules. Help would be appreciated. Thanks

Here are some monads that might be helpful:
logict
weighted-search
These monads have a notion of failure which automatically backtracks to previous states (they backtrack in different ways -- which to use depends on what behavior you want).
If you are doing unification, use StateT on one of these monads with a dictionary from variables to their values.
With these pieces, a backward-chaining logic engine is actually quite small and easy in Haskell. I wrote something similar for one of my projects in about 30 lines (it's in the latter part of this file, if you want a reference. I doubt you'll be able to use it exactly.).
Warning: although this task is easy for an experienced Haskell programmer, it uses some relatively advanced concepts, so if you do not already know Haskell, the necessary 30 lines will be quite hard to come up with. Do an extended tutorial first.

Related

Thread Synchronization Primitives [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
I am looking for a good material on different thread synchronization primitives that are generic (not tied to any language or implementation. I only want the concepts).
Searches in the internet point to specific language or implementation.
Well, it will be hard to find such resources, because they are almost always accompanied with some (at least pseudo) code example. Unless someone better informed than me sees this question :)
I would suggest exploring wikipedia for starters, e.g.:
Producer consumer problem
Dining philosophers problem
Sleeping barber problem
Synchronization (computer science)
Inter-process communication
look at the linked general words, links and external links, once you get familiar enough in the desired direction it would be ideal to find a scientific article that covers the topic - they are full of many references, and evenutally you'll stumble upon some great article(s).

Dreaming of making my own OS- what should I use? (suggestions) [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 11 years ago.
I was just wanting to go ahead and make an OS. Because working on projects makes one's knowledge quite good enough. I know I will have to study OS inside-out before actually trying to implement one on my own. I also know I wouldn't be able to implement something right from square one. So I searched the internet for something to work upon. The most common option that I found was to work upon existing Linux distro and contribute to it.
But I found some more interesting options. Would like your suggestions on what to choose for and work upon.
LFS: http://www.linuxfromscratch.org/lfs/
PintOS: http://www.scs.stanford.edu/10wi-cs140/pintos/pintos_1.html#SEC1
Cosmos: http://www.gocosmos.org/index.en.aspx
I would get around 6 months time to work upon it. But before I start off with it, I want to do my research work properly and finalize what and how to work.
Drop in your suggestions on what should I use to work on. :)

How do you become an expert in a programming language? [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 12 years ago.
Assuming you have basic to intermediate knowledge of a particular language, how can you become an expert in that language in a short amount of time?
Refer to this 21 Days by Peter Norvig
Pull all your information sources together - such as:
The official language documentation,
Best practice books,
Google around for tutorial sites,
Get used to searching and finding what you need quickly
The obvious reply would be: Practice makes perfect.
Try to work with the language on daily basis and push yourself out of your comfort zone in using it. Joining a user group is also a good option.
But at the end of the day, I must agree with Rozuur and concede that becoming an expert in something usually requires experience and experience requires time.
I think,
Passion: to explore and learn, and then
Dedication: to learn different aspects of that programming language, finally,
Patience: to design a project and apply all that one has learned into it.
Note:The programming languages these days have grown too big to implement above strategy.
However, I would still believe that passion is the key to all learning!

Programming World [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 12 years ago.
In this programming world of ours we see C sharp and Java on the top. But these have rich library of thousand classes and function which become more richer with their new editions. Can we have a programming language which can give us more creativity and innovation inspite of this ever increasing library based languages ?
There are plenty of such languages: Ruby, Python, JavaScript, Erlang and plenty of others. You just need to stop trolling and do your homework.
Assembly. Can't get much more free then that.
In fact any decent library or framework is a language itself. A domain specific language. Of course you could have all the same functionality in form of a variety of "proper" DSLs, but it won't be that much different from the current state.

How to avoid saying "gstring"? [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 12 years ago.
I am picking up Groovy. The language is fine. But I have a non-technical problem. One of the classes is called GString. In some context, it can be misleading. And mentioning it is not very appropriate in the office, especially when some non-technical female colleagues are around.
I guess this is not enough to justify renaming the class in the language. So how should I avoid saying "GString" when I want to say GString?
Personally, I think you should just say "GString" and use the confusion and subsequent explanation to begin conversations with the non-technical female colleagues.
Other languages call these kind of strings with placeholders "interpolated strings", so you can use that, or potentially just call them "Groovy String".
what does the G stand for? If it's Groovy, then call it GroovyString, or even GrooveString ... or guhString ... as in the lower-case sound of 'G'
I would pronounce it "GiString".
Say Gstring a lot. You female colleages may start to notice you.

Resources