::: {.Section1} [Wesner Moise has a fantastic blog post on how iterators and Expressions can be used to implement backtracking:]
It turns out that it is possible to implement logic programming in C\# natively through the use of iterators.
The above rules in [Prolog](https://www.amazon.com/gp/product/0262193388 "http://www.amazon.com/exec/obidos/redirect?path=ASIN/0262193388&link code=as2&camp=1789&tag=netundocume-20&creative=9325") could be translated into following C\# code[: ]http://wesnerm.blogs.com/net undocumented/2005/12/iterators and n.html
grandparent(x, z) :– parent(x, y), parent(y, z).
parent(jebbush, gpbush).
parent(ghwbush, gwbush).
parent(ghwbush, jebbush).
:::