|
View:
New views
3 Messages
—
Rating Filter:
Alert me
|
|
|
Help to build a huge treeHi,
My fact database represents a filesystem (dirs & files). It is very large and has many snapshots of a filesystem over the time. What is the best strategy to retrieve a filesystem snapshot ? YAP offers a lot of functionality: basic prolog, some tree structure (AVL, Red-Black, Splays,...), global variables, CHR or some of them. Maybe the most efficient way is using CHR: Adding tree nodes into the constraint store and remove those which don't belong to the snapshot and are not son of the goal (parent) node. The remaining items in the store at the end should be the searched tree nodes. Please, if you know if exists a similar problem resolved then send the url with the example. Suggestions will be very appreciated. Thanks in advanced, Pablo. ------------------------------------------------------------------------------ Check out the new SourceForge.net Marketplace. It is the best place to buy or sell services for just about anything Open Source. http://p.sf.net/sfu/Xq1LFB _______________________________________________ Yap-users mailing list Yap-users@... https://lists.sourceforge.net/lists/listinfo/yap-users |
|
|
Re: Help to build a huge treeHi Pablo
I am not sure I understood your queston but I will be happy to have a look at the snasphot.- 2009/1/9 Pablo Beltran <pbeltranl@...>: > Hi, > > My fact database represents a filesystem (dirs & files). It is very large > and has many snapshots of a filesystem over the time. > > What is the best strategy to retrieve a filesystem snapshot ? What is your goal? Wht do you pretend to do with your snapshot? > > YAP offers a lot of functionality: basic prolog, some tree structure (AVL, > Red-Black, Splays,...), global variables, CHR or some of them. > > Maybe the most efficient way is using CHR: Adding tree nodes into the > constraint store and remove those which don't belong to the snapshot and are > not son of the goal (parent) node. The remaining items in the store at the > end should be the searched tree nodes. > > Please, if you know if exists a similar problem resolved then send the url > with the example. Suggestions will be very appreciated. > I think we're unclear about what you want to do with the data :( y Cheers Vitor ------------------------------------------------------------------------------ This SF.net email is sponsored by: SourcForge Community SourceForge wants to tell your story. http://p.sf.net/sfu/sf-spreadtheword _______________________________________________ Yap-users mailing list Yap-users@... https://lists.sourceforge.net/lists/listinfo/yap-users |
|
|
Re: Help to build a huge treeHi Vitor,
The snapshot is here: http://www.upversion.com/downloads/data.pl.zip It's compressed with bzip2 but I've changed the extension .bz->.zip to avoid potential downloading problems. Tell me when it would not be necessary to delete it. The snapshot is the full Apache subversion repository converted to prolog facts. Subversion is a filesystem where every revision (commit) creates a new version of the whole filesystem (in an efficient way). Thus I want to obtain the whole filesystem tree for every revision/commit. There are a lot of revisions and a lot of files in this repository then performance is critical. My problem in a backward scenrario is stopping the search in a concrete revision of an item. I don't kown how to do it without using some sort of memory (list, assert, global variables,...) and I doubt about my tech capacity to wirte a enought good algorithm. On the other hand: if I need to use some kind of memory (list, assert, ...) and the filsystem tree can be build reading the full database facts only once then I don't want to reinvent the wheel. It sounds like CHR (memory+forward). Now I'm stopped trying to undesrstand how to CHR & prolog are related. Today I've posted a question in various forums and maybe you (if you are still awake or others with a lot of patience to read this long email) could help me. I reproduce the question here: ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ Is possible to use a prolog fact as constraint and vice versa? Example: Next "max.chr" file defines the max/2 constraint: ========================================================
max.chr -------------------------------------------------------- :-use_module(library(chr)). :-chr_constraint max/2. simplest @ max(N) \ max(M) <=> N>M | true. ======================================================== You can ask to chr: ======================================================== ?- max(1),max(2),max(3). max(3) yes. ======================================================== But, you can't load next file due constraint max/2 conflicts. ======================================================== data.pl -------------------------------------------------------- max(1). max(2). max(3). ======================================================== You need to rewrite the file to: ======================================================== data_2.pl -------------------------------------------------------- :-max(1), max(2), max(3). ======================================================== And neither I know how to use a constraint in the middle of a prolog sentence (if possible): ======================================================== ------------------------------------------ foo(X):-max(Y), X is Y+1. ------------------------------------------ ?- foo(X). X=4; no. ======================================================== Where max(Y) is the previous chr constraint (with Y=3 result). Might somebody explain if is it possible? A) Using prolog facts (not goals) as constraints to satisfy/apply? B) Reuse the output of a chr program as input (clause) of a prolog rule? Thanks in advanced, Pablo. PS: I promise that next emails will be considerably shorter. 2009/1/14 Vitor Santos Costa <vscosta@...> Hi Pablo ------------------------------------------------------------------------------ This SF.net email is sponsored by: SourcForge Community SourceForge wants to tell your story. http://p.sf.net/sfu/sf-spreadtheword _______________________________________________ Yap-users mailing list Yap-users@... https://lists.sourceforge.net/lists/listinfo/yap-users |
| Free embeddable forum powered by Nabble | Forum Help |