coq


forward_call with local variables


VST version 1.7.
I'm having an issue where coq won't recognize locally declared variables when I try to use them in a function call. I have the code:
void deSignArray(int bits[], int invKey, int size)
{
int i = 0;
while (i < size) {
int bit = bits[i];
int ans = deSignInt(bit, invKey);
bits[i] = ans;
i++;
}
}
with coq types bits : list Z, invKey : Z, size : Z.
I successfully stepped through the bit = bits[i] step, but when I then try to step forwards using
forward_call((Int.repr bit), (Int.repr invKey)).
the step fails with bit not being found in the environment. I tried using
forward_call(_bit, (Int.repr invKey)).
as _bit appears in the LOCAL clause, but that provides a typing mismatch since _bit is an ident type and not an int or Z type. I'm wondering how I am supposed to use my locally defined values to call other functions as a result, any help would be appreciated.
The argument that you provide to forward_call, in your case (Int.repr bit, Int.repr invKey), must be a Coq value. In your case, if (at the time of forward_call) you have above the line in your Coq proof goal, variables "bit" and "invKey", then this should work.
How would you get such variables above the line? If the LOCALS part of your function precondition contains (temp _invKey (Vint (Int.repr invkey))), then you should have invKey above the line. And then, after going forward through the load statement (bit = bits[i]), your current proof goal's precondition should have a LOCALS of the form (temp _bit something-or-other), and it's that something-or-other that you should use instead of "bit".

Related Links

Construct Sets in Coq
Is this relationship between forall and exists provable in Coq/intuitionistic logic?
Proof automation in Coq how to factorize a proof
How to use matched case and variable equivalence in coq
Proof with false hypothesis in Isabelle/HOL Isar
Is there a convention for the order of applying ssreflect tactic/taticals?
How to systematically normalize inequalities to < (lt) and <= (le) in Coq?
Inductive subset of an inductive set in Coq
How to find the source file for an identifier in Coq
Coq “Unknown interpretation for notation” error
How to switch the current goal in Coq?
Reasoning about lists in Coq
what does the curly braces {} do in ssreflect rewrite
How to define unspecified constants in Coq
How to automatically prove simple equality of real numbers in Coq?
How to simplify real number terms in Coq?

Categories

HOME
pandas
hook
keras
magnific-popup
tinymce
nullpointerexception
objectgears
spring-cloud-stream
jgroups
virtualization
elasticsearch-hadoop
gorm
row
circular-dependency
ibm-odm
windows-server-2012
ghc
crystal-reports-2008
introduction
emulator
predix
xlsxwriter
one-hot-encoding
abi
spark-jobserver
internet-explorer-9
jaxb2
srcset
yadcf
wallpaper
html5-fullscreen
android-ble
xcode-extension
lto
xenforo
opshub
awt
checkboxlist
acoustics
btrace
scorm
upstart
qsslsocket
dds
rails-routing
hls.js
veracode
integrity
lowpass-filter
kbuild
windows-mobile-6.5
pycaffe
color-picker
passport-google-oauth
httplistener
radtreelist
savon
ado.net-entity-data-model
mikroc
trash
nsfilemanager
merge-conflict-resolution
fuzzy-search
firebaseui
r-tree
varargs
sysinternals
jsapi
device-orientation
website-monitoring
c3
gui-test-framework
rdtsc
zend-route
article
contenttype
rebol3
expected-exception
comexception
mechanize-ruby
app42
flexmojos
inbox
google-cloud-save
yui-compressor
typoscript2
path-separator
coderush
parametric-equations
code-cleanup
data-loss
mod-auth
table-footer
google-friend-connect
fluent-interface
dmx512
forums
thunderbird-lightning
meego
firefox4
privilege
simpletest
project-hosting

Resources

Database Users
RDBMS discuss
Database Dev&Adm
javascript
java
csharp
php
android
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App