Core.logic appendo for string?

2014-05-04 Thread Adam Saleh
Hi, every once in a while I am toying with an idea of doing string manipulation in core.logic. Naively trying to use appendo doesn't really work. As far as I understand, most of the magic, that enables core logic to work with lists is in the type LCons, that holds a sequence with tail that is

Re: Functional programming and security

2014-05-04 Thread Adam Saleh
Well, what does it mean to write secure programs? Citation needed :) I remember a lengthy discussion with coleague of mine about writing cryptography primitives in haskell. I suggested, that haskells strong typing and syntax well suited for expressing mathematics, combined with good speed

core.logic - using membero to generate list?

2013-07-06 Thread Adam Saleh
Hi, I wanted to use featurec to generate hash-map, similarily to a way I use membero when generating lists. i.e = (run 1 [q] #= (membero :a q)) ((:a . _0)) Unfortunately when I try to do something \w it, it throws exception = (first *1) (1 . _0) = (first *1) IllegalArgumentException Don't

Re: Anybody has tried to (re)write re-match in core.logic?

2013-07-05 Thread Adam Saleh
What does that mean? Because right now I am using core.logic quite naively, mostly just applying recursion and some pattern matching. Adam -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to

Re: Anybody has tried to (re)write re-match in core.logic?

2013-07-05 Thread Adam Saleh
Apologies, forgot that this is not a forum. 1) What would environment trimming provide me? Because right now I am using core.logic quite naively, mostly just applying recursion and some pattern matching. 2) for starting I have implemented a simple regular grammar engine, seems to work :)

Anybody has tried to (re)write re-match in core.logic?

2013-07-04 Thread Adam Saleh
I was thinking about rewriting re-match in core.logic, so I am asking if somebody tried something similiar. My reasoning goes along like this: 1) core.logic has no utils for dealing \w strings 2) regular expressions are declarative 3) (re-match expression string) is a relation I am hoping to

Knowledge derivation in core.logic?

2013-05-25 Thread Adam Saleh
Hi, I am trying to implement a simple knowledge derivation program in clojure.core.logic, and I am not sure how to approach it. To be more specific, after I am done, it will be used as a toy cryptographic protocol verifier, that tries to infer what knowledge can attacker get based on some

Superset goal in clojure.core.logic?

2013-04-07 Thread Adam Saleh
Hi, I am having trouble creating superset goal. I managed to create a subset goal: (defn subseto [smaller larger] (fresh [e] (appendo smaller e larger))) (run 3 [s l] (membero :a s) (membero :b s) (membero :a l) (membero :c l) (subseto s

Re: Superset goal in clojure.core.logic?

2013-04-07 Thread Adam Saleh
This seemed to do the trick :) (defne superseto A relation where x, y are proper collections, such that y is superset x [x y] ([() y]) ([[a . d] y] (membero a y) (superseto d y))) I modified appendo ... will try to create subseto goal in similar fashion so that I see where

Re: Superset goal in clojure.core.logic?

2013-04-07 Thread Adam Saleh
I forgot to run it with multiple goals, it seems it behaves the same :-/ -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be

How to use clojure.core.logic to generate strings?

2013-04-04 Thread Adam Saleh
Hi, I am trying to write myself something to generate some test data, and I thought clojure.core logic fits the bill ... unfortunately, for some reason, it doesn't work. In my project.clj: [org.clojure/clojure 1.5.0] [org.clojure/core.logic 0.8.3] in my namespace: (ns tests.search

Re: How to use clojure.core.logic to generate strings?

2013-04-04 Thread Adam Saleh
Thanks, this got me quite far. But I'd like to create goals with string, for example currently I have no idea, how would I write a substring goal. Thanks for any suggestion! Adam -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this