-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from flamapy/splc22
Splc22
- Loading branch information
Showing
10 changed files
with
381 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
%Relationships | ||
Pizza: Topping Size Dough [CheesyCrust]; | ||
Size: [1,1]{Normal Big}; | ||
Topping: [1,3]{Salami Ham Mozzarella}; | ||
Dough: [1,1]{Neapolitan Sicilian}; | ||
|
||
%Constraints | ||
CheesyCrust REQUIRES Big; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?xml version="1.0" encoding="UTF-8" standalone="no"?> | ||
<featureModel> | ||
<struct> | ||
<and abstract="true" mandatory="true" name="Pizza"> | ||
<or mandatory="true" name="Topping"> | ||
<feature name="Salami"/> | ||
<feature name="Ham"/> | ||
<feature name="Mozzarella"/> | ||
</or> | ||
<alt mandatory="true" name="Size"> | ||
<feature name="Normal"/> | ||
<feature name="Big"/> | ||
</alt> | ||
<alt mandatory="true" name="Dough"> | ||
<feature name="Neapolitan"/> | ||
<feature name="Sicilian"/> | ||
</alt> | ||
<feature name="CheesyCrust"/> | ||
</and> | ||
</struct> | ||
<constraints> | ||
<rule> | ||
<imp> | ||
<var>CheesyCrust</var> | ||
<var>Big</var> | ||
</imp> | ||
</rule> | ||
</constraints> | ||
</featureModel> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,141 @@ | ||
{ | ||
"id": "FM_Pizza", | ||
"name": "FM_Pizza", | ||
"features": { | ||
"Pizza": { | ||
"name": "Pizza", | ||
"optional": true, | ||
"type": "FEATURE", | ||
"note": "" | ||
}, | ||
"Topping": { | ||
"name": "Topping", | ||
"optional": false, | ||
"type": "OR", | ||
"note": "" | ||
}, | ||
"Salami": { | ||
"name": "Salami", | ||
"optional": true, | ||
"type": "FEATURE", | ||
"note": "" | ||
}, | ||
"Ham": { | ||
"name": "Ham", | ||
"optional": true, | ||
"type": "FEATURE", | ||
"note": "" | ||
}, | ||
"Mozzarella": { | ||
"name": "Mozzarella", | ||
"optional": true, | ||
"type": "FEATURE", | ||
"note": "" | ||
}, | ||
"Size": { | ||
"name": "Size", | ||
"optional": false, | ||
"type": "XOR", | ||
"note": "" | ||
}, | ||
"Normal": { | ||
"name": "Normal", | ||
"optional": true, | ||
"type": "FEATURE", | ||
"note": "" | ||
}, | ||
"Big": { | ||
"name": "Big", | ||
"optional": true, | ||
"type": "FEATURE", | ||
"note": "" | ||
}, | ||
"Dough": { | ||
"name": "Dough", | ||
"optional": false, | ||
"type": "XOR", | ||
"note": "" | ||
}, | ||
"Neapolitan": { | ||
"name": "Neapolitan", | ||
"optional": true, | ||
"type": "FEATURE", | ||
"note": "" | ||
}, | ||
"Sicilian": { | ||
"name": "Sicilian", | ||
"optional": true, | ||
"type": "FEATURE", | ||
"note": "" | ||
}, | ||
"CheesyCrust": { | ||
"name": "CheesyCrust", | ||
"optional": true, | ||
"type": "FEATURE", | ||
"note": "" | ||
} | ||
}, | ||
"tree": { | ||
"id": "Pizza", | ||
"children": [ | ||
{ | ||
"id": "Topping", | ||
"children": [ | ||
{ | ||
"id": "Salami" | ||
}, | ||
{ | ||
"id": "Ham" | ||
}, | ||
{ | ||
"id": "Mozzarella" | ||
} | ||
] | ||
}, | ||
{ | ||
"id": "Size", | ||
"children": [ | ||
{ | ||
"id": "Normal" | ||
}, | ||
{ | ||
"id": "Big" | ||
} | ||
] | ||
}, | ||
{ | ||
"id": "Dough", | ||
"children": [ | ||
{ | ||
"id": "Neapolitan" | ||
}, | ||
{ | ||
"id": "Sicilian" | ||
} | ||
] | ||
}, | ||
{ | ||
"id": "CheesyCrust" | ||
} | ||
] | ||
}, | ||
"constraints": { | ||
"1": { | ||
"type": "ImpliesTerm", | ||
"operands": [ | ||
{ | ||
"type": "FeatureTerm", | ||
"operands": [ | ||
"CheesyCrust" | ||
] | ||
}, | ||
{ | ||
"type": "FeatureTerm", | ||
"operands": [ | ||
"Big" | ||
] | ||
} | ||
] | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,141 @@ | ||
{ | ||
"id": "FM_Pizza", | ||
"name": "FM_Pizza", | ||
"features": { | ||
"Pizza": { | ||
"name": "Pizza", | ||
"optional": true, | ||
"type": "FEATURE", | ||
"note": "" | ||
}, | ||
"Topping": { | ||
"name": "Topping", | ||
"optional": false, | ||
"type": "OR", | ||
"note": "" | ||
}, | ||
"Salami": { | ||
"name": "Salami", | ||
"optional": true, | ||
"type": "FEATURE", | ||
"note": "" | ||
}, | ||
"Ham": { | ||
"name": "Ham", | ||
"optional": true, | ||
"type": "FEATURE", | ||
"note": "" | ||
}, | ||
"Mozzarella": { | ||
"name": "Mozzarella", | ||
"optional": true, | ||
"type": "FEATURE", | ||
"note": "" | ||
}, | ||
"Size": { | ||
"name": "Size", | ||
"optional": false, | ||
"type": "XOR", | ||
"note": "" | ||
}, | ||
"Normal": { | ||
"name": "Normal", | ||
"optional": true, | ||
"type": "FEATURE", | ||
"note": "" | ||
}, | ||
"Big": { | ||
"name": "Big", | ||
"optional": true, | ||
"type": "FEATURE", | ||
"note": "" | ||
}, | ||
"Dough": { | ||
"name": "Dough", | ||
"optional": false, | ||
"type": "XOR", | ||
"note": "" | ||
}, | ||
"Neapolitan": { | ||
"name": "Neapolitan", | ||
"optional": true, | ||
"type": "FEATURE", | ||
"note": "" | ||
}, | ||
"Sicilian": { | ||
"name": "Sicilian", | ||
"optional": true, | ||
"type": "FEATURE", | ||
"note": "" | ||
}, | ||
"CheesyCrust": { | ||
"name": "CheesyCrust", | ||
"optional": true, | ||
"type": "FEATURE", | ||
"note": "" | ||
} | ||
}, | ||
"tree": { | ||
"id": "Pizza", | ||
"children": [ | ||
{ | ||
"id": "Topping", | ||
"children": [ | ||
{ | ||
"id": "Salami" | ||
}, | ||
{ | ||
"id": "Ham" | ||
}, | ||
{ | ||
"id": "Mozzarella" | ||
} | ||
] | ||
}, | ||
{ | ||
"id": "Size", | ||
"children": [ | ||
{ | ||
"id": "Normal" | ||
}, | ||
{ | ||
"id": "Big" | ||
} | ||
] | ||
}, | ||
{ | ||
"id": "Dough", | ||
"children": [ | ||
{ | ||
"id": "Neapolitan" | ||
}, | ||
{ | ||
"id": "Sicilian" | ||
} | ||
] | ||
}, | ||
{ | ||
"id": "CheesyCrust" | ||
} | ||
] | ||
}, | ||
"constraints": { | ||
"1": { | ||
"type": "ImpliesTerm", | ||
"operands": [ | ||
{ | ||
"type": "FeatureTerm", | ||
"operands": [ | ||
"CheesyCrust" | ||
] | ||
}, | ||
{ | ||
"type": "FeatureTerm", | ||
"operands": [ | ||
"Big" | ||
] | ||
} | ||
] | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
namespace Pizza | ||
|
||
features | ||
Pizza {abstract} | ||
mandatory | ||
Topping | ||
or | ||
Salami | ||
Ham | ||
Mozzarella | ||
Size | ||
alternative | ||
Normal | ||
Big | ||
Dough | ||
alternative | ||
Neapolitan | ||
Sicilian | ||
|
||
optional | ||
CheesyCrust | ||
|
||
constraints | ||
CheesyCrust => Big |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
%Relationships | ||
Size: [1,1]{Normal Big}; | ||
Pizza: Topping Size Dough [CheesyCrust]; | ||
Topping: [1,3]{Salami Ham Mozzarella}; | ||
Dough: [1,1]{Neapolitan Sicilian}; | ||
|
||
%Constraints | ||
CheesyCrust REQUIRES Big; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
Big,True | ||
Medium,True |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
Big,True | ||
Medium,True |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
from flamapy.core.discover import DiscoverMetamodels # This loads the tool in the python execution environment | ||
dm = DiscoverMetamodels() # Instantiate the class | ||
#result = dm.use_operation_from_file("Products", "./tutorial-splc22/models/pizzas/pizzas.fide") # This launch the operation and stores the result on the result variable | ||
result = dm.use_operation_from_file("ValidProduct", "./tutorial-splc22/models/pizzas/pizzas.fide",configuration_file="./tutorial-splc22/models/pizzas_nonvalid.csvconf" ) # This launch the operation and stores the result on the result variable | ||
print(result) # to print the result |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/bin/sh | ||
|
||
# Set local port from command line arg or default to 8080 | ||
LOCAL_PORT=${1-8080} | ||
|
||
echo "Start ngrok in background on port [ $LOCAL_PORT ]" | ||
nohup ./tutorial-splc22/ngrok http ${LOCAL_PORT} &>/dev/null & | ||
|
||
echo -n "Extracting ngrok public url ." | ||
NGROK_PUBLIC_URL="" | ||
while [ -z "$NGROK_PUBLIC_URL" ]; do | ||
# Run 'curl' against ngrok API and extract public (using 'sed' command) | ||
export NGROK_PUBLIC_URL=$(curl --silent --max-time 10 --connect-timeout 5 \ | ||
--show-error http://127.0.0.1:4040/api/tunnels | \ | ||
sed -nE 's/.*public_url":"https:..([^"]*).*/\1/p') | ||
sleep 1 | ||
echo -n "." | ||
done | ||
|
||
echo | ||
echo "NGROK_PUBLIC_URL => [ $NGROK_PUBLIC_URL ]" |