Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
spot-web-app
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
3
Issues
3
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Spot
spot-web-app
Commits
9a39bb3d
Commit
9a39bb3d
authored
Jul 24, 2020
by
Alexandre Duret-Lutz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add Rabin & Streett indices
parent
9cb28747
Pipeline
#20694
passed with stage
in 2 minutes and 7 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
61 additions
and
2 deletions
+61
-2
client/src/LtlApp.js
client/src/LtlApp.js
+39
-1
server/spotapi.py
server/spotapi.py
+22
-1
No files found.
client/src/LtlApp.js
View file @
9a39bb3d
/* -*- coding: utf-8 -*-
** Copyright (C) 2018
, 2019
Laboratoire de Recherche et Développement de
** Copyright (C) 2018
-2020
Laboratoire de Recherche et Développement de
** l'Epita.
**
** This application is free software; you can redistribute it and/or
...
...
@@ -247,6 +247,9 @@ const styles = theme => ({
paddingBottom
:
10
},
stutterdiv
:
{},
indexdiv
:
{
paddingBottom
:
10
},
livenessdiv
:
{
paddingBottom
:
10
},
...
...
@@ -944,6 +947,41 @@ class LtlStudy extends React.Component {
<
/Typography
>
)}
<
/div
>
<
div
className
=
{
this
.
props
.
classes
.
indexdiv
}
>
<
Typography
variant
=
"
body2
"
color
=
"
primary
"
>
Indices
<
/Typography
>
{(
res
[
"
Rabin_index
"
]
!==
null
||
res
[
"
Streett_index
"
]
!==
null
)
&&
(
<
Table
className
=
{
this
.
props
.
classes
.
wordtable
}
>
<
TableBody
>
<
TableRow
className
=
{
this
.
props
.
classes
.
wordtablerow
}
>
<
TableCell
component
=
"
th
"
scope
=
"
row
"
className
=
{
this
.
props
.
classes
.
wordtablecell
}
>
Rabin
index
:
<
/TableCell
>
<
TableCell
className
=
{
this
.
props
.
classes
.
wordtablecellw
}
>
{
res
[
"
Rabin_index
"
]}
<
/TableCell
>
<
/TableRow
>
<
TableRow
className
=
{
this
.
props
.
classes
.
wordtablerow
}
>
<
TableCell
component
=
"
th
"
scope
=
"
row
"
className
=
{
this
.
props
.
classes
.
wordtablecell
}
>
Streett
index
:
<
/TableCell
>
<
TableCell
className
=
{
this
.
props
.
classes
.
wordtablecellw
}
>
{
res
[
"
Streett_index
"
]}
<
/TableCell
>
<
/TableRow
>
<
/TableBody
>
<
/Table
>
)}
<
/div
>
<
div
className
=
{
this
.
props
.
classes
.
satisfiabilitydiv
}
>
<
Typography
variant
=
"
body2
"
color
=
"
primary
"
>
Satisfiability
...
...
server/spotapi.py
View file @
9a39bb3d
#!/usr/bin/python3
# -*- coding: utf-8 -*-
# Copyright (C) 2018-20
19
Laboratoire de Recherche et Développement de
# Copyright (C) 2018-20
20
Laboratoire de Recherche et Développement de
# l'Epita.
#
# This application is free software; you can redistribute it and/or
...
...
@@ -331,6 +331,27 @@ def study(ltlformula, method='GET'):
else
:
result
[
'rej_word'
]
=
None
;
# Rabin and Streett indices
# This is done my calling reduce_parity() on a deterministic
# parity automaton.
# Note that f2 is relabeled, so do not attempt to reuse
# pos as-is after this block.
if
not
spot
.
is_deterministic
(
pos
):
pos
=
spot
.
translate
(
f2
,
'medium'
,
'generic'
,
'deterministic'
)
isparity
,
ismax
,
isodd
=
pos
.
acc
().
is_parity
()
if
not
isparity
:
pos
=
spot
.
to_parity
(
pos
)
spot
.
complete_here
(
pos
)
spot
.
change_parity_here
(
pos
,
spot
.
parity_kind_max
,
spot
.
parity_style_any
)
pos
=
spot
.
reduce_parity
(
pos
)
isparity
,
ismax
,
isodd
=
pos
.
acc
().
is_parity
()
assert
isparity
assert
ismax
ns
=
pos
.
num_sets
()
+
1
result
[
'Rabin_index'
]
=
(
ns
+
int
(
isodd
))
//
2
result
[
'Streett_index'
]
=
(
ns
+
int
(
not
isodd
))
//
2
return
jsonify
(
result
)
# Input parameters
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment