which prolog implementation will be helpful in my case [closed] - prolog

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
I was going through Prolog. I want to use it for natural language processing. I came across this paper for natural language processing with Prolog in the IBM Watson system. As stated in the paper I want to try it out in some what similar way.
Now I was wondering which of the Prolog implementation to use. I came across all of these Comparison onto Prolog onto wiki which is stated in this link. So which one of these implementations can be used for the purpose of
NLP using onto Ubunutu. Also the one which will easily integrate with python and good in speed. Has anyone ever worked any of these implementations. Is SWI-Prolog good?
Help is appreciated. Thankz :)

ProNTo it's the first thing you should know/read, if you already know and are committed to Prolog.
Wordnet has a 'ready to use' Prolog interface. Again, if you know your way in Prolog. It's somewhat difficult to find the proper site location from where to download the SW...
Attempto is in my opinion the most interesting resource - but it take on CNL, not NLP.
Anyway, the parser was developen in SWI-Prolog.
Overall, if you are serious about NLP, take a look at Grammatical Framework.
If you know Python, you are of course aware of NLTK (but I would not call it a true NLP solution...)
Alpino it's a real life NLP package, developed in SWI-Prolog, but only for Dutch. Lookup in github for Python resources.

The Watson system you mentioned, as many other NLP systems, has been developed in the ISO conforming SICStus Prolog. In its most recent version 4.3 SICStus contains a JIT compiler which is on by default and works entirely transparently. The predicate properties jittable and jitted are the only way you can see that the jitter is present — except for performance improvements, indeed. Apart from the ISO core functionality, SICStus offers freeze/2 and dif/2 since about 1985 ; with CLP(Q), and CLP(FD) added a few years later. The one downside of SICStus is its
pricing.
SWI-Prolog in contrast is free, but much more volatile. The newest version, SWI7 is no longer ISO conforming and breaks several conventions that have been followed by all major Prolog systems from Prolog I (Marseille) and DECsystem 10 Prolog (Edinburgh) on.
So, as a start, you probably would go for SWI, but if things get serious business-wise you would switch to SICStus.

Related

Prolog as first programming language [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 2 years ago.
Improve this question
I'm a computer engineering student but i've never programmed in my life (i've only studied physics, chemistry, control systems etc). Since I know a lot more about math than programming languages, and I'm studying logic right now on my own (i read it can be useful for artificial intelligence), i was thinking about learning Prolog as a first programming language. I tried to find some information about it on the internet but i couldn't really find much, all i discovered is that it's not really useful for landing a job but it can give you a different "mindset". Do you think it would be worth to learn it, or it would just be better learning something like C, Python etc?
Thank you!
Prolog is indeed a wonderful language, and it makes you think is a very differnt mode from other languages. As for making it a first, I think that's a bold move, and I suspect it'll make learning more languages a bit of a challenge. If your intent is to learn sofware engineering, I'm very sure you'll eventually learn another one.
I'd start with Python but, since you're curious already, learn it on the side.

How do Hardware Description Languages differ from General Purpose languages at the low level? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
Question:
How do Hardware languages (HDLs) differ from general purpose languages such as Python, Java, etc. In particular, what is the primary trade-off that causes general purpose languages to be sub-optimal for FPGA's when compared to VHDL and Verilog?
Context:
I'm a programmer but definitely work at a high level of abstraction such as JavaScript, tinkering with API's, etc. My low-level knowledge is very limited but I am playing around with an FPGA and have some novice questions that I cannot solve with Google or Wikis.
Considering I am a novice, please do not vote harshly against this post. Just state your suggestions for the question and I will happily revise! :)
Example:
For example, why isn't everyone just coding FPGAs and ASICs with Python or C# instead of Verilog or VHDL? I understand that there are some Python libraries, but I have read that they are limited in their viable use-cases. I would greatly appreciate someone shining some light on why HDLs are necessary and beneficial and why general purpose languages are not optimal in comparison for these scenarios.
Thanks in advance!
This is a broad opinionated question, but I think there is a short answer. In some sense, they are all programming languages, i.e text descriptions that gets compiled into a set of machine instructions to be executed on a host machine(software).
But an HDL is also a text description that gets compiled into a set of machine instructions to build another machine (hardware).
Technically, any programming language could be used to describe hardware (SystemC in C++ as an example), Verilog and VHDL were specifically developed to model and simulate hardware most efficiently.

When to use declarative programming over imperative programming [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 7 years ago.
Improve this question
As far as I know the main difference between declarative and imperative programming is the fact that in declarative programming you rather specify what the problem is, while in imperative programming you state exactly how to solve a problem.
However it is not entirely clear for me when to use one over another. Imagine you are imposed to solve a certain problem, according to which properties you decide to tackle this down declaratively (i.e using prolog) or imperatively (i.e using Java)? For what kind of problems would you prefer to use one over the other?
Imperative programming is closer to what the actual machine performs. This is a quite low level form of programming, and the more complex your application grows, the harder it will be for you to grasp all details at such a low level. On the plus side, being close to the machine, you can write quite performant code if you are good at that.
Declarative programming is more abstract and higher level: With comparatively little code, you can express quite sophisticated relationships in a way that can be more easily seen to be correct.
To see an important difference, compare for example pure Prolog with Java: Suppose I take away one of the rules in a Prolog program. I know a priori that this can make the program at most more specific: Some things that held previously may now no longer hold.
On the other hand, suppose I take away a statement in a Java program: Nothing much can be said about the effect in general. The program may even no longer compile.
So, changes in an imperative program can have very unforeseen effects, and are extremely hard to reason about, because there are few guarantees and invariants, and many things are implicit in some global state of the program. This makes imperative programming very error-prone.

How to implement fully-declarative Horn logic? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
I would like to formalize some knowledge and execute queries in what may referred to as fully-declarative Horn logic (or, fully-declarative Prolog). Could anyone provide some guidelines on how to implement it? I briefly recap the fine description from the link above:
The formal language is that of (the core of) Prolog: a "program" is a set of rules and facts as in Prolog (including functions and variables and basically, containing only user defined predicates).
In contrast to Prolog, however, I am looking for an implementation that is sound and complete with respect to the standard declarative semantics of logic programs --- the least Herbrand model (i.e., the inductively defined set of ground terms). In theoretical work on logic programming this is usually the object of study, and it is well known that a sound and complete answer to queries can be attained (in the "recursively-enumerable" sense), for example, using SLD-resolution subject to the following conditions:
fair search for matching rules (e.g., Prolog's depth-first search is not fair);
unification with "occurs-check" (checking that a variable doesn't occur in a term with which it is unified).
I am looking for a concise implementation that would build on existing capabilities, rather than inventing the wheel. Two of the more promising directions that I see are implementing it as a meta-interpreter of Prolog, or as part of some theorem prover. Could anyone with practical knowledge in these domains provide some guideline on how to implement it? Can it be easily implemented in miniKanren?
My intentions are to formalize some knowledge in a fully-declarative manner. The crucial characteristics of such a formalization is that it precisely corresponds to the mathematical notion of (monotone) induction, so that the knowledge and it's properties can be easily reasoned about with inductive arguments.
It is an easy exercise to implement a prover for Horn logic in a few lines of Prolog. Start with the Vanilla Meta-interpreter, then modify it to use the standard unify_with_occurs_check/2 predicate for all unifications, and to use a complete search procedure - iterative deepening depth first search is the simplest to implement.
See #mat's page A Couple of Meta-interpreters in Prolog for some inspiration.
More pointers:
Datalog has declarative semantics, but as a "Prolog without function symbols" it is not Prolog. See the excellent intro "What You Always Wanted to Know About Datalog (And Never Dared to Ask)" by Ceri, Gottlob and Tanca, 1989. Available via CiteSeerX
Implementations of Prolog that use tabling instead of depth-first search for added declarativeness (plus other nice features as I understand), like XSB.

automated theorem proving program - where to start? [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
I'm a second year student with my discrete mathematics 2 assignment is to make an automated theorem prover. I have to make a simple prover program that works on Propositional Logic in 4 weeks (assuming that the proof always exist). I've googled so far but the materials there is really hard to understand in 4 weeks. Can anyone recommend me some book/site/open source code that is for beginners or some useful hints to start with? Thank you in advance.
Note: I flagged this to be moved to the Computer Science site because they are much more on top of ATP over there.
It would be nice if you could include what you have looked at and why it does not help you. Then we can figure out what might be better for you. Also, if you have to write a program, then knowing what languages you know will help. Most of what I do with this is done in a functional language such as OCaml or F#, or a logic language such as Prolog or Mercury.
Have you seen "Handbook of Practical Logic and Automated Reasoning" (WorldCat) by John Harrison. I included the (WorldCat) link so you can find the book in a local library as opposed to waiting to buy it which will eat up most of your time.
If you look you will find the OCaml code at the bottom of the page, and F# here and Haskell here.
In case you haven't see the ATP or Proof Assistant at Wikipedia, you might get a lead to some code and papers.

Resources