Running "backwards" here pertains to logic/relational programming in
MiniKanren/core.logic style. Roughly here programs are expressed in terms
of relations between the input and output. So given an input and an output
query you'll run it forwards and by making the input itself a variable with
a fixed output will generate a series of possible inputs, that'd be running
it backwards. Useful for generating programs :-)

Here is an example:
http://jvns.ca/blog/2013/11/20/day-31-logic-programming-pretty-music/

~BG

On Thu, Jun 23, 2016 at 7:52 AM, Ashish Negi <thisismyidash...@gmail.com>
wrote:

> I am reading joy of clojure. In the "forward to second edition" William E
> Byrd and Daniel P Firedman says :
>
>
>
> *As with recursion, the art of defining little languages encourages—and
> rewards—wishful thinking. You might think to yourself, “If only I had a
> language for expressing the rules for legal passwords for my login system.”
> A more involved example—a story, really—started several years ago, when we
> thought to ourselves, “If only we had the right relational language, we
> could write a Lisp interpreter that runs backward.”[2]
> <http://www-legacy.manning.com/fogus2/excerpt_foreword2ed.html#footnote-2>
> What does this mean? *
>
>
> *An interpreter can be thought of as a function that maps an input
> expression, such as (+ 5 1), onto a value—in this case, 6. We wanted to
> write an interpreter in the style of a relational database, in which either
> the expression being interpreted or the value of that expression, or both,
> can be treated as unknown variables. We can run the interpreter forward
> using the query (interpret ‘(+ 5 1) x), which associates the query variable
> x with the value 6. Better yet, we can run the interpreter backward with
> the query (interpret x 6), which associates x with an infinite stream of
> expressions that evaluate to 6, including (+ 5 1) and ((lambda (n) (* n 2))
> 3). (Brainteaser: determine the behavior of the query (interpret x x).)*
>
> Although the writer gave an example of `*(interpret x 6)*` i could not
> imagine the use case of `*lisp interpreter running backwards*` ?
> I am not even sure what he meant exactly.
>
> Thinking on it, i could only relate this to *theorem prover*s where you
> run backwards from the result.
> Can somebody explain this ?
>
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with
> your first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Baishampayan Ghose
b.ghose at gmail.com

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to