Heya Pascal: Yep, the binary representation of i.2^n gives you every combination of n bits (n boolean inputs).
I'm not sure I understand what you mean by the state of propositions. Are you talking about being able to assert and retract facts and rules, like in prolog? I made a little datalog-like language in java many years ago, I have some ideas on how I would approach it for j. I'm not sure how much of what I've done here would carry over, other than the rules of logic itself. I guess my main thought right now is that if we have a big array of N symbols, then we could store symbolic predicates in an N * N sparse array. So if you wanted to model likes(mouse, cheese) you could have a rank 2 sparse array for 'likes' and set the value to 1 in at the coordinates corresponding to mouse, cheese. I haven't gotten around to actually prototyping it though. :) Good point about showing the (5 32) -shaped version. I rewrote my message showing it that way and expanding it a bit for an audience that didn't know j, and posted it over on the logic forum on reddit, along with some follow up comments: http://www.reddit.com/r/logic/comments/1zf14x/how_i_use_j_to_learn_about_logic/ Didn't get much of of a response, but so far 14 people upvoted it. :) On Mon, Mar 3, 2014 at 8:40 AM, Pascal Jasmin <godspiral2...@yahoo.ca>wrote: > interesting. the 32 bits is done specifically to test 5 variables. > > this probably helps see the structure: > > p,q,r,s,t > 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 > 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 > 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 > 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 > 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 > > > the obvious extention would be to cover a list (db)of givens and then > query the state of propositions. Do you think your framework is extendable > to such? > > ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm