Skip to content

Commit

Permalink
CIL-1328 fix., Changed a character in a QDL operator.
Browse files Browse the repository at this point in the history
  • Loading branch information
gaynor@illinois.edu authored and gaynor@illinois.edu committed Jul 6, 2022
1 parent 774f4af commit 7d62264
Show file tree
Hide file tree
Showing 15 changed files with 58 additions and 55 deletions.
41 changes: 21 additions & 20 deletions .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions ncsa-qdl/buildNumber.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#maven.buildNumber.plugin properties file
#Fri Jul 01 10:16:04 CDT 2022
buildNumber\\d*=9623
#Wed Jul 06 12:16:46 CDT 2022
buildNumber\\d*=9662
2 changes: 1 addition & 1 deletion ncsa-qdl/src/main/antlr4/QDLLexer.g4
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ SCIENTIFIC_NUMBER : Decimal (E SIGN? Integer)?;
LessThan : '<';
GreaterThan : '>';
SingleEqual : '=';
To_Set : '|>' | ''; // unicode 22a2
To_Set : '|=' | ''; // unicode 22a2
LessEquals : '<=' | '' ; // unicode 2264
MoreEquals : '>=' | '' ; // unicode 2265
IsA : '<<';
Expand Down
Binary file modified ncsa-qdl/src/main/docs/qdl_reference.odt
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public class OpEvaluator extends AbstractEvaluator {
public static final String REGEX_MATCH = "=~";
public static final String REGEX_MATCH2 = "≈";
public static final String TO_SET = "⊢";
public static final String TO_SET2 = "|>";
public static final String TO_SET2 = "|=";
public static final String EPSILON = "∈";
public static final String EPSILON_NOT = "∉";
public static final String IS_A = "<<";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ public void set(State state, Object newValue) {
gotOne = true;
}
if (!gotOne) {
System.out.println("uh-oh");
throw new IndexError("no such element", null);
}
// it is possible that the left most expression is a stem node, so make sure there is
// something to return
Expand Down
Binary file not shown.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ public QDLParserLexer(CharStream input) {
"/\2\2\u01a8\u01a9\7/\2\2\u01a9r\3\2\2\2\u01aa\u01ab\7/\2\2\u01abt\3\2"+
"\2\2\u01ac\u01ad\7>\2\2\u01adv\3\2\2\2\u01ae\u01af\7@\2\2\u01afx\3\2\2"+
"\2\u01b0\u01b1\7?\2\2\u01b1z\3\2\2\2\u01b2\u01b3\7~\2\2\u01b3\u01b6\7"+
"@\2\2\u01b4\u01b6\7\u22a4\2\2\u01b5\u01b2\3\2\2\2\u01b5\u01b4\3\2\2\2"+
"?\2\2\u01b4\u01b6\7\u22a4\2\2\u01b5\u01b2\3\2\2\2\u01b5\u01b4\3\2\2\2"+
"\u01b6|\3\2\2\2\u01b7\u01b8\7>\2\2\u01b8\u01bb\7?\2\2\u01b9\u01bb\7\u2266"+
"\2\2\u01ba\u01b7\3\2\2\2\u01ba\u01b9\3\2\2\2\u01bb~\3\2\2\2\u01bc\u01bd"+
"\7@\2\2\u01bd\u01c0\7?\2\2\u01be\u01c0\7\u2267\2\2\u01bf\u01bc\3\2\2\2"+
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -881,15 +881,15 @@ public IndexList newGet(IndexList indexList, boolean strictMatching) {
if (hasDefaultValue()) {
obj = getDefaultValue();
} else {
throw new IndexError("the index of \"" + indexList.get(i) + "\" was not found in this stem", null);
throw new IndexError("the index " + i + " for " + indexList + "\" was not found in this stem", null);
}
}

if (obj instanceof QDLStem) {
currentStem = (QDLStem) obj;
} else {
if (strictMatching && i != indexList.size() - 1) {
throw new IndexError("no such stem at this multi-index.", null);
throw new IndexError("no such stem at multi-index " + indexList, null);
}
rc.add(obj); // 0th entry is returned value
gotOne = true;
Expand Down
41 changes: 21 additions & 20 deletions ncsa-qdl/src/main/resources/func_help.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2344,7 +2344,7 @@ assert[][] ⊨ a \u22a8 assert
|] ⟧ } \u27e7 right closed slice bracket
ceiling ⌈ k \u2308 ceiling
floor ⌊ l \u230a floor
|> ⊢ s \u22a2 create a set
|= ⊢ s \u22a2 create a set
transpose τ t \u03c4 alias for the transpose function.
pi π p \u03c0 Greek letter pi.
Expand Down Expand Up @@ -3647,7 +3647,7 @@ another.
See also: ∈ (has_value), comparisons, subset(@pick arg)]]>
</body>
<example>
<![CDATA[ z := |>[;20]*3+2
<![CDATA[ z := |=[;20]*3+2
z == z
true
'abcd' == 'Abcd'
Expand Down Expand Up @@ -3702,7 +3702,7 @@ can be recursive structures, highly nested etc.) can
be slow and very difficult. On the other hand, sets may
be entries in stems with no issues.
See also: \/, /\, /, %, <, >, ==, ∈, ∉, ~, |>, pick(@f, arg)]]>
See also: \/, /\, /, %, <, >, ==, ∈, ∉, ~, |=, pick(@f, arg)]]>
</body>
</entry>
<entry id="local">
Expand Down Expand Up @@ -3754,21 +3754,21 @@ with stems is a bit clunky.
See also: slice, set]]>
</body>
</entry>
<entry id="|>" alt="">
<entry id="|=" alt="">
<body>
<![CDATA[Ascii digraph for the operator to convert its argument to a set.
|>false
|=false
{false}]]>
</body>
<example>
<![CDATA[ |>3; // convert a scalar to a set
<![CDATA[ |=3; // convert a scalar to a set
{3}
|>[2;7]; // convert the values of a list to a set
|=[2;7]; // convert the values of a list to a set
{2,3,4,5,6}
|>{'a':2/3,'b':-3/pi()}; // convert the values of a stem to a set
|={'a':2/3,'b':-3/pi()}; // convert the values of a stem to a set
{0.666666666666666,-0.954929658551372}
|>keys({'a':2/3,'b':-3/pi()}); // convert the keys of a stem to a set
|=keys({'a':2/3,'b':-3/pi()}); // convert the keys of a stem to a set
{a,b}
⊢[;5]; // use the other form of the operator
{0,1,2,3,4}]]>
Expand Down Expand Up @@ -4192,7 +4192,7 @@ extract part of a stem.
var ((\ scalar | stem | *) | (\! scalar | stem | *))+
where var is a stem. Note that
\! (uniqueness) will force the resulting stem to have exactly the
indices of that dimension,
\ for integers, they will be re-ordered. String keys are, however, never altered.
Expand Down Expand Up @@ -4234,6 +4234,11 @@ hence the values are copied.
is treated like an argument. In essence, in this context > distrubutes \
to each element of the list
var ((\> stem) | (\!> stem ))+
think of > as an operator in this context which means to distribute the \ to
each element of the stem argument.
E.g.
a\p\q\r\t == a\>[p,q,r,t]
Expand All @@ -4248,10 +4253,6 @@ not possible and all list elements must be resolvable.
See \, star()
]]>
</body>
<example>
<![CDATA[
]]>
</example>
</entry>
<entry id="star">
<body>
Expand All @@ -4261,14 +4262,14 @@ a\* == a\star()
This is most useful if you are constructing an argument for extraction, e.g.
a.:=n(3,4,n(12))
a\>(1~(size(a.)<4?star():2))
a\>(1~(size(a.)<4?star():[2,4]))
[4,5,6,7]
]]>
Note that this creates (in this case) the expression a\>[1,*] meaning go to the first element,
return everything. Compare with say
a\>[2,[1,3]]
[9,11]]]>
</body>
<example>
<![CDATA[
]]>
</example>
</entry>

<!--
Expand Down
2 changes: 1 addition & 1 deletion ncsa-qdl/src/main/resources/qdl.nanorc
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ color brightred "∉"
color brightred ""
color brightred ""
color brightred ""
color brightred "|>"
color brightred "|="
color brightred ""
color brightred "×"
color brightred "÷"
Expand Down
2 changes: 1 addition & 1 deletion ncsa-qdl/src/main/resources/qdl.nanorc-2.3.1
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ color brightred "∉"
color brightred "⟦"
color brightred "⟧"
color brightred "⊢"
color brightred "|>"
color brightred "|="
color brightred "→"
color brightred "×"
color brightred "÷"
Expand Down
6 changes: 3 additions & 3 deletions ncsa-qdl/src/test/java/edu/uiuc/ncsa/qdl/SetTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public class SetTest extends AbstractQDLTester {
public void testSetCreate() throws Throwable {
State state = testUtils.getNewState();
StringBuffer script = new StringBuffer();
addLine(script, "ok := {0,3,1,2} == |>[;4];");
addLine(script, "ok := {0,3,1,2} == " +OpEvaluator.TO_SET2 + "[;4];");
QDLInterpreter interpreter = new QDLInterpreter(null, state);
interpreter.execute(script.toString());
assert getBooleanValue("ok", state);
Expand Down Expand Up @@ -493,7 +493,7 @@ public void testToSetForEach() throws Throwable {
public void testToSetOOO() throws Throwable {
State state = testUtils.getNewState();
StringBuffer script = new StringBuffer();
addLine(script, "ok ≔ ⊢[;5] ≡ |>[;5];");
addLine(script, "ok ≔ ⊢[;5] ≡ " +OpEvaluator.TO_SET2 + "[;5];");
QDLInterpreter interpreter = new QDLInterpreter(null, state);
interpreter.execute(script.toString());
assert getBooleanValue("ok", state);
Expand All @@ -516,7 +516,7 @@ protected String makeTestSet(int n) throws Throwable {
addLine(script, "count := n%3;"); // number per group
addLine(script, "A. := random_string(6, count)~[0==date_ms()%2] ~(mod(random(count), p)+p);");
addLine(script, "A. := A. ~ (mod(random(n-size(A.)), p)+p)/(3+p%4);"); // make some fractions
addLine(script, "A := input_form(|>A.);");
addLine(script, "A := input_form(" +OpEvaluator.TO_SET2 + "A.);");
QDLInterpreter interpreter = new QDLInterpreter(null, state);
interpreter.execute(script.toString());
return getStringValue("A", state);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,8 @@ public void doUserInfo() throws Throwable {
h.setAccountingInformation();
}
doScript(SRE_PRE_USER_INFO);

//CIL-1328 fix
getFromSources(transaction.getFlowStates(), SRE_PRE_AUTH, false);
doScript(SRE_POST_USER_INFO);
for (PayloadHandler h : handlers) {
h.checkClaims();
Expand Down

0 comments on commit 7d62264

Please sign in to comment.