Cool, visually-transmissible uses of Prolog [closed] - prolog

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I will be teaching only one lecture on basic Prolog to students with little to no experience in programming. I'd like them to see that programming and Prolog can be used in the real world, perhaps even to do cool things.
I have looked at this and this threads, but I cannot find anything that is visually appealing that I can show them when we wrap up the lecture.
Do you have any suggestions for cool applications that use Prolog? I'm especially looking for something that can be shown as a video or slideshow.

If what you want is to highlight the uses of prolog and use audio-visual media merely for presentation purposes, combining the following 2 links might do it:
Natural language processing with prolog in the IBM Watson system
IBM's Watson supercomputer destroys all humans in Jeopardy

Dynalearn is implemented in Prolog and has animations.

See:
http://personnel.univ-reunion.fr/fred/Enseignement/Prolog/index.html
under "La librairie clpfd", there are links to 3 finite domain constraint animations (N-Queens, Sudoku, Knight Tour) that are used in this class.

InFlow is written in Prolog. You may browse through the examples and / or contact the author for details. VisiRule might also help.
Disclaimer: I have not used either InFlow or VisiRule, but I do use WIN-Prolog which is the environment used for both programs.

+1 for Visirule. It is, as far as I can tell (and I've researched this topic quite a lot) a unique visual programming tool (I don't know of any other visual tool that is easily reduced to a turing-complete language). I have implemented a trouble-shooting website with it along with various other solutions. Highly recommended- version 5 coming out soon too.

Related

I've been programing for six year and my homework in University gets marked down for coding style [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I've been programming for the last 6 years. I just recently started my first degree in computer science. My work seems to be constantly marked down for different reasons, amongst many of them:
Uncommented code
Writing too long identifier names and methods
Writing too many methods
After working as a programmer for six years for numerous startup companies, and absorbing best practices which include the requirement to write "self explanatory code" I find it very difficult to go back to bad practices.
What can I do?
Self documented code is not synonymous with comments.
I've argued with many senior devs around this point. Code can go a long way in communicating intent but there are some things which simply cannot (and should not) be documented through code.
For example if you have a highly optimised function/method or chunk of code which is heavily coupled to the underlying problem domain and requires very specific knowledge of the business or solution. Comments are needed in these scenarios.
Yes, yes, comments come with there fair share of problems but this doesn't mean they aren't helpful (or mandatory in certain cases).
I can't tell you how many times I've read a colleagues line of code and thought "what the hell?!?" only for them to explain that they needed to do that due to some quirk of some library or browser we were targeting etc.
Comments are a mechanism for a developer to justify a design decision.
As for your other problems, they are subjective. How long is too long? How many is too many?
Point them at Microsoft's guidelines if you are on the MS stack or there will be countless articles for whichever language you're using...
Hope that helps.

What is a good website to learn prolog? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 9 years ago.
I need to do a project for class in Prolog but they gave us no guidance at all in the language it self. I was reading http://kti.mff.cuni.cz/~bartak/prolog/contents.html but I am not understanding anything of what I am reading.
Any better sources out there you can share?
Bratko's "Prolog Programming for AI" is excellent, clear, lively, accessible. Sterling and Shapiro's "The Art of Prolog" is very good too, very thorough with the basic/foundational stuff.
Bratko was the one were it "clicked" for me. I took this slogan from him (don't remember if he wrote it or if I distilled it from his book somehow) - in Prolog, to understand the question is to have your answer. Writing down the question properly gives you a runnable program, more or less. I remember reading a page on AVL trees where he wrote down the definition, and I turned the page expecting to see the "solution". But it was already about something else. Turning the page back I realized, that the statement of what AVL trees were, was already the program itself.
Many moons ago, I liked the book Programming in Prolog by William F. Clocksin & Christopher S. Mellish. It also helps to work through exercises and see how the language works. You can work through some problems from this site Werner Hett's P-99: Ninety-Nine Prolog Problems and here SWI Prolog is a good implementation to use.
I like Adventures in Prolog, but learning a logic language on your own can be very hard. You really can learn much faster and more correctly with a mentor or taking a college course.

How to write a desktop app that filters test questions according to topic [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
What programming language/method would be best suited to writing a desktop app that
filters question types and displays a listing of those questions to view.
For example, if I have a mix algebra, geometry, and calculus questions stored in the app,
I should be able to select just the algebra questions to view and print.
I have a little experience with python/django but I've never made a desktop app before.
You have lots of options. You will need to make several design decisions before you move forward. Things to consider are:
Which technologies do you feel comfortable with?
How much time/effort do you want to put into the project?
Are you willing to spend money on tools?
Etc.
That being said, the rest of this answer is to give you some options to consider:
You'll need a data structure which can filter the problems for you.
From your description, the first thing I thought of was using a
database, however I'm not sure if you are familar with databases, in
which case you'd have to create some classes/structs that would allow for you to do the filtering yourself. Some options for databases are SQL Express, Oracle, MySQL, DB2, and many more.
Another thing to consider is you mentioned several different type of
math problems. You'd want to consider how you would be displaying
the problems. Mathematica formats math problems nicely, but if you
wanted to go down this road, you'd either have to find a tool that
would allow you to display that math problems in a syntax like
Mathematica or do exports/screen shots of the problems and have those as
part of your program.
Another option would be to try to find a
language that has some sort of plugin for TeX or LaTeX (For example,
you can see how wikipedia allows for nice math formatting here:
http://en.wikipedia.org/wiki/Help:Displaying_a_formula
This sounds like a good pet project to play with to learn different technologies. If that is the intent, great. If not, then you might want to do some googling to see if someone else has already created what you are looking for.

Understanding Introduction to Algorithms, Third Edition [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I've been trying to read and understand the contents of this book: http://www.amazon.com/Introduction-Algorithms-Thomas-H-Cormen/dp/0262033844
But I'm finding the contents to be challenging purely because I don't understand the mathematical or pseudo code notation. Are there any resources or books I should read / study in order to help me understand the content? I think I'm looking for the missing mathematical link in my life. I need something to bridge the gap between school and college level.
Thanks
Chris
Maybe go for a book where the examples are given in a specific language rather than pseudo-code. e.g. Algorithms in C++ by Sedgewick is a grand book if you know C++. Many of the older books tend to use Pascal like pseudo code, where Pascal isn't as common as it once was.
Being able run the code under a debugger, single stepped watching variables change, is also a great aid to understanding how the algorithm works.
Be sure to read the first sections and the appendix at the end of the book, which has some mathematical background explained.
A good, not easy, but suitable for high school student, introduction to mathematics used in computer science is Concrete Mathematics, by Knuth, Graham & Patashnik.

is SICP still recommended? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I have some experience with python, I asked for a new language, and said that i am having a hard time implementing what I have learned. they suggested I learn SICP. Saying it uses a great language and teaches great programming fundamentals.
But I notice it was published in 1984. Do you guys recommend it, or have I been trolled? :p
Thanks.
Yes, SICP is still a great book! The second edition, which is available online, as of 1996. Although, if you just want to learn Scheme instead of fundamental computer science, you might be better off with Teach Yourself Scheme in Fixnum Days.
I strongly encourage you to check out the book How to Design Programs. It focuses on the fundamentals of programming, not on the specific language, but it also uses Scheme as its language. It's also available free online.
You can also check out the current release of the second edition, which is in preparation (or the less-stable but more up-to-date current draft).
Firstly, you're loooking at the first edition. The second edition is from 1996.
You should VERY MUCH tackle the book. I've gone through about half and my mind is blown. I can't begin to explain how amazing it is. Not only will you develop an appreciation for elegance in programming, but you'll see the line blurred between coding and computer science.
Don't approach this book like a programming book. Approach it as if you want to learn the fundamentals of computation and computer science using programming as a means of expression.
SICP is one of the best books I've read for learning how to write programs well. I never used scheme outside of the work I did in that book, but it's well worth your time.

Resources