Skip to content

Commit

Permalink
Merge pull request #535 from Lexpedite/six_twelve
Browse files Browse the repository at this point in the history
Six twelve
  • Loading branch information
Gauntlet173 authored May 9, 2023
2 parents 046bf4f + bab65cd commit 3251dab
Show file tree
Hide file tree
Showing 10 changed files with 251 additions and 185 deletions.
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,20 @@ As of v0.2-alpha, this project is attempting to adhere to [Semantic Versioning](
While alpha, however, any version may include breaking changes that may not be specifically noted as such,
and breaking changes will not necessarily result in changes to the main version number.

## [v1.6.12-alpha](https://github.com/Lexpedite/blawx/releases/tag/v1.6.12-alpha) 2023-05-09

This release chances how code is generated for projects. To upgrade existing files you may need to
open each section of the code and re-save it.

### Fixes
* Numerical constraints with equality work properly
* Date constraints no longer fail on type errors related to the beginning and end of time
* Scenario editor now displays all relevant constraints in the explanations
* Scenario editor will now display reasoner errors if they occur.
* The OASA example is no longer published by default.
* Scenario Editor and Test Editor no longer crash when dealing with attributed rules in the root section of the project.
* Disequalities and numerical constraints now appear in explanations.

## [v1.6.11-alpha](https://github.com/Lexpedite/blawx/releases/tag/v1.6.11-alpha) 2023-05-08

### Fixes
Expand Down
48 changes: 24 additions & 24 deletions blawx/dates.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,51 +47,51 @@
date_compare(time(X),ne,time(Y)) :- X \= Y.
date_compare(datetime(X),eq,datetime(X)).
date_compare(datetime(bot),gte,datetime(bot)).
date_compare(datetime(bot),lte,datetime(bot)).
date_compare(datetime(eot),gte,datetime(eot)).
date_compare(datetime(eot),lte,datetime(eot)).
date_compare(datetime(bot),lt,datetime(Y)) :- Y \= bot.
date_compare(datetime(eot),gt,datetime(Y)) :- Y \= eot.
%date_compare(datetime(bot),gte,datetime(bot)).
%date_compare(datetime(bot),lte,datetime(bot)).
%date_compare(datetime(eot),gte,datetime(eot)).
%date_compare(datetime(eot),lte,datetime(eot)).
%date_compare(datetime(bot),lt,datetime(Y)) :- Y \= bot.
%date_compare(datetime(eot),gt,datetime(Y)) :- Y \= eot.
date_compare(datetime(X),lt,datetime(Y)) :- X #< Y.
date_compare(datetime(X),gt,datetime(Y)) :- X #> Y.
date_compare(datetime(X),lte,datetime(Y)) :- X #=< Y.
date_compare(datetime(X),gte,datetime(Y)) :- X #>= Y.
date_compare(datetime(X),ne,datetime(Y)) :- X \= Y.
date_compare(date(X),eq,datetime(X)).
date_compare(date(bot),gte,datetime(bot)).
date_compare(date(eot),lte,datetime(eot)).
date_compare(date(eot),gte,datetime(eot)).
date_compare(date(bot),lte,datetime(bot)).
date_compare(date(bot),lt,datetime(Y)) :- Y \= bot.
date_compare(date(eot),gt,datetime(Y)) :- Y \= eot.
%date_compare(date(bot),gte,datetime(bot)).
%date_compare(date(eot),lte,datetime(eot)).
%date_compare(date(eot),gte,datetime(eot)).
%date_compare(date(bot),lte,datetime(bot)).
%date_compare(date(bot),lt,datetime(Y)) :- Y \= bot.
%date_compare(date(eot),gt,datetime(Y)) :- Y \= eot.
date_compare(date(X),lt,datetime(Y)) :- X #< Y.
date_compare(date(X),gt,datetime(Y)) :- X #> Y.
date_compare(date(X),lte,datetime(Y)) :- X #=< Y.
date_compare(date(X),gte,datetime(Y)) :- X #>= Y.
date_compare(date(X),ne,datetime(Y)) :- X \= Y.
date_compare(datetime(X),eq,date(X)).
date_compare(datetime(bot),gte,date(bot)).
date_compare(datetime(bot),lte,date(bot)).
date_compare(datetime(eot),gte,date(eot)).
date_compare(datetime(eot),lte,date(eot)).
date_compare(datetime(bot),lt,date(Y)) :- Y \= bot.
date_compare(datetime(eot),gt,date(Y)) :- Y \= eot.
%date_compare(datetime(bot),gte,date(bot)).
%date_compare(datetime(bot),lte,date(bot)).
%date_compare(datetime(eot),gte,date(eot)).
%date_compare(datetime(eot),lte,date(eot)).
%date_compare(datetime(bot),lt,date(Y)) :- Y \= bot.
%date_compare(datetime(eot),gt,date(Y)) :- Y \= eot.
date_compare(datetime(X),lt,date(Y)) :- X #< Y.
date_compare(datetime(X),gt,date(Y)) :- X #> Y.
date_compare(datetime(X),lte,date(Y)) :- X #=< Y.
date_compare(datetime(X),gte,date(Y)) :- X #>= Y.
date_compare(datetime(X),ne,date(Y)) :- X \= Y.
date_compare(date(X),eq,date(X)).
date_compare(date(bot),gte,date(bot)).
date_compare(date(bot),lte,date(bot)).
date_compare(date(eot),gte,date(eot)).
date_compare(date(eot),lte,date(eot)).
date_compare(date(bot),lt,date(Y)) :- Y \= bot.
date_compare(date(eot),gt,date(Y)) :- Y \= eot.
%date_compare(date(bot),gte,date(bot)).
%date_compare(date(bot),lte,date(bot)).
%date_compare(date(eot),gte,date(eot)).
%date_compare(date(eot),lte,date(eot)).
%date_compare(date(bot),lt,date(Y)) :- Y \= bot.
%date_compare(date(eot),gt,date(Y)) :- Y \= eot.
date_compare(date(X),lt,date(Y)) :- X #< Y.
date_compare(date(X),gt,date(Y)) :- X #> Y.
date_compare(date(X),lte,date(Y)) :- X #=< Y.
Expand Down
19 changes: 19 additions & 0 deletions blawx/passthrough.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
blawx_passthrough = """
#pred blawx_diseq(X,Y) :: '@(X) is not the same object as @(Y)'.
blawx_diseq(X,Y) :- X \= Y.
#pred blawx_comparison(X,eq,Y) :: '@(X) is equal to @(Y)'.
#pred blawx_comparison(X,neq,Y) :: '@(X) is not equal to @(Y)'.
#pred blawx_comparison(X,gt,Y) :: '@(X) is greater than @(Y)'.
#pred blawx_comparison(X,gte,Y) :: '@(X) is greater than or equal to @(Y)'.
#pred blawx_comparison(X,lt,Y) :: '@(X) is less than @(Y)'.
#pred blawx_comparison(X,lte,Y) :: '@(X) is less than or equal to @(Y)'.
blawx_comparison(X,eq,Y) :- X #= Y.
blawx_comparison(X,neq,Y) :- X \= Y.
blawx_comparison(X,gt,Y) :- X #> Y.
blawx_comparison(X,gte,Y) :- X #>= Y.
blawx_comparison(X,lt,Y) :- X #< Y.
blawx_comparison(X,lte,Y) :- X #=< Y.
"""
4 changes: 4 additions & 0 deletions blawx/reasoner.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
from .dates import scasp_dates, scasp_now
from .aggregates import scasp_aggregates
from .events import ec_code
from .passthrough import blawx_passthrough

from rest_framework import permissions

Expand Down Expand Up @@ -563,6 +564,7 @@ def run_test(request,ruledoc,test_name):
# maplist(del_attrs, AttVars).
# """)

rulefile.write(blawx_passthrough + '\n\n')
rulefile.write(ldap_code + '\n\n')
rulefile.write(scasp_dates + '\n\n')
rulefile.write(scasp_now + '\n\n')
Expand Down Expand Up @@ -660,6 +662,7 @@ def get_ontology_internal(ruledoc,test_name):
maplist(del_attrs, AttVars).
""")

rulefile.write(blawx_passthrough + '\n\n')
rulefile.write(ldap_code + '\n\n')
rulefile.write(scasp_dates + '\n\n')
rulefile.write(scasp_now + '\n\n')
Expand Down Expand Up @@ -1238,6 +1241,7 @@ def interview(request,ruledoc,test_name):
%maplist(del_attrs, AttVars).
""")

rulefile.write(blawx_passthrough + '\n\n')
rulefile.write(ldap_code + '\n\n')
rulefile.write(scasp_dates + '\n\n')
rulefile.write(scasp_now + '\n\n')
Expand Down
2 changes: 1 addition & 1 deletion blawx/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from pathlib import Path

# For adding a version identifier
BLAWX_VERSION = "v1.6.11-alpha"
BLAWX_VERSION = "v1.6.12-alpha"


# Build paths inside the project like this: BASE_DIR / 'subdir'.
Expand Down
2 changes: 1 addition & 1 deletion blawx/static/blawx/blawx-blocks.js
Original file line number Diff line number Diff line change
Expand Up @@ -1672,7 +1672,7 @@ scasp_blockset = [{
],
[
"\\=",
"ne"
"neq"
]
]
},
Expand Down
Loading

0 comments on commit 3251dab

Please sign in to comment.