Is there a concurrent separation logic in Isabelle for imperative language? I found A Separation Logic Framework for Imperative HOL but that's not designed for concurrent imperative language like C and I wonder if there is a such framework as Iris in Coq? Maybe the framework developed by Viktor Vafeiadis is the most relevant one. But I wonder if there is a more well-developed framework that supports better syntax and detailed features.
Related
In the introduction to The Art of Prolog, Sterling and Shapiro defer a discussion of parallelism, concurrency, and logic programming to another book. My question is whether there is such a resource:
[the] promise of parallel computers, combined with the parallelism that seems to be available in the logic programming model, have lead to numerous attempts, which are still ongoing, to execute Prolog in parallel, and to devise novel concurrent programming languages based on the logic programming computation model. This, however, is a subject for another book (The Art of Prolog, p. xx).
Searching on Google, I found a parallel implementation of Prolog and concurrency libraries for Mercury, in addition to hundreds of research papers and dissertations. But it's harder to locate resources on the second part of the paragraph, about concurrent programming and programming languages based on the execution models of logic programming languages. Is there a good resource on these topics? I'm particularly interested in references on compiling and writing parallel and concurrent logic programs.
In Prolog you can have both non-determinism and concurrency. Non-determinsim is what is usually described as unification and backtracking. You can imagine that a Prolog clause is full of implicit amb statements. It is less known that concurrency is also supported by logic-programming.
But today we might just go with treads inside logic programming. Here is an example to implement a findall via threads. This can also be modded to perform all kinds of tasks on the collection, or maybe even produce agent networks towards distributed artificial intelligence.
There is a even a proposal for a set of ISO standard predicates that support threading inside Prolog. These predicates also cover synchronization and queueing primitives. But more important, light weighted Prolog based web servers wouldn't work, there werent multi-threaded Prolog systems around:
ISO/IEC DTR 13211–5:2007 Prolog multi-threading support
http://logtalk.org/plstd/threads.pdf
Whether this question is a wide range or not I would like to ask :
Is it possible to implement aspect-oriented programming (AOP) features into OCaml language?
It is interesting to observe that, in contrast to the traditional
concept of crosscutting in the OO setting where aspects typically
crosscut several classes, the majority of the applications of aspects
in functional programming only involve a single function in the
pointcut. We believe the realisation of this difference as concluded
by this paper is important to both the functional and AOP commu- nity.
There is a pressing need to properly interpret and develop of the
concept of ‘crosscutting’ in the functional setting before functional AOP spreads its wings.
[emphasis mine]
What Does Aspect-Oriented Programming Mean for Functional Programmers? (PDF)
Regardless, there are direct attempts/translations of AOP to OCaml or ML systems. From my comment, I don't find these convincing, and believe that proper use of modules and functors can do a lot to capture the demarcation of concerns. Those direct attempts are,
Aspectual Caml
PolyAml(PDF)
Aspect ML
I have asked a related question, but I did not get a satisfactory answer. So, perhaps I should ask it a different way.
How do large-scale C projects, like Perl or Ruby or even the Linux kernel, handle unit-testings? Or even in any functional language?
I am familiar with Dependency Injection and Abstract Factory for testings in OOP, but I don't see a scalable and manageable equivalence in non OOP. In C or Haskell, for example, there would be layers over layers of functions, higher ones implicitly calling the lower ones. How do I find seams to test just an unit of code instead of all its dependencies?
One way to avoid the need for seams all together is to keep the depths of call-dependency graph very low. Code horizontally rather than vertically, so to speak. Keep as much of the application logic as possible in the "leaf" functions; and make sure the "node" functions do no work other than plumbing the data to other node/leaf functions. Then, test only the "leaf" functions; leave the "node" functions out to integration tests. Is that approach effective?
The largest software today are still written in procedural languages. There must be some methodologies being employed that work. Could someone with experience with large-scale software in procedural languages with good unit-testings comment?
Functional languages have other constructs (than objects) for modularity, such as ML functors. "Dependency injection" is basically a glorified name for "abstracting over things" and has been used for ages in functional languages.
Testing, in all paradigms, should follow the specification boundaries. If you have an idea what a given piece of code (function, method, object...) is supposed to do, you should test against this specification. For leaf functions, this will be unit testing, for "node" function this can be considered "integration testing" if you like, but it's really the same activity.
I think you will find that the same methodologies essentially applies to functional programming, with essentially the same results; in particular, (re)designing code to be easy to test also improves its modularity and maintainability.
designing code to be easy to test also improves its modularity and maintainability.
Not true. Designing code to be easy to test improves the ease of writing test code.
Natural divisions of functional modules usually aren't the most convenient for unit testing. That's why so much Java code these days is broken into tiny, scattered pieces, with each piece mostly not useful by itself.
What are the programming languages we can use in the development of an artificial intelligent system? which operating system should be used? can C or C++ programming languages be used?
What are the programming languages we can use in the development of an artificial intelligent system?
Prolog is a good start for reasoning systems. Lisp is a good start for symbolic systems. Both of those can be embedded in other languages, e.g., C++.
which operating system should be used?
Er.... any?
can C or C++ programming languages be used?
Yes.
You probably want to learn more about programming before you tackle AI.
Definitely. And it's a good choice too, because it can be made pretty well performing (which is the main problem in developing a good AI).
But there is no limitation, really. Any language will do.
Just about any language can be used but you want one that works well with your specific domain, and you are comfortable with using.
As already mentioned, PROLOG and LISP are both traditional AI languages. General purpose languages such as Java, C#, and C++ also have their uses.
Also if you are looking at aural language processing, then a language that is good at text processing and data structures would be ideal. Eg. Python and the NLTK toolkit.
Although some languages are more strongly associated with AI programming than others -- e.g., LISP, Prolog -- many different languages can be used.
Any of the general-purpose operating systems may be used.
You can use a procedural language like C. An OO language like C++, Java or C# offers some advantages. Functional and logical languages are also worth considering.
Personally, I've written one A-B game-playing program now in LISP, Java and C#.
Any language can be used to develop Artificial Intelligence, AI, applications; some make implementing the AI concepts easier than others.
Some old time favorites are LISP and Prolog.
If you are well versed in C or C++, then use either one to implement the concepts.
When you want to learn AI programming you should pick a language where you can concentrate on the problem domain instead of the language.
For example in a typical C program about half of the code concerns itself with memory management and error handling. By using a language that supports garbage collection and exceptions you can reduce this amount drastically.
The choice of language also depends on prior works. Are there any or do you want to start from scratch? If the prior works seem to be good, you can hope that they already chose an appropriate language.
It depends on the niche you are interested in, but C++ is probably the most popular language for artificial intelligence. You will find that most libraries are written for it.
You can use languages other than C++, too. Functional languages, such as LISP and F# are good choices for AI, because they offer good tools for decomposing complicated logic.
The operating system is not much of an issue. Whether you choose Windows, Unix, or Mac, you will find a few libraries that are not cross-platform and unavailable for your platform.
Every language that supports Object Orientation has a port of xUnit. What about for non-oo languages? Are there advantages, or different ways of doing things, and if so, is there a prototypical example (like xUnit is for OO languages)?
wikipedia has a nice page listing the testing frameworks by language: http://en.wikipedia.org/wiki/List_of_unit_testing_frameworks