Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ COPY *.lisp .
RUN ros install ./lisp-inference.asd
RUN ros run -s lisp-inference/web -q
EXPOSE 40000
ENTRYPOINT ["/root/.roswell/bin/inference-server"]
ENTRYPOINT ["/app/roswell/inference-server.ros"]
1 change: 1 addition & 0 deletions lisp-inference.asd
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
:homepage "https://github.com/ryukinix/lisp-inference"
:serial t
:depends-on (:lisp-inference
:40ants-logging
:40ants-routes ;; implicit dependency of reblocks
:reblocks
:reblocks-ui
Expand Down
8 changes: 4 additions & 4 deletions roswell/inference-server.ros
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ exec ros -Q -- $0 "$@"
(unwind-protect
(handler-case
(progn
(format t "[+] Starting Lisp Inference server...~%")
(lisp-inference/web:start *port*)
(format t "[+] http://127.0.0.1:~a~%" *port*)
(format t "[+] Press C-c to kill Lisp Inference server...~%")
(lisp-inference/web:start :port *port* :debug nil)
(log:info "[+] Starting Lisp Inference server...")
(log:info "[+] http://127.0.0.1:~a" *port*)
(log:info "[+] Press C-c to kill Lisp Inference server...")
(loop do (sleep 10)))
(#+sbcl sb-sys:interactive-interrupt
#+ccl ccl:interrupt-signal-condition
Expand Down
9 changes: 7 additions & 2 deletions web/webapp.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -91,14 +91,17 @@ history.pushState(null, '', url);
(defun truth-table (exp)
(with-output-to-string (s)
(let ((inference:*output-stream* s))
(log:info "expression: ~a" exp)
(handler-case (inference:print-truth-table
(inference:parse-logic exp))
(simple-error (c)
(log:warn "Maximum variables reached in expression '~a' generated the error: ~a" exp c)
(apply #'format s
(simple-condition-format-control c)
(simple-condition-format-arguments c)))
(error (c)
(declare (ignore c))
(log:error "Invalid expression: '~a' generated the error: ~a" exp c)
(format s "error: invalid logic expression!"))))))

(defun create-table (exp-string)
Expand Down Expand Up @@ -192,8 +195,10 @@ history.pushState(null, '', url);
*proposition*
prop))))

(defun start (&optional (port *port*))
(reblocks/debug:on)
(defun start (&key (port *port*) (debug t))
(if debug
(reblocks/debug:on)
(40ants-logging:setup-for-cli :level :info))
(reblocks/server:stop)
(reblocks/server:start :port port))

Expand Down