How does Warrens Abstract Machine work?

I’ve recently learned about prolog and Logic programming which I find pretty cool, but the compiler is currently like magic to me and I want to know how they work.

After a little bit of research I discovered that logical compilers are based on Warrens Abstract Machine (WAM). I’ve tried to find some information on WAM, but the Wikipedia page only describes what it is and not how it works and the book Warrens Abstract Machine: A Tutorial Reconstruction doesn’t read very well for me.

Could I please have basic explanation of how WAM works?

Thank you.

Abstract data access to user data in large-scale webservices

I am doing research on large-scale webservices and I am trying to understand what common techniques are to prevent user data being accidentally leaked to other logged in users. Especially where end-to-end encryption is not possible because the server needs to be content aware of the data.

So, Imagine a high-frequented service like GitHub, Google Docs or Stackoverflow. In a naive/classic database environment there is a database with a huge table called users and fields like sha256_password_with_salt etc.

Is that it? What abstraction layers or mechanisms are used to prevent data being exposed due to attacks or simply bugs? I would like to avoid under any circumstances that e.g. due to a bug in the usage of a SQL INNER JOIN data gets exposed to another user.

Let’s assume I have a service like Google Docs where a few users have access to the same document. I was thinking about a database per document because I would have a single connection handle and from there I could be assured that a faulty access to another database is pretty much impossible.

But that would mean that every (RESTful)-request would result in a new connection because keeping more than just a few hundred connections open is out of question. Also initiating a new connection to each database for every single request takes too much time. So to keep it short, are there any talks, papers or resources which focus on this issue and how to solve them in a secure and performant manner?

Simplify expression with abstract matrices

After defining a commutator function

Commutator[X_, Y_] := X.Y - Y.X; 

I would like to be able to simplify abstract matrix algebra expressions such as

Simplify[Commutator[A + B, Commutator[A + B, A - B]] -    Commutator[A - B, Commutator[A + B, A - B]]] 

instead of just printing out

-(A - B).(-(A - B).(A + B) + (A + B).(A - B)) + (A +      B).(-(A - B).(A + B) + (A + B).(A - B)) + (-(A - B).(A + B) + (A +         B).(A - B)).(A -      B) - (-(A - B).(A + B) + (A + B).(A - B)).(A + B) 

Is there a way to do this without downloading a non-commutative algebra package?

Is there an abstract architecture equivalent to Von Neumann’s for Lambda expressions?

In other words, was a physical implementation modelling lambda calculus (so not built on top of a Von Neumann machine) ever devised? Even if just on paper?
If there was, what was it? Did we make use of its concepts somewhere practical (where it can be looked into and studied further)?

— I’m aware of specialised LISP machines. They were equipped with certain hardware components that made them better but eventually they were still the same at their core.

If there isn’t such thing, what stops it from being relevant or worth the effort? Is it just a silly thought to diverge so greatly from the current hardware and still manage to create a general-purpose computer?

Unity C# XML Serialization broke when abstract base type is added

I had a menu system with 4 different item types instantiated from one XML file. I had always intended to build an abstract base class for them to inherit from, after I knew what the common elements would be. When I wrote the simple base class, and assigned the 4 existing items as derived classes, everything broke! The GameObjects with my instantiator scrips kick this error, now:

InvalidOperationException: To be XML serializable, types which inherit from IEnumerable must have an implementation of Add(System.Object) at all levels of their inheritance hierarchy. UnityEngine.Transform does not implement Add(System.Object) 

I read a lot about why it could happen, but like I said, it wasn’t happening until I build a new, very simple abstract class for the items to inherit from.
Any help understanding “why” would be awesome!

What is the difference between a Type and an Abstract Type?

In my data structures course we are given definitions for Type and Abstract Type but they confuse me.

A type is a set of values and the operations you can do on them. The set of operations is called an interface.

Wait, what? Do this mean that Type = set of values + interface?

An Abstract Type is a type only accessible through its interface.

I fail to see how this differ from the Type definition. You always need to use the interface in order to do anything with the set of values. Are there types that can be accessed without having a set of operations defined on them a.k.a an interface?

Abstract data types (model, principle of no junk)

I have the following abstract data structure

Now i have to find a model that satisfies the principle of no junk and proof that

Could someone advise me to get to a solution and to understand the whole topic?


1 spec NatSet = Bool and Nat then 2 3 sorts 4 natSet = emptySet | add(natSet, nat) 5 6 ops 7 isEmpty: (natSet) bool, 8 contains: (natSet, nat) bool, 9 union: (natSet, natSet) natSet, 10 intersect: (natSet, natSet) natSet 11 12 vars 13 s,s’: natSet, 14 n,n’: nat 15 16 axioms 17 isEmpty(emptySet) = true 18 isEmpty(add(s, n)) = false 19 20 contains(emptySet, n) = false 21 contains(add(s, n), n) = true 22 n 6= n’ ⇒ contains(add(s, n), n’) = contains(s, n’) 23 24 union(emptySet, s) = s 25 union(add(s, n), s’) = add(union(s,s’), n) 26 27 intersect(emptySet, s’) = emptySet 28 intersect(s, emptySet) = emptySet 29 intersect(add(s, n), add(s’, n)) = add(intersect(s, s’), n) 30 n 6= n’ ⇒ intersect(add(s, n), add(s’, n’)) = 31 union(intersect(s, add(s’, n’)), intersect(add(s, n), s’)) 32 end 

What is meant by a full abstract model of a lambda-calculus like language?

The simply typed lambda-calculus with numbers and fix has long been a favorite experimental subject for programming language researchers, since it is the simplest language in which a range of subtle semantic phenomena such as full abstraction arise.

I tried to find a definition for full-abstract model but I haven’t found such. This quote is from Pierce’s TAPL book. Note that there is also a related question: What is a "model" of lambda calculus? on the site that has not been answered.