;;;; -*- Mode: LISP; Syntax: Common-Lisp; Base: 10 -*- ;;;; --------------------------------------------------------------------------- ;;;; File name: run-qr-bote-examples.lsp ;;;; System: ;;;; Author: Praveen Paritosh ;;;; Created: May 2, 2004 19:56:17 ;;;; Purpose: ;;;; --------------------------------------------------------------------------- ;;;; Modified: Sunday, May 2, 2004 at 20:41:40 by paritosh ;;;; --------------------------------------------------------------------------- (in-package :common-lisp-user) (defparameter *suggestion-assertions* nil) (defparameter *wm-fact-dump* nil) (defun wm-fact-dump () (let (facts) (map-over-facts (lambda (f) (push f facts))) facts)) (defun collect-solve-data () (push (fire::grab-all-suggestions-assertions) *suggestion-assertions*) (push (wm-fact-dump) *wm-fact-dump*)) ;;;Problem WM KB ;;;1 12 30 ;;;2 20 30 ;;;3 13 20 ;;;4 20 12 ;;;5 14 30 ;;;6 10 10 ;;;7 16 18 ;;;8 18 20 (defun run-qr-bote-examples () ;; How many popcorns would fill in the 1890 Maple big classroom? ;; To Run the example (fire::setup-solve-test-case *popcorn-suggestions* *popcorn-facts* :KB) (multiple-value-setq (ans tree) (fire::solve *popcorn-query* :response :bindings)) (collect-solve-data) ;; For more solutions ;; (fire::get-solution tree) ;; How much money is spent on Newspapers in the US? ;; (annualSales NewspaperCopy UnitedStatesOfAmerica (YearFn 2003) ?money) ;; To Run the example (fire::setup-solve-test-case *news-suggestions* *news-facts* :KB) (multiple-value-setq (ans tree) (fire::solve *news-query* :response :bindings)) (collect-solve-data) ;; For more solutions ;; (fire::get-solution tree) ;; How Many K-8 Teachers are there in the US? ;; (cardinality K-8SchoolTeacher ?numteachers) (fire::setup-solve-test-case *teacher-suggestions* *teacher-facts* :KB) (multiple-value-setq (ans tree) (fire::solve *teacher-query* :response :bindings)) (collect-solve-data) ;; For more solutions ;; (fire::get-solution tree) ;; What is the annual cost of healthcare in the US? (fire::setup-solve-test-case *health-suggestions* *health-facts* :KB) (multiple-value-setq (ans tree) (fire::solve *health-query* :response :bindings)) (collect-solve-data) ;; For more solutions ;; (fire::get-solution tree) ;; How many cars are bought per year in the US? (fire::setup-solve-test-case *cars-suggestions* *cars-facts* :KB) (multiple-value-setq (ans tree) (fire::solve *cars-query* :response :bindings)) (collect-solve-data) ;; For more solutions ;; (fire::get-solution tree) ;; What is the weight of solid garbage thrown away by American ;; families each year? (fire::setup-solve-test-case *garbage-suggestions* *garbage-facts* :KB) (multiple-value-setq (ans tree) (fire::solve *garbage-query* :response :bindings)) (collect-solve-data) ;; For more solutions ;; (fire::get-solution tree) ;; How many hotdogs are sold in a baseball season in Wrigley Field? (fire::setup-solve-test-case *hotdog-suggestions* *hotdog-facts* :KB) (multiple-value-setq (ans tree) (fire::solve *hotdog-query* :response :bindings)) (collect-solve-data) ;; For more solutions ;; (fire::get-solution tree) ;; What is the total amount of gasoline consumption by cars in the US? (fire::setup-solve-test-case *gas-suggestions* *gas-facts* :KB) (multiple-value-setq (ans tree) (fire::solve *gas-query* :response :bindings)) (collect-solve-data) ;; For more solutions ;; (fire::get-solution tree) ) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; End of Code