No subject

From: ()
Date: Mon Dec 3 19:58:15 EST 2012

Symbolic Logic inference systems.
 - Rete Forward Rule Firing: Jess Drools
 - Backward Chaining:  Prolog, many others ...
 - Theorem Provers: Coq, Isabelle, ...

If you really want to play with something very cool that combines both
forward/backward chaining, I'd suggest having some fun with OpenCyc.  Makes
you think Ray K's singularity is just around the corner (-not-) .  Low
level logic programming (forward/backwards chaining) in CL (Lisp) and is
fascinating to play with.  You can add tons of complex rules,
run interference queries.  http://www.cyc.com/opencyc

Since the world doesn't really dance to a Vulcan tune, most of the cool
stuff today is in and around probabilistic casual inference.  Bayesian
Statistics, Graphical Models, BGMs,  MRFs.  Heck I wouldn't even spend time
taking a "traditional" stats course with all the alpha, significance, null
hypothesis voodoo silliness.  I don't even think it should be taught at
colleges anymore for those who require practical application of stats in
their field.   Go straight to Bayesian.

The next big computer programming language may very well be
for probabilistic programming.
http://zinkov.com/posts/2012-06-27-why-prob-programming-matters/   Really
good book, which sucks because they price it at a premium is:
http://www.amazon.com/Doing-Bayesian-Data-Analysis-Tutorial/dp/0123814855

P.S. For example if the Neil's ever got together and implemented
a probabilistic reasoning multi-agent solution for the home, think Nest
thermostat, music player, dvd, kitchen, washer/dryer, water heater,
security system, , garage door, fish tank, dog dish, the whole "internet of
things" (think a whole bunch of Raspberry Pi devices in the house on a
network) they'd be rich and famous (hopefully I'll get 3%).  Did I just say
"Startup".  (Google: Probabilistic Reasoning In Multi-Agent Systems, U
Xiang for the PDF).

P.P.S So much cool things in this world, so little time...



On Wed, Jan 9, 2013 at 10:48 AM, Ray Racine <ray.racine at gmail.com> wrote:

> Sorry off topic, but Forward Production Rete Rules Engines, such fond
> memories.   An exact blueprint to code one from scratch is below.  Jess is
> license encumbered, Drools is not, but I expect you've already run across
> it.
>
> And many, many moons long gone, I did an impl in SML that compiled under
> MLton  which was PDQ.  Then a buddy of mine with some assistance did what
> is AFAIK still the only mult-threaded / concurrent implementation (in Java)
> of a Reta alpha/beta network using a sort of "zipper" algo on the network
> graph.  It's still out there http://www.zilonis.org/ , not used by anyone
> AFAIK, though we believe a few folks did take the code internally.   We had
> it in production for awhile long ago (ad targeting on web).   Rumor was
> Forgy also built a concurrent solution, but you had to model the Rete in a
> DSL and it compiled to Java code.  Never caught on.
>
> Oh and yes of course, the Zilonis version has a "tiny" scheme interpreter
> built in to write capable of simple calculations, regex matches etc in the
> rules.
> Production Matching for Large Learning Systems (Rete/UL)<http://docs.codehaus.org/download/attachments/8082/CMU-CS-95-113.pdf?version=1&modificationDate=1092858118000>
>
>
> by Robert B. Doorenbos
>
>
> On Wed, Jan 9, 2013 at 8:36 AM, Grant Rettke <grettke at acm.org> wrote:
>
>> Hi,
>>
>> I have the goal of inserting some Jess (http://herzberg.ca.sandia.gov/)
>> code inside of a Scribble interaction environment (eventually I will have a
>> language to evaluate this but I'm not there yet). Here is the relevant part
>> of the code I have to do that:
>>
>> #lang racket
>>
>> (define (my-read-syntax src in)
>>   (define path-ls (get-path in))
>>   (define path (list->string path-ls))
>>   (define fis (open-input-file #:mode 'text path))
>>   (define datums (let loop ()
>>                    (let* ((datum (read fis)))
>>                      (cond ((eof-object? datum) empty)
>>                            (else (cons datum (loop)))))))
>>   (close-input-port fis)
>>   (datum->syntax #f datums))
>>
>> This does load the file and insert it into Scribble eg:
>>
>> (interaction
>>     #:eval
>>     my-evaluator
>>     ((watch all)
>>      (reset)
>>      (defrule do-anything "A rule for anything." ?ne <- (anything) =>
>> (printout t "Someone did something.") (retract ?ne))
>>      (assert (anything))
>>      (run)))))
>>
>> There are two things I'm still not doing correctly though:
>>
>> #1. I've collected the contents of that file into a list of datums that
>> looks like this in DrRacket's console:
>>
>> '((watch all)
>>   (reset)
>>   (defrule
>>    do-anything
>>    "A rule for anything."
>>    ?ne
>>    <-
>>    (anything)
>>     =>
>>    (printout t "Someone did something.")
>>    (retract ?ne))
>>   (assert (anything))
>>   (run))
>>
>> I don't want those inserted as a list though, I only want the contents
>> inserted. Up above I see why it is happening, but I am not successfully
>> splicing it in my attempts. What is the right way?
>>
>> #2. The code body is formatted at least in the output in DrRacket. When
>> it is inserted into the Scribble environment, though, it loses some of it's
>> formatting namely the defrule and right arrow appear in the same line. That
>> said, when Scribble renders it, all of the code is rendered on the same
>> line like this:
>>
>> > ((watchall)(reset)(defruledo-anything"A rule for anything."?ne<-(
>> anything)=>(printoutt"Someone did something.")(retract?ne))(assert(
>> anything))(run))
>>
>> =>: arrow not allowed as an expression
>>
>> How may I read in that file and then generated a syntax object that
>> retains the indentation and new lines?
>>
>> #3. Am I generally going about this in an OK manner? My next part of the
>> plan to make a simple language whose only purpose in life is to evaluate
>> Jess code and print out the results; I want to be able to use Scribble for
>> any other Lispy language out there at least the interaction environment.
>>
>> ____________________
>>   Racket Users list:
>>   http://lists.racket-lang.org/users
>>
>>
>

--14dae93404ed4374ca04d2de427c
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">I&#39;ll respond on the list if that is ok, you never know=
 the utility. =A0 To be clear none of this is my field, and I&#39;m no expe=
rt, just stuff I&#39;ve played with.<div><br></div><div>From Jess (Rete) a =
likely progression of things ...<br>
</div><div><div><br></div><div>Symbolic Logic inference systems.</div><div>=
=A0- Rete Forward Rule Firing: Jess Drools</div><div>=A0- Backward Chaining=
: =A0Prolog, many others ...</div><div style>=A0-=A0Theorem=A0Provers: Coq,=
 Isabelle, ...=A0</div>
<div><br></div><div style>If you really want to play with something very co=
ol that combines both forward/backward chaining, I&#39;d suggest having som=
e fun with OpenCyc. =A0Makes you think Ray K&#39;s singularity is just arou=
nd the corner (-not-) . =A0Low level logic programming (forward/backwards c=
haining) in CL (Lisp) and is fascinating to play with. =A0You can add tons =
of complex rules, run=A0interference=A0queries. =A0<a href=3D"http://www.cy=
c.com/opencyc">http://www.cyc.com/opencyc</a></div>
</div><div style><br></div><div style>Since the world doesn&#39;t really da=
nce to a Vulcan tune, most of the cool stuff today is in and around=A0proba=
bilistic=A0casual inference. =A0Bayesian Statistics, Graphical Models, BGMs=
, =A0MRFs. =A0Heck I wouldn&#39;t even spend time taking a &quot;traditiona=
l&quot; stats course with all the alpha,=A0significance, null hypothesis=A0=
voodoo=A0silliness. =A0I don&#39;t even think it should be taught at colleg=
es anymore for those who require practical application of stats in their fi=
eld. =A0 Go straight to Bayesian. =A0</div>
<div style><br></div><div style>The next big computer programming language =
may very well be for=A0probabilistic=A0programming. =A0<a href=3D"http://zi=
nkov.com/posts/2012-06-27-why-prob-programming-matters/">http://zinkov.com/=
posts/2012-06-27-why-prob-programming-matters/</a>=A0=A0=A0Really good book=
, which sucks because they price it at a premium is:=A0<a href=3D"http://ww=
w.amazon.com/Doing-Bayesian-Data-Analysis-Tutorial/dp/0123814855">http://ww=
w.amazon.com/Doing-Bayesian-Data-Analysis-Tutorial/dp/0123814855</a></div>
<div style><br></div><div style>P.S. For example if the Neil&#39;s ever got=
 together and implemented a=A0probabilistic=A0reasoning multi-agent solutio=
n for the home, think Nest thermostat, music player, dvd, kitchen, washer/d=
ryer, water heater, security system, , garage door, fish tank, dog dish, th=
e whole &quot;internet of things&quot; (think a whole bunch of=A0Raspberry=
=A0Pi devices in the house on a network) they&#39;d be rich and famous (hop=
efully I&#39;ll get 3%).=A0=A0Did I just say &quot;Startup&quot;.=A0=A0(Goo=
gle: Probabilistic Reasoning In Multi-Agent Systems, U Xiang for the PDF). =
=A0=A0</div>
<div style><br></div><div style>P.P.S So much cool things in this world, so=
 little time...</div><div style><br></div></div><div class=3D"gmail_extra">=
<br><br><div class=3D"gmail_quote">On Wed, Jan 9, 2013 at 10:48 AM, Ray Rac=
ine <span dir=3D"ltr">&lt;<a href=3D"mailto:ray.racine at gmail.com" target=3D=
"_blank">ray.racine at gmail.com</a>&gt;</span> wrote:<br>
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex"><div dir=3D"ltr">Sorry off topic, but Forwar=
d Production Rete Rules Engines, such fond memories. =A0 An exact blueprint=
 to code one from scratch is below. =A0Jess is license encumbered, Drools i=
s not, but I expect you&#39;ve already run across it.<div>

<br></div><div>And many, many moons long gone, I did an impl in SML that co=
mpiled under MLton =A0which was PDQ. =A0Then a buddy of mine with some assi=
stance did what is AFAIK still the only mult-threaded / concurrent implemen=
tation (in Java) of a Reta alpha/beta network using a sort of &quot;zipper&=
quot; algo on the network graph. =A0It&#39;s still out there=A0<a href=3D"h=
ttp://www.zilonis.org/" target=3D"_blank">http://www.zilonis.org/</a>=A0, n=
ot used by anyone AFAIK, though we believe a few folks did take the code in=
ternally. =A0 We had it in production for awhile long ago (ad targeting on =
web). =A0=A0Rumor was Forgy also built a concurrent solution, but you had t=
o model the Rete in a DSL and it compiled to Java code. =A0Never caught on.=
</div>

<div><br></div><div>Oh and yes of course, the Zilonis version has a &quot;t=
iny&quot; scheme interpreter built in to write capable of simple=A0calculat=
ions, regex matches etc in the rules.<br><div><h2 style=3D"font-weight:norm=
al;margin:30px 0px 10px 10px;font-size:1.1em;padding:5px 0px 5px 8px;backgr=
ound-image:url(http://media.codehaus.org/themes/standard-green-experimental=
/img/gradient2.png);background-color:rgb(238,238,238);border-width:1px;bord=
er-style:solid;border-color:rgb(221,221,221) rgb(187,187,187) rgb(187,187,1=
87) rgb(221,221,221);font-family:tahoma,verdana,sans-serif;background-repea=
t:repeat no-repeat">

<a href=3D"http://docs.codehaus.org/download/attachments/8082/CMU-CS-95-113=
.pdf?version=3D1&amp;modificationDate=3D1092858118000" style=3D"text-decora=
tion:none;color:rgb(34,102,204)" target=3D"_blank">Production Matching for =
Large Learning Systems (Rete/UL)</a>=A0<br>

<br>by Robert B. Doorenbos=A0</h2></div></div></div><div class=3D"gmail_ext=
ra"><br><br><div class=3D"gmail_quote"><div><div class=3D"h5">On Wed, Jan 9=
, 2013 at 8:36 AM, Grant Rettke <span dir=3D"ltr">&lt;<a href=3D"mailto:gre=
ttke at acm.org" target=3D"_blank">grettke at acm.org</a>&gt;</span> wrote:<br>

</div></div><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;bo=
rder-left:1px #ccc solid;padding-left:1ex"><div><div class=3D"h5">Hi,<div><=
br></div><div>I have the goal of inserting some Jess (<a href=3D"http://her=
zberg.ca.sandia.gov/" target=3D"_blank">http://herzberg.ca.sandia.gov/</a>)=
 code inside of a Scribble interaction environment (eventually I will have =
a language to evaluate this but I&#39;m not there yet). Here is the relevan=
t part of the code I have to do that:</div>


<div><br></div><div><div>#lang racket</div><div><br></div><div>(define (my-=
read-syntax src in)</div><div>=A0 (define path-ls (get-path in))</div><div>=
=A0 (define path (list-&gt;string path-ls))</div><div>=A0 (define fis (open=
-input-file #:mode &#39;text path))</div>


<div>=A0 (define datums (let loop ()</div><div>=A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0(let* ((datum (read fis)))</div><div>=A0 =A0 =A0 =A0 =A0 =A0 =A0=
 =A0 =A0 =A0 =A0(cond ((eof-object? datum) empty)</div><div>=A0 =A0 =A0 =A0=
 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0(else (cons datum (loop)))))))</div=
>


<div>=A0 (close-input-port fis)</div><div>=A0 (datum-&gt;syntax #f datums))=
</div><div><br></div><div>This does load the file and insert it into Scribb=
le eg:</div><div><br></div><div><div>(interaction</div><div>=A0 =A0 #:eval<=
/div>


<div>=A0 =A0 my-evaluator</div><div>=A0 =A0 ((watch all)</div><div>=A0 =A0 =
=A0(reset)</div><div>=A0 =A0 =A0(defrule do-anything &quot;A rule for anyth=
ing.&quot; ?ne &lt;- (anything) =3D&gt; (printout t &quot;Someone did somet=
hing.&quot;) (retract ?ne))</div>


<div>=A0 =A0 =A0(assert (anything))</div><div>=A0 =A0 =A0(run)))))</div></d=
iv><div><br></div><div>There are two things I&#39;m still not doing correct=
ly though:</div><div><br></div><div>#1. I&#39;ve collected the contents of =
that file into a list of datums that looks like this in DrRacket&#39;s cons=
ole:</div>


<div><br></div><div><div>&#39;((watch all)</div><div>=A0 (reset)</div><div>=
=A0 (defrule</div><div>=A0 =A0do-anything</div><div>=A0 =A0&quot;A rule for=
 anything.&quot;</div><div>=A0 =A0?ne</div><div>=A0 =A0&lt;-</div><div>=A0 =
=A0(anything)</div>

<div>
=A0 =A0=3D&gt;</div><div>=A0 =A0(printout t &quot;Someone did something.&qu=
ot;)</div><div>=A0 =A0(retract ?ne))</div><div>=A0 (assert (anything))</div=
><div>=A0 (run))</div></div><div><br></div><div>I don&#39;t want those inse=
rted as a list though, I only want the contents inserted. Up above I see wh=
y it is happening, but I am not successfully splicing it in my attempts. Wh=
at is the right way?</div>


<div><br></div><div>#2. The code body is formatted at least in the output i=
n DrRacket. When it is inserted into the Scribble environment, though, it l=
oses some of it&#39;s formatting namely the defrule and right arrow appear =
in the same line. That said, when Scribble renders it, all of the code is r=
endered on the same line like this:</div>


<div><br></div><div><table cellspacing=3D"0"><tbody><tr><td><span>&gt; </sp=
an><span>(</span><span>(</span><span>watch</span><span>all</span><span>)</s=
pan><span>(</span><span>reset</span><span>)</span><span>(</span><span>defru=
le</span><span>do-anything</span><span>&quot;A rule for anything.&quot;</sp=
an><span>?ne</span><span>&lt;-</span><span>(</span><span>anything</span><sp=
an>)</span><span>=3D&gt;</span><span>(</span><span>printout</span><span>t</=
span><span>&quot;Someone did something.&quot;</span><span>)</span><span>(</=
span><span>retract</span><span>?ne</span><span>)</span><span>)</span><span>=
(</span><span>assert</span><span>(</span><span>anything</span><span>)</span=
><span>)</span><span>(</span><span>run</span><span>)</span><span>)</span></=
td>


</tr><tr><td><p><span>=3D&gt;: arrow not allowed as an expression</span></p=
><p>How may I read in that file and then generated a syntax object that ret=
ains the=A0indentation=A0and new lines?</p><p>#3. Am I generally going abou=
t this in an OK manner? My next part of the plan to make a simple language =
whose only purpose in life is to evaluate Jess code and print out the resul=
ts; I want to be able to use Scribble for any other Lispy language out ther=
e at least the interaction environment.</p>


</td></tr></tbody></table></div>
</div>
<br></div></div>____________________<br>
=A0 Racket Users list:<br>
=A0 <a href=3D"http://lists.racket-lang.org/users" target=3D"_blank">http:/=
/lists.racket-lang.org/users</a><br>
<br></blockquote></div><br></div>
</blockquote></div><br></div>

--14dae93404ed4374ca04d2de427c--

Posted on the users mailing list.