Hi Reuben!

> That said, I'm interested in coding a "troubleshooter" to help with my day
> job in tech support, and was wondering if there are similar projects I could
> study for inspiration. It would, for example, accept as input a number of
> observed symptoms, and output the most likely known issues matching all
> those symptoms. Similarly, it could help with upgrade path validation —
> e.g., by warning of known issues with existing hardware and targeted
> software versions.

Sounds to me like you want to implement an *expert system*!

> This probably sounds trivial compared with something like generating quines,

The neat thing about generating quines is that the entire program is
super short--maybe 10 or 12 lines of code, if you use the matche
pattern matcher.  It's more the search behind the scenes, and the
constraints like 'symbolo', that are a little tricky.

An expert system may be longer and more complex.  Or it may not be,
depending on how sophisticated it is.

> but I'm having trouble wrapping my mind around how to express things like
> "search for known issues associated with this version and add them to a list
> of risks to beware" in logic programming. Is it worthwhile, even just as a
> brainstorming exercise, to write such a program imperatively, then
> "translate" it to the logic engine paradigm?

It is definitely possible to write sophisticated expert systems in
miniKanren (or in core.logic, the Clojure equivalent).  For example,
see this comment from https://news.ycombinator.com/item?id=8549823:

"Interesting and relevant comment from cbrozefsky, which is marked dead.

ThreatGRID, now part of Cisco, uses clojure in our malware analysis
and threat intelligence platform. It's a core part of our analysis
engine, which examines all the things malware does and how to detect
it on the rest of your systems. We've built a 1980s "expert system"
startup using core.logic.

It's also the core of our API service, and the UI built on top of
that. We use clojurescript extensively in the UI, and have been moving
large parts of it to Om.

It is a key technology for us, letting us build better analysis tools,
faster and more performant than other languages. We have clojure code
in production both in our SaaS offering, and shipped to many large
finance, government, and corporate customers around the world. "

The ThreatGrid folks wrote the pldb library, presumably as a helper
for their expert system, which has now been integrated into
core.logic:

https://github.com/threatgrid/pldb

The Reasoned Schemer doesn't tell you how to build an expert system.
But it does discuss the "impure" features like conda, condu, and
project (in the chapter "On Thin Ice") that might be handy (although
which would also inhibit the ability to run backwards).  Writing the
expert system to be purely relational is almost certainly trickier,
but is almost certainly possible.

A great book for learning about these sorts of AI-related topic is
'Prolog Programming for Artificial Intelligence, 4th Edition' by Ivan
Bratko.  Or you can get ther 3rd edition for super cheap.  Chapter 15
of the 4th edition is all about expert systems.  The code is in
Prolog, but the book is full of interesting ideas, and much of the
code can be translated into miniKanren without much difficulty.

You could also try writing an expert system in the imperative or
functional language of your choice, then translating it into
miniKanren, as you suggest.  You might pick up Norvig's 'Paradigms of
Artificial Intelligence Programming: Case Studies in Common Lisp' if
you are a Lisper -- chapter 16 is on expert systems:

http://norvig.com/paip.html

And there are a zillion books and papers on building expert systems,
going back at least to the 1980s.  And there are lots of expert system
libraries for Clojure, Java, etc., that you might want to look at for
inspiration.

Hope this helps!

--Will

-- 
You received this message because you are subscribed to the Google Groups 
"minikanren" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/minikanren.
For more options, visit https://groups.google.com/d/optout.

Reply via email to