First Alloy model on Software Abstracts, showing different view - alloy

I'm starting to study Alloy with the first edition of Software Abstractions, and in the first example, at the point 2.1 of the book, the book shows a different simulation of the one I'm seeing with the Alloy4.2
I'm using a Alloy Analyzer 4.2 on macOS 10.12.5
The simulation I'm getting on the execution is this one: https://puu.sh/w0Tp4/be9c6da0a8.png

Related

Agent Oriented Programming code sample

I'm currently studying Agent Oriented Programming,
And I'm having trouble about finding sample code in any language that is written to demonstrate the idea in real programming modele.
Can any one provide a link where a simple code is written to demonstrate the ideas of AOP?
Firstly, let's try to have a common understanding of what is AOP. From "Agent-oriented programming" paper written by Yoav Shoham (1993) we have:
Agent-oriented programming (AOP), can be viewed as a specialization of
object-oriented programming. The state of an agent consists of
components such as beliefs, decisions, capabilities, and obligations;
for this reason the state of an agent is called its mental state. The
mental state of agents is described formally in an extension of
standard epistemic logics: beside temporalizing the knowledge and
belief operators, AOP introduces operators for obligation, decision,
and capability. Agents are controlled by agent programs, which include
primitives for communicating with other agents. In the spirit of
speech act theory, each communication primitive is of a certain type:
informing, requesting, offering, and so on.
A good implementation of this concept is Jason, which is richly explained in the book "Programming Multi-Agent Systems in AgentSpeak using Jason" written by Rafael H. Bordini, Jomi Fred Hübner and Michael Wooldridge (2007).
An application to see how would be an AOP could be this small app:
https://github.com/cleberjamaral/beersponsor
In this simple app there are 3 agents, a robot, an owner (of the robot) and a sponsor. The idea is that the owner want to drink beer and a robot brings all the beer he wants. But after some deliveries the refrigerator run out of beers, so, a Java IDE is launched and the user can click to sponsoring beer to this lazy guy.
To run it you can download Jason and run JEdit (Java -jar JEdit.jar), which is a programming IDE for Jason.
https://sourceforge.net/projects/jason/
You can have more details about this simple implementation here: http://jasonagents.blogspot.com.br/2015/09/exemplo-de-integracao-com-interface.html

is there a verilog tutorial where you build a very simple microprocessor? [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
The community reviewed whether to reopen this question 10 months ago and left it closed:
Original close reason(s) were not resolved
Improve this question
I'm a programmer wishing to learn verilog.
What would be amazingly neat would be a tutorial where one constructs a tiny microprocessor with a very clean design, something like an Intel 4004, and then goes on to actually make it using an fpga and gets it to flash LEDs to order.
Is there such a tutorial?
If not, I might have a go at writing one as I try to do it. Has anyone got any recommendations as to resources I might draw on? e.g. nice open source verilog compiler, debugging tools, simulators, verilog tutorials, cheap fpgas and programming tools, breadboards for LEDs, etc.
I found some glorious slides about an elementary microprocessor here:
http://www.slideshare.net/n380/elementary-processor-tutorial
The open source tools are good for development/testing but won't be able to synthesise your hdl to produce a bitstream, you'll need to use one of the manufacturers tools from altera or xilinx (or others).
The manufacturers tools come as suites , are large (5GB install and need 7 to 12 GB drive space) available for windows and linux. altera.com xilinx.com
There are plenty of soft cores out there.
opencores.org would be a good place to have a look at
There is the zpuino which is arduino compatible.
Best idea is start simple and build up
Get a fpga board, implement a simple design (led flasher) and work up from there.
Quite a learning curve especially if you haven't done much digital electronics.
Remember its hardware and your designing circuits not writing code
so timing is everything.
Have a look at the fpga4fun.com projects and work through them
as a starting point.
xilinx based
digilentinc has some low cost boards , as does gadget factory.
avnet has a usb dongle based board for $80.
altera based .
terasic has some nice boards.
Gadget factory has a kickstarter project up at the moment for the paillio + a few addon boards http://www.kickstarter.com/projects/13588168/retrocade-synth-one-chiptune-board-to-rule-them-al
You can play with Verilog without an actual board using the GNU Icarus Verilog. You can get a Windows build from here.
There is a also a tutorial by Niklaus Wirth on how to design and build a simple CPU, with code in Verilog for a Xilinx board:
https://www.inf.ethz.ch/personal/wirth/FPGA-relatedWork/RISC.pdf
https://www.inf.ethz.ch/personal/wirth/FPGA-relatedWork/ComputerSystemDesign.pdf
~Yes, it is the same Wirth that invented Pascal -- he is playing with FPGAs in his retirement.
Not sure about an explicit verilog tutorial, but you might find this class interesting from MIT open courseware:
http://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-004-computation-structures-spring-2009/
All the class notes are online, and the syllabus sounds like it might be what you're interested in (emphasis mine):
6.004 offers an introduction to the engineering of digital systems. Starting with MOS transistors, the course develops a series of
building blocks — logic gates, combinational and sequential circuits,
finite-state machines, computers and finally complete systems. Both
hardware and software mechanisms are explored through a series of
design examples.
6.004 is required material for any EECS undergraduate who wants to understand (and ultimately design) digital systems. A good grasp of
the material is essential for later courses in digital design,
computer architecture and systems. Before taking 6.004, students
should feel comfortable using computers; a rudimentary knowledge of
programming language concepts (6.001) and electrical fundamentals
(6.002) is assumed.
The problem sets and lab exercises are intended to give students
"hands-on" experience in designing digital systems; each student
completes a gate-level design for a reduced instruction set computer
(RISC) processor during the semester. Access to workstations as well
as help from the course staff is provided in the lab but it is
possible to complete the assignments using Athena machines or one's
home computer.
Altera has great resources on this kind of stuff.
You can try out this link:
http://www.altera.com/education/univ/materials/digital_logic/labs/unv-labs.html
There's a series of lab tutorials that goes through making an embedded processor using Verilog/VHDL.
All of the FPGA vendors have inexpensive ($200~250 range) development kits. For example, the SP601 from Xilinx or the Cyclone III Starter from Altera. I personally own an SP605 (~$500) from Xilinx. You may be able to find cheaper options from other options (e.g. Sparkfun).
Strictly speaking, while you can find open source VHDL/Verilog tools, I am not aware of any such tools for synthesis (making something the FPGA will use). Both Xilinx and Altera provide free (as in beer) tooling, but they are not open or free (as in libre) software. The Xilinx tools include a simulator (limited in the free version) and can run on Windows or Linux. I assume the Altera tools are similar, but I am not familiar with them.
Building a simple microprocessor in Verilog/VHDL is a pretty common feature in college computer architecture classes. You can undoubtedly find class notes and the like from pretty much any major school.
There is an excellent open source verilog compiler, Icarus. From the Icarus web page
Icarus Verilog is a Verilog simulation and synthesis tool. It operates as a compiler, compiling source code written in Verilog (IEEE-1364) into some target format.
I am not aware of a microprocessor-in-verilog tutorial, but there is the OpenCores web site. In the Processors tag under Projects, I see many processors implemented in Verilog or VHDL: 8080, 6502, 8051, Z80, 6805, to name a few. I assume one of these would serve you as an example to get you started.

Which UML tool can really round-trip java code?

Many UML tools claim to do forward / reverse engineering of Java code. However, it turns out from prior experience, that few tools really work in this area.
I haven't been doing Java projects for 3 years, and want to get up to date with the current status in this area.
In Particular I am interested in Creating State Machine Skeletons from Diagram, be able to create hooks to my own code, and be able to reverse engineer the State Diagram back (Do not want to change the State Machine itself outside the Tool).
Which UML tools works in this area? Enterprise Architecht? Visual Paradigm? Others?
Geir Ove
Norway
The reverse engineering from code to UML is done at class diagram for static and sequence diagram for behavioral visualizations.
There is no state machine reverse engineering standard up to today therefore no tool has implemented this feature.
Enterprise Architect comes with a Visual Execution Analysis tool set that has a number of outputs including Sequence Diagram generation of live code execution, State Transition Diagrams (sequence Diagram with states) as well as Profiler reports showing operation and call frequency.
I would suggest reading more on Enterprise Architect Visual Execution Analysis here.

What are some great books for beginning game programming?

I've been programming for a little over 2 years now, and I want to get started with graphics programming and make some simple games to start with. A lot of the books I've looked at for learning directx assume you know the basics of it, which I don't, or that they'll just give you some snippets and assume you'll be able to digest their cryptic code without an explanation. So what are some good books for somebody that is truly new to graphics programming but has a some knowledge with general programming?
Hands down, the best 'graphics programming' book I have ever seen is "An Introduction to 3D Game Programming with DirectX 9.0c: A Shader Approach" by Frank Luna. It starts from the ground up with a linear algebra primer (absolutely critical), then explains how the 3D pipeline works (model, world, camera, ndc, view) and how to deal with the programming nightmare that is Directx ;)
It also covers some advanced techniques, suchs as reflections and refractions etc, but once you've gotten the essentials down (the first 8 chapters) you can basically write anything you want in directx and the rest of your graphics programming time will be spent reading books like the "Shader X" series by Wolfgang Engel, (Shader X7 is particularly good), GPU Pro (same author), and Nvidia's GPU Gems, which they have on their website for free: Gpu Gems.
Android NDK Game Development Cookbook http://www.amazon.com/Android-NDK-Game-Development-Cookbook/dp/1782167781 has pretty few things to do with Android NDK. However, it focuses on implementing a portable game engine from scratch in C++, regardless of the platform. Its topics mainly include low level things like filesystem, networking, audio and so on.

Binary Analysis Research Tools

Can some one provide me with a list of leading binary research tools for Windows OS and windows applications? I found BinScope from microsoft itself but was wondering if there are any other better tools around?
Thanks,
Omer
If you only have access to the binary your access is limited. If you want to peer into the inner workings of this binary your best bet is a Decompiler like IDA Pro and a assembler level debugger like OllyDBG.
Tom Reps, a professor at the University of Wisconsin and founder of GrammaTech, gave an impressive talk on this at Stanford last summer. GrammaTech is working on binary analysis (http://www.grammatech.com/research/contracts/HSARPA/HSARPA-2005-MCSB/), but I don't know whether it's available in their static analysis product yet.
Disclaimer: One of their VP's bought me lunch and got me to try a demo of their source code analysis tool while I was at Palm (before the binary analysis talk), but I think the results are confidential.
BAP is a toolkit for performing binary analysis on x86 programs. It lifts binary code to an easily understandable and analyzable language similar to compiler intermediate languages. It's not a point and click solution (i.e., programming is required to use it effectively), but it can be useful for people who want to write new program analyses on binary code without redefining the semantics of x86.

Resources