OverviewFilesCommitsIssuesDocsReleasesPeers

opencog-atomspace / tests / query / quote-crash.scm

33 lines · scm ref:

(use-modules (opencog))

; This is an infinite loop, except that the QuoteLink is supposed
; to stop the recursion.
(define crasher
	(CollectionOf
	(QueryLink
		(VariableNode "$x") ; Variable decl
		(VariableNode "$x") ; body
		(ListLink
			(ConceptNode "And the answer is ...")
			(QuoteLink (VariableNode "$x"))))
	)
	)

; (cog-execute! crasher)

;; This is an infinite loop, because there are no type restrictions on
;; the variable, and the instantiator can get confused.
(define infloop
	(CollectionOf
	(QueryLink
		(VariableNode "$x") ; Variable decl
		(VariableNode "$x") ; body
		(ListLink
			(ConceptNode "And the answer is ...")
			(VariableNode "$x")))
	)
	)

; (cog-execute! infloop)