<!DOCTYPE html>
<html> <head>
<meta charset="UTF-8">
<title>Question answering demo</title>
<link rel=stylesheet type="text/css" href="/~hallgren/gf/src/www/minibar/minibar.css">
div.answer { font-size: 125%; background: #def; }

<body class=minibar>
<h1>Question answering demo</h1>

<div id="question_answer">
  <noscript>Enable JavaSscript to use this web app</noscript>

<h2>About this demo</h2>

Press space for word completion.
Press <kbd>Enter</kbd> after entering a number.
This demo was created by combining three parts:
  <li><p>A GF grammar for math queries.
    (Abstract syntax:
  <a href="../Ex3/"></a> and
  <a href="../Ex3/"></a>,
  concrete syntax for English:
  <a href="../Ex3/"></a> and
  <a href="../Ex3/"></a>.)
  The grammar covers a small set of properties of numbers
  (smaller than, greater than, even, odd, prime, divisibility),
  conjunction, disjunction, negation, and quantification (all, any).
  You can ask if a property holds, for which numbers a property holds or
  for how many numbers a property holds. Examples:
    <li>which numbers smaller than 100 are prime
    <li>how many prime numbers are even
    <li>is 607 prime
  <li><p>A Haskell program (<a href="../Ex3/Answer.hs">Answer.hs</a>
  and generated by GF: <a href="../Ex3/MathQuery.hs">MathQuery.hs</a>)
  that interprets the queries and computes answers.
  To ensure termination, only a finite subset of the natural numbers
  is considered (currently [0..1000]). This also means that some questions
  have surprising answers (e.g. which numbers are greater than all prime
  <li><p>JavaScript components from <a href="">the Minibar</a> for guided input of queries.
  The parts are combined and initialized in
  <a href="../../js2html.cgi/Tutorial2012/Ex4/answer.js">answer.js</a>.

<div class=modtime><small>
<!-- hhmts start -->Last modified: Wed Nov 21 19:16:08 CET 2012 <!-- hhmts end -->
<address><a href="">TH</a></address>
<script type="text/JavaScript" src="/~hallgren/gf/src/www/js/support.js"></script>
<script type="text/JavaScript" src="/~hallgren/gf/src/www/js/localstorage.js"></script>
<script type="text/JavaScript" src="/~hallgren/gf/src/www/js/pgf_online.js"></script>
<script type="text/JavaScript" src="/~hallgren/gf/src/www/minibar/minibar_support.js"></script>
<script type="text/JavaScript" src="/~hallgren/gf/src/www/minibar/minibar_input.js"></script>
<script type="text/JavaScript" src="answer.js"></script>
<script type="text/JavaScript">

Generated by GNU Enscript