// -*- Mode: LISP; Syntax: Common-lisp; Package: DTP; Base: 10 -*- // ---------------------------------------------------------------------------- // // File Classes.Lisp // System Don's Theorem Prover // // Written by Don Geddis (Geddis@CS.Stanford.Edu) "(in-package dtp)"; // ---------------------------------------------------------------------------- define class (); end class ; // ---------------------------------------------------------------------------- define class (); end class ; // ---------------------------------------------------------------------------- define class () slot literal :: type-union(, singleton(#f)) = #f, init-keyword: #"literal"; slot answers :: = #f; slot conjuncts-to-propagate-to :: = #f, init-keyword: #"propagate-to"; // Used for residue slot assumables :: type-union(, // LTD: Can't convert type specification. eql(#"uninitialized")) = #"uninitialized"; // List of conjunction nodes slot inferences :: type-union(, // LTD: Can't convert type specification. eql(#"uninitialized")) = #"uninitialized"; // Conjunction nodes that are waiting for another subgoal slot blocked-conjunctions :: = #f; // Cached values (could be computed, but expensive) // Length of minimal path from root to this node slot depth :: type-union(singleton(#f), limited(, min: 0, max: \*)) = #f, init-keyword: #"depth"; // Used for reduction computation slot remaining-ancestor-subgoals :: type-union(, // LTD: Can't convert type specification. eql(#"uninitialized")) = #"uninitialized"; // Upward pointer in proof space slot parent-subgoal :: type-union(singleton(#f), ) = #f; // Upward pointer in proof space slot parent-conjunct :: type-union(singleton(#f), ) = #f; end class ; define method print-object (object :: , stream) begin format(stream, "#)) if (object.inferences) (method (s, #rest args) apply(maybe-initiate-xp-printing, method (xp, #rest args) let init = args; begin write-string++(" [", xp, 0, 2); using-format(xp, "~D", pop!(args)); write-string++(" task", xp, 0, 5); if (~ (head(backup-in-list(1, init, args)) == 1)) write-char++('s', xp); end if; write-string++(" pending]", xp, 0, 9); end; if (args) copy-sequence(args); end if; end method, s, args); end method)(stream, size(object.inferences)); else format(stream, " [complete]"); end if; end if; format(stream, ">"); end; end method print-object; // ---------------------------------------------------------------------------- define class () // List of conjuncts slot list :: = #f, init-keyword: #"list"; slot stack = #f; // Number of current conjunct slot stack-pointer :: limited(, min: -1, max: \*) = 0; // Conjuncts from 0 to here must not be backjumped over slot backtrack-pointer :: limited(, min: -1, max: \*) = -1; // Parent of NIL means this is a query-conjunction slot parent-subgoal :: type-union(, singleton(#f)) = #f, init-keyword: #"parent"; // From inference slot binding-list :: = #f, init-keyword: #"binding-list"; // From inference slot label :: type-union(