diff --git a/Help/parse-andes.cl b/Help/parse-andes.cl index bc36cfeaa..bc3b3997e 100644 --- a/Help/parse-andes.cl +++ b/Help/parse-andes.cl @@ -128,11 +128,12 @@ (cond ((not (position #\= equation)) (setf rem (make-hint-seq (list - (format nil "Entry ~a is not an equation." equation) + (format nil "Entry \"~a\" is not an equation.  If you are trying to define a scalar quantity, use ~A instead." + equation *text-tool*) "The entry needs an = sign to be an equation.")))) ((> (count #\= equation) 1) (setf rem (make-hint-seq (list - (format nil "~a is not a single equation." equation) + (format nil "\"~a\" is not a single equation." equation) "You may enter only one equation on a line.")))) ((search "sec" equation) (setf rem (make-hint-seq (list diff --git a/INSTALL b/INSTALL index 173cbd3b9..86605897c 100644 --- a/INSTALL +++ b/INSTALL @@ -70,14 +70,8 @@ make install-solver # a binary release and then use that to compile the sbcl source code. cd lisp-site-install make get-binary # download a binary release - # Compile and install the source version: make get-source # download and compile source make source-install # install in /usr/local (do as superuser) - -# To test for thread support, start up sbcl and enter the -# command "(find :sb-thread *features*)". If it returns ":sb-thread" -# then threading is enabled. Enter "(quit)" to exit sbcl. - cd ../ # return to Andes root directory make sbclrc # Install the sbcl initialization file. diff --git a/KB/Ontology.cl b/KB/Ontology.cl index d36e5aeff..9916e5826 100644 --- a/KB/Ontology.cl +++ b/KB/Ontology.cl @@ -118,7 +118,7 @@ (eval (force-types ?type)) (or ;; This should handle "force of the man acting on the crate" - (and (object ?body) (agent ?agent) (time ?time)) + (and (preferred (object ?body)) (preferred (agent ?agent)) (time ?time)) ;; case "the force that the man exerts on the crate" (and ((or "that" "with which") ?agent (or "exerts on" "acts on") ?body) (time ?time))))) @@ -241,7 +241,7 @@ (def-qexp property (property ?body) ;; "for" is exceptionally used - :new-english ("of" (or (var (body ?body) :namespace :objects) ?body))) + :new-english ("of" (or (var ?body :namespace :objects) ?body))) (def-qexp change (change ?property) @@ -328,16 +328,6 @@ ) ) -;; optime : time is optional -;; ex) "the net force exerted by the man at time T1" -(def-qexp property-object-optime - (property-object-optime ?property ?body :time ?time) - :new-english ((the) - ?property ; "mass" - (and (preferred (property ?body)) (time ?time)) - ) - ) - ;; ex) "the mass of the crate" ;; "the crate's mass" ;; "the value of crate's mass" @@ -359,7 +349,7 @@ :new-english (eval (when (expand-new-english ?body) '((or "on" "acting on" "exerted on" "that acts on" "applied on" "applied to" "against") - (or (var (body ?body) :namespace :objects) ?body))))) + (or (var ?body :namespace :objects) ?body))))) (def-qexp agent (agent ?body) ;;+syjung @@ -367,12 +357,12 @@ ;; important for the case that it is missing (in elec4b, see Bug #1676) :new-english (eval (when (expand-new-english ?body) '((or "due to" "by" "from" "caused by" "exerted by" "of") - (or (var (body ?body) :namespace :objects) ?body))))) + (or (var ?body :namespace :objects) ?body))))) (def-qexp agent-with-preposition (agent ?preposition ?body) :new-english (eval (when (expand-new-english ?body) '(?preposition - (or (var (body ?body) :namespace :objects) ?body))))) + (or (var ?body :namespace :objects) ?body))))) (def-qexp time (time ?time) :new-english (eval (when ?time @@ -401,8 +391,8 @@ :units |kg| :restrictions positive ;; "ball's mass" problem s2e - :new-english (property-object-optime "mass" ?body :time ?time) -) + :new-english ((the) "mass" + (and (preferred (property ?body)) (time ?time)))) ;; the magnitude of the change of mass of ~A per unit time due to ~A~@[ ~A~]" ;; (nlg ?body) (nlg ?agent 'agent) (nlg ?time 'pp) @@ -431,8 +421,7 @@ :units |m| :new-english ((the) (or "distance" "dist." "dist") (or ((or "traveled" "travelled" "travels" "moves" "moved") - (and ("by" (or (var (body ?body) :namespace :objects) - ?body)) + (and ("by" (or (var ?body :namespace :objects) ?body)) (time ?time))) ((property-object "distance" ?body) (and (allowed (or "traveled" "travelled" "travels" @@ -471,7 +460,11 @@ :short-name "coef. of friction" :units NIL ;; dimensionless :new-english ((the) "coefficient of" ?static-or-kinetic "friction" - (and (preferred ("between" (or (var ?body1 :namespace :objects) ?body1) "and" (or (var ?body2 :namespace :objects) ?body2))) + (and (preferred + ("between" + (or (var ?body1 :namespace :objects) ?body1) + "and" + (or (var ?body2 :namespace :objects) ?body2))) (time ?time)))) ;; "coefficient of drag for ~A moving through ~A" diff --git a/KB/circuit-ontology.cl b/KB/circuit-ontology.cl index 70494863f..66e939809 100644 --- a/KB/circuit-ontology.cl +++ b/KB/circuit-ontology.cl @@ -25,11 +25,13 @@ :units |V| :new-english ((the) "voltage across" (component ?comp) (time ?time))) +;; BobShelby (epow2): "resistance of R1" +;; "resistance of resistor R2" (def-qexp resistance (resistance ?name) :symbol-base |R| :short-name "resistance" :units |$W| - :new-english ((the) "resistance of" (component ?name))) + :new-english ((the) "resistance of" (allowed "resistor") (component ?name))) (def-qexp current (current-thru ?component :time ?time) :symbol-base |I| @@ -44,7 +46,8 @@ :symbol-base |C| :short-name "capacitance" :units |F| - :new-english ((the) "capacitance of" (component ?name))) + :new-english ((the) "capacitance of" (allowed "capacitor") + (component ?name))) ;;; in the workbench, the time slot is added if feature changing-voltage ;;; is included. @@ -58,7 +61,7 @@ ;; Generally components are a single symbol or a list for ;; a compound component. ;; Sometimes the component can be defined with the body tool. - :new-english (or (var (body ?a) :namespace :objects) + :new-english (or (var ?a :namespace :objects) (eval (if (consp ?a) `(conjoin (or "and" "&") . ,?a) ?a)))) ;;; in the workbench, the time slot is added if feature changing-voltage @@ -85,13 +88,14 @@ (component ?name) (time ?time))) ;; ind3a "self-inductance" +;; from resitance: "the inductance of inductor L1" (def-qexp self-inductance (self-inductance ?inductor) :symbol-base |L| :short-name "self-inductance" :units |H| :new-english ((the) (or ((preferred "self") "inductance") "self-inductance") - (preferred "of" (component ?inductor)))) + "of" (allowed "inductor") (component ?inductor))) (def-qexp mutual-inductance (mutual-inductance orderless . ?inductors) :symbol-base |M| diff --git a/KB/circuits.cl b/KB/circuits.cl index 8051624b7..512f75ec9 100644 --- a/KB/circuits.cl +++ b/KB/circuits.cl @@ -662,6 +662,7 @@ ) :hint( ;;(point (string "Apply Kirchhoff's Loop Rule to the circuit.")) + ;; See bug #1729 (point (string "You can apply Kirchoff's Loop Rule to the loop containing ~A." (?p1 conjoined-names))) ;;(point (string "Write an equation that sets the sum of the voltage across each component around the closed circuit loop to zero.")) (teach (string "Kirchoff's Loop Rule states that the sum of the voltages around any closed circuit loop must be equal to zero.")) diff --git a/KB/dynamics.cl b/KB/dynamics.cl index 84511b2e0..8236ac33c 100644 --- a/KB/dynamics.cl +++ b/KB/dynamics.cl @@ -740,9 +740,10 @@ (given (dir (force ?b ?medium drag :time ?t)) ?drag-dir) (implicit-eqn (= ?dir-var ?dir-var-value) (dir (force ?b ?medium drag :time ?t)))) :hint - ((point (string "Notice that ~a is moving in a fluid medium ~a." ?b ?medium)) + ((point (string "Notice that ~a is moving in a fluid medium (~a)." + ?b ?medium)) (teach (string "When an object is moving in a fluid medium, the fluid offers resistance to the motion of the object. This is represented by a drag force directed opposite to the direction of motion.")) - (bottom-out (string "Because ~a is moving in fluid medium ~a, draw ~a at ~a." + (bottom-out (string "Because ~a is moving in ~a, draw ~a at ~a." ?b ?medium ((force ?b ?medium drag :time ?t) def-np) (?drag-dir adj) )) )) diff --git a/KB/kinematics.cl b/KB/kinematics.cl index 75a9c53ce..f90d1e89e 100644 --- a/KB/kinematics.cl +++ b/KB/kinematics.cl @@ -1574,8 +1574,9 @@ (kcd "draw_accel_straight_speeding_up") (string "When a body is moving in a straight line and speeding up, its acceleration is parallel to the line of motion.")) (bottom-out (string "Because ~a is speeding up while moving in a straight line with direction ~a, you should use ~A to draw an acceleration for it ~a at direction ~a." + ?b ?dir (*vector-tool* eval) - ?b ?dir (?t pp) ?dir)) + (?t pp) ?dir)) )) (defoperator draw-accel-potential (?b ?t) diff --git a/KB/principles.cl b/KB/principles.cl index 11dee1c16..c6f86dc6c 100755 --- a/KB/principles.cl +++ b/KB/principles.cl @@ -1057,8 +1057,7 @@ ;; so nested data structures can exceed the signal ;; recursion limit in lisp. #+sbcl (SB-KERNEL:*MAXIMUM-ERROR-DEPTH* 20) - (Stream (open - (merge-pathnames file *Andes-Path*) + (Stream (open file :direction :output :if-exists :supersede :external-format #+sbcl :utf-8 #-sbcl :default))) ;; Assume stream has UTF-8 encoding (default for sbcl) @@ -1101,8 +1100,7 @@ ;; recursion limit in lisp. #+sbcl (SB-KERNEL:*MAXIMUM-ERROR-DEPTH* 20) (json:*lisp-identifier-name-to-json* #'string-downcase) - (stream (open - (merge-pathnames file *Andes-Path*) + (stream (open file :direction :output :if-exists :supersede :external-format #+sbcl :utf-8 #-sbcl :default))) ;; Assume stream has UTF-8 encoding (set for sbcl) @@ -1248,7 +1246,7 @@ )) -(defun problem-html-files (&optional (path *andes-path*)) +(defun problem-html-files (&optional path) "construct html files for all problems" (dolist (prob (listprobs)) (when (problem-graphic prob) (format t "~A~%" (problem-graphic prob))) @@ -1283,7 +1281,7 @@ F-8\">~%" (when (streamp stream) (close stream))))) -(defun problem-xml-files (&optional (path *andes-path*)) +(defun problem-xml-files (&optional path) "construct xml files for all problems" (dolist (prob (listprobs)) (let ((*print-pretty* NIL) ;disble line breaks