Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Subgraph #31

Open
wants to merge 61 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
5ed2085
added file for future unit tests
TigerThePro Jun 15, 2021
02cd7ae
changeg namespace
TigerThePro Jun 15, 2021
ec133f7
added/changed specs and todo
TigerThePro Jun 15, 2021
7c9a9e4
added methods used to creat nodes for testing
TigerThePro Jun 16, 2021
5d42166
removed test files with wrong framework
TigerThePro Jun 16, 2021
ea50c76
test files with correct framework
TigerThePro Jun 16, 2021
9c057d8
change some some function names
TigerThePro Jun 17, 2021
e409638
AllDownPatterns implmeneted, untested
TigerThePro Jun 17, 2021
9d6516a
Added Graph to test AllDownPatterns
TigerThePro Jun 18, 2021
921ce16
improved test cases for AllDownPatterns
TigerThePro Jun 18, 2021
3fc2d3e
AllDownPatterns debugges
TigerThePro Jun 18, 2021
876b375
added test graph 3
TigerThePro Jun 19, 2021
479a637
refactoed ContainPattern to DAGView.cs
TigerThePro Jun 19, 2021
c6e2a45
removed unecessary 'using' tags'
TigerThePro Jun 19, 2021
5e07ee7
created test cases for ExtendDownWards
TigerThePro Jun 19, 2021
1fc8686
add unlimited case for ExtendDownwards
TigerThePro Jun 19, 2021
5100f7c
typo fix
TigerThePro Jun 20, 2021
5963a12
ExtendDownwards implemented
TigerThePro Jun 20, 2021
b4ef1ea
Test cases added for AllUpPatterns
TigerThePro Jun 20, 2021
971e0fb
AllUpPatterns implemented
TigerThePro Jun 20, 2021
9c0389c
naming fixes
TigerThePro Jun 20, 2021
8a31b1d
tests added for ExtendUpwards
TigerThePro Jun 20, 2021
b11d3ab
test case error fixes
TigerThePro Jun 20, 2021
4ba7080
ExtendUpwards implemented
TigerThePro Jun 20, 2021
0a11c35
clean up and rename some variables
TigerThePro Jun 20, 2021
829bb1b
added CustomPathComparer, deleted bestuppath and bestdownpath
TigerThePro Jun 21, 2021
9c23ee4
tests added for CustomPathComparer
TigerThePro Jun 23, 2021
6701353
CustomPathComparer unit test error fix
TigerThePro Jun 23, 2021
ce0e1b3
CustomPathCompater implemented
TigerThePro Jun 23, 2021
6fa2cb8
new pathExplanationButton_click implemented
TigerThePro Jun 23, 2021
1cde62c
bug fix, when there are no pattern
TigerThePro Jun 27, 2021
32a3a5a
bug fix for find path, added test case
TigerThePro Aug 6, 2021
962771d
DAGView, UI and naming change, path is no referred as subgraph
TigerThePro Aug 6, 2021
710b7ef
created InstantiationSubgraph class
TigerThePro Aug 7, 2021
8f7ef38
created class InstantiationSungraph
TigerThePro Aug 7, 2021
bb07331
declared find subgraph function
TigerThePro Aug 7, 2021
c18e4be
update sln and csproj
TigerThePro Aug 7, 2021
8dbc609
property file for unit test
TigerThePro Aug 7, 2021
117dd6c
pattern can have multiple occurences of the same quant
TigerThePro Aug 7, 2021
b271fa2
implemented find substrucutre
TigerThePro Aug 8, 2021
3d4301f
changed highlightPath to highlightSubgraph
TigerThePro Aug 8, 2021
07606ac
findsubgraph, debugg case when selected node is less than the first c…
TigerThePro Aug 8, 2021
b504031
bug gix for findsubgraph, still contain more bugs
TigerThePro Aug 8, 2021
a46f6c1
findsubgrpah bug fix
TigerThePro Aug 8, 2021
3ce9e2b
findsubgraph bug fix
TigerThePro Aug 8, 2021
76585fe
basic finding subgraph working
TigerThePro Aug 9, 2021
8acda60
copied parts of InstantiatnionPath to Instantiationgraph with some ch…
TigerThePro Aug 9, 2021
c16b7df
bug fix, still had runtime error
TigerThePro Aug 9, 2021
2df1bea
updated infopanel for subgraph
TigerThePro Aug 9, 2021
ef2d8d5
changes to DAGView
TigerThePro Aug 9, 2021
204d3de
fix match same term bug
TigerThePro Aug 10, 2021
1ccb5c9
finding subgrpah bug fix
TigerThePro Aug 10, 2021
4190cfa
find subgraph bug fix
TigerThePro Aug 11, 2021
e46dd87
delted useless comment
TigerThePro Aug 11, 2021
e2b2d79
deleted test cases that no longer applies
TigerThePro Aug 11, 2021
7d1433e
order of cycleInstantiations changed
TigerThePro Aug 11, 2021
4e1f204
CycleDetection, deleted a 'if debug'
TigerThePro Aug 20, 2021
a463365
Console output fix
TigerThePro Aug 20, 2021
c649cc8
bug fix
TigerThePro Aug 22, 2021
a445a89
deleted useless line
TigerThePro Aug 22, 2021
3fed549
Merge branch 'viperproject:master' into subgraph
TigerThePro Sep 25, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions UnitTestProject1/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

[assembly: AssemblyTitle("UnitTestProject1")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("UnitTestProject1")]
[assembly: AssemblyCopyright("Copyright © 2021")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

[assembly: ComVisible(false)]

[assembly: Guid("6fb6598f-e98a-4f89-a1b9-580bfa97c4bc")]

// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
227 changes: 227 additions & 0 deletions UnitTestProject1/TestGraphs.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,227 @@
using System;
using System.Collections.Generic;
using Microsoft.Msagl.Drawing;
using AxiomProfiler.QuantifierModel;

namespace UnitTestProject1
{
// A visulization and explination for the test graphs can be found here
// https://docs.google.com/document/d/1SJspfBecgkVT9U8xC-MvQ_NPDTGVfg0yqq7YjJ3ma2s/edit?usp=sharing
// Some graphs
class TestGraphs
{
public List<Quantifier> Quants = new List<Quantifier>(); // Quantifiers used in unit tests
public BindingInfo Info; // BindingInfo used to make nodes
public Graph graph1, graph2, graph3, graph4, graph5, graph6, graph7;

// Constructor
// Mkae the graphs needsed for testing
public TestGraphs()
{
InitQuantsAndInfo();
MakeGraph1();
MakeGraph2();
MakeGraph3();
MakeGraph4();
MakeGraph5();
MakeGraph6();
MakeGraph7();
}

// initialize 9 quantifiers
private void InitQuantsAndInfo()
{
// initialize Quants
for (int i = 0; i < 10; i++)
{
Quants.Add(new Quantifier());
Quants[i].PrintName = i.ToString();
}
// initialize Info, with meaningless arguments
Term[] args = new Term[0];
Term Term = new Term("a", args);
Info = new BindingInfo(Quants[0], args, args);
}

// function that make of node with Id = nodeId,
// and UserDate = a instantiation with quantifier quant
private Node MakeNode(String nodeId, int quant)
{
Node node = new Node(nodeId);
Instantiation Inst = new Instantiation(Info, "a");
Inst.Quant = Quants[quant];
node.UserData = Inst;
return node;
}

// Graph1 is graph containing only one node
private void MakeGraph1()
{
graph1 = new Graph();
graph1.AddNode(MakeNode("A", 0));
}

// Graph2
private void MakeGraph2()
{
graph2 = new Graph();
graph2.AddNode(MakeNode("A", 0));
graph2.AddNode(MakeNode("B", 1));
graph2.AddNode(MakeNode("C", 2));
graph2.AddNode(MakeNode("D", 3));
graph2.AddNode(MakeNode("E", 4));
graph2.AddNode(MakeNode("F", 5));
graph2.AddNode(MakeNode("G", 6));
graph2.AddNode(MakeNode("H", 7));
graph2.AddNode(MakeNode("I", 8));
graph2.AddNode(MakeNode("J", 9));
graph2.AddNode(MakeNode("K", 0));
graph2.AddNode(MakeNode("L", 0));
graph2.AddNode(MakeNode("M", 0));
graph2.AddNode(MakeNode("N", 1));
char prev = 'A';
for (char c = 'C'; c <= 'K'; c++)
{
graph2.AddEdge(prev.ToString(), c.ToString());
prev = c;
}
graph2.AddEdge("A", "B");
graph2.AddEdge("B", "L");
graph2.AddEdge("L", "N");
graph2.AddEdge("A", "M");
}

private void MakeGraph3()
{
graph3 = new Graph();
graph3.AddNode(MakeNode("A", 0));
graph3.AddNode(MakeNode("B", 1));
graph3.AddNode(MakeNode("C", 1));
graph3.AddNode(MakeNode("D", 0));
graph3.AddNode(MakeNode("E", 0));
graph3.AddNode(MakeNode("F", 1));
graph3.AddNode(MakeNode("G", 1));
graph3.AddNode(MakeNode("H", 0));
graph3.AddNode(MakeNode("I", 0));
graph3.AddEdge("A", "B");
graph3.AddEdge("A", "C");
graph3.AddEdge("C", "D");
graph3.AddEdge("C", "E");
graph3.AddEdge("E", "F");
graph3.AddEdge("E", "G");
graph3.AddEdge("G", "H");
graph3.AddEdge("G", "I");
}

private void MakeGraph4()
{
graph4 = new Graph();
graph4.AddNode(MakeNode("A", 0));
graph4.AddNode(MakeNode("B", 1));
graph4.AddNode(MakeNode("C", 2));
graph4.AddNode(MakeNode("D", 3));
graph4.AddNode(MakeNode("E", 4));
graph4.AddNode(MakeNode("F", 5));
graph4.AddNode(MakeNode("G", 6));
graph4.AddNode(MakeNode("H", 7));
graph4.AddNode(MakeNode("I", 8));
graph4.AddNode(MakeNode("J", 9));
graph4.AddNode(MakeNode("K", 0));
graph4.AddNode(MakeNode("L", 0));
graph4.AddNode(MakeNode("M", 0));
graph4.AddNode(MakeNode("N", 1));
char prev = 'K';
for (char c = 'J'; c >= 'C'; c--)
{
graph4.AddEdge(prev.ToString(), c.ToString());
prev = c;
}
graph4.AddEdge("C", "A");
graph4.AddEdge("B", "A");
graph4.AddEdge("L", "B");
graph4.AddEdge("N", "L");
graph4.AddEdge("M", "A");
}

private void MakeGraph5()
{
graph5 = new Graph();
graph5.AddNode(MakeNode("A", 0));
graph5.AddNode(MakeNode("B", 1));
graph5.AddNode(MakeNode("C", 1));
graph5.AddNode(MakeNode("D", 0));
graph5.AddNode(MakeNode("E", 0));
graph5.AddNode(MakeNode("F", 1));
graph5.AddNode(MakeNode("G", 1));
graph5.AddNode(MakeNode("H", 0));
graph5.AddNode(MakeNode("I", 0));
graph5.AddEdge("B", "A");
graph5.AddEdge("C", "A");
graph5.AddEdge("D", "C");
graph5.AddEdge("E", "C");
graph5.AddEdge("F", "E");
graph5.AddEdge("G", "E");
graph5.AddEdge("H", "G");
graph5.AddEdge("I", "G");
}

private void MakeGraph6()
{
graph6 = new Graph();
graph6.AddNode(MakeNode("A", 0));
graph6.AddNode(MakeNode("B", 1));
graph6.AddNode(MakeNode("C", 0));
graph6.AddNode(MakeNode("D", 2));
graph6.AddNode(MakeNode("E", 0));
graph6.AddNode(MakeNode("F", 1));
graph6.AddNode(MakeNode("G", 0));
graph6.AddNode(MakeNode("H", 2));
graph6.AddNode(MakeNode("I", 0));
graph6.AddNode(MakeNode("J", 1));
graph6.AddNode(MakeNode("K", 0));
graph6.AddNode(MakeNode("L", 0));
graph6.AddNode(MakeNode("M", 1));

for (char c = 'A'; c < 'H'; c++)
{
graph6.AddEdge(c.ToString(), ((char) (c + 1)).ToString());
}

char prev = 'A';
for (char c = 'I'; c <= 'M'; c++)
{
graph6.AddEdge(prev.ToString(), c.ToString());
prev = c;
}
}

private void MakeGraph7()
{
graph7 = new Graph();
graph7.AddNode(MakeNode("A", 0));
graph7.AddNode(MakeNode("B", 1));
graph7.AddNode(MakeNode("C", 0));
graph7.AddNode(MakeNode("D", 2));
graph7.AddNode(MakeNode("E", 0));
graph7.AddNode(MakeNode("F", 1));
graph7.AddNode(MakeNode("G", 0));
graph7.AddNode(MakeNode("H", 2));
graph7.AddNode(MakeNode("I", 0));
graph7.AddNode(MakeNode("J", 1));
graph7.AddNode(MakeNode("K", 0));
graph7.AddNode(MakeNode("L", 0));
graph7.AddNode(MakeNode("M", 1));

for (char c = 'H'; c > 'A'; c--)
{
graph7.AddEdge(c.ToString(), ((char) (c - 1)).ToString());
}

graph7.AddEdge("M", "L");
graph7.AddEdge("L", "K");
graph7.AddEdge("K", "J");
graph7.AddEdge("J", "I");
graph7.AddEdge("I", "A");
}
}
}
Loading