AToMPM / AToMPM/atompm

SimpleClassDiagrams diamond inheritance

Open
#147 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
25
Forks
15
PR merge metrics
No merged PRs in 30d

Description

While multiple inheritance is supported in the SimpleClassDiagrams formalism, creating an instance that has diamond inheritance gives an error "500:constraint (post-create noInheritanceLoops) failed".

![image](https://user-images.githubusercontent.com/37209254/199004782-2e309e27-520e-434d-ae3b-90a4eaf671ca.png)

Is this intended behavior?

- If so, we must make it explicit that diamond inheritance is not allowed.
- Otherwise, the constraint checking function should be fixed to allow this.

The constraint checking function is currently as follows:
```
var mm = '/Formalisms/__LanguageSyntax__/SimpleClassDiagram/SimpleClassDiagram/',
nout = getNeighbors('>',mm+'Class'),
visited = [];
function dfs(to_visit)
{
var curr = to_visit.pop();
if( curr == undefined )
return true;
else if( visited.indexOf(curr) > -1 )
return false;
else
{
visited.push(curr);
var ntype = (getAttr('$type',curr) == mm+'Class' ?
mm+'Inheritance' : mm+'Class');
return dfs( to_visit.concat(getNeighbors('>',ntype,curr)) );
}
}
dfs(nout);
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the SimpleClassDiagram constraint-checking function shown in the issue and reproduce the diamond-inheritance instance that triggers the post-create noInheritanceLoops error. Determine whether the formalism permits diamond inheritance; done means either the restriction is made explicit or validation accepts the instance without the reported error.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
devtools
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.