From f696b1ae6e832fb4b3b45ecee89574abb449c748 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Barrette-LaPierre Date: Mon, 17 Sep 2007 20:00:24 -0400 Subject: [PATCH] better output --- finenight/lisp/compile.lisp | 2 +- finenight/lisp/iadfa-run.lisp | 11 +++++------ finenight/lisp/iadfa.lisp | 10 ++++++++-- finenight/lisp/package.lisp | 7 ++++--- 4 files changed, 18 insertions(+), 12 deletions(-) diff --git a/finenight/lisp/compile.lisp b/finenight/lisp/compile.lisp index 6081e7c..a4a547c 100644 --- a/finenight/lisp/compile.lisp +++ b/finenight/lisp/compile.lisp @@ -1,4 +1,4 @@ -(declaim (optimize (speed 3) (space 3) (debug 0))) +(declaim (optimize (safety 0) (speed 3) (space 3) (debug 0))) ;(declaim (optimize (speed 0) (space 0) (compilation-speed 0) (debug 3))) (compile-file "package.lisp") diff --git a/finenight/lisp/iadfa-run.lisp b/finenight/lisp/iadfa-run.lisp index 481a8b5..1086a4c 100644 --- a/finenight/lisp/iadfa-run.lisp +++ b/finenight/lisp/iadfa-run.lisp @@ -6,15 +6,14 @@ (defun iadfa-run () (let* ((iadfa (gen-iadfa-from-file "../../data/com.zone.sorted.small")) (fsa (iadfa-fsa iadfa))) - (with-open-file (str "output.txt" :direction :output :if-exists :supersede) - (dolist (word (extract-words fsa)) - (format str "~A~%" word))))) - -;(detect-problems-from-file "../../data/com.zone.sorted.small") -(iadfa-run) + (print-stats iadfa))) + ;(with-open-file (str "output.txt" :direction :output :if-exists :supersede) + ;(dolist (word (extract-words fsa)) + ;(format str "~A~%" word))))) +;(do-symbols (s (find-package :com.rrette.finenight.iadfa)) ;(sb-ext:save-lisp-and-die "iadfa-run" :executable t :toplevel #'iadfa-run) diff --git a/finenight/lisp/iadfa.lisp b/finenight/lisp/iadfa.lisp index 8ea6736..1c0a90f 100644 --- a/finenight/lisp/iadfa.lisp +++ b/finenight/lisp/iadfa.lisp @@ -272,7 +272,6 @@ (nb-per-hours 0) (nb-hours-for-all 0)) (for-each-line-in-file (line file) - (format t "~,2F w/h ~,2F Hours ~A ~A ~%" nb-per-hours nb-hours-for-all index line) (handle-word iadfa (concatenate 'list line)) (when (member index dump) (graphviz-export-to-file (make-fsa-builder-from-fsa (iadfa-fsa iadfa)) (concatenate 'string "output/iadfa" (format nil "~A" index) ".dot")) @@ -284,7 +283,8 @@ internal-time-units-per-second)) 60 60))) (setf nb-hours-for-all (float (/ (* 65000 (/ (- current-time last-time) internal-time-units-per-second)) 60 60))) - (setf last-time current-time))) + (setf last-time current-time) + (format t "~2,12$ w/h ~2,2$ Hours ~A ~A ~%" nb-per-hours nb-hours-for-all index line))) iadfa) iadfa)) @@ -384,6 +384,12 @@ words-to-be-checked)) +(defun print-stats (iadfa) + (format t + "ancestrors length: ~A~%parent-arities length: ~A~%" + (length (iadfa-ancestrors iadfa)) + (length (iadfa-parent-arities iadfa)))) + diff --git a/finenight/lisp/package.lisp b/finenight/lisp/package.lisp index f2ab929..f50bf43 100644 --- a/finenight/lisp/package.lisp +++ b/finenight/lisp/package.lisp @@ -78,11 +78,12 @@ :build-iadfa :debug-gen-iadfa :debug-gen-iadfa-from-file + :detect-problems-from-file :gen-iadfa-from-file :iadfa-fsa :iadfa-state-ancestrors :make-fsa-builder-from-fsa :nadd-edge - :transition - :detect-problems-from-file - :test-equivalence)) + :print-stats + :test-equivalence + :transition))