Alloy Community

User login

  • : Function ereg_replace() is deprecated in /afs/csail.mit.edu/proj/alloy/www/data/community/sites/all/themes/Aeon5/advforum/forum-thread.tpl.php on line 25.
  • : Function ereg_replace() is deprecated in /afs/csail.mit.edu/proj/alloy/www/data/community/sites/all/themes/Aeon5/advforum/forum-thread.tpl.php on line 26.
  • : Function ereg_replace() is deprecated in /afs/csail.mit.edu/proj/alloy/www/data/community/sites/all/themes/Aeon5/advforum/forum-thread.tpl.php on line 27.
  • : Function ereg_replace() is deprecated in /afs/csail.mit.edu/proj/alloy/www/data/community/sites/all/themes/Aeon5/advforum/forum-thread.tpl.php on line 28.
  • : Function ereg_replace() is deprecated in /afs/csail.mit.edu/proj/alloy/www/data/community/sites/all/themes/Aeon5/advforum/forum-thread.tpl.php on line 29.
  • : Function ereg_replace() is deprecated in /afs/csail.mit.edu/proj/alloy/www/data/community/sites/all/themes/Aeon5/advforum/forum-thread.tpl.php on line 30.
  • : Function ereg_replace() is deprecated in /afs/csail.mit.edu/proj/alloy/www/data/community/sites/all/themes/Aeon5/advforum/forum-thread.tpl.php on line 31.
  • : Function ereg_replace() is deprecated in /afs/csail.mit.edu/proj/alloy/www/data/community/sites/all/themes/Aeon5/advforum/forum-thread.tpl.php on line 32.
  • : Function ereg_replace() is deprecated in /afs/csail.mit.edu/proj/alloy/www/data/community/sites/all/themes/Aeon5/advforum/forum-thread.tpl.php on line 33.
  • : Function ereg_replace() is deprecated in /afs/csail.mit.edu/proj/alloy/www/data/community/sites/all/themes/Aeon5/advforum/forum-thread.tpl.php on line 34.
  • : Function ereg_replace() is deprecated in /afs/csail.mit.edu/proj/alloy/www/data/community/sites/all/themes/Aeon5/advforum/forum-thread.tpl.php on line 25.
  • : Function ereg_replace() is deprecated in /afs/csail.mit.edu/proj/alloy/www/data/community/sites/all/themes/Aeon5/advforum/forum-thread.tpl.php on line 26.
  • : Function ereg_replace() is deprecated in /afs/csail.mit.edu/proj/alloy/www/data/community/sites/all/themes/Aeon5/advforum/forum-thread.tpl.php on line 27.
  • : Function ereg_replace() is deprecated in /afs/csail.mit.edu/proj/alloy/www/data/community/sites/all/themes/Aeon5/advforum/forum-thread.tpl.php on line 28.
  • : Function ereg_replace() is deprecated in /afs/csail.mit.edu/proj/alloy/www/data/community/sites/all/themes/Aeon5/advforum/forum-thread.tpl.php on line 29.
  • : Function ereg_replace() is deprecated in /afs/csail.mit.edu/proj/alloy/www/data/community/sites/all/themes/Aeon5/advforum/forum-thread.tpl.php on line 30.
  • : Function ereg_replace() is deprecated in /afs/csail.mit.edu/proj/alloy/www/data/community/sites/all/themes/Aeon5/advforum/forum-thread.tpl.php on line 31.
  • : Function ereg_replace() is deprecated in /afs/csail.mit.edu/proj/alloy/www/data/community/sites/all/themes/Aeon5/advforum/forum-thread.tpl.php on line 32.
  • : Function ereg_replace() is deprecated in /afs/csail.mit.edu/proj/alloy/www/data/community/sites/all/themes/Aeon5/advforum/forum-thread.tpl.php on line 33.
  • : Function ereg_replace() is deprecated in /afs/csail.mit.edu/proj/alloy/www/data/community/sites/all/themes/Aeon5/advforum/forum-thread.tpl.php on line 34.
  • : Function ereg_replace() is deprecated in /afs/csail.mit.edu/proj/alloy/www/data/community/sites/all/themes/Aeon5/advforum/forum-thread.tpl.php on line 25.
  • : Function ereg_replace() is deprecated in /afs/csail.mit.edu/proj/alloy/www/data/community/sites/all/themes/Aeon5/advforum/forum-thread.tpl.php on line 26.
  • : Function ereg_replace() is deprecated in /afs/csail.mit.edu/proj/alloy/www/data/community/sites/all/themes/Aeon5/advforum/forum-thread.tpl.php on line 27.
  • : Function ereg_replace() is deprecated in /afs/csail.mit.edu/proj/alloy/www/data/community/sites/all/themes/Aeon5/advforum/forum-thread.tpl.php on line 28.
  • : Function ereg_replace() is deprecated in /afs/csail.mit.edu/proj/alloy/www/data/community/sites/all/themes/Aeon5/advforum/forum-thread.tpl.php on line 29.
  • : Function ereg_replace() is deprecated in /afs/csail.mit.edu/proj/alloy/www/data/community/sites/all/themes/Aeon5/advforum/forum-thread.tpl.php on line 30.
  • : Function ereg_replace() is deprecated in /afs/csail.mit.edu/proj/alloy/www/data/community/sites/all/themes/Aeon5/advforum/forum-thread.tpl.php on line 31.
  • : Function ereg_replace() is deprecated in /afs/csail.mit.edu/proj/alloy/www/data/community/sites/all/themes/Aeon5/advforum/forum-thread.tpl.php on line 32.
  • : Function ereg_replace() is deprecated in /afs/csail.mit.edu/proj/alloy/www/data/community/sites/all/themes/Aeon5/advforum/forum-thread.tpl.php on line 33.
  • : Function ereg_replace() is deprecated in /afs/csail.mit.edu/proj/alloy/www/data/community/sites/all/themes/Aeon5/advforum/forum-thread.tpl.php on line 34.

one question about modeling a concrete graph

 
Posted on: Thu, 12/17/2009 - 16:13
Joined: 2009-12-13
Points: 56
User is offline
one question about modeling a concrete graph
I want to use Alloy to model a concrete graph, G, shown as below:

G:

f1->f2
f2->f1
f2->f3
f1->f3
f3->f4
f4->f3

Then I want to extract all sub-graphs with 3 nodes, for example,

G':

f1->f2
f2->f3

or

G'':
f2->f3
f3->f4
f4->f3

I can only write down the following very initial model as the following:

================================

abstract sig Feature{depends: Feature}

one  sig f1 extends Feature {}
one  sig f2 extends Feature {}
one  sig f3 extends Feature {}
one  sig f4 extends Feature {}

sig edges{edge: Feature->Feature}

fact realEdges{
   f1->f2 in edges.edge
   f1->f3 in edges.edge
   f2->f3 in edges.edge
   f2->f1 in edges.edge
   f3->f4 in edges.edge
   f4->f3 in edges .edge
}

============================

Any help is highly appreciated!

Thanks in advance!

Best,
Jiangfan
 
Posted on: Fri, 12/18/2009 - 08:43    #1
Joined: 2008-06-06
Points: 147
User is offline
It depends on what you are trying to model.

The following Alloy module has one command that gives a sequence of solutions, each of which has exactly on identified subgraph of size three.  By stepping through the solutions you will see every subgraph of size three.

If you want to check some fact about each subgraph, then you can do that, too: a pair of examples (one valid, one invalid) is given.  In this style you cannot check facts about combinations of subgraphs (the numbers will grow too fast to be practical).

module directed_graph

abstract sig Graph{node : set Node}

abstract sig Node{edge : set Node}
one sig n1, n2, n3, n4, n5, n6, n7  extends Node{}

fact edge{ // layout of graph
   edge = n1->n2
            +n1->n3
            +n2->n4
            +n4->n3
            +n3->n4
            +n4->n6
            +n3->n5
            +n5->n7
            +n7->n6
            +n7->n2
}

one sig Three_Graph extends Graph{} {#node = 3}

examples: run{} // see all three graphs, one at a time.

no_3_graph_has_all_edges: check{ // true of example above
   let n = Three_Graph.node | // nodes in selected sub-graph
      n<:edge:>n != edge
}

every_3_graph_has_exactky_two_edges: check{ // false of example above
   let n = Three_Graph.node | // nodes in selected sub-graph
      #(n<:edge:>n) = 2
}

--
Jeremy L. Jacob        Tel: +44-1904-43-2747    Fax: +44-1904-43-2767
Jeremy.Jacob@cs.york.ac.uk    http://www-users.cs.york.ac.uk/~jeremy/
Dept. of Computer Science, The University of York, YORK, YO10 5DD, UK
 
Posted on: Fri, 12/18/2009 - 09:03    #2
Joined: 2009-12-13
Points: 56
User is offline
Thanks, Dr. Jacob.

It definitely gives me a very good start point.  I will work on this.

Best,

Jiangfan

Syndicate content  

The development of this site is supported by the National Science Foundation under Computing Research Infrastructure Grant No. 0707612.

Theme originally designed by Chris Herberte