From 6dae43e4ee011ea0ef4fedeae7c2a492823a9812 Mon Sep 17 00:00:00 2001 From: Gary King Date: Tue, 30 Sep 2008 22:13:30 -0400 Subject: [PATCH] clean up all the current warnings darcs-hash:20081001021330-3cc5d-77254a52871937d966d9923a320a60381f066292.gz --- dev/api.lisp | 38 ++++++++++++++++++++++++++++-------- dev/graph-algorithms.lisp | 3 +-- dev/graph.lisp | 3 +-- dev/graphviz/graphviz-support.lisp | 12 +++++++----- dev/subgraph-containing.lisp | 3 ++- 5 files changed, 41 insertions(+), 18 deletions(-) diff --git a/dev/api.lisp b/dev/api.lisp index b7f6e00..1e762b9 100644 --- a/dev/api.lisp +++ b/dev/api.lisp @@ -51,6 +51,9 @@ be called with the previous edge.")) (defgeneric delete-edge (graph edge) (:documentation "Delete the `edge' from the `graph' and returns it.")) +(defgeneric delete-all-edges (graph) + (:documentation "Delete all edges from `graph'. Returns the graph..")) + (defgeneric delete-edge-between-vertexes (graph value-or-vertex-1 value-or-vertex-2 &rest args) @@ -104,11 +107,6 @@ the graph.")) (defgeneric iterate-target-edges (vertex fn) (:documentation "In a directed graph, calls `fn` on each edge of a vertex that ends at vertex. In an undirected graph, this is equivalent to `iterate-edges`.")) - -(defgeneric iterate-children (vertex fn) - (:documentation "Calls fn on every vertex that is either connected to vertex by an undirected edge or is at the target end of a directed edge.")) - - (defgeneric has-children-p (vertex) (:documentation "In a directed graph, returns true if vertex has any edges that point from vertex to some other vertex (cf. iterate-target-edges). In an undirected graph, `has-children-p` is testing only whether or not the vertex has any edges.")) @@ -586,9 +584,33 @@ counted as a source. [?? Could be a defun].")) (defgeneric complete-links (new-graph old-graph) (:documentation "Add edges between vertexes in the new-graph for which the matching vertexes in the old-graph have edges. The vertex matching is done using `find-vertex`.")) -(defgeneric subgraph-containing (graph vertex &key) - (:documentation "Returns a new graph that is a subset of `graph` that contains `vertex` and all of the other vertexes that can be reached from vertex by paths of less than or equal of length `depth`. If depth is not specified, then the entire sub-graph reachable from vertex will be returned. [?? Edge weights are always assumed to be one.]")) +(defgeneric subgraph-containing (graph vertex &key depth new-graph) + (:documentation "Returns a new graph that is a subset of `graph` +that contains `vertex` and all of the other vertexes that can be +reached from vertex by paths of less than or equal of length `depth`. +If depth is not specified, then the entire sub-graph reachable +from vertex will be returned. [?? Edge weights are always assumed +to be one.]")) (defgeneric weight (edge) - (:documentation "Returns the weight of an edge. This defaults to 1.0 and can only be altered if the edge is a sub-class of `weighted-edge-mixin`.")) + (:documentation "Returns the weight of an edge. This defaults +to 1.0 and can only be altered if the edge is a sub-class of +`weighted-edge-mixin`.")) + +(defgeneric (setf dot-attribute-value) (value attribute thing) + ) + +(defgeneric dot-attribute-value (attribute thing) + ) + +(defgeneric graph->dot-external (graph file-name &key type) + ) + +(defgeneric ensure-valid-dot-attribute (key object) + ) + +(defgeneric write-name-for-dot (attribute stream) + ) + + diff --git a/dev/graph-algorithms.lisp b/dev/graph-algorithms.lisp index 30cac2d..d84a799 100644 --- a/dev/graph-algorithms.lisp +++ b/dev/graph-algorithms.lisp @@ -146,8 +146,7 @@ (let ((element (element (parent component)))) (unless (item-at found-elements element) (setf (item-at found-elements element) t) - - (push (subgraph-containing graph (element component) + (push (subgraph-containing graph (element component) most-positive-fixnum) result))))) diff --git a/dev/graph.lisp b/dev/graph.lisp index f05dfcc..60864ff 100644 --- a/dev/graph.lisp +++ b/dev/graph.lisp @@ -753,11 +753,10 @@ something is putting something on the vertexes plist's (setf (tag vertex) nil) (traverse-elements-helper vertex style marker fn))))) - ;; also in metatilites (defun graph-search-for-cl-graph (states goal-p successors combiner &key (state= #'eql) old-states - (new-state-fn #'new-states)) + (new-state-fn (error "argument required"))) "Find a state that satisfies goal-p. Start with states, and search according to successors and combiner. Don't try the same state twice." diff --git a/dev/graphviz/graphviz-support.lisp b/dev/graphviz/graphviz-support.lisp index b511279..a88bce3 100644 --- a/dev/graphviz/graphviz-support.lisp +++ b/dev/graphviz/graphviz-support.lisp @@ -341,11 +341,13 @@ B--D [] (:export-p t)) -(defmethod (setf dot-attribute-value) :before (value (attr symbol) (thing dot-attributes-mixin)) +(defmethod (setf dot-attribute-value) + :before (value (attr symbol) (thing dot-attributes-mixin)) (declare (ignore value)) (ensure-valid-dot-attribute attr thing)) -(defmethod (setf dot-attribute-value) (value (attr symbol) (thing dot-attributes-mixin)) +(defmethod (setf dot-attribute-value) + (value (attr symbol) (thing dot-attributes-mixin)) (setf (getf (dot-attributes thing) attr) value)) (defmethod dot-attribute-value ((attr symbol) (thing dot-attributes-mixin)) @@ -515,10 +517,10 @@ the program in *dot-path*." #-(or sbcl lispworks) (error "Don't know how to execute a program on this platform"))) -;;; --------------------------------------------------------------------------- -; +;;; ; Test dot external -; + +#+test (defun test-dot-external () (let* ((g (make-graph 'dot-graph)) (v1 (add-vertex g 'a :dot-attributes '(:shape :box diff --git a/dev/subgraph-containing.lisp b/dev/subgraph-containing.lisp index 813d577..492f61a 100644 --- a/dev/subgraph-containing.lisp +++ b/dev/subgraph-containing.lisp @@ -84,7 +84,8 @@ (defmethod subgraph-containing ((graph basic-graph) (vertex basic-vertex) &rest args &key (depth nil) (new-graph nil)) - (declare (ignore depth new-graph)) + (declare (ignore depth new-graph) + (dynamic-extent args)) (apply #'make-filtered-graph graph #'(lambda (v) -- 1.7.10.4