Commit 1909189a authored by Akim Demaille's avatar Akim Demaille
Browse files

nullableset: denote as nullableset instead of lan

* lib/vcsn/dyn/context-parser.cc, lib/vcsn/dyn/signature-printer.cc,
* vcsn/dyn/context-parser.hh, vcsn/labelset/nullableset.hh: Now
the displayed name for nullableset _is_ nullableset, no longer lan.
'lan' is still accepted in input though.

* tests/python/automaton.dir/lan_char_z.daut,
* tests/python/automaton.dir/lan_char_z.out.gv,
* tests/python/automaton.dir/lan_char_z.tex.gv,
* tests/python/automaton.py,
* tests/python/compose.dir/result.gv,
* tests/python/compose.py,
* tests/python/context.py,
* tests/python/insplit.py,
* tests/python/prefix.dir/aut1-subword.gv,
* tests/python/prefix.dir/aut2-subword.gv,
* tests/python/prefix.dir/aut3-subword.gv,
* tests/python/prefix.dir/aut4-subword.gv,
* tests/python/product.py,
* tests/python/proper.py,
* tests/python/thompson.py:
Adjust.
parent ae165b52
......@@ -201,7 +201,7 @@ namespace vcsn
{
if (ls == "lal_char")
return std::make_shared<letterset>(genset_("char_letters"));
else if (ls == "lan")
else if (ls == "lan" | ls == "nullableset")
{
eat(is_, '<');
auto res = labelset_();
......
......@@ -60,7 +60,7 @@ namespace vcsn
DEFINE(nullableset)
{
os_ << "lan<";
os_ << "nullableset<";
t.get_labelset()->accept(*this);
os_ << '>';
}
......
......@@ -143,10 +143,10 @@ def CHECK_EQ(expected, effective, loc = None):
def normalize(a):
'''Turn automaton `a` into something we can check equivalence with.'''
a = a.strip()
if 'lan' in str(a.context()):
if 'nullableset' in str(a.context()):
a = a.proper()
# Eliminate nullablesets if there are that remain.
to = re.sub(r'lan<(lal_char\(.*?\)|letterset<char_letters\(.*?\)>)>', r'\1', a.context().format('text'))
to = re.sub(r'nullableset<(lal_char\(.*?\)|letterset<char_letters\(.*?\)>)>', r'\1', a.context().format('text'))
return a.automaton(vcsn.context(to))
......
context = "lan<letterset<char_letters(abcdefghijklmnopqrstuvwxyz)>>, z"
context = "nullableset<letterset<char_letters(abcdefghijklmnopqrstuvwxyz)>>, z"
$ -> 0
0 -> 1 "\\e"
1 -> 2 "<2>\\e"
......
digraph
{
vcsn_context = "lan<letterset<char_letters(abcdefghijklmnopqrstuvwxyz)>>, z"
vcsn_context = "nullableset<letterset<char_letters(abcdefghijklmnopqrstuvwxyz)>>, z"
rankdir = LR
edge [arrowhead = vee, arrowsize = .6]
{
......
digraph
{
vcsn_context = "lan<letterset<char_letters(abcdefghijklmnopqrstuvwxyz)>>, z"
vcsn_context = "nullableset<letterset<char_letters(abcdefghijklmnopqrstuvwxyz)>>, z"
rankdir = LR
edge [texmode = math, lblstyle = auto]
d2toptions = "--format tikz --tikzedgelabels --graphstyle=automaton --crop --nominsize --autosize"
......
......@@ -214,7 +214,7 @@ c = vcsn.context('lan_char(ab), z')
a = c.expression('<2>a+<2>b').thompson()
CHECK_EQ('''digraph
{
vcsn_context = "lan<letterset<char_letters(ab)>>, z"
vcsn_context = "nullableset<letterset<char_letters(ab)>>, z"
rankdir = LR
edge [arrowhead = vee, arrowsize = .6]
{
......@@ -245,7 +245,7 @@ CHECK_EQ('''digraph
# conjunction: state names, and useless states, etc.
CHECK_EQ('''digraph
{
vcsn_context = "lan<letterset<char_letters(ab)>>, z"
vcsn_context = "nullableset<letterset<char_letters(ab)>>, z"
rankdir = LR
edge [arrowhead = vee, arrowsize = .6]
{
......@@ -288,7 +288,7 @@ CHECK_EQ('''digraph
# Tooltip.
CHECK_EQ('''digraph
{
vcsn_context = "lan<letterset<char_letters(ab)>>, z"
vcsn_context = "nullableset<letterset<char_letters(ab)>>, z"
rankdir = LR
edge [arrowhead = vee, arrowsize = .6]
{
......@@ -331,7 +331,7 @@ CHECK_EQ('''digraph
# Transitions.
CHECK_EQ('''digraph
{
vcsn_context = "lan<letterset<char_letters(ab)>>, z"
vcsn_context = "nullableset<letterset<char_letters(ab)>>, z"
rankdir = LR
edge [arrowhead = vee, arrowsize = .6]
{
......
digraph
{
vcsn_context = "lat<lan<letterset<char_letters(ab)>>, lan<letterset<char_letters(ab)>>>, b"
vcsn_context = "lat<nullableset<letterset<char_letters(ab)>>, nullableset<letterset<char_letters(ab)>>>, b"
rankdir = LR
edge [arrowhead = vee, arrowsize = .6]
{
......
......@@ -18,7 +18,7 @@ c2 = vcsn.context("lat<lan<lal_char(xyz)>,lan<lal_char(def)>>, b")
check(c1.expression("'(a, x)'").standard(), c2.expression("'(x, d)'").standard(),
'''digraph
{
vcsn_context = "lat<lan<letterset<char_letters(abc)>>, lan<letterset<char_letters(def)>>>, b"
vcsn_context = "lat<nullableset<letterset<char_letters(abc)>>, nullableset<letterset<char_letters(def)>>>, b"
rankdir = LR
edge [arrowhead = vee, arrowsize = .6]
{
......@@ -38,7 +38,7 @@ check(c1.expression("'(a, x)'").standard(), c2.expression("'(x, d)'").standard()
a = '''digraph
{
vcsn_context = "lat<lan<letterset<char_letters(abc)>>, lan<letterset<char_letters(def)>>>, b"
vcsn_context = "lat<nullableset<letterset<char_letters(abc)>>, nullableset<letterset<char_letters(def)>>>, b"
rankdir = LR
edge [arrowhead = vee, arrowsize = .6]
{
......@@ -72,7 +72,7 @@ CHECK_EQ(vcsn.automaton(a),
check(c1.expression("'(a, x)'*").standard(), c2.expression("'(y, d)'*").standard(),
'''digraph
{
vcsn_context = "lat<lan<letterset<char_letters(abc)>>, lan<letterset<char_letters(def)>>>, b"
vcsn_context = "lat<nullableset<letterset<char_letters(abc)>>, nullableset<letterset<char_letters(def)>>>, b"
rankdir = LR
edge [arrowhead = vee, arrowsize = .6]
{
......@@ -98,7 +98,7 @@ check(c_ratb.expression("<o>'(a, x)'").standard(),
c_q.expression("<3/2>'(x, d)'").standard(),
'''digraph
{
vcsn_context = "lat<lan<letterset<char_letters(abc)>>, lan<letterset<char_letters(def)>>>, expressionset<letterset<char_letters(mno)>, q>"
vcsn_context = "lat<nullableset<letterset<char_letters(abc)>>, nullableset<letterset<char_letters(def)>>>, expressionset<letterset<char_letters(mno)>, q>"
rankdir = LR
edge [arrowhead = vee, arrowsize = .6]
{
......@@ -143,7 +143,7 @@ a2 = vcsn.automaton(r'''digraph
res = r'''digraph
{
vcsn_context = "lat<lan<letterset<char_letters(xyz)>>, lan<letterset<char_letters(def)>>>, b"
vcsn_context = "lat<nullableset<letterset<char_letters(xyz)>>, nullableset<letterset<char_letters(def)>>>, b"
rankdir = LR
edge [arrowhead = vee, arrowsize = .6]
{
......@@ -174,7 +174,7 @@ c_r = vcsn.context("lat<lan_char(abc),lan_char(xyz)>, r")
check(c_r.expression("<3.1>'(a, x)'").standard(), c2.expression("'(x, d)'").standard(),
'''digraph
{
vcsn_context = "lat<lan<letterset<char_letters(abc)>>, lan<letterset<char_letters(def)>>>, r"
vcsn_context = "lat<nullableset<letterset<char_letters(abc)>>, nullableset<letterset<char_letters(def)>>>, r"
rankdir = LR
edge [arrowhead = vee, arrowsize = .6]
{
......
......@@ -45,10 +45,10 @@ check('lal_char(ab), lat<b, z>', 'letterset<char_letters(ab)>, lat<b, z>')
# End of level bosses.
check('lat<lal_char(ba),lan<lal_char(vu)>, law_char(x-z)>, lat<expressionset<lat<lal_char(fe), lal_char(hg)>, q>, r, q>',
'lat<letterset<char_letters(ab)>, lan<letterset<char_letters(uv)>>, wordset<char_letters(xyz)>>, lat<expressionset<lat<letterset<char_letters(ef)>, letterset<char_letters(gh)>>, q>, r, q>')
'lat<letterset<char_letters(ab)>, nullableset<letterset<char_letters(uv)>>, wordset<char_letters(xyz)>>, lat<expressionset<lat<letterset<char_letters(ef)>, letterset<char_letters(gh)>>, q>, r, q>')
check('lan<lat<lal_char(ba),lat<lan<lal_char(vu)>,law_char(x-z)>>>, lat<expressionset<lan<lat<lan_char(fe),lan_char(hg)>>, lat<r, q>>, lat<b, z>>',
'lan<lat<letterset<char_letters(ab)>, lat<lan<letterset<char_letters(uv)>>, wordset<char_letters(xyz)>>>>, lat<expressionset<lat<lan<letterset<char_letters(ef)>>, lan<letterset<char_letters(gh)>>>, lat<r, q>>, lat<b, z>>')
check('lan<lat<lal_char(ba),lat<lan<lal_char(vu)>,law_char(x-z)>>>, lat<expressionset<nullableset<lat<lan_char(fe),lan_char(hg)>>, lat<r, q>>, lat<b, z>>',
'nullableset<lat<letterset<char_letters(ab)>, lat<nullableset<letterset<char_letters(uv)>>, wordset<char_letters(xyz)>>>>, lat<expressionset<lat<nullableset<letterset<char_letters(ef)>>, nullableset<letterset<char_letters(gh)>>>, lat<r, q>>, lat<b, z>>')
## ------- ##
......
......@@ -56,7 +56,7 @@ digraph
2 -> F2
}''',r'''digraph
{
vcsn_context = "lan<letterset<char_letters(abc)>>, b"
vcsn_context = "nullableset<letterset<char_letters(abc)>>, b"
rankdir = LR
edge [arrowhead = vee, arrowsize = .6]
{
......@@ -92,7 +92,7 @@ digraph
2 -> F2
}''', r'''digraph
{
vcsn_context = "lan<letterset<char_letters(abc)>>, b"
vcsn_context = "nullableset<letterset<char_letters(abc)>>, b"
rankdir = LR
edge [arrowhead = vee, arrowsize = .6]
{
......
digraph
{
vcsn_context = "lan<letterset<char_letters(abc)>>, z"
vcsn_context = "nullableset<letterset<char_letters(abc)>>, z"
rankdir = LR
edge [arrowhead = vee, arrowsize = .6]
{
......
digraph
{
vcsn_context = "lan<letterset<char_letters(abc)>>, z"
vcsn_context = "nullableset<letterset<char_letters(abc)>>, z"
rankdir = LR
edge [arrowhead = vee, arrowsize = .6]
{
......
digraph
{
vcsn_context = "lan<letterset<char_letters(a)>>, z"
vcsn_context = "nullableset<letterset<char_letters(a)>>, z"
rankdir = LR
edge [arrowhead = vee, arrowsize = .6]
{
......
digraph
{
vcsn_context = "lan<letterset<char_letters(abc)>>, z"
vcsn_context = "nullableset<letterset<char_letters(abc)>>, z"
rankdir = LR
edge [arrowhead = vee, arrowsize = .6]
{
......
......@@ -309,7 +309,7 @@ lhs = vcsn.context('lan_char(ab), b').expression('(a+b)*').thompson()
rhs = vcsn.context('lan_char(bc), b').expression('(b+c)*').thompson()
res = r'''digraph
{
vcsn_context = "lan<letterset<char_letters(b)>>, b"
vcsn_context = "nullableset<letterset<char_letters(b)>>, b"
rankdir = LR
edge [arrowhead = vee, arrowsize = .6]
{
......@@ -387,7 +387,7 @@ CHECK_EQUIV(vcsn.automaton(res),
third = vcsn.context('lan_char(bcd), b').expression('(b+c+d)*').thompson()
res = r'''digraph
{
vcsn_context = "lan<letterset<char_letters(b)>>, b"
vcsn_context = "nullableset<letterset<char_letters(b)>>, b"
rankdir = LR
edge [arrowhead = vee, arrowsize = .6]
{
......@@ -658,7 +658,7 @@ a2 = vcsn.automaton(r'''digraph
res = r'''digraph
{
vcsn_context = "lan<letterset<char_letters(abc)>>, b"
vcsn_context = "nullableset<letterset<char_letters(abc)>>, b"
rankdir = LR
edge [arrowhead = vee, arrowsize = .6]
{
......
......@@ -404,7 +404,7 @@ check(r'''digraph
2 -> F2
}''', r'''digraph
{
vcsn_context = "lat<lan<letterset<char_letters(ab)>>, lan<letterset<char_letters(xy)>>>, b"
vcsn_context = "lat<nullableset<letterset<char_letters(ab)>>, nullableset<letterset<char_letters(xy)>>>, b"
rankdir = LR
edge [arrowhead = vee, arrowsize = .6]
{
......@@ -445,7 +445,7 @@ check(r'''digraph
2 -> F2
}''', r'''digraph
{
vcsn_context = "lat<lan<letterset<char_letters(ab)>>, letterset<char_letters(xy)>>, b"
vcsn_context = "lat<nullableset<letterset<char_letters(ab)>>, letterset<char_letters(xy)>>, b"
rankdir = LR
edge [arrowhead = vee, arrowsize = .6]
{
......
......@@ -33,7 +33,7 @@ xfail(r'(ab){T}')
check('(?@lal_char(a), z)<12>\e',
r'''digraph
{
vcsn_context = "lan<letterset<char_letters(a)>>, z"
vcsn_context = "nullableset<letterset<char_letters(a)>>, z"
rankdir = LR
edge [arrowhead = vee, arrowsize = .6]
{
......@@ -59,7 +59,7 @@ r'''digraph
check('(?@lal_char(ab), z)\e+a+\e',
r'''digraph
{
vcsn_context = "lan<letterset<char_letters(ab)>>, z"
vcsn_context = "nullableset<letterset<char_letters(ab)>>, z"
rankdir = LR
edge [arrowhead = vee, arrowsize = .6]
{
......@@ -131,7 +131,7 @@ r'''digraph
check('(?@lan_char(ab), z)<12>(\e+a+<10>b+<10>\e)',
r'''digraph
{
vcsn_context = "lan<letterset<char_letters(ab)>>, z"
vcsn_context = "nullableset<letterset<char_letters(ab)>>, z"
rankdir = LR
edge [arrowhead = vee, arrowsize = .6]
{
......@@ -172,7 +172,7 @@ r'''digraph
check('(?@lan_char(ab), z)(\e+a+<2>b+<3>\e)<10>',
r'''digraph
{
vcsn_context = "lan<letterset<char_letters(ab)>>, z"
vcsn_context = "nullableset<letterset<char_letters(ab)>>, z"
rankdir = LR
edge [arrowhead = vee, arrowsize = .6]
{
......@@ -217,7 +217,7 @@ r'''digraph
check('(?@lal_char(ab), z)<12>(ab)<23>',
r'''digraph
{
vcsn_context = "lan<letterset<char_letters(ab)>>, z"
vcsn_context = "nullableset<letterset<char_letters(ab)>>, z"
rankdir = LR
edge [arrowhead = vee, arrowsize = .6]
{
......@@ -246,7 +246,7 @@ r'''digraph
check('(?@lan_char(ab), z)\z*',
r'''digraph
{
vcsn_context = "lan<letterset<char_letters(ab)>>, z"
vcsn_context = "nullableset<letterset<char_letters(ab)>>, z"
rankdir = LR
edge [arrowhead = vee, arrowsize = .6]
{
......@@ -267,7 +267,7 @@ r'''digraph
check('(?@lan_char(ab), b)\e*',
r'''digraph
{
vcsn_context = "lan<letterset<char_letters(ab)>>, b"
vcsn_context = "nullableset<letterset<char_letters(ab)>>, b"
rankdir = LR
edge [arrowhead = vee, arrowsize = .6]
{
......@@ -294,7 +294,7 @@ r'''digraph
check('(?@lan_char(ab), z)(<2>a)*',
r'''digraph
{
vcsn_context = "lan<letterset<char_letters(ab)>>, z"
vcsn_context = "nullableset<letterset<char_letters(ab)>>, z"
rankdir = LR
edge [arrowhead = vee, arrowsize = .6]
{
......@@ -321,7 +321,7 @@ r'''digraph
check('(?@lan_char(ab), z)<2>a*<3>',
r'''digraph
{
vcsn_context = "lan<letterset<char_letters(ab)>>, z"
vcsn_context = "nullableset<letterset<char_letters(ab)>>, z"
rankdir = LR
edge [arrowhead = vee, arrowsize = .6]
{
......@@ -348,7 +348,7 @@ r'''digraph
check('(?@lan_char(ab), z)(<2>a+<3>b)*',
r'''digraph
{
vcsn_context = "lan<letterset<char_letters(ab)>>, z"
vcsn_context = "nullableset<letterset<char_letters(ab)>>, z"
rankdir = LR
edge [arrowhead = vee, arrowsize = .6]
{
......@@ -384,7 +384,7 @@ r'''digraph
check('(?@lan_char(ab), z)<2>(<3>a+<5>b)*<7>',
r'''digraph
{
vcsn_context = "lan<letterset<char_letters(ab)>>, z"
vcsn_context = "nullableset<letterset<char_letters(ab)>>, z"
rankdir = LR
edge [arrowhead = vee, arrowsize = .6]
{
......@@ -420,7 +420,7 @@ r'''digraph
check('(?@lan_char(ab), z)<2>(<3>(ab)<5>)*<7>',
r'''digraph
{
vcsn_context = "lan<letterset<char_letters(ab)>>, z"
vcsn_context = "nullableset<letterset<char_letters(ab)>>, z"
rankdir = LR
edge [arrowhead = vee, arrowsize = .6]
{
......@@ -451,7 +451,7 @@ r'''digraph
check('(?@lan_char(ab), z)a**',
r'''digraph
{
vcsn_context = "lan<letterset<char_letters(ab)>>, z"
vcsn_context = "nullableset<letterset<char_letters(ab)>>, z"
rankdir = LR
edge [arrowhead = vee, arrowsize = .6]
{
......@@ -488,7 +488,7 @@ r'''digraph
check('(?@lan_char(abcd), expressionset<lal_char(efgh), z>)(<e>\e+abc)*',
r'''digraph
{
vcsn_context = "lan<letterset<char_letters(abcd)>>, expressionset<letterset<char_letters(efgh)>, z>"
vcsn_context = "nullableset<letterset<char_letters(abcd)>>, expressionset<letterset<char_letters(efgh)>, z>"
rankdir = LR
edge [arrowhead = vee, arrowsize = .6]
{
......@@ -532,7 +532,7 @@ r'''digraph
check('(?@lan_char(abcd), expressionset<lal_char(efgh), z>)(<e>\e+ab<f>)*',
r'''digraph
{
vcsn_context = "lan<letterset<char_letters(abcd)>>, expressionset<letterset<char_letters(efgh)>, z>"
vcsn_context = "nullableset<letterset<char_letters(abcd)>>, expressionset<letterset<char_letters(efgh)>, z>"
rankdir = LR
edge [arrowhead = vee, arrowsize = .6]
{
......@@ -574,7 +574,7 @@ r'''digraph
check('(?@lan_char(a), expressionset<lal_char(xyz), z>)<x>a(<y>\e+<z>a)',
r'''digraph
{
vcsn_context = "lan<letterset<char_letters(a)>>, expressionset<letterset<char_letters(xyz)>, z>"
vcsn_context = "nullableset<letterset<char_letters(a)>>, expressionset<letterset<char_letters(xyz)>, z>"
rankdir = LR
edge [arrowhead = vee, arrowsize = .6]
{
......
......@@ -71,8 +71,7 @@ namespace vcsn
std::istringstream& is_;
/// The set of terminal weightset names.
std::set<std::string> weightsets_
=
std::set<std::string> weightsets_ =
{
"b",
"f2",
......@@ -85,8 +84,7 @@ namespace vcsn
};
/// The set of weightset names.
std::set<std::string> labelsets_
=
std::set<std::string> labelsets_ =
{
"lal_char",
"lan",
......@@ -94,6 +92,7 @@ namespace vcsn
"lao",
"law_char",
"letterset",
"nullableset",
"wordset",
};
};
......
......@@ -179,17 +179,17 @@ namespace vcsn
static symbol sname()
{
static symbol res("lan<" + labelset_t::sname() + '>');
static symbol res("nullableset<" + labelset_t::sname() + '>');
return res;
}
/// Build from the description in \a is.
static nullableset make(std::istream& is)
{
// name: lan<lal_char(abc)>.
// ^^^^^^^^^^^^
// name: nullableset<lal_char(abc)>.
// ^^^^^^^^^^^^
// labelset
eat(is, "lan<");
eat(is, "nullableset<");
auto ls = labelset_t::make(is);
eat(is, '>');
return {ls};
......@@ -427,7 +427,7 @@ namespace vcsn
}
else if (format == "text")
{
o << "lan<";
o << "nullableset<";
labelset()->print_set(o, format);
o << '>';
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment