📄 acqclips.clp
字号:
=> (retract ?question) (printout t "How would you characterize the target firm's strategic planning?"crlf) (printout t "The valid response is 3-synergistic with acquisition,2-acceptable,"crlf) (printout t "1-no effect or unknown, or 0-unacceptable. Please choose 3,2,1, or 0."crlf) (assert (am9 (read))) (assert (question qm10)))(defrule qm10 ?question <- (question qm10) => (retract ?question) (printout t "How would you rate the target firm's tax planning?"crlf) (printout t "The valid choice is 3-synergistic with acquisition),2-acceptable,"crlf) (printout t "1-no effect or unknown, or 0-unacceptable. Please choose 3,2,1, or 0."crlf) (assert (am10 (read))) (assert (question qm11)))(defrule qm11 ?question <- (question qm11) => (retract ?question) (printout t "How would you qualitatively characterize the target firm's"crlf) (printout t "growth or expansion policy in relation to its resources?"crlf) (printout t "The valid response is 4-mismatched,1-na or unknown,"crlf) (printout t "or 0- well-matched. Please choose 4,1, or 0 and one answer only."crlf) (assert (am11 (read))) (assert (question qm12)))(defrule qm12 ?question <- (question qm12) => (retract ?question) (printout t "How does the target firm's management feel about the acquisition?"crlf) (printout t "Factors to consider include golden parachute, continued employment, etc."crlf) (printout t "The valid response is 3-cooperative with acquisition,2-compatible,"crlf) (printout t "1-no effect or unknown, or 0-antagonistic. Choose 3,2,1, or 0."crlf) (assert (am12 (read))) (assert (phase finance))); The third and last phase of user-input questions pertain to the target firm's; financial factors such as liquidity, return on investment, etc.(defrule phase-3 ?phase <- (phase finance) => (retract ?phase) (printout t "The third phase of questions gathers the target firm's financial"crlf) (printout t "information in assessing its suitability for acquisition."crlf) (printout t "In all your responses, please choose only one answer for each question"crlf) (printout t "and remember that the answer is case-sensitive and should be in exact"crlf) (printout t "number or word as it appears in the choice."crlf) (assert (question qf1)))(defrule qf1 ?question <- (question qf1) => (retract ?question) (printout t "What is the size, total assets, of the target firm?"crlf) (printout t "The valid choice is 6-under $100 million,"crlf) (printout t "3-between $100 million and $500 million, 0-over $5million."crlf) (printout t "Please choose 6,3, or 0 and one answer only."crlf) (assert (af1 (read))) (assert (question qf2))); asks the target firm's market to book value ratio and checks for valid response.(defrule qf2 ?question <- (question qf2) => (retract ?question) (printout t "What is the target firm's market to book value ratio?"crlf) (printout t "Please enter any number or na if the ratio is unknown."crlf) (printout t "Your response will be converted by the system as 3,2,1, or 0."crlf) (printout t "Please enter a valid response, for no error checking will be done."crlf) (bind ?answer (read)) (while (and (neq ?answer na) (not (numberp ?answer))) do (printout t "Please enter a valid response, any number or na-if the ratio is unknown."crlf) (bind ?answer (read))) (if (and (numberp ?answer) (>= ?answer 1.0) (<= ?answer 2.0)) then (assert (af2 2))) (if (and (numberp ?answer) (> ?answer 2.0)) then (assert (af2 3))) (if (and (numberp ?answer) (< ?answer 1.0)) then (assert (af2 0))) (if (eq ?answer na) then (assert (af2 1))) (assert (question qf3)))(defrule qf3 ?question <- (question qf3) => (retract ?question) (printout t "How has the target firm's market to book value ratio changed compared"crlf) (printout t "to one year ago?"crlf) (printout t "The valid response is 5-greater than or equal to 50% decrease,"crlf) (printout t "3-decreased but less than 50%,1-the ratio is unknown, or 0-increased."crlf) (printout t "Please choose 5, 3, 1, or 0 and only one answer."crlf) (assert (af3 (read))) (assert (question qf4)));; The following question concerns price per share and in relation to earnings.;; If only level price is concerned more by the shareholders, then similar ;; questions as qf2 and qf3 can be made up for the level price variable questions.(defrule qf4 ?question <- (question qf4) => (retract ?question) (printout t "What is the target firm's price to earnings ratio?"crlf) (printout t "Please enter na if the ratio is unknown."crlf) (printout t "Please enter a valid response, for no error checking will be done."crlf) (printout t "Your response will be converted by the system as 3,2,1, or 0."crlf) (bind ?answer (read)) (if (and (numberp ?answer) (>= ?answer 1.0) (<= ?answer 2.0)) then (assert (af4 2))) (if (and (numberp ?answer) (> ?answer 2.0)) then (assert (af4 3))) (if (and (numberp ?answer) (< ?answer 1.0)) then (assert (af4 0))) (if (eq ?answer na) then (assert (af4 1))) (assert (question qf5)))(defrule qf5 ?question <- (question qf5) => (retract ?question) (printout t "How has the target firm's price to earnings ratio changed compared"crlf) (printout t "to one year ago?"crlf) (printout t "The valid response is 5-greater than or equal to 50% decrease,"crlf) (printout t "3-decreased but less than 50%,1-the ratio is unknown, or 0-increased."crlf) (printout t "Please choose 5, 3, 1, or 0 and only one answer."crlf) (assert (af5 (read))) (assert (question qf6)))(defrule qf6 ?question <- (question qf6) => (retract ?question) (printout t "What is the average excess return of the target firm for the last"crlf) (printout t "21 trading days?"crlf) (printout t "The valid response is 3-less than or equal to $-3 per share,"crlf) (printout t "2-greater than $-3 and less than $-0.2 per share, 1-between $-0.2 "crlf) (printout t "and $0.2 per share or unknown, or 0-greater than $0.2 per share."crlf) (printout t "Please choose 3, 2, 1, or 0 and one answer only."crlf) (assert (af6 (read))) (assert (question qf7)))(defrule qf7 ?question <- (question qf7) => (retract ?question) (printout t "How has the target firm's average excess return for the last 21"crlf) (printout t "trading days changed compared to one year ago?"crlf) (printout t "The valid response is 4-greater than or equal to 50% decrease,"crlf) (printout t "3-less than 50% decrease, 1-immaterial or unknown, or 0-increased."crlf) (printout t "Please choose 4, 3, 1, or 0 and one answer only."crlf) (assert (af7 (read))) (assert (question qf8)))(defrule qf8 ?question <- (question qf8) => (retract ?question) (printout t "How much has the trading volume for the last 21 trading days increased"crlf) (printout t "for the target firm compared to three month ago?"crlf) (printout t "The valid response is 3-more than 300%, 2-between 300% and 100%,"crlf) (printout t "1-less than 100% and greater than 0%, or 0-not increased or unknown."crlf) (printout t "Please choose 3, 2, 1, or 0 and one answer only."crlf) (assert (af8 (read))) (assert (question qf9)))(defrule qf9 ?question <- (question qf9) => (retract ?question) (printout t "How much has the bid-ask spread for the last 21 trading days increased"crlf) (printout t "for the target firm compared to three month ago?"crlf) (printout t "The valid choice is 3-more than 200%, 2-between 200% and 100%,"crlf) (printout t "1-less than 100% and greater than 0%, or 0-not increased or unknown."crlf) (printout t "Please choose 3, 2, 1, or 0 and one answer only."crlf) (assert (af9 (read))) (assert (question qf10))); The following rule is not used for assessing the suitability in this program, but; it is included for future reference and future use with neural nets. (defrule qf10 ?question <- (question qf10) => (retract ?question) (printout t "What is the current ratio of the target firm? Enter na if unknown."crlf) (printout t "Current ratio is the ratio of current assets to current liabilities."crlf) (printout t "This response will not be used for evaluation, but "crlf) (printout t "please answer for future neural nets application."crlf) (assert (af10 (read))) (assert (question qf11)))(defrule qf11 ?question <- (question qf11) => (retract ?question) (printout t "How would you evaluate the current ratio of the target firm "crlf) (printout t "for acquisition purpose?"crlf) (printout t "The valid response is 6-excellent, 3-good, 1-unknown,"crlf) (printout t "or 0-unacceptable. Choose 6, 3, 1, or 0 and one answer only."crlf) (assert (af11 (read))) (assert (question qf12))); The following rule is not used for assessing the suitability in this program, but; it is included for future reference and future use with neural nets.(defrule qf12 ?question <- (question qf12) => (retract ?question) (printout t "What is the quick ratio of the target firm? Enter na if unknown."crlf) (printout t "Quick ratio is the ratio of current assets minus inventory"crlf) (printout t "divided by current liabilities."crlf) (printout t "This response will not be used for evaluation, but please answer."crlf) (assert (af12 (read))) (assert (question qf13)))(defrule qf13 ?question <- (question qf13) => (retract ?question) (printout t "How would you evaluate the quick ratio of the target firm "crlf) (printout t "for acquisition purpose?" crlf) (printout t "The valid response is 4-excellent, 3-good, 1-unknown,"crlf) (printout t "or 0-unacceptable. Choose 4, 3, 1, or 0 and one answer only."crlf) (assert (af13 (read))) (assert (question qf14))); The following rule is not used for assessing the suitability in this program, but; it is included for future reference and future use with neural nets.(defrule qf14 ?question <- (question qf14) => (retract ?question) (printout t "What is the return on total assets of the target firm?"crlf) (printout t "Enter na if the ratio is unknown."crlf) (printout t "The return on total assets is the ratio of net income to total assets."crlf) (printout t "This response will not be used for evaluation, but please answer."crlf) (assert (af14 (read))) (assert (question qf15)))(defrule qf15 ?question <- (question qf15) => (retract ?question) (printout t "How would you evaluate the return on total assets of the target firm "crlf) (printout t "for acquisition purpose?"crlf) (printout t "The valid response is 5-excellent, 3-good, 1-unknown,"crlf) (printout t "or 0-unacceptable. Please choose 5,3,1,or 0 and one answer only."crlf) (assert (af15 (read))) (assert (question qf16))); The following rule is not used for assessing the suitability in this program, but; it is included for future reference and future use with neural nets.(defrule qf16 ?question <- (question qf16) => (retract ?question) (printout t "What is the target firm's return on equity? Enter na if unknown."crlf) (printout t "The return on equity is the ratio of net income to total equity."crlf) (printout t "This response will not be used for evaluation, but please answer."crlf) (assert (af16 (read))) (assert (question qf17)))(defrule qf17 ?question <- (question qf17) => (retract ?question) (printout t "How would you evaluate the target firm's return on equity "crlf) (printout t "for acquisition purpose?"crlf) (printout t "The valid response is 5-excellent, 3-good, 1-unknown,"crlf) (printout t "or 0-unacceptable. Please choose 5,3,1, or 0 and only one answer."crlf) (assert (af17 (read))) (assert (show endinput))); The following rule indicates that the user input has ended.(defrule endinput ?show <- (show endinput) => (retract ?show) (printout t "You have successfully answered all the questions required for the"crlf) (printout t "expert system to return a target firm's acquisition suitability value."crlf) (assert (phase environment-value)));; This phase contains environmental evaluation of the user's;; input for acquisition consideration. It returns one overall;; evaluation of environmental input and offers an explanation;; for the evaluation. The possible values for the evaluation;; are excellent, good, fair, or poor. Each of the 3 groups of;; user input will be assessed by the expert system and will be;; given one of the four values. Based on the 64 combination ;; of evaluation values (4 values for each group and 3 groups =;; 4x4x4=64), a final overall evaluation will be presented by;; the expert system as explained earlier using 10 point scale.(defrule phase-4 ?phase <- (phase environment-value) => (retract ?phase) (printout t "This phase contains environmental evaluation of the user's "crlf) (printout t "input for acquisition consideration. It returns one overall "crlf) (printout t "evaluation of environmental input and offers an explanation "crlf) (printout t "for the evaluation. The possible values for the evaluation "crlf) (printout t "are excellent, good, fair, or poor. Each of the 3 groups of"crlf) (printout t "user input will be assessed by the expert system and will be"crlf) (printout t "given one of the four values. Based on the 64 combination"crlf) (printout t "of evaluation values (4 values for each group and 3 groups = "crlf) (printout t "4x4x4=64), a final overall evaluation will be presented by"crlf) (printout t "the expert system as explained earlier using 10 point scale."crlf) (assert (envvalue allenvvalue)));; The following rule stores the user's response to be used in ;; printing and explaining the expert system's evaluation, and;; the next rule adds the user's response values;; to give the overall environmental evaluation value as ;; excellent, good, fair, or poor. (defrule allenvvalue (ae1 ?ae1) (ae2 ?ae2) (ae3 ?ae3) (ae4 ?ae4) (ae5 ?ae5) (ae6 ?ae6) (ae7 ?ae7)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -