maude: run.sx search command + result-sort output (254 total)
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 36s
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 36s
run.sx now handles 'search START =>* GOAL .' (reports the witness path) and mau/run-pretty prints Maude-style 'result SORT: TERM' using least-sort inference. searchpath.sx exposes mau/search-path-terms (term-level entry). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -61,24 +61,21 @@
|
||||
goal
|
||||
(- depth 1))))))))
|
||||
|
||||
;; term-level: returns the canonical-state path start..goal, or nil
|
||||
(define
|
||||
mau/search-path
|
||||
mau/search-path-terms
|
||||
(fn
|
||||
(m start-src goal-src max-depth)
|
||||
(m start-term goal-term max-depth)
|
||||
(let
|
||||
((theory (mau/build-theory m))
|
||||
(eqs (mau/module-eqs m))
|
||||
(rules (mau/module-rules m)))
|
||||
(let
|
||||
((start (mau/cnormalize theory eqs (mau/parse-term-in m start-src) mau/reduce-fuel))
|
||||
((start (mau/cnormalize theory eqs start-term mau/reduce-fuel))
|
||||
(goal
|
||||
(mau/canon
|
||||
theory
|
||||
(mau/cnormalize
|
||||
theory
|
||||
eqs
|
||||
(mau/parse-term-in m goal-src)
|
||||
mau/reduce-fuel))))
|
||||
(mau/cnormalize theory eqs goal-term mau/reduce-fuel))))
|
||||
(let
|
||||
((res (mau/bfs-path theory eqs rules (list (list start)) (list (mau/canon theory start)) goal max-depth)))
|
||||
(if
|
||||
@@ -86,6 +83,16 @@
|
||||
nil
|
||||
(map (fn (t) (mau/canon theory t)) (mau/reverse2 res))))))))
|
||||
|
||||
(define
|
||||
mau/search-path
|
||||
(fn
|
||||
(m start-src goal-src max-depth)
|
||||
(mau/search-path-terms
|
||||
m
|
||||
(mau/parse-term-in m start-src)
|
||||
(mau/parse-term-in m goal-src)
|
||||
max-depth)))
|
||||
|
||||
;; number of steps in the shortest solution (nil if unreachable)
|
||||
(define
|
||||
mau/search-length
|
||||
|
||||
Reference in New Issue
Block a user