Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
NatKarmios committed Mar 12, 2023
1 parent 0a6fa28 commit 215dd8c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion Gillian-JS/Examples/Amazon/EncryptionHeaderLogic.gil
Original file line number Diff line number Diff line change
Expand Up @@ -450,8 +450,9 @@ nounfold pred ElementsJS(definition : Str, +buffer : List, +readPos : Num,
+eCount : Num, +fCount : Num, eList : List,
esLength : Num) :
Elements(definition, buffer, (as_int readPos), (as_int eCount), (as_int fCount), eList, #esLength) *
(is-int readPos) * (is-int eCount) * (is-int fCount) *
(esLength == (as_num #esLength));
facts: (0 <# readPos) and (readPos <# as_int(l-len buffer)) and (0 <# eCount) and (0 <# fCount) and (0 <=# esLength)
and (is-int readPos) and (is-int eCount) and (is-int fCount);

lemma ElementsShift(buffer, readPos, eCount, fCount, shift)
[[ Elements(#definition, #buffer, #readPos, #eCount, #fCount, #eList, #esLength) *
Expand Down
3 changes: 2 additions & 1 deletion Gillian-JS/Examples/Amazon/deserialize_factory.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,9 @@ function readElements(elementCount, fieldsPerElement, buffer, readPos) {
while (elementCount--) {
/* @tactic
unfold ElementsJS(#definition, #view, #outerLoopReadPos, #eLeft, #fCount, #remElsList, #remElsLength);
unfold Elements(#definition, #view, (as_int #outerLoopReadPos), (as_int #eLeft), (as_int #fCount), #remElsList, (as_int #remElsLength));
if (#definition = "Complete") then {
unfold CElementsJS(#view, #outerLoopReadPos, #eLeft, #fCount, #remElsList, #remElsLength) [bind: (#element := #fList) and (#eLength := #eLength)]
unfold CElements(#view, (as_int #outerLoopReadPos), #eLeft, (as_int #fCount), #remElsList, #remElsLength) [bind: (#element := #fList) and (#eLength := #eLength)]
} else {
unfold IElementsJS(#view, #outerLoopReadPos, #eLeft, #fCount, #remElsList, #remElsLength) [bind: (#fList := #fList) and (#eLength := #eLength)]
} */
Expand Down

0 comments on commit 215dd8c

Please sign in to comment.