h$}      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~The main switch for activating tracing messages for debugging in output.(c) John Maraist, 2022AllRightsReservedhaskell-tms@maraist.org experimentalPOSIXNoneBPSFlag which indicates whether debugging output should be compiled into modules using this system for runtime trace output.BPSMacro which expands to definitions which either print debugging statements, or do nothing.None>1%Helping functions, sort of ExtraExtra(c) John Maraist, 2022AllRightsReservedhaskell-tms@maraist.org experimentalPOSIXNonewBPSCheck whether a list contains a value which, when applied to a computation, returns True.BPSCheck whether a returned list contains a value which satisfies some monadic predicate.BPSCheck whether all of the values of a list, when applied to a computation, return True.BPSDetermine whether one list is a subset of the other, under the assumption that both lists are sorted in ascending order. BPSConvert a list to a string, where the converter for each element is a monadic computation. BPSLike , but with both the elements source as well as the loop body as computations over the monad. BPSA while loop, guard at the top. BPSA while' loop based on stuff, guard at the top. BPSLike , but with an extra check run after the body of the loop. If the check fails, the loop exits early.BPSLike  , but the source list is also the result of a monadic computation.BPSLike  ,, except instead of a fixed list, loop over  values returned from a subcomputation, until that subcomputation returns .BPSLike , expect both the tested value and the body are returned from a computation in a monad.BPSMonadic version of null for a list stored in an  : returns  when the list is empty.BPS Opposite of  , returning $ when the referenced list is empty.BPSLike a combination of  and , where the body receives the (pure) non-null list as an argument.BPS:Map over the values contained within a list of references.BPSFold (right-associatively) the values contained within a list of references.BPSFold (left-associatively) the values contained within a list of references.BPSLike , but with the list under an  . The first argument lifts an  operation into m.BPS5Push a value onto the front of the list at the given  reference.BPSPush the result of a computation onto the front of the list at the given  reference.BPSPush every value in a collection onto the front of the list at the given  reference.BPSPush every value in a collection returned from a computation onto the front of the list at the given  reference.BPS=Pop a value from the given reference to a list if one exists.BPSConsumes the elements of a referenced list, one at a time, until the list is empty. The first argument is a lift-style function which brings  operations into the top-level monad of interest. Intended to be compatible with stack-like behavior (such as with ; this function does use /) where the body of the loop may add elements.BPS*Form a comma-separated string from a list.BPS Remove the  constructors from the elements of a list, discarding elements which are .  6Justification-based truth maintenance systems (JTMSes)(c) John Maraist, 2022 Kenneth D. Forbus, Johan de Kleer and Xerox Corporation, 1986-1993AllRightsReservedhaskell-tms@maraist.org experimentalPOSIXNoneV BPSForms of data which might signal support for a node. The original Lisp does not need this declaration since it is untyped; the latter two cases are simply symbols.$BPSWrapper for one justification relationship between many antecedent nodes and one consequent node. Lisp origins: ;; In jtms.lisp: (defstruct (just (:PRINT-FUNCTION print-just)) (index 0) informant consequence antecedents)(BPS1Wrapper for one possible belief known to the TMS. Lisp origins: ;; In jtms.lisp: (defstruct (tms-node (:PRINT-FUNCTION print-tms-node)) (index 0) (datum nil) ;; pointer to external problem solver (label :OUT) ;; :IN means believed, :OUT means disbelieved (support nil) ;; Current justification or premise marker (justs nil) ;; Possible justifications (consequences nil) ;; Justifications in which it is an antecedent (mark nil) ;; Marker for sweep algorithms (contradictory? nil) ;; Flag marking it as contradictory (assumption? nil) ;; Flag marking it as an assumption. (in-rules nil) ;; Rules that should be triggered when node goes in (out-rules nil) ;; Rules that should be triggered when node goes out (jtms nil)) ;; The JTMS in which this node appears.)BPS4Returns the piece of data associated with this node.*BPSStandalone implementation of justification-based truth maintenance systems.d* is the type of data associated with each ( of this JTMS.i2 is the type of informants in the external system.r8 is the type of rules which may be associated with each ( of this JTMS.s+ is the (phantom) type of the state thread.m. is the monad in which this computation lives. Lisp origins: ;; In jtms.lisp: (defstruct (jtms (:PRINT-FUNCTION print-jtms)) (title nil) (node-counter 0) ;; unique namer for nodes. (just-counter 0) ;; unique namer for justifications. (nodes nil) ;; list of all tms nodes. (justs nil) ;; list of all justifications (debugging nil) ;; debugging flag (contradictions nil) ;; list of contradiction nodes. (assumptions nil) ;; list of assumption nodes. (checking-contradictions T) ;; For external systems (node-string nil) (contradiction-handler nil) (enqueue-procedure nil))+BPSName of this JTMS.,BPS1The process of building and using a mutable JTMS.-BPS,Errors which can arise from JTMS operations..BPSExecute a computation in the , monad transformer./BPSReturn the current list of (s of a *.0BPSReturn the current $s of a *.1BPS,Return the current designated contradictory (s of a *.2BPS'Return the current possible assumption (s of a *. Note that these nodes will not be used as assumptions unless activated by c.3BPSReturn whether a * is currently invoking its external handler for deduced contradictions.4BPSReturn the current ( formatter of a *.5BPSReturn the current $ formatter of a *.6BPSReturn the current d datum formatter of a *.7BPSReturn the current i informant formatter of a *.8BPS3Return the current external queuing procedure of a *.9BPS)Return the current external handler of a ** for reacting to a deduced contradiction.:BPS/Return the current debugging flag setting of a *.;BPSPrint a simple tag with the title of this JTMS. Forces the enclosed monad to be . Lisp origins: ;; In jtms.lisp: (defun print-jtms (jtms stream ignore) (declare (ignore ignore)) (format stream "#" (jtms-title jtms)))<BPSWrite one node in the standard way for this JTMS. Forces the wrapped monad to be . Lisp origins: ;; In jtms.lisp: (defun print-tms-node (node stream ignore) (declare (ignore ignore)) (format stream "#" (node-string node)))=BPSReturn whether a (( may currently be used as an assumption.>BPSReturn whether a () is currently considered a contradiction.?BPS+Return the current support for believing a (.@BPSReturn whether a ( is currently believed.ABPS Return the $s which use a ( as an antecedent.BBPS!Return the current in-rules of a (.CBPS"Return the current out-rules of a (.DBPS Return the $s which currently give a ( as their conclusion.EBPS&Print the tag of a JTMS justification. Lisp origins: ;; In jtms.lisp: (defun print-just (just stream ignore) (declare (ignore ignore)) (format stream "#" (just-index just)))FBPSReturns True! when the node is supported by a $ with no antecedents. Lisp origins: ;; In jtms.lisp: (defun tms-node-premise? (node &aux support) (and (setq support (tms-node-support node)) (not (eq support :ENABLED-ASSUMPTION)) (null (just-antecedents support))))GBPSProduce a representation of the node in the default manner for its JTMS. Lisp origins: ;; In jtms.lisp: (defun node-string (node) (funcall (jtms-node-string (tms-node-jtms node)) node))HBPSCreate and return a new JTMS. Lisp origins: ;; In jtms.lisp: (defun create-jtms (title &key (node-string 'default-node-string) debugging (checking-contradictions t) (contradiction-handler 'ask-user-handler) enqueue-procedure) (make-jtms :TITLE title :NODE-STRING node-string :DEBUGGING debugging :CHECKING-CONTRADICTIONS checking-contradictions :CONTRADICTION-HANDLER contradiction-handler :ENQUEUE-PROCEDURE enqueue-procedure))IBPSSet the display function for (s in a *.After  change-jtms in  jtms.lisp.JBPSWhen the node type d implements , use this display method as the standard for printing the node.KBPS#Use the node index for its display.LBPSWhen the node type d implements , use both the node index and this display method as the standard for printing the node.MBPS JTMS d i r s m -> [Node d i r s m] -> JTMST s m () askUserHandler jtms contradictions = error " TODO unimplemented" Lisp origins: ;; In jtms.lisp: (defun handle-one-contradiction (contra-node &aux the-answer *contra-assumptions*) (setq *contra-assumptions* (assumptions-of-node contra-node)) (unless *contra-assumptions* (tms-error "~%There is a flaw in the universe...~A" contra-node)) (format t "~%Contradiction found: ~A" (node-string contra-node)) (print-contra-list *contra-assumptions*) (format t "~%Call (TMS-ANSWER ) to retract assumption.") (setq the-answer (catch 'tms-contradiction-handler (break "JTMS contradiction break"))) (if (and (integerp the-answer) (> the-answer 0) (not (> the-answer (length *contra-assumptions*)))) (retract-assumption (nth (1- the-answer) *contra-assumptions*))))handleOneContradiction :: Monad m => JTMS d i r s m -> JTMST s m () handleOneContradiction node = error " TODO unimplemented"Print a verbose debugging output list of the contradictions in the JTMS. Requires that the underlying monad m be . Lisp origins: ;; In jtms.lisp: (defun print-contra-list (nodes) (do ((counter 1 (1+ counter)) (nn nodes (cdr nn))) ((null nn)) (format t "~%~A ~A" counter (node-string (car nn)))))iBPS Lisp origins: ;; In jtms.lisp: (defun tms-answer (num) (if (integerp num) (if (> num 0) (if (not (> num (length *contra-assumptions*))) (throw 'tms-contradiction-handler num) (format t "~%Ignoring answer, too big.")) (format t "~%Ignoring answer, too small")) (format t "~%Ignoring answer, must be an integer.")))tmsAnswer :: MonadIO m => Int -> JTMST s m () tmsAnswer = error " TODO unimplemented"$Print debugging information about a *.jBPS&Print debugging information about the (s of a *.kBPS$Print debugging information about a (.lBPS&Print debugging information about the $s of a *.mBPS$Print debugging information about a $.sBPS Equality on $3s is based simply on comparing their index number.tBPS Equality on (?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklm,-.*;H+IJKLMNOPQRSTUVWX/0123456789:([)<\G=>@ABCD?`ab^ !"#$%&'Ec_]YZeFdgfhijklmMutable linked lists in STT(c) John Maraist, 2022AllRightsReservedhaskell-tms@maraist.org experimentalPOSIXNoneakwBPSSingly linked lists! But with mutable CARs and CDRs  la Common Lisp.xBPSA cons cell with mutable fields.yBPS Regular old nil.zBPS(Convert a pure list into a mutable list.{BPS Convert an w to a .|BPSReturns  for an empty list.}BPSReturns  from an ) monad for a reference to an empty list.~BPSReturns the CAR (element) of the first CONS cell of a non-empty mutable list.BPSReturns the CDR (next cell) of the first CONS cell of a non-empty mutable list.BPS2Convert a traditional Haskell list into a mutable w list.BPS2Convert a traditional Haskell list into a mutable w list.BPS2Convert a traditional Haskell list into a mutable w4 list, applying the given function to each element.BPSConvert a mutable w& list into a traditional Haskell list.BPSConvert a mutable w list of  values into a traditional Haskell list containing only the values under a  constructor.BPS A version of map for ws.BPS A version of filter for ws.BPS Return a new w which strips off the  constructor from its elements, dropping and elements which are .BPS Return a new w which drops elements which are .BPS Return a new w which drops elements which are  from the w under the reference argument.BPS Treating an w as a stack, add a new element at the top of the stack, and return the new stack top.BPS Treating an w as a stack, add a new element at the top of the stack, and return the new stack top.BPSIterate over the elements of a w. The body does not necessarily need operate in the same monad as where the references originate; the lifter. parameter brings the latter into the former.BPSLike , but the body expects an x cell instead of the list element itself. Useful for mutating the list along the way.BPSA combination of  and : iterate over the x cell of a list, with a trigger for an early exit. Note that the monad for the continuation condition is over the overall monad m , not the  wrapped monad m0.BPSOverwrite the car slot of the given x with the given value. Named after the Common Lisp function with the same behavior.wyxz{|}~wyxz{|}~;Mutable assumption-based truth maintenance systems (ATMSes)(c) John Maraist, 2022 Kenneth D. Forbus, Johan de Kleer and Xerox Corporation, 1986-1993AllRightsReservedhaskell-tms@maraist.org experimentalPOSIXNone>BPS/Type alias for the array storage of a table of s arranged by length.BPSAn environment of 5s which may be used as the basis of reasoning in an .BPSThe unique nomber of this  within its .BPS&The assumptions contained within this .BPSExplanation of why a  may be believed by the  for output to a query.BPSDescription of why a  may be believed by the .BPSThe justification of one   by zero or more others.BPS;The informant associated with applying this inference rule.BPS&The conclusion of this inference rule.BPS'The antecedents of this inference rule.BPS4Wrapper for the datum associated with a node of the .Translated from  (tms-node in  atms.lisp.BPS%Retrieve the datum associated with a .BPS Retrieve the  associated with a .BPSTop-level representation of an assumption-based truth maintenance system.BPSName of this ATMS.BPS8Class of type which can be used as the datum underlying  s in an .BPSThe datum associated with the contradiction node in a newly-initialized  with  data of this type.BPS1The process of building and using a mutable ATMS.BPS,Errors which can arise from ATMS operations.BPSIt is not possible to remove a  from an  after a  which uses that  is added to the .BPS?Internal error called when there is no internal default empty  associated with this #. Should never be signaled for an  created with , since this latter function does set up the default empty environment before returning the new .BPS0Indicates a pattern-matching failure within an  operation.BPSRetrieve the current initial  table size setting.BPSRetrieve the current initial  table size setting.BPSRetrieve the current initial  table size setting.BPSRetrieve the current initial  table size setting.BPSExecute a computation in the  monad transformer.BPS Return the  's current  list.BPS Return the  's current  list.BPS Return the 's current contradictions list.BPS Return the 's current assumptions list.BPS Return the 's built-in empty environment.BPS Return the 's built-in contradiction node.BPS Return the  's current  formatter.BPS Return the  's current  formatter.BPS Return the 's current datum formatter.BPSWhen the data associated with  s are all s, we can direct the ! to display each datum as itself.BPSWhen the data associated with s are of a type of class , we can direct the " to display each datum using the  instance.BPS Return the 's current informant formatter.BPS$When the informants associated with  s are all s, we can direct the & to display each informant as itself.BPS$When the informants associated with s are of a type of class , we can direct the " to display each datum using the  instance.BPS Return the #'s current rule-queueing procedure.BPS,Print the internal title signifying an ATMS.Translated from  print-atms in  atms.lisp.BPS Return the  's label.BPS Return the  's rules.BPS Return the 's consequences.BPSReturn whether the 's is currently contradictory.BPSReturn whether the *'s is currently markable as an assumption.BPSShortcut for reading the s of an .BPS Shortcut for testing whether an  is nogood.BPSShortcut for retrieving the  formatter from an  , and applying it to the given .Translated from  node-string in  atms.lisp.BPSDefault formatter for the s of an .Translated from default-node-string in  atms.lisp.BPSCreate a new, empty ATMS.Translated from  create-atms in  atms.lisp.BPSReturns  if the given  is axiomatic, following from the assumption of zero other nodes.Translated from  true-node? in  atms.lisp.BPSReturns  if the given ! is justified by some labelling  ironment of  s in the .Translated from in-node? in  atms.lisp.BPSReturns  if the given > is justified by some subset of the given environment in the .Translated from in-node? in  atms.lisp.BPSReturns  if the given  is justified by no labelling  ironment of  s in the .Translated from  out-node? in  atms.lisp.BPSReturns * if some environment justifying the given  is consistent with the given environment, where two environments are consistent when their union is not no-good.Translated from node-consistent-with? in  atms.lisp.BPS Create a new  in an .Translated from  create-node in  atms.lisp.BPSMark the given , as to be believed as an assumption by its .Translated from  assume-node in  atms.lisp.BPSMark the given - as an additional contradiction node of the .Translated from make-contradiction in  atms.lisp.BPS Direct the  to believe a particular  when all of the given list of s are also believed. The first argument is the informant associated with this inference.Translated from  justify-node in  atms.lisp.BPS Remove a  from the .Translated from  remove-node in  atms.lisp.BPSPrint the justifying ironments which label a .Translated from why-node in  atms.lisp.BPSPrint the justifying ironments which label each  of an .Translated from  why-nodes in  atms.lisp.BPSPrint an environment.Translated from  print-env in  atms.lisp.BPSList the nogood ironments of an .Translated from  print-nogoods in  atms.lisp.BPS Print the ironments of an .Translated from  print-envs in  atms.lisp.BPS Print the !ironments contained in the given .Translated from print-env-table in  atms.lisp.BPSPrint statistics about an .Translated from print-atms-statistics in  atms.lisp.BPSPrint the entries of an .Translated from  print-table in  atms.lisp.BPSGive a verbose printout of an .BPS0Computation returning a one-line summary of one  of an .BPS0Computation returning a one-line summary of the  s of an .BPS;Computation returning a one-line summary of the label of a  of an .BPSPrint a verbose summary of a  of an .Translated from print-tms-node in  atms.lisp.BPSGive a verbose printout of a  of an .BPS:Computation returning a one-line summary of the reason an  may believe a .BPS&Print a more verbose description of a ification rule of an .Translated from  print-just in  atms.lisp.BPSGive a verbose printout of one ification rule of an .BPSGive a verbose printout of the ironments of an .BPSGive a verbose printout of one ironment of an .BPS'Give a verbose printout of the no-good ironments of an .BPSGive a verbose printout of the ironments of an  of an . Safe-Inferred      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~(,,-./01IFEOabcdefnosu{|"BPS-0.1.0.0-7nxjBBPhOkKIihemtSutCo Data.TMS.DbgData.TMS.ChooseDebuggingData.TMS.Helpers Data.TMS.JTMSData.TMS.MListData.TMS.ATMS.ATMST forMwhile_ Paths_BPSdbg Debuggable debuggingOn debugging $fDebuggablemanyByManyMMallByM ordSubsetp formatListforMM_whileDo whileDoWith forMMwhile_whileReturnJustunlessMMnullRnonnullR whenNonnullRmapRefs foldrRefs foldlRefsforRM_pushpushMpushAllpushAllMpop whileListM_ commaListunmaybe JustificationByRuleEnabledAssumptionUserStipulationJustRule justInformantjustConsequencejustAntecedentsNode nodeDatumJTMS jtmsTitleJTMSTJtmsErrrunJTMST getJtmsNodes getJtmsJustsgetJtmsContradictionsgetJtmsAssumptionsgetJtmsCheckingContradictionsgetJtmsNodeStringgetJtmsJustStringgetJtmsDatumStringgetJtmsInformantStringgetJtmsEnqueueProceduregetJtmsContradictionHandlergetJtmsDebugging printJTMS printTmsNodegetNodeIsAssumptiongetNodeIsContradictorygetNodeSupportgetNodeBelievedgetNodeConsequencesgetNodeInRulesgetNodeOutRules getNodeJusts printJustRule nodeIsPremise nodeString createJTMS setNodeStringnodeStringByDatumnodeStringByIndexnodeStringByIndexDatumsetDatumStringdatumStringByShowsetInformantStringinformantStringByShow setJustStringjustStringByIndexjustStringByInformantjustStringByIndexInformant setDebuggingsetCheckingContradictionssetContradictionHandlersetEnqueueProcedureisInNode isOutNode createNode assumeNodemakeContradiction justifyNoderetractAssumptionisEnabledAssumptionwhenSupportedByRuleifSupportedByRuleenableAssumptionassumptionsOfNodeenabledAssumptionswhyNodewhyNodesprintContraList debugJTMS debugNodes debugNode debugJusts debugJust$fMonadIOJTMST$fMonadTransJTMST $fMonadJTMST$fApplicativeJTMST$fFunctorJTMST $fEqJustRule$fEqNode$fEqJTMS $fShowJtmsErrMListMConsMNiltoMListshowMmnullgetMnullmcarmcdrmlengthfromList fromListMaptoList toUnmaybeListmlistMap mlistFilter mlistUnmaybemlistStripNothinggetMlistStripNothing mlistPush mlistRefPush mlistFor_ mlistForCons_mlistForConsWhile_rplacaEnvTableEnvenvIndexenvAssumptions ExplanationnodeATMSATMS atmsTitle NodeDatumcontradictionNodeDatumATMSTAtmsErr CannotRemoveNodeWIthConsequencesInternalNoEmptyEnv FromMonadFailgetInitialEnvTableAllocsetInitialEnvTableAllocgetEnvTableIncrsetEnvTableIncrrunATMSTgetNodesgetJustsgetContradictionsgetAssumptionsgetEmptyEnvironmentgetContradictionNode getNodeString getJustStringgetDatumStringsetDatumStringViaStringsetDatumStringViaShowgetInformantStringsetInformantStringViaStringsetInformantStringViaShowgetEnqueueProcedure printAtms getNodeLabel getNodeRules getEnvNodes envIsNogooddefaultNodeString createATMS isTrueNode isInNodeByEnvisNodeConsistentWith removeNodeprintEnv printNogoods printEnvs printEnvTableprintAtmsStatistics printTable debugAtms formatNode formatNodesformatNodeLabel printNodeformatJustification printJust debugAtmsEnvsdebugEnv debugNogoods debugEnvTable $fMonadIOSTT$fMonadFailATMST$fMonadIOATMST$fMonadTransATMST $fMonadATMST$fApplicativeATMST$fFunctorATMST$fNodeDatumSymbol $fNodeDatum[] $fShowEnv$fEqEnv $fShowNode $fOrdNode $fShowAtmsErrbase Data.FoldableforM_ GHC.MaybeMaybeNothing Control.Monadunless GHC.STRefSTRefghc-prim GHC.TypesTrueFalse#extra-1.7.10-HmixojwBlnt312RGWImlS3Control.Monad.ExtrawhenM)STMonadTrans-0.4.6-Dk2OrGwcNJOHVm5OJEFTCkControl.Monad.ST.Trans.InternalSTTJustControl.Monad.IO.ClassMonadIOGHC.ShowShowGHC.BaseStringshowversion getBinDir getLibDir getDynLibDir getDataDir getLibexecDir getSysconfDirgetDataFileName