Does anyone know of a program that uses a GA to perform grammar induction/inference, I've read tonnes of research papers and articles on this stuff like Lankhorst and De Pauw but I can't find any implementations or programmes that use this technique anywhere. Any help on this greatly appreciated, cheers
I think the work by Oscar Nierstrasz, Markus Kobel and Tudor Gîrba in the context of the MOOSE framework and "agile modeling" could be starting point. They want to infer grammars for programming languages and their dialects, and they make a point of making their tools available in the public domain.
Related
I have a repeat coming up in Computability and Complexity and I was wondering if anybody has good resources for this sort of study.
Things like regular languages, context free and context sensitive languages and all that sort of stuff.
For example:
As you can see, it is a horribly phrased question. The notes our lecturer gave us are equally as bad. I really need to pass this module so if anybody has a good resource for studying these topics it would be much appreciated.
I think the problem you're having is not the fault of the phrasing, but the fact that you're not yet comfortable dealing with the mathematical notation involved.
Wikipedia has a lot of articles on automata and other computer science theory topics. Also, a google search on 'NFA to DFA' turns up many helpful results. Automata are used heavily in compilers, so you might find a more "practical" explanation of things in material from a compilers course.
Your class is going to be heavily mathematical, though, so you would do best for yourself by putting aside the attitude that the material you've been given is poor and spend the time learning to understand it. Mathematical formulations give you precise and concise descriptions without as much room for misinterpretation as informal language has.
You may want to look at the class notes made available by Avi Kak at
https://engineering.purdue.edu/kak/courses-i-teach/ECE664/Index.html
See the handwritten notes on Lecture 17 that explain the notation in your question.
I'm thoroughly intrigued by Scheme, and have started with some toy programming examples, and am reading through Paul Graham's On Lisp.
One thing I haven't been able to find is a book or website intended to teach Scheme to "OO people", i.e. people like myself who've done 99 % of their coding in c++/Java/Python.
I see that closures are sort of object-y, in the sense that they have local state, and offer one or more functions that have access to that state. But I don't want to learn Scheme only to port my existing habits on to it. This is why I'm learning Scheme rather than Common Lisp at the moment; I fear that CLOS might just serve as a crutch to my existing OO habits.
What would be ideal is a book or website that offers case studies of problems solved in both an OO language, and also in Scheme in a Schemey way. I suppose I would most appreciate scientific computing and/or computer graphics problems, but anything would do.
Any pedagogical leads would be much appreciated.
I doubt CLOS would serve as a crutch for old habits, I found it to be pretty different from the OO style in C++/Java/Python, and very interesting. I don't understand all the details, but I would recommend Peter Seibel's Practical Common Lisp. If you are reading On Lisp without much trouble, you should be able to dive into the chapters introducing CLOS in PCL. Also, I'd recommend his Google Tech Talk comparing Java and Common Lisp.
Here's a few more recommendations to make this a more full-fledged answer:
The classic text Structure and Interpretation of Computer Programs covers quite a few examples in chapter 3 of building modular systems using closures (and addresses issues with introducing state and mutability). Chapter 2 includes some generic and data/type-directed programming which could be helpful for motivating study of CLOS. This book really needs no introduction though, it's a towering work, and I've only been reading it slowly since the spring. Highly recommended if you are interested in Scheme.
While SICP is a great book, it's not without its flaws: A really interesting look at these is the essay "The Structure and Interpretation of the Computer Science Curriculum" which elaborates on a few criticism of SICP, and is written by the authors of How to Design Programs (I haven't read HTDP but I hear it's very good). While this essay won't teach you specifically what you are looking for - comparing functional and OO programming - it is really interesting anyway. Their freshman undergraduate course starts with a first semester introduction to functional programming using Scheme (I think, PLT/Racket) and is followed by a semester of OO programming with C++ or Java... at least that's the course they describe in the essay.
These slides from Peter Norvig address some of the design patterns common in OO programming and show why they are missing or unnecessary in dynamic, functional languages like Scheme and Lisp: http://norvig.com/design-patterns/
I cautiously recommend the book by the same authors as the Little Schemer books: A Little Java, A Few Patterns. I can't say for sure if this is a really a good book or not, it was incredibly strange and there are some really bad typesetting decisions (italic, serif, variable-width, superscript doesn't belong in a text on programming), but it might be interesting to take a look at. You can probably find it cheap, anyway. Don't take this recommendation that seriously. I think it would be better to stick to the Scheme texts.
p.s. I have to disagree with one comment stating that functional programming is not as complicated at OO programming, I think that's grossly misstating it. Functional programming in all its breadth is truly mind-boggling. When you go beyond map/filter/reduce and first-class functions, and take a look at other things in the functional realm like lazy evaluation, avoiding side effects and mutation, and the strong, static-typed languages, it gets pretty interesting, and is certainly just as complicated as traditional OO programming. I've only just scratched the surface myself but have discovered a great deal of new ideas. Programming is complicated business, whether OO or functional.
Congrat you, my friend ! Love cs, love functional programming.
If you are python developer it takes 3-4 days to think in scheme
Here is the best simple tutorial I have ever met http://www.shido.info/lisp/idx_scm_e.html
I found this course http://cs.gettysburg.edu/~tneller/cs341/scheme-intro/index.html and it may be useful for you
One beginner's resource that is very helpful and geared very much toward the casual reader is "The Adventures of a Pythonista in Schemeland". It's written (obviously) from the point of view of a Python programmer taking first steps with Scheme. One especially nice thing about it is that it includes an overview of the current implementations and compatibility issues between each scheme implementation, which, unfortunately, can cause some headaches when you're just starting out.
With regards to object systems, these two documents (linked from here) give nice examples of very simple toy implementations using closures that I found helpful in understanding their use in capturing state.
If you are starting off with Scheme, have a look at How to Design Programs. This book presents the "Schemey" approach to problem solving. I don't think there is a book that compares OO and functional solutions to the same programming problems. But there is a nice presentation that shows how dynamic languages like Scheme could provide simple solutions to problems that demand complex design patterns in statically typed OOP languages.
Can somebody point me to good intruductions into OOP main paradigms, like inheritance, polymorphism, encapsulation? I am looking for short article, about 2-3 pages, for very quick reading.
Thank you very much.
Just google for it http://en.wikipedia.org/wiki/Object-oriented_programming
The definitions from Alan Kay (he invented the term) on c2.com:
http://c2.com/cgi/wiki?AlanKaysDefinitionOfObjectOriented
http://c2.com/cgi/wiki?AlanKayOnMessaging
Which might not be the object-oriented you're looking for.
The big idea is "messaging" - that is what the kernel ...
is all about ... The Japanese have a small word - ma - for "that which
is in between" - perhaps the nearest English equivalent is "interstitial".
The key in making great and growable systems is much more to design how its
modules communicate rather than what their internal properties and
behaviors should be.
A very quickly reading cannot introduce you to the OOP paradigm. It's a very large topic and it's better that you study it with attention because it can determine how your code is structured.
I also suggest you to improve your knowledge of design patterns, when you'll correctly understand OOP.
This is hardly a niche topic. For a C#-angle on it take a look at MSDN's documentation: http://msdn.microsoft.com/en-us/library/ms173109%28v=VS.80%29.aspx
Take a look a the Simple English wiki article on OOP.
Can anyone point me in the direction of a very good online OO Design (and Programming) tutorial or resource ?
I appear to have badly designed a small AP in C# and now want to sort it out before I go any further and frustrate myself even more.
I did try to do it quickly and only went over a small and insignificant (now I realise) tutorial on OODP and C# and classes etc and not given it the importance, and time, its obviously needs.
Actually, a good C# tutorial would be helpful too - I only read the C# Programming guide (Public Beta Release), a very old book - 2000/1.
More haste less speed etc. doh
Thanks, George.
I have pointed people to both of these resources before, they are a little basic but they over some good high level overviews:
Learning C# and OOP
C# an Object Oriented Introduction
A lot depends on your skill level and how you design programs in general (your background etc).
It will come with experience. One of my favorite ways to learn is to have a senior coder with 20+ years of experience to tear my code apart. No pain - no gain. The book knowledge goes into one eye and comes out of the other ... Post some code here, damn it!
Does anyone know where to find good online resources with examples of how to make grammars and parse trees? Preferably introductory materials.
Info that is n00b friendly, haven't found anything good with Google myself.
Edit: I'm thinking about theory, not a specific parser software.
Not online, but maybe you should take a look at Compilers: Principles, Techniques, and Tools (2nd Edition) by Aho et al. This is a standard text that has been evolving for 30 years (if you count the 1st Dragon Book, published in 1977
Well, here's where I learned it...
http://www.cs.uiuc.edu/class/sp08/cs273/
Click on the lectures tag, scroll through till you find the lectures on the material you are talking about.
Love my alma mater. God bless them, they never take down their lectures in any class and you can go and read any of them anytime you want.
edit: Looks like you want lecture11
Antlr?
http://www.antlr.org/
Has a quite good IDE for designing a grammar, and a lot of generators for different languages.
www.goldparser.com
The tools are free and good to work on. It has technical and theoretical tutorials, lots of info, tools and code generators for many langs.
in C,C++ use lex and bison
in java use ANTLR
this is a beautiful antlr video tutorial