<div class="notebook"> <div class="nb-cell html" name="htm1"> <h1>Simple genealogist</h1> </div> <div class="nb-cell program" name="p1"> parent(abe, homer). parent(homer, bart). parent(homer, lisa). parent(homer, maggie). grandparent(G, C):- parent(G, P), parent(P, C). </div> <div class="nb-cell html" name="htm2"> <p>Who are the grandchildren?</p> <form> <label for="grandparent">Grandparent</label> <input id="theGrandparent" type="text" value="abe" name="grandparent"> <button id="compute">Compute</button> </form> <script> notebook.$("#compute").on("click", function(ev){ notebook.run("whoAreTheGrandchildren", { G: notebook.$("#theGrandparent").val() }); }); </script> </div> <div class="nb-cell query" name="whoAreTheGrandchildren"> grandparent(G, C). </div> </div>