datalog input format of Z3 - z3

I am looking for examples, specification, or documentation of the datalog input format that fixpoint Z3 accepts. I have looked for them in the source distribution, but did not find any. Are they available online or in any reports/papers?

I presume your question is about the files with the ".datalog" suffix.
The online tutorial says: "Files with suffix .datalog are parsed using the BDDBDDB format. The format can be used for comparing benchmarks with the BDDBDDB tool."
I believe there should be a decent number of examples of files that the
BDDBDDB tool accepts from the distribution page of that tool. Our parser may have some incompatibilities because I am unaware of a specification for this language.
You can also enter datalog problems in the SMT2 format.
THe extensions to SMT2 are few and we describe them in http://research.microsoft.com/en-us/people/nbjorner/bmr-smt.pdf

The input format is described in the following online tutorials.
http://rise4fun.com/Z3/tutorial/fixedpoints (SMT 2.0 front-end)
http://rise4fun.com/Z3Py/tutorial/fixedpoints (Python front-end)

Related

Print contents of rpg file in human-readable format

Context
A friend of mine is having trouble printing source code to a human readable format.
The compiled (I assume) programs of their welding robot have the .rpg extension. They want to collect print-outs in human-readable format, possibly for backup or future reference.
Their supplier can provide the software that accomplishes this, be it at a considerable cost (and possibly: an annual license). Because of this, my friend decided to ask me if a easier/cheaper solution exists.
Examples & Pictures
The files can be read on the console of the robot, an example:
I've done some minor research and I'm fairly sure this is the Report Program Generator (RPG) language developed by IBM. The Assembly-like syntax seems to match; it might be one of the later versions of the language.
My friend has send me an example .rpg file, the contents seem binary with some string literals scattered throughout. Screenshot of the contents of an example file in hexadecimal:
The Question
There is not much, if any, clear information to be found online so I suppose I have multiple questions (for anyone that might know more about this):
Is this (first image) Report Program Generator (RPG) code?
Does the .rpg file contain compiled or processed code? Maybe an intermediate format?
Is it possible to convert files as shown in the example, back to source-code or human-readable format, kind of 'disassemble' it?
If anyone knows more, don't hesitate to give me any information or ask more details if necessary. Thanks in advance!
And maybe not an important question but still something that bugs me (and might indicate I'm on the wrong track):
If this is indeed an RPG program, why would the compiled/processed binary have the .rpg extension, shouldn't the source-file have that? This leads me to believe I'm either (a) assuming the wrong things (the language, etc...) or (b) this is an intermediate format, easier for machines to read, that has to be interpreted by some kind of runtime system.
I don't think that's any version of IBM's RPG language. RPG does have a MOVEL opcode, but it doesn't have any of the others.
Also, all the versions of the IBM language have been intended for business programming. I doubt that it would have been used for robotics.
My guess is that's a proprietary language of the company that makes the robot.
There are some similarities but it does not look like IBM RPG language.
RPG sources are in fact source physical file members. They are not stored in the "traditional" file system but in OS/400 libraries. Therefore RPG sources have no extension. They can be converted to Integrated File System stream file though.
I can't answer this question I'm afraid as it's unknown language to me.
I expect possibly that the OP misidentifies the file type/extension; that the extension is actually .prg, and the files serve as instructions for a Panasonic Industrial Welding Robot. The following forum [drilled down to Panasonic Robots] bills itself as the biggest Industrial Robots Supportforum worldwide!; perhaps a good place to ask about those images provided in the OP, and the inquiry about getting source from what appears to be a binary instruction stream.
FWiW, the first image seems to show that the Ezed utility [on the console] gives that human-readable format, so then the question might be how to get that saved and then how to transfer that elsewhere; e.g. what type of comm ports and file transfer utilities are available from whatever platform/OS.

Unipaas extracting a XML

Is someone tried to extract XML to "Unipass" Programming Language? I've read a XML file then put it on a blob virtual, From there i want i get the data inside .
<patient>
<name>
<given>Henry</given>
<family>Sovelen</family>
<suffix>The 6th</suffix>
</name>
<administrativeGenderCode code="M" codeSystem="2.16.840.1.113883.5.1"/>
<birthTime value="19320924"/>
</patient>
Can someone teach me how to get the value 'Henry' Using unipaas programming language and btw i also used .xsl for stylesheet for that one
UniPaas (previously know as Magic, or eDeveloper, or xpa) is able to read XML directly. XML is one of data sources available for UniPaas; there are gateways for MSSQL Server, Oracle, DB2, MySQL and finally ODBC (which covers pretty much all other sources).
Luckily for you, no need to install support for XML, it's in UniPaas by default.
Since you are new to UniPaas and data sources, I'd recommend to see this video.
Once you have XML connected, you can use APG (automatic program generator) feature to quickly generate simple export-import program.
I'd strongly advice to install "On-line" samples, in Chapter 14 you can find example for XML data (see image below).
Let me know if you need more detail. UniPaas is really powerful tool, but it's "strange kind of animal" and can be confusing at the start.

Machine Learning - Software to learn file formats by example

My program can read several dozen file formats, using the traditional approach where I write procedural code for each file format. Most of these formats have their own unique loader library, their own bugs, their own limitations, and the whole thing is a huge time sink for me. I'd like to support a ton of other formats, but they're mostly not worth my time because they're not popular enough.
I'd like to replace my existing loaders with a single loader powered by a file format descriptor. I'm certain that someone has created software to learn file formats by example. My existing loaders would make excellent fitness functions for those formats, and I can write fitness functions for new formats too.
My question is, what software can I use to "learn" file formats by example, and how can I convert that "learning" into a descriptor for use with a generic loader?
Unless you limit it in some massive ways, I don't think you're likely to get very far. This would be ideal but beyond the current state of the art. For an arbitrary formats, you cannot do this, for example if I give you 200 JPGs,PNGs,BMPs and GIFs it very highly unlikely that a learning system can learn the formats.
Here are some problems researchers have looked at:
Learning a regular expression from examples: look at this question:
Is it possible for a computer to "learn" a regular expression by user-provided examples?,
for example
Information extraction: I give you a list of classified ads from the
newspaper, for example apartments for rent. You need to extract the
number of bedrooms, the rent, the deposit and the size of the unit.
You can read more about it here:
http://en.wikipedia.org/wiki/Information_extraction

Parsing OFX or SGML in iOS

How do I parse OFX in iOS? OFX is formatted in SGML, and I can't find any good parsers to use in C or Objective-C on iOS.
Try using libofx. It depends on OpenJADE for SGML but I've gotten them both to compile and work on iOS.
There are a few challenges here:
(1) OFX 1.x documents are SGML-based, while 2.x documents are XML-based, so if you know you will only deal with 2.x documents you could probably use an XML parser.
(2) If you do have to deal with 1.x documents, you'll have some code-lifting ahead of you. SGML in general and OFX 1.x in particular do not enforce close tags for simple types. That means you'll see things like:
<INVACCTFROM>
<BROKERID>Fidelity Investments
<ACCTID>FidRoth
</INVACCTFROM>
Parsing this kind of thing will be tricky unless you provide your own schema logic, or pre-process the data to a more "valid" format. An example of the latter, while not in C/Obj-C/C++, is given on Scott Hanselman's blog.
Good resources on OFX can be found here.

What is the official standard for pthreads?

I am trying to find the document that specifies the standard for pthreads. I've seen various links which point to IEEE 1003.1c-1995 (i.e. Wikipedia or OpenGroup). However when I searched for this document on the IEEE standards site I eventually found this page which said "Superseded Standard."
The IEEE page for 1003.1c-1995 did have a note that said: "Abstract not available. See ISO/IEC 9945-1." Searching for that on Google led me to a page for ISO/IEC 9945-1:1996 but the status said "withdrawn."
So my question is what is the current active standard for pthreads? Even better would be if there was a link to a free version of the standard, but it looks like most of the links I've seen for standards cost money. But I figure if I can find out the actual standard then I might try to see if I can access it through my school's library. But first I want to know what document I should be looking for.
I believe you want ISO/IEC/IEEE 9945:2009 as it is newer than ISO/IEC 9945-1:1996 , which was revised ISO/IEC 9945-1:2003 and ISO/IEC/IEEE 9945:2009 revised that.
The following POSIX FAQ provides additional information, specifically relevant Q4. Where can I download the 1003.1 standard from? and includes links to a free HTML online version that requires registration here.
There is understandably a lot of confusion around the relevant standards. We have:
ISO/IEC 9945
IEEE 1003.1
POSIX.1
Single Unix Specification
The Open Group Base Specifications
Possibly others
Why so many different standards? I'm sure it's mostly historical. At one point some or all of these standards might have referred to their own thing. But the simplest answer is that, today, all of these specifications are now just different names for the same thing*. Here is the opening sentence from the online version of The Open Group Base Specifications, Issue 7:
POSIX.1-2008 is simultaneously IEEE Std 1003.1™-2008 and The Open Group Technical Standard Base Specifications, Issue 7
Some of the standards bodies do not provide free or registration-free access to their copies of the standard. However, The Open Group does allow free (and registration-free) access to the current issue of their online copy.
*The Single Unix Specification may not be exactly the same; it seems it contains everything in POSIX, plus the X/Open Curses standard.

Resources