k-user AT lists.cs.illinois.edu
Subject: K-user mailing list
List archive
- From: Omar Duhaiby <3omarz AT gmail.com>
- To: "k-user AT cs.uiuc.edu" <k-user AT cs.uiuc.edu>
- Cc: "Musab A. AlTurki" <musab AT kfupm.edu.sa>
- Subject: [K-user] function to get list of Ancestors
- Date: Sat, 15 Nov 2014 14:53:13 +0300
- List-archive: <http://lists.cs.uiuc.edu/pipermail/k-user/>
- List-id: <k-user.cs.uiuc.edu>
Hello,
I have in my configuration a cell for the thread's ID and another for its parent's ID, called respectively <tid> and <parentId>. I use this to make a tree of threads.
rule
<k> ancestorsOf(Tid:Int) => ListItem(Pid) ancestorsOf(Pid) ...</k>
<thread>... <tid> Tid </tid> <parentId> Pid </parentId> ...</thread>
<thread>... <tid> Pid </tid> ...</thread>
rule ancestorsOf(0) => .List
when AncestorId in ancestorsOf(MyId)
- [K-user] function to get list of Ancestors, Omar Duhaiby, 11/15/2014
Archive powered by MHonArc 2.6.16.