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

Weakening hypothesis without a cut
Rewriting at the type level
Port a Coq lemma over Z to a similar lemma over nat
Coq fixpoint defintion numerated by natural numbers.(type of (n+1)'s type depends on (n)'s type)
`No more subgoals, but there are non-instantiated existential variables` in Coq proof language?
Simplify assumption
Apply partially instantiated lemma
Using reflexivity in Coq
High-speed calculation of Coq's theorems
Topological Definition of Continuous in Coq
Reference in Coq Lists library not found
Purpose of maximal vs non-maximal implicit arguments
Idris type system properties
How to destruct/generalize over Program's rewritten match statements
Show all axioms Coq
Product Type in Coq

Categories

HOME
java
multithreading
hook
gerrit
cookies
minimum-spanning-tree
single-sign-on
google-api-php-client
plot
include
alfresco
routes
jira
jxls
swagger-ui
elasticsearch-hadoop
communication
metatrader4
imacros
row
export-to-csv
quickbooks
google-cloud-spanner
messages
zebra-printers
iron-router
serilog
solaris-10
nas
swiftlint
jasonette
orleans
zurb-foundation-6
claims-based-identity
sparse-matrix
su
facebook-access-token
procdump
librato
nouislider
microsoft-chart-controls
nameservers
iframe-resizer
ecto
.net-4.0
semantic-versioning
dosbox
dartium
swisscomdev
hockeyapp
lumberjack
avro4s
websphere-mq-fte
xml-documentation
youcompleteme
pnotify
gabor-filter
darcs
np-complete
python-cryptography
cudafy.net
vtigercrm
httplistener
infix-notation
android-textview
file-writing
phishing
websitepanel
prettytensor
actionbardrawertoggle
oauth2client
netmq
phpcas
iad
r-tree
lib.web.mvc
marching-cubes
metaclass
cakephp-3.1
apache-commons-fileupload
sniffer
operator-precedence
socketexception
phpthumb
wp-query
ivyde
ril
buster.js
django-nonrel
hungarian-algorithm
type-equivalence
distutils
libstdc++
online-compilation
windows-phone-7.1.1
osql
asyncfileupload
hgsubversion
php-parser
xmlspy
rescale
libs
swing-app-framework
xetex
yagni
sustainable-pace
spec#
ajax-forms

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App