inference

Is solving the halting problem easier than people think?

Although the general case is undecidable, many people still do solve problems that are equivilent well enough for day to day use. In cohen's phd thesis on computer viruses, he showed how virus scanning is equivilent to the halting problem, yet we have an entire industry based around this challenge. I also have seen microsoft's terminat...

What is Hindley-Milner?

I encountered this term "Hindley-Milner" which I'm not sure if grasp what it means. I read Steve Yegge's "Dynamic Languages Strike Back" and "The Pinocchio Problem" and Daniel Spiewak's "What is Hindley-Milner? (and why is it cool?)". But there is no single entry for this term in wikipedia where usually offers me a concise explanation. ...

How could I get data for an intelligent suggestion list?

I want to build a suggestion list where that when I enter "PHP" it knows to suggest "Web Development," and if I enter "Data Recovery" "or "Software Installations," it suggests "Information Technology." I'm sure I can work out a database schema for this, but where would I get the data from? How would the system learn to, as in the exampl...

How does del.icio.us know what tags to suggest for a URL?

When I bookmark http://dbpedia.org/About, del.icio.us suggests "xml" and "programming" as tags. How does it know that the URL relates to these topics? ...

Why not infer template parameter from constructor?

Hi all, my question today is pretty simple: why can't the compiler infer template parameters from class constructors, much as it can do from function parameters? For example, why couldn't the following code be valid: template<typename obj> class Variable { obj data; public: Variable(obj d) { ...

Inference from Generic Type Question.

I suppose this is more of a public rant, but why can't I get c# to infer my Id's type? public EntityT Get<EntityT>(IdT id) where EntityT : EntityObject<IdT> and a defined EntityObject with a Guid as an Id as follows: public Foo : EntityObject<Guid> Inheriting from the abstract EntityObject class defined as follows: public abstract...

Automatically deducing operators in C++?

Is it possible in C++ for the compiler/language to automatically deduce unimplemented operators? For example, if I have: class X { public: bool operator ==(const X &x) const; }; Is there a way for != to be deduced implicitly? And I'll exploit this questions for a semi-related one: How come map's only requirement from it's keys is...

F# Type Inference and System.Object

Hi I have a problem getting the following code to work. open System open System.ComponentModel open System.Threading let triggerEvent (state : Object) = Console.Write("Do Something.") let asyncContext = AsyncOperationManager.CreateOperation(null) asyncContext.PostOperationCompleted(triggerEvent, null) I get an error, that triggerEv...

Objective-C Type Inference

Okay, I have a feeling that you guys'll be able to quickly point out why I'm so confused about this, but I have a question as to why the following does NOT result in a compiler error or warning: NSString * intValue = [ NSString stringWithFormat:@"int = %i", [ [ self.selectedObject valueForKey:name ] integerValue ] ]; selectedObject is...

Retail knowledge inference

So i am doing a research on how can i infer knowledge from reports (not with a specific format), but after pre processing, i should have some kind of formatted data. A fairly basic inference would be: "Retailer has X stock." and "X is sellable." -> "Retailer sells X" the knowledge i focus is retail domain oriented, and if possible i sho...

make inference rule for files in a folder

I use GNU make, I want my source files and object files to be in different folders. As a first step, I want the source files at the root of my project folder, and the object files in a subfolder (say Debug/). The inference rule would be: .ss.obj: echo Assembling $*.ss... $(ASSEMBLY) $(2210_ASSEMBLY_FLAGS) $*.ss -o Debug\$*.obj...

calling template function without <>; type inference

Hi, if I have a function template with typename T, where the compiler can set the type by itself, I do not have to write the type explicitely when I call the function like: template < typename T > T min( T v1, T v2 ) { return ( v1 < v2 ) ? v1: v2; } int i1 = 1, i2 = 2; int i3 = min( i1, i2 ); //no explicit <type> but if I have a ...

Inference engine to calculate matching set according to internal rules

I have a set of objects with attributes and a bunch of rules that, when applied to the set of objects, provides a subset of those objects. To make this easier to understand I'll provide a concrete example. My objects are persons and each has three attributes: country of origin, gender and age group (all attributes are discrete). I have ...

Why can't these generic type parameters be inferred?

Given the following interfaces/classes: public interface IRequest<TResponse> { } public interface IHandler<TRequest, TResponse> where TRequest : IRequest<TResponse> { TResponse Handle(TRequest request); } public class HandlingService { public TResponse Handle<TRequest, TResponse>(TRequest request) where TRequest : ...

Jena Effects of Different Entailment Regimes

I am trying sparql and the use of entailment. As a example i used http://www.w3.org/TR/2010/WD-sparql11-entailment-20100126/#t112 i try to put them in jena. OntClass book1= model.createClass(NS+"book1"); OntClass book2=model.createClass(NS+"book2"); OntClass book3=model.createClass(NS+"book3"); OntClass publicatio...

Ontology - Conflict of same individuals property and datatype property

I am having a problem with "same individuals property" in protege, when i run a reasoner (pellet 1.5 or fact++) Lets take ontology example thing has class sons A and B, A has sons C and D. B, C and D have individuals of the same class. Cant i say a individual C is "same individual" as individual B, and then add also individual D is...

Inferring using Jena

InfModel infmodel = ModelFactory.createInfModel(reasoner, m); Resource vegetarian = infmodel.getResource(source + "Vegetarian"); Resource margherita = infmodel.getResource(source + "Example-Margherita"); if (infmodel.contains(margherita, RDF., vegetarian)) { System.out.println("Margherita is a memberOf Vegetarian pizza"); } ...

Problem in inferring instances that have integer cardinality constraint

Hello, I have created an RDF/OWL file using Protege 4.1 alpha. I also created a defined class in Protege called CheapPhone. This class has a restriction which is shown below : (hasPrice some integer[< 350]) Whenever, a price of a phone is below 350, it is inferred as CheapPhone. There is no problem for inferring this in Protege 4.1 a...

Inference logic rule selection problem

Tommy, jill and travelor belong to the Sc club.Every member of sc club is either a surfer or a bike rider or both.No bike rider likes a rainy day and all the surfers like a sunny day.Jill like whatever Tommy likes and likes whatever tommy dislikes.Tommy likes a rainy day and a sunny day. I want to represent the above information in firs...