This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-12-06
Channels
- # adventofcode (106)
- # aleph (1)
- # announcements (1)
- # asami (14)
- # babashka (120)
- # beginners (54)
- # calva (106)
- # chlorine-clover (33)
- # clj-kondo (5)
- # cljdoc (3)
- # cljs-dev (3)
- # clojure (92)
- # clojure-android (1)
- # clojure-australia (2)
- # clojure-europe (24)
- # clojure-italy (3)
- # clojure-nl (5)
- # clojure-uk (16)
- # clojuredesign-podcast (1)
- # clojurescript (29)
- # code-reviews (58)
- # conjure (16)
- # core-logic (4)
- # cursive (9)
- # datalevin (2)
- # graphql (20)
- # gratitude (7)
- # jackdaw (11)
- # java (9)
- # jobs (2)
- # lsp (23)
- # minecraft (1)
- # missionary (28)
- # off-topic (5)
- # polylith (5)
- # react (1)
- # reagent (12)
- # releases (1)
- # remote-jobs (4)
- # reveal (7)
- # shadow-cljs (8)
- # slack-help (1)
- # tools-deps (11)
- # vim (6)
How would you output the number of steps a logic program took to get the desired output?
e.g. https://github.com/clojure/core.logic/wiki/Examples#a-classic-ai-program
How can you find how many times moveo
needs to be run for each success?
Use trace-lvar
? log
? Or embed a counter as an lvar and inc it? (not sure how to do that)?
Extend a basic logic function?
dunno, but thinking about it, for an "execution to succeed" it will have to execute the last goal from run, that means it reached a leaf, but the only thing that is threaded through all branches is the substitution map. I imagine trying to hack the substitution in core.logic to count the times it makes a unification, but that's not exactly how many goals/relation have been executed
also you could hack the substitution to count how many times it executed bind
, that is how many relations the substitution has executed